void _gs_OnAccountInfoResponse(AccountInfoResponseArgs e) { GSTask t = new GSTask(); t.Type = (int)GSTask.GSTType.AccountInfoResponse; t.Client = null; t.Args = e; TaskProcessor.AddTask(t); }
void AccountInfoResponseHandler(BinaryReader br) { AccountInfoResponseArgs args = new AccountInfoResponseArgs(); args.ClientKey = br.ReadUInt32(); args.AccountId = br.ReadInt32(); args.HardCurrency = br.ReadInt32(); args.Vip = br.ReadInt32(); args.DisplayName = ReadUTF8String(br); args.AuthString = ReadUTF8String(br); OnAccountInfoResponse(args); }
void AccountInfoResponseHandler(Task t) { GSTask task = (GSTask)t; AccountInfoResponseArgs args = (AccountInfoResponseArgs)task.Args; GameClient client = (GameClient)_server.InputThread.FindClient(args.ClientKey); if (args.AccountId < 0) { // Account doesnt exist client.SendAccountResponse(-1, null); } else if (args.DisplayName == null || args.DisplayName.Length <= 0) { // Account exists but password is wrong client.SendAccountResponse(args.AccountId, null); } else if (client.PendingAuthTask != null) { // Cache this auth string for later _server.AuthManager.RegisterAuthString(args.AuthString, args.AccountId, args.HardCurrency, args.Vip, args.DisplayName); // Add the task to process this GSTask authTask = (GSTask)client.PendingAuthTask; AddTask(authTask); } else { // Store stuff client.AccountId = args.AccountId; client.HardCurrency = args.HardCurrency; client.Vip = args.Vip; client.DisplayName = args.DisplayName; client.AuthString = args.AuthString; // Let the server do new client stuff _server.NewAuthorizedClient(client); } }
void _gs_OnAccountInfoResponse(object sender, AccountInfoResponseArgs e) { GSTask t = new GSTask(); t.Type = (int)GSTask.GSTType.AccountInfoResponse; t.Client = null; t.Args = e; TaskProcessor.AddTask(t); }
void AccountInfoResponseHandler(BinaryReader br) { AccountInfoResponseArgs args = new AccountInfoResponseArgs(); args.ClientKey = br.ReadUInt32(); args.AccountId = br.ReadInt32(); args.HardCurrency = br.ReadInt32(); args.DisplayName = ReadUTF8String(br); OnAccountInfoResponse(this, args); }