private void timerRefreshRooms_Tick(object sender, EventArgs e)
        {
            if (m_Client != null && m_Client.GetState() > 0 &&
                m_UserName.Length > 0 && m_UserToken.Length > 0)
            {
                GetRoomListRequest request = new GetRoomListRequest();
                request.UserName  = m_UserName;
                request.UserToken = m_UserToken;

                m_Client.SendString("lobby/list/" + WebMessage.ToJsonString <GetRoomListRequest>(request));
            }
        }
        public void EnterLobby(string result)
        {
            LogMsg(result);

            Invoke((Action)(() =>
            {
                if (result.ToLower() == "ok")
                {
                    gbLogin.Enabled = false;

                    if (m_RoomName == null || m_RoomName.Length <= 0)
                    {
                        gbLobby.Enabled = true;
                        m_UserList.Clear();
                        UpdateUserList();
                        richChatBox.Clear();
                    }

                    if (m_UserName.Length > 0 && m_UserToken.Length > 0 && m_RoomName.Length > 0)
                    {
                        gbChatRoom.Enabled = true;
                        ShowText("Re-enter lobby/chat-room successfully");
                    }

                    if (m_UserName.Length > 0 && m_UserToken.Length > 0)
                    {
                        GetRoomListRequest request = new GetRoomListRequest();
                        request.UserName = m_UserName;
                        request.UserToken = m_UserToken;

                        m_Client.SendString("lobby/list/" + WebMessage.ToJsonString <GetRoomListRequest>(request));
                    }
                }
                else
                {
                    ShowText("ERROR: " + "Failed to enter lobby: " + result);
                }
            }));
        }
        private void timerRefreshRooms_Tick(object sender, EventArgs e)
        {
            if (m_Client != null && m_Client.GetState() > 0
                && m_UserName.Length > 0 && m_UserToken.Length > 0)
            {
                GetRoomListRequest request = new GetRoomListRequest();
                request.UserName = m_UserName;
                request.UserToken = m_UserToken;

                m_Client.SendString("lobby/list/" + WebMessage.ToJsonString<GetRoomListRequest>(request));
            }
        }
        public void EnterLobby(string result)
        {
            LogMsg(result);

            Invoke((Action)(() =>
            {
                if (result.ToLower() == "ok")
                {
                    gbLogin.Enabled = false;

                    if (m_RoomName == null || m_RoomName.Length <= 0)
                    {
                        gbLobby.Enabled = true;
                        m_UserList.Clear();
                        UpdateUserList();
                        richChatBox.Clear();
                    }

                    if (m_UserName.Length > 0 && m_UserToken.Length > 0 && m_RoomName.Length > 0)
                    {
                        gbChatRoom.Enabled = true;
                        ShowText("Re-enter lobby/chat-room successfully");
                    }

                    if (m_UserName.Length > 0 && m_UserToken.Length > 0)
                    {
                        GetRoomListRequest request = new GetRoomListRequest();
                        request.UserName = m_UserName;
                        request.UserToken = m_UserToken;

                        m_Client.SendString("lobby/list/" + WebMessage.ToJsonString<GetRoomListRequest>(request));
                    }
                }
                else
                {
                    ShowText("ERROR: " + "Failed to enter lobby: " + result);
                }
            }));
        }