コード例 #1
0
 private void Instance_LoginPacketEvent(DataHandler.EventManager.LoginPacketReceivedArgs e)
 {
     if (e.Data.isDuplication)
     {
         MessageBox.Show("중복된 ID 입니다.");
     }
     else
     {
         this.SetVisible(Screen.SelectedGame);
     }
 }
コード例 #2
0
        private void Instance_LoginPacketEvent(DataHandler.EventManager.LoginPacketReceivedArgs e)
        {
            LoginPacket loginPacket = new LoginPacket();

            if (e.Data.isLogin == true)
            {
                //클라이언트 정보 저장
                ClientInfo clientInfo = new ClientInfo(e.Data, e.ClientSocket);

                bool checkInfo = clientManagement.CheckClientInfo(clientInfo);

                if (!checkInfo)
                {
                    clientManagement.AddClient(clientInfo);
                    clientInfoListView.Add(clientInfo);

                    Dispatcher.BeginInvoke(new Action(() =>
                    {
                        ListView_ClientListView.Items.Refresh();
                    }));

                    loginPacket.isDuplication = false;
                    PrintText("클라이언트" + clientInfo.ClientSocket.RemoteEndPoint.ToString() + " -> ID : " + clientInfo.ClientID + "로그인 했습니다.");
                }
                else
                {
                    loginPacket.isDuplication = true;
                }
                indianPokerServer.SendMessage(Header.Login, loginPacket, clientInfo.ClientSocket);
            }
            else
            {
                clientManagement.RemoveClient(e.Data.clientID);
                PrintText("클라이언트" + " -> ID : " + e.Data.clientID + "로그아웃 했습니다.");
            }
        }