Beispiel #1
0
        public Client(LengthedSocket socket, AuthServer server)
        {
            Socket = socket;
            Server = server;

            RegisterHandler(ClientOpcode.AboutToPlay, MsgAboutToPlay);
            RegisterHandler(ClientOpcode.Login, MsgLogin);
            RegisterHandler(ClientOpcode.Logout, MsgLogout);
            RegisterHandler(ClientOpcode.SCCheck, MsgSCCheck);
            RegisterHandler(ClientOpcode.ServerListExt, MsgServerListExt);

            Server.GenerateData(out OneTimeKey, out SessionId1, out SessionId2);

            SendProtocolVersion();

            Socket.SetNeedDecrypt(true);
            Socket.BeginReceive(_internalBuffer, 0, 2048, EndReceive);
        }