Пример #1
0
        /// <summary>
        /// LS의 연결 상태 변동에 따른 처리
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="status"></param>
        private void LS_ConnectionStatusChanged(EventDrivenTCPClient sender, EventDrivenTCPClient.ConnectionStatus status)
        {
            if (status == EventDrivenTCPClient.ConnectionStatus.Connected)
            {
                _Main.UpdateLSinfo("Connected");
                MSG_ZA2LS_CONNECT LS_Connect = new MSG_ZA2LS_CONNECT();
                LS_Connect.byServerID = Config.ZA.sID;
                LS_Connect.byAgentID  = Config.ZA.aID;
                LS_Connect.szZAIP     = Config.ZA.IP.ToString();
                LS_Connect.dwZAPort   = (uint)Config.ZA.Port;
                LS.Send(LS_Connect.Serialize());

                //LS가 종료되었다 재실행 되었을 경우를 대비하여 현재 접속 유저 정보를 LS에 알려준다.
                if (ZoneAgent._Players != null)
                {
                    foreach (var player in ZoneAgent._Players)
                    {
                        MSG_ZA2LS_LOGIN_USER_LIST LS_ConnectedPlayer = new MSG_ZA2LS_LOGIN_USER_LIST();
                        LS_ConnectedPlayer.MsgHeader.dwPCID = player.Key;
                        LS_ConnectedPlayer.szUserAccount    = player.Value.Account;
                        LS_ConnectedPlayer.szUserIP         = player.Value.IPadress;
                        LS.Send(LS_ConnectedPlayer.Serialize());
                    }
                }
                LS_Reporter.Change(0, 5000);
                Prepared_Checker.Change(0, 500);
            }
            else
            {
                _Main.UpdateLSinfo("Disconnected");
                LS_Reporter.Change(Timeout.Infinite, Timeout.Infinite);
                Prepared_Checker.Change(Timeout.Infinite, Timeout.Infinite);
                PreparedAcc.Clear();
            }
        }
Пример #2
0
        void m_simpleClient_ConnectionStatusChanged(EventDrivenTCPClient sender, EventDrivenTCPClient.ConnectionStatus status)
        {
            string msg = "Unknown Status";

            switch (status)
            {
            case EventDrivenTCPClient.ConnectionStatus.AutoReconnecting:
                msg = "Reconnecting...";
                break;

            case EventDrivenTCPClient.ConnectionStatus.Connected:
                msg = "Connected";
                break;

            case EventDrivenTCPClient.ConnectionStatus.ConnectFail_Timeout:
                msg = "Connection Fail, Timeout";
                break;

            case EventDrivenTCPClient.ConnectionStatus.Connecting:
                msg = "Connecting...";
                break;

            case EventDrivenTCPClient.ConnectionStatus.DisconnectedByHost:
                msg = "Disconnected by Host";
                break;

            case EventDrivenTCPClient.ConnectionStatus.DisconnectedByUser:
                msg = "Disconnected by User";
                break;

            case EventDrivenTCPClient.ConnectionStatus.Error:
                msg = "Error";
                break;

            case EventDrivenTCPClient.ConnectionStatus.NeverConnected:
                msg = "Never Connected";
                break;

            case EventDrivenTCPClient.ConnectionStatus.ReceiveFail_Timeout:
                msg = "Recieve Failure, Timeout";
                break;

            case EventDrivenTCPClient.ConnectionStatus.SendFail_NotConnected:
                msg = "Send Failure, Not Connected";
                break;

            case EventDrivenTCPClient.ConnectionStatus.SendFail_Timeout:
                msg = "Send Failure, Timeout";
                break;
            }

            OnMessage(new OmegaTempCtrlMessageEventArgs("Temp Ctrl: " + msg));
        }
Пример #3
0
 private void ZS_ConnectionStatusChanged(EventDrivenTCPClient sender, EventDrivenTCPClient.ConnectionStatus status)
 {
     if (status == EventDrivenTCPClient.ConnectionStatus.Connected)
     {
         MSG_ZA2ZS_CONNECT ZS_Connect = new MSG_ZA2ZS_CONNECT();
         ZS_Connect.byAgentID = Config.ZA.aID;
         ZS[sender.ID].Send(ZS_Connect.Serialize());
         Config.ZSList[sender.ID].Status = "Connected";
     }
     else
     {
         Config.ZSList[sender.ID].Status = "Disconnected";
     }
     _Main.UpdateConnectedZs();
 }
Пример #4
0
 /// <summary>
 /// BatlleServer connection Status Change event method
 /// Executed when status of connection to BattleServer is changed
 /// </summary>
 /// <param name="sender">EventDrivenTCPClient object</param>
 /// <param name="status">status of TCPClient</param>
 void BS_ConnectionStatusChanged(EventDrivenTCPClient sender, EventDrivenTCPClient.ConnectionStatus status)
 {
     if (status == EventDrivenTCPClient.ConnectionStatus.Connected)
     {
         Logger.Write("BattleServer.log", "BattleServer Connected");
         BS.Send(Packet.ZoneConnectPacket());
         Config.isBSConnected = true;
         Config.CONNECTED_SERVER_COUNT++;
     }
     else
     {
         if (Config.isBSConnected)
         {
             Logger.Write("BattleServer.log", "BattleServer Disonnected");
         }
         Config.isBSConnected = false;
     }
 }
Пример #5
0
 private void client_ConnectionStatusChanged(EventDrivenTCPClient sender, EventDrivenTCPClient.ConnectionStatus status)
 {
     if (status == EventDrivenTCPClient.ConnectionStatus.Connecting)
     {
         draftWindow.PrintLine("Connecting...");
     }
     else if (status == EventDrivenTCPClient.ConnectionStatus.DisconnectedByHost || status == EventDrivenTCPClient.ConnectionStatus.DisconnectedByUser)
     {
         draftWindow.PrintLine($"Connection failed: {status}");
         if (!draftDone)
         {
             draftWindow.Invoke(new MethodInvoker(delegate
             {
                 draftWindow.ClearDraftPicker();
                 draftWindow.OpenConnectWindow();
             }));
             draftWindow.ClearCardPool();
         }
     }
 }
Пример #6
0
 /// <summary>
 /// XX_ConnectionStatusChanged will check for connection status and set value true or false in Config variable accrodingly
 /// XX_DataReceived will process received data if required and send packets to client
 /// </summary>
 /// <summary>
 /// LoginServer connection Status Change event method
 /// Will be executed when connections status is changed
 /// </summary>
 /// <param name="sender">EventDrivenTCPClient object</param>
 /// <param name="status">status of TCPClient</param>
 void LS_ConnectionStatusChanged(EventDrivenTCPClient sender, EventDrivenTCPClient.ConnectionStatus status)
 {
     if (status == EventDrivenTCPClient.ConnectionStatus.Connected)
     {
         LS.Send(Packet.LoginServerConnectPacket());
         Logger.Write("LoginServer.log", "LoginServer Connected");
         Config.isLSConnected = true;
         LSReporter.Enabled   = true;
         LSReporter.Start();
     }
     else
     {
         if (Config.isLSConnected)
         {
             Logger.Write("LoginServer.log", "LoginServer Disconnected");
         }
         LSReporter.Enabled = false;
         LSReporter.Stop();
         Config.isLSConnected = false;
     }
 }
 private void MainServerClient_ConnectionStatusChanged(EventDrivenTCPClient sender, EventDrivenTCPClient.ConnectionStatus status)
 {
     if (status == EventDrivenTCPClient.ConnectionStatus.Connected)
     {
         // Initial handshake message
         this.mainServerClient.Send(PacketHelper.MakeBytesArrayfromHexString("01 A0 00 00 03"));
     }
 }