예제 #1
0
 private void dispatch(Network.ForwardPacket packet)
 {
     Controller.LogIT("Reception de données ..", Color.Green);
     switch (packet.ID)
     {
     case Network.ForwardPacketTypeEnum.NIGHTWORLD_ClientInfos:
         this.onClientInfos(packet);
         break;
     }
 }
예제 #2
0
        private void onClientInfos(Network.ForwardPacket packet)
        {
            this.IP           = Socket.IP;
            this.Name         = packet.Reader.ReadString();
            this.Version      = packet.Reader.ReadString();
            this.PlayersCount = packet.Reader.ReadInt32();
            this.Uptime       = packet.Reader.ReadString();

            Controller.LogIT("Informations reçu de la part du serveur '" + this.Name + "'", Color.Green);
            Controller.UpdateServersIT();
        }
예제 #3
0
 public void Send(Network.ForwardPacket packet)
 {
     try
     {
         this.Socket.Send(packet.GetBytes);
     }
     catch (Exception e)
     {
         Controller.LogIT("Impossible d'envoyer le packet : " + e.ToString(), Color.Red);
     }
 }
예제 #4
0
        private void Socket_OnDataArrivalEvent(byte[] data)
        {
            var packet = new Network.ForwardPacket(data);

            this.dispatch(packet);
        }
예제 #5
0
 private void Socket_OnDataArrivalEvent(byte[] data)
 {
     var packet = new Network.ForwardPacket(data);
     this.dispatch(packet);
 }