Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void AuthServer_OnClientReceive(byte[] buffer, int length, ClientWrapper arg3)
- {
- var player = arg3.Connector as Client.AuthClient;
- player.Cryptographer.Decrypt(buffer, length);
- player.Queue.Enqueue(buffer, length);
- while (player.Queue.CanDequeue())
- {
- byte[] packet = player.Queue.Dequeue();
- ushort len = BitConverter.ToUInt16(packet, 0);
- ushort id = BitConverter.ToUInt16(packet, 2);
- if (len == 312)
- {
- player.Info = new ConquerMatrix.Network.AuthPackets.Authentication();
- player.Info.Deserialize(packet);
- player.Account = new AccountTable(player.Info.Username);
- msvcrt.msvcrt.srand(player.PasswordSeed);
- Forward Fw = new Forward();
- if (player.Account.Password == player.Info.Password && player.Account.exists)
- Fw.Type = Forward.ForwardType.Ready;
- else
- Fw.Type = Forward.ForwardType.InvalidInfo;
- if (Fw.Type == Network.AuthPackets.Forward.ForwardType.Ready)
- {
- Fw.Identifier = player.Account.GenerateKey();
- Kernel.AwaitingPool[Fw.Identifier] = player.Account;
- Fw.IP = Program.GameIP;
- Fw.Port = Program.GamePort;
- }
- player.Send(Fw);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement