public void Execute() { if (String.IsNullOrEmpty(this.ApiRequest.ClientAlertsAuthToken)) { throw new ApplicationException("Invalid call to Login. The ClientAlerts authentication token is null or empty."); } Logger.Log(LogLevel.Info, "Logging into ClientAlerts..."); string url = String.Format(this.UrlBase + @"?callname=Login&ClientAlertsAuthToken={0}", EscapeParam(this.ApiRequest.ClientAlertsAuthToken)); string responseJson = null; try { responseJson = this.JsonWebService.Call(url); } catch { this.Logger.Log(LogLevel.Error, "An exception occurred while calling the Login web service."); throw; } try { JsonDeserializer deserializer = new JsonDeserializer(); this.ApiResponse = deserializer.DeSerialiseObject <LoginResponseType>(responseJson); } catch { Logger.Log(LogLevel.Error, "Failed to deserialise the following: {0}", responseJson); throw; } Logger.Log(LogLevel.Debug, "Login Ack {0}", this.ApiResponse.Ack); }
public static AuthenticationResponse InvalidLogin(LoginResponseType responseType) { return(new AuthenticationResponse { Success = false, ResponseType = responseType }); }
public static Command loginCommand(long ts, LoginResponseType t, GameState[] gss) { Command newCommand = new Command(); newCommand.timeStamp = ts; newCommand.cType = CType.Login; newCommand.loginResponse = t; newCommand.message = newCommand.cType + ":" + t; newCommand.message += ":" + gss.Length; if((newCommand.loginResponse & LoginResponseType.SucceededLogin) != 0) { foreach (GameState gs in gss) { newCommand.message += ":" + gs.roomName + ":" + gs.numberOfPlayers(); } } newCommand.message += ";"; return newCommand; }
public NexoLogin() : base(MessageCategoryEnumeration.Login) { RequestItem = new LoginRequestType(); ReplyItem = new LoginResponseType(); }
public static AuthenticationResponse InvalidLogin(LoginResponseType responseType) { return new AuthenticationResponse { Success = false, ResponseType = responseType }; }