//method for creating the return data object based on response from client private ReturnData GenerateReturnData(UpdatingGameStatusResponse response) { ReturnData output = new ReturnData() { PlayerID = response.PlayerID, PlayerNumber = response.PlayerNumber, Response = response.Done, }; return(output); }
private UpdatingGameStatusResponse GenerateGameUpdatingResponse() { UpdatingGameStatusResponse response = new UpdatingGameStatusResponse() { Done = true, PlayerID = CurrentPlayerDataStorage.PlayerID, PlayerNumber = CurrentPlayerDataStorage.PlayerNumber, }; return(response); }
//update the game private ReturnData EngineDataUpdateHandler(IMakaoGameClientService proxy, object dataToTransfer) { UpdatingGameStatusResponse response = null; ReturnData output = null; try { response = proxy.UpdateGameStateAndData((PersonalizedPlayerDataRequest)dataToTransfer); } catch (Exception ex) { CatchConnectionException(ex, (dataToTransfer as PersonalizedPlayerDataRequest).DataOfThisPlayer.ThisPlayerNumber); } if (response != null) { output = GenerateReturnData(response); } return(output); }
//start new game private ReturnData EngineInstanceCreatedDataHandler(IMakaoGameClientService proxy, object dataToTransfer) { UpdatingGameStatusResponse response = null; ReturnData output = null; try { response = proxy.StartNewGameWindow((PersonalizedForSpecificPlayerStartGameDataRequest)dataToTransfer); } catch (Exception ex) { CatchConnectionException(ex, (dataToTransfer as PersonalizedForSpecificPlayerStartGameDataRequest).DataOfThisPlayer.ThisPlayerNumber); } if (response != null) { output = GenerateReturnData(response); } return(output); }