예제 #1
0
파일: Server.cs 프로젝트: zaklaus/Rasa.NET
        private void OnCommunicatorConnect(SocketAsyncEventArgs args)
        {
            if (args.SocketError != SocketError.Success)
            {
                Timer.Add("CommReconnect", 10000, false, () =>
                {
                    if (AuthCommunicator?.Connected ?? true)
                    {
                        ConnectCommunicator();
                    }
                });

                Logger.WriteLog(LogType.Error, "Could not connect to the Auth server! Trying again in a few seconds...");
                return;
            }

            Logger.WriteLog(LogType.Network, "*** Connected to the Auth Server!");

            AuthCommunicator.OnReceive += OnCommunicatorReceive;
            AuthCommunicator.Send(new LoginRequestPacket
            {
                ServerId      = Config.ServerInfoConfig.Id,
                Password      = Config.ServerInfoConfig.Password,
                PublicAddress = PublicAddress
            });

            AuthCommunicator.ReceiveAsync();
        }
예제 #2
0
파일: Server.cs 프로젝트: zaklaus/Rasa.NET
 private void MsgGameInfoRequest(ServerInfoRequestPacket packet)
 {
     AuthCommunicator.Send(new ServerInfoResponsePacket
     {
         AgeLimit       = Config.ServerInfoConfig.AgeLimit,
         PKFlag         = Config.ServerInfoConfig.PKFlag,
         CurrentPlayers = CurrentPlayers,
         GamePort       = Config.GameConfig.Port,
         QueuePort      = Config.QueueConfig.Port,
         MaxPlayers     = (ushort)Config.SocketAsyncConfig.MaxClients
     });
 }
예제 #3
0
파일: Server.cs 프로젝트: zaklaus/Rasa.NET
        private void MsgRedirectRequest(RedirectRequestPacket packet)
        {
            lock (IncomingClients)
            {
                if (IncomingClients.ContainsKey(packet.Id))
                {
                    IncomingClients.Remove(packet.Id);
                }

                IncomingClients.Add(packet.Id, new LoginAccountEntry(packet));
            }

            AuthCommunicator.Send(new RedirectResponsePacket
            {
                AccountId = packet.Id,
                Response  = RedirectResult.Success
            });
        }
예제 #4
0
파일: Server.cs 프로젝트: vitalyo7/Rasa.NET
        private void OnCommunicatorConnect(SocketAsyncEventArgs args)
        {
            if (args.SocketError != SocketError.Success)
            {
                OnCommunicatorError(args);
                return;
            }

            Logger.WriteLog(LogType.Network, "*** Connected to the Auth Server!");

            AuthCommunicator.OnReceive += OnCommunicatorReceive;
            AuthCommunicator.Send(new LoginRequestPacket
            {
                ServerId      = Config.ServerInfoConfig.Id,
                Password      = Config.ServerInfoConfig.Password,
                PublicAddress = PublicAddress
            });

            AuthCommunicator.ReceiveAsync();
        }