/// <summary> /// Initialises a new instance of the request with the given description. /// </summary> /// /// <param name="desc">The description.</param> /// <param name="gameToken">The Game to log in to.</param> public LogInUsingUserNameRequest(LogInUsingUserNameRequestDesc desc, string gameToken) { ReleaseAssert.IsNotNull(desc, "A description object cannot be null."); ReleaseAssert.IsNotNull(desc.UserName, "UserName cannot be null."); ReleaseAssert.IsNotNull(desc.Password, "Password cannot be null."); ReleaseAssert.IsNotNull(gameToken, "Game Token cannot be null."); UserName = desc.UserName; Password = desc.Password; DeviceModel = desc.DeviceModel; if (desc.DeviceType == null) { DeviceType = DeviceTypeDefaultProvider.GetDefault(); } else { DeviceType = desc.DeviceType; } if (desc.Platform == null) { Platform = PlatformDefaultProvider.GetDefault(); } else { Platform = desc.Platform; } AppVersion = desc.AppVersion; GameToken = gameToken; Date = DateTime.Now; Url = "https://connect.chilliconnect.com/1.0/player/login/username"; HttpRequestMethod = HttpRequestMethod.Post; }
/// <summary> /// Initialises a new instance of the request with the given description. /// </summary> /// /// <param name="desc">The description.</param> /// <param name="gameToken">The Game to log in to.</param> public LogInUsingChilliConnectRequest(LogInUsingChilliConnectRequestDesc desc, string gameToken) { ReleaseAssert.IsNotNull(desc, "A description object cannot be null."); ReleaseAssert.IsNotNull(desc.ChilliConnectId, "ChilliConnectId cannot be null."); ReleaseAssert.IsNotNull(desc.ChilliConnectSecret, "ChilliConnectSecret cannot be null."); ReleaseAssert.IsNotNull(gameToken, "Game Token cannot be null."); ChilliConnectId = desc.ChilliConnectId; ChilliConnectSecret = desc.ChilliConnectSecret; DeviceModel = desc.DeviceModel; if (desc.DeviceType == null) { DeviceType = DeviceTypeDefaultProvider.GetDefault(); } else { DeviceType = desc.DeviceType; } if (desc.Platform == null) { Platform = PlatformDefaultProvider.GetDefault(); } else { Platform = desc.Platform; } AppVersion = desc.AppVersion; GameToken = gameToken; Date = DateTime.Now; Url = "https://connect.chilliconnect.com/2.0/player/login/chilli"; HttpRequestMethod = HttpRequestMethod.Post; }
/// <summary> /// Initialises a new instance of the request with the given description. /// </summary> /// /// <param name="desc">The description.</param> /// <param name="gameToken">The Game to log in to.</param> public LogInUsingMobileDeviceIdRequest(LogInUsingMobileDeviceIdRequestDesc desc, string gameToken) { ReleaseAssert.IsNotNull(desc, "A description object cannot be null."); ReleaseAssert.IsNotNull(desc.DeviceId, "DeviceId cannot be null."); ReleaseAssert.IsNotNull(desc.Platform, "Platform cannot be null."); ReleaseAssert.IsNotNull(gameToken, "Game Token cannot be null."); DeviceId = desc.DeviceId; Platform = desc.Platform; CreatePlayer = desc.CreatePlayer; DeviceModel = desc.DeviceModel; if (desc.DeviceType == null) { DeviceType = DeviceTypeDefaultProvider.GetDefault(); } else { DeviceType = desc.DeviceType; } AppVersion = desc.AppVersion; GameToken = gameToken; Date = DateTime.Now; Url = "https://connect.chilliconnect.com/1.0/player/login/device"; HttpRequestMethod = HttpRequestMethod.Post; }
/// <summary> /// Initialises a new instance of the request with the given description. /// </summary> /// /// <param name="desc">The description.</param> /// <param name="gameToken">The Game to log in to.</param> public LogInUsingGoogleRequest(LogInUsingGoogleRequestDesc desc, string gameToken) { ReleaseAssert.IsNotNull(desc, "A description object cannot be null."); ReleaseAssert.IsNotNull(desc.AuthCode, "AuthCode cannot be null."); ReleaseAssert.IsNotNull(gameToken, "Game Token cannot be null."); AuthCode = desc.AuthCode; CreatePlayer = desc.CreatePlayer; DeviceModel = desc.DeviceModel; if (desc.DeviceType == null) { DeviceType = DeviceTypeDefaultProvider.GetDefault(); } else { DeviceType = desc.DeviceType; } if (desc.Platform == null) { Platform = PlatformDefaultProvider.GetDefault(); } else { Platform = desc.Platform; } AppVersion = desc.AppVersion; GameToken = gameToken; Date = DateTime.Now; Url = "https://connect.chilliconnect.com/2.0/player/login/google"; HttpRequestMethod = HttpRequestMethod.Post; }
/// <summary> /// Initialises a new instance of the request with the given description. /// </summary> /// /// <param name="desc">The description.</param> /// <param name="gameToken">The Game to log in to.</param> /// <param name="serverUrl">The server url for this call.</param> public LogInUsingGameCenterRequest(LogInUsingGameCenterRequestDesc desc, string gameToken, string serverUrl) { ReleaseAssert.IsNotNull(desc, "A description object cannot be null."); ReleaseAssert.IsNotNull(desc.GameCenterId, "GameCenterId cannot be null."); ReleaseAssert.IsNotNull(gameToken, "Game Token cannot be null."); GameCenterId = desc.GameCenterId; CreatePlayer = desc.CreatePlayer; Country = desc.Country; DeviceModel = desc.DeviceModel; if (desc.DeviceType == null) { DeviceType = DeviceTypeDefaultProvider.GetDefault(); } else { DeviceType = desc.DeviceType; } if (desc.Platform == null) { Platform = PlatformDefaultProvider.GetDefault(); } else { Platform = desc.Platform; } AppVersion = desc.AppVersion; GameToken = gameToken; Date = DateTime.Now; Url = serverUrl + "/2.0/player/login/gamecenter"; HttpRequestMethod = HttpRequestMethod.Post; }
/// <summary> /// Initialises a new instance of the request with the given description. /// </summary> /// /// <param name="desc">The description.</param> /// <param name="gameToken">The Game within which to create the new player.</param> /// <param name="serverUrl">The server url for this call.</param> public CreatePlayerRequest(CreatePlayerRequestDesc desc, string gameToken, string serverUrl) { ReleaseAssert.IsNotNull(desc, "A description object cannot be null."); ReleaseAssert.IsNotNull(gameToken, "Game Token cannot be null."); UserName = desc.UserName; DisplayName = desc.DisplayName; Email = desc.Email; Password = desc.Password; Country = desc.Country; DeviceModel = desc.DeviceModel; if (desc.DeviceType == null) { DeviceType = DeviceTypeDefaultProvider.GetDefault(); } else { DeviceType = desc.DeviceType; } if (desc.Platform == null) { Platform = PlatformDefaultProvider.GetDefault(); } else { Platform = desc.Platform; } AppVersion = desc.AppVersion; GameToken = gameToken; Url = serverUrl + "/1.0/player/create"; HttpRequestMethod = HttpRequestMethod.Post; }
/// <summary> /// Initialises a new instance of the request with the given description. /// </summary> /// /// <param name="desc">The description.</param> /// <param name="gameToken">The GameToken.</param> public StartSessionRequest(StartSessionRequestDesc desc, string gameToken) { ReleaseAssert.IsNotNull(desc, "A description object cannot be null."); ReleaseAssert.IsNotNull(desc.UserId, "UserId cannot be null."); ReleaseAssert.IsNotNull(gameToken, "Game Token cannot be null."); UserId = desc.UserId; AppVersion = desc.AppVersion; Country = desc.Country; if (desc.DeviceType == null) { DeviceType = DeviceTypeDefaultProvider.GetDefault(); } else { DeviceType = desc.DeviceType; } if (desc.Platform == null) { Platform = PlatformDefaultProvider.GetDefault(); } else { Platform = desc.Platform; } TestKey = desc.TestKey; TestGroupKey = desc.TestGroupKey; GameToken = gameToken; Date = DateTime.Now; Url = "https://metrics.chilliconnect.com/1.0/session/start"; HttpRequestMethod = HttpRequestMethod.Post; }