public object Any(GetTimeRequest request) { // Wait some time to simulate a working delay System.Threading.Thread.Sleep(1000); return DateTime.Now.ToString(); }
public Service.ReturnData GetTime(string FirstName, string LastName) { GetTimeRequest inValue = new GetTimeRequest(); inValue.FirstName = FirstName; inValue.LastName = LastName; getTimeResponse retVal = ((ISer)(this)).GetTime(inValue); return(retVal.getTimeResult); }
public void GetCurrentServerTime() { var time = new GetTimeRequest(); PlayFabClientAPI.GetTime(time, result => { //Debug.Log("server time = " + result.Time); osTrackController.RecieveCurrentServerTime(result.Time); }, error => { Debug.Log(error.ErrorMessage); }); }
IEnumerator MakeUpdate() { try { var requestTime = new GetTimeRequest { }; PlayFabClientAPI.GetTime(requestTime, onGetTimeResult => { //TimeTMP.text = onGetTimeResult.Time.ToShortTimeString() + ", " + onGetTimeResult.Time.ToLongDateString(); TimeTMP.text = "Tournament ends: " + CultureInfo.CurrentCulture.DateTimeFormat.GetMonthName(onGetTimeResult.Time.Month); }, onGetTimeError => { }); } catch (Exception e) { coroutine = MakeUpdate(); StartCoroutine(coroutine); } yield return(new WaitForSeconds(5)); StartCoroutine(MakeUpdate()); }
/// <summary> Setter constructor. </summary> public GetTime(GetTimeRequest request) { Request = request; Response = new GetTimeResponse(); }
getTimeResponse ISer.GetTime(GetTimeRequest request) { return(base.Channel.GetTime(request)); }
public GetTimeResponse GetTime(GetTimeRequest request) { return new GetTimeResponse(DateTime.Now); }
private void UpdateTime() { GetTimeRequest request = new GetTimeRequest(); PlayFabClientAPI.GetTime(request, OnTimeUpdate, OnPlayFabError); }
void HeartsUpdate(GetPlayerStatisticsResult result) { currentHearts = result.Statistics.Find(stat => stat.StatisticName == "Lives").Value; startButton.gameObject.SetActive(currentHearts > 0); restertButton.gameObject.SetActive(currentHearts > 0); for (int i = 0; i < currentHearts; i++) { Hearts[i].color = Color.white; } for (int i = currentHearts; i < 3; i++) { Hearts[i].color = Color.black; } if (currentHearts < 3) { var requestTime = new GetTimeRequest { }; PlayFabClientAPI.GetTime(requestTime, ServerTimeResult => { PlayerTime = result.Statistics.Find(stat => stat.StatisticName == "Time").Value; Debug.Log("PlayerTime: " + PlayerTime); ServerTime = Convert.ToInt32(new TimeSpan(ServerTimeResult.Time.Ticks).TotalMinutes); Debug.Log("ServerTime B: " + ServerTime); RemainingTime.text = "Life will be restored in " + (60 - (ServerTime - PlayerTime)) + " minutes"; Debug.Log("ServerTime A: " + ServerTime); switch (currentHearts) { case 0: { //string RemainingTime = "Life will be restored in " + (60 - (ServerTime - PlayerTime)) + " minutes"; if (ServerTime >= PlayerTime + 180) { UpdateLives(currentHearts + 3); UpdateTime(PlayerTime + 180); //RemainingTime = ""; RemainingTime.text = "Restoring life, Wait a second..."; startButton.gameObject.SetActive(false); } else if (ServerTime >= PlayerTime + 120) { UpdateLives(currentHearts + 2); UpdateTime(PlayerTime + 120); //RemainingTime = "Life will be restored in " + (60 - (ServerTime - (PlayerTime + 120))) + " minutes"; RemainingTime.text = "Restoring life, Wait a second..."; startButton.gameObject.SetActive(false); } else if (ServerTime >= PlayerTime + 60) { UpdateLives(currentHearts + 1); UpdateTime(PlayerTime + 60); //RemainingTime = "Life will be restored in " + (60 - (ServerTime - (PlayerTime + 60))) + " minutes"; RemainingTime.text = "Restoring life, Wait a second..."; startButton.gameObject.SetActive(false); } Debug.Log("ServerTime IN 0: " + ServerTime); //this.RemainingTime.text = RemainingTime; } break; case 1: { //string RemainingTime = "Life will be restored in " + (60 - (ServerTime - PlayerTime)) + " minutes"; if (ServerTime >= PlayerTime + 120) { UpdateLives(currentHearts + 2); UpdateTime(PlayerTime + 120); //RemainingTime = ""; RemainingTime.text = "Restoring life, Wait a second..."; startButton.gameObject.SetActive(false); } else if (ServerTime >= PlayerTime + 60) { UpdateLives(currentHearts + 1); UpdateTime(PlayerTime + 60); //RemainingTime = "Life will be restored in " + (60 - (ServerTime - (PlayerTime + 60))) + " minutes"; RemainingTime.text = "Restoring life, Wait a second..."; startButton.gameObject.SetActive(false); } Debug.Log("ServerTime IN 1: " + ServerTime); //this.RemainingTime.text = RemainingTime; } break; case 2: { //string RemainingTime = "Life will be restored in " + (60 - (ServerTime - PlayerTime)) + " minutes"; if (ServerTime >= PlayerTime + 60) { UpdateLives(currentHearts + 1); UpdateTime(PlayerTime + 60); //RemainingTime = ""; RemainingTime.text = "Restoring life, Wait a second..."; startButton.gameObject.SetActive(false); } Debug.Log("ServerTime IN 2: " + ServerTime); //this.RemainingTime.text = RemainingTime; } break; } }, ServerTimeError => { }); } else { RemainingTime.text = ""; startButton.gameObject.SetActive(true); } }
//gets the timestamp to start a new streak of games. Upon getting the server time a game starts public void GetTimeStampedGame() { var timeRequest = new GetTimeRequest(); PlayFabClientAPI.GetTime(timeRequest, OnStartTimeStampSuccess, OnGetTimeFailure); }
public void GetCurrentTime() { var timeRequest = new GetTimeRequest(); PlayFabClientAPI.GetTime(timeRequest, OnGetTimeSuccess, OnGetTimeFailure); }
public GetTimeResponse GetTime(GetTimeRequest request) { return(new GetTimeResponse(DateTime.Now)); }