Exemple #1
0
 void LoginClient_OnPacket(object sender, PacketReceivedEventArgs e)
 {
     MethodInfo method = HandlerStore.GetHandler(e.Packet.Header, e.Packet.Type);
     if (method != null)
     {
         Action action = HandlerStore.GetCallback(method, this, e.Packet);
         Worker.Instance.AddCallback(action);
     }
     else
     {
         Log.WriteLine(LogLevel.Debug, "Unhandled packet: {0}", e.Packet);
     }
 }
Exemple #2
0
 void WorldClient_OnPacket(object sender, PacketReceivedEventArgs e)
 {
     if (!Authenticated && !(e.Packet.Header == 3 && e.Packet.Type == 15)) return; //do not handle packets if not authenticated!
     MethodInfo method = HandlerStore.GetHandler(e.Packet.Header, e.Packet.Type);
     if (method != null)
     {
         Action action = HandlerStore.GetCallback(method, this, e.Packet);
         Worker.Instance.AddCallback(action);
     }
     else
     {
         Log.WriteLine(LogLevel.Debug, "Unhandled packet: {0}", e.Packet);
     }
 }