public static PlayerAuthResponse Unmarshall(UnmarshallerContext context) { PlayerAuthResponse playerAuthResponse = new PlayerAuthResponse() { HttpResponse = context.HttpResponse, RequestId = context.StringValue("PlayerAuth.RequestId"), LogURL = context.StringValue("PlayerAuth.LogURL") }; List <PlayerAuthResponse.Switch> switchList = new List <PlayerAuthResponse.Switch>(); for (int i = 0; i < context.Length("PlayerAuth.SwitchList.Length"); i++) { PlayerAuthResponse.Switch switch_ = new PlayerAuthResponse.Switch() { State = context.StringValue($"PlayerAuth.SwitchList[{i}].State"), FunctionId = context.StringValue($"PlayerAuth.SwitchList[{i}].FunctionId"), SwitchId = context.StringValue($"PlayerAuth.SwitchList[{i}].SwitchId"), FunctionName = context.StringValue($"PlayerAuth.SwitchList[{i}].FunctionName") }; switchList.Add(switch_); } playerAuthResponse.SwitchList = switchList; return(playerAuthResponse); }
private void HandlePlayerAuthResponse(PlayerAuthResponse msg) { if (_authRequests.TryGetValue(msg.AccountId, out AuthRequest request)) { Logger.LogInformation("Player auth result received: " + msg.Result); request.Success = (msg.Result > 0); request.Signal.Release(); } }
private async Task HandlePlayerAuthRequest(PlayerAuthRequest msg) { // Create response PlayerAuthResponse response = new PlayerAuthResponse(); response.AccountId = msg.AccountId; if (LoginService.Instance.VerifySession(msg.AccountId, msg.LoginAuthKey, msg.GameAuthKey)) { response.Result = 1; } else { response.Result = 0; } await SendPacketAsync(0x01, response); }
public static PlayerAuthResponse Unmarshall(UnmarshallerContext context) { PlayerAuthResponse playerAuthResponse = new PlayerAuthResponse(); playerAuthResponse.HttpResponse = context.HttpResponse; playerAuthResponse.RequestId = context.StringValue("PlayerAuth.RequestId"); List <PlayerAuthResponse.Switch> switchList = new List <PlayerAuthResponse.Switch>(); for (int i = 0; i < context.Length("PlayerAuth.SwitchList.Length"); i++) { PlayerAuthResponse.Switch switch_ = new PlayerAuthResponse.Switch(); switch_.State = context.StringValue("PlayerAuth.SwitchList[" + i + "].State"); switch_.FunctionId = context.StringValue("PlayerAuth.SwitchList[" + i + "].FunctionId"); switch_.SwitchId = context.StringValue("PlayerAuth.SwitchList[" + i + "].SwitchId"); switchList.Add(switch_); } playerAuthResponse.SwitchList = switchList; return(playerAuthResponse); }
public static PlayerAuthResponse Unmarshall(UnmarshallerContext context) { PlayerAuthResponse playerAuthResponse = new PlayerAuthResponse(); playerAuthResponse.HttpResponse = context.HttpResponse; playerAuthResponse.RequestId = context.StringValue("PlayerAuth.RequestId"); playerAuthResponse.LogURL = context.StringValue("PlayerAuth.LogURL"); List <PlayerAuthResponse.PlayerAuth__Switch> playerAuthResponse_switchList = new List <PlayerAuthResponse.PlayerAuth__Switch>(); for (int i = 0; i < context.Length("PlayerAuth.SwitchList.Length"); i++) { PlayerAuthResponse.PlayerAuth__Switch _switch = new PlayerAuthResponse.PlayerAuth__Switch(); _switch.State = context.StringValue("PlayerAuth.SwitchList[" + i + "].State"); _switch.FunctionId = context.StringValue("PlayerAuth.SwitchList[" + i + "].FunctionId"); _switch.SwitchId = context.StringValue("PlayerAuth.SwitchList[" + i + "].SwitchId"); _switch.FunctionName = context.StringValue("PlayerAuth.SwitchList[" + i + "].FunctionName"); playerAuthResponse_switchList.Add(_switch); } playerAuthResponse.SwitchList = playerAuthResponse_switchList; return(playerAuthResponse); }