public override async Task OnReceive(byte[] buffer) { var packet = new IncomingRealmPacket(buffer, buffer.Length); Console.WriteLine("Received: {0}", packet.PacketId.ToString()); LoginHandler.ProcessPacket(this, packet); }
public static void HandleAuthSession(IClient client, IncomingRealmPacket packet) { packet.ReadUInt16(); uint version = packet.ReadUInt32(); uint sessionId = packet.ReadUInt32(); string account = packet.ReadCString(); uint seed = packet.ReadUInt32(); SendAuthSessionOkay(client); }
public static void ProcessPacket(IClient client, IncomingRealmPacket packet) { var packetId = packet.PacketId; Action <IClient, IncomingRealmPacket> methodHandler; actions.TryGetValue(packetId, out methodHandler); if (methodHandler != null) { methodHandler.Invoke(client, packet); } else { Console.WriteLine("Unknown packet :("); } }