Posts: 150
Threads: 20
Thanks Received:
0 in 0 posts
Thanks Given: 0
Joined: May 2021
Reputation:
0
Hello.
I managed to add a button 'Refresh' to update state when a channel is busy or down.
For example when the game server is still loading obv the client will mark as down.
Without make Exit and Relog I'd like to reload information.
I did this but does not work:
if (m_pWnd != NULL)
{
switch (m_cmdTpye)
{
case GotoLogin:
m_pWnd->GotoLogin();
break;
case ConnectServer:
m_pWnd->ConnectServer();
break;
case Refresh:
m_pWnd->UpdateServerList();
....
I tried also:
m_pWnd->ResetServerAndChannelData();
m_pWnd->Lock(TRUE);
Sleep(500);
m_pWnd->Lock(FALSE);
m_pWnd->UpdateServerList();
but does not work either.
If toggling m_pWnd->CloseUI() and m_pWnd->OpenUI() the form of selection does not appear anymore.
Does anyone how to fix this or If my approach is totally wrong?
Thanks
Best Regards
Posts: 280
Threads: 42
Thanks Received:
0 in 0 posts
Thanks Given: 0
Joined: Sep 2012
Reputation:
0
The difficulty with what you want to do is that when you go to the server selection scene, you are not connected to anything, neither the connector, loginserver nor gameserver, so you should make a button to logout > login again, and finally receive the server list information once again from loginserver, or connect to any gameserver if there is one available and send a package with MSG_MENU & MSG_RETURN_TO_SELECT_CHANNEL
Posts: 150
Threads: 20
Thanks Received:
0 in 0 posts
Thanks Given: 0
Joined: May 2021
Reputation:
0
/index.php?/profile/14423-nicolasg/&do=hovercard" data-mentionid="14423" href="/index.php?/profile/14423-nicolasg/" rel="">@nicolasg I've seen that you implemented that refresh. Could you give me any hint how to reach that?
Thanks
Posts: 280
Threads: 42
Thanks Received:
0 in 0 posts
Thanks Given: 0
Joined: Sep 2012
Reputation:
0
4 hours ago, Andrein95 said:
/index.php?/profile/14423-nicolasg/&do=hovercard" data-mentionid="14423" href="/index.php?/profile/14423-nicolasg/" rel="">@nicolasg I've seen that you implemented that refresh. Could you give me any hint how to reach that?
Thanks
u can reconnect to LoginServer using _cmiComm.Reconnect (Can found info about it in the src), send a package asking for the data, in my case i hooked CDescriptor::operate (LoginServer Descriptor), before switch (client_type_) check if msg->m_mtype is the same what u send from Client for asking about channels data, if is that, send the data
for (int i = 0; i < gserver.m_nConnector; i++) {
CNetMsg::SP rmsg(new CNetMsg);
PlayerNumMsg(rmsg, -1, -1, i);
SEND_Q(rmsg, this);
}
for the rest you can track MSG_LOGINSERV_PLAYER in client side.
little bit tricky and dirty, but essentially it works.