Exemple #1
0
        public void OnSendUniversal(Packets.Login.Get.SendUniversal p)
        {
            uint          id     = p.SessionID;
            GatewayClient client = GatewayClientManager.Instance.clients[id];

            client.SendToClient(p.GetData(), 0x0401);
        }
Exemple #2
0
        public void OnKick(Packets.Map.Get.ClientKick p)
        {
            uint          id     = p.SessionID;
            GatewayClient client = GatewayClientManager.Instance.clients[id];

            client.onKickMap = true;
            client.netIO.Disconnect();
        }
Exemple #3
0
        public void OnSendToMap(Packets.Login.Get.SendToMap p)
        {
            uint          id     = p.SessionID;
            GatewayClient client = GatewayClientManager.Instance.clients[id];

            client.SendToMap(p);
            //this.Client.SendToMap(p);
        }
Exemple #4
0
 public void NewSession(GatewayClient client, uint charID, uint Validation)
 {
     Packets.Map.Send.SendIdentify send = new SagaGateway.Packets.Map.Send.SendIdentify();
     send.SetCharID(charID);
     send.SetValidationKey(Validation);
     send.SetSessionID(client.SessionID);
     this.netIO.SendPacket(send, client.SessionID);
     this.netIO.fullHeader = true;
     client.ConnectedtoMap();
 }
Exemple #5
0
        public void OnSendUniversal(Packets.Map.Get.SendUniversal p)
        {
            uint id = p.SessionID;

            if (!GatewayClientManager.Instance.clients.ContainsKey(id))
            {
                return;
            }
            GatewayClient client = GatewayClientManager.Instance.clients[id];

            client.SendToClient(p.GetData(), 0x0601);
        }
Exemple #6
0
 public void OnResponseRequest(Packets.Login.Get.ResponseRequest p)
 {
     Logger.ShowInfo("Got New SessionID:" + p.GetSessionID().ToString());
     if (this.waitingQueue.Count > 0)
     {
         try
         {
             GatewayClient client = this.waitingQueue[0];
             client.OnGotSessionID(p.GetSessionID());
             this.waitingQueue.RemoveAt(0);
         }
         catch (Exception ex)
         {
             Logger.ShowError(ex);
         }
     }
 }
 /// <summary>
 /// Connects new clients
 /// </summary>
 public override void NetworkLoop(int maxNewConnections)
 {
     for (int i = 0; listener.Pending() && i < maxNewConnections; i++)
     {
         Socket sock = listener.AcceptSocket();
         string ip   = sock.RemoteEndPoint.ToString().Substring(0, sock.RemoteEndPoint.ToString().IndexOf(':'));
         if (Gateway.lcfg.Banned_IP.Contains(ip))
         {
             Logger.ShowWarning("Conncetion from banned IP:" + ip + " rejected!");
             sock.Close();
         }
         else
         {
             Logger.ShowInfo("New client from: " + sock.RemoteEndPoint.ToString(), null);
             GatewayClient newClient = new GatewayClient(sock, this.commandTable);
         }
     }
 }
Exemple #8
0
 public void Logout(GatewayClient client)
 {
     Packets.Login.Send.Logout p = new SagaGateway.Packets.Login.Send.Logout();
     p.SetSessionID(client.SessionID);
     this.netIO.SendPacket(p, client.SessionID);
 }
Exemple #9
0
 public void RequestNewSession(GatewayClient client)
 {
     Packets.Login.Send.NewClient p = new SagaGateway.Packets.Login.Send.NewClient();
     this.waitingQueue.Add(client);
     this.netIO.SendPacket(p, this.SessionID);
 }
        public override void OnClientDisconnect(Client client_t)
        {
            GatewayClient client = (GatewayClient)client_t;

            this.clients.Remove(client.SessionID);
        }