![]() |
|
How to Refresh channel state with button on Channel Select when is Down or Busy? - Printable Version +- LCKB (https://lckb.dev/forum) +-- Forum: ** OLD LCKB DATABASE ** (https://lckb.dev/forum/forumdisplay.php?fid=109) +--- Forum: Guides & Help Section (https://lckb.dev/forum/forumdisplay.php?fid=193) +---- Forum: Help & Support (https://lckb.dev/forum/forumdisplay.php?fid=157) +----- Forum: Ep4 Support (https://lckb.dev/forum/forumdisplay.php?fid=128) +----- Thread: How to Refresh channel state with button on Channel Select when is Down or Busy? (/showthread.php?tid=5049) |
- Andrein95 - 05-21-2023 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 - nicolasg - 05-21-2023 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 - Andrein95 - 08-21-2023 /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 - nicolasg - 08-21-2023 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. |