private void SendLoadInventoryData(int connectionId, ErrorCode error = ErrorCode.None) { var dataLoadResponse = new DMarketDataLoadResponse(GetInventory(connectionId), error); var answerMessage = new InventoryBasicIntegrationAnswerMessage(dataLoadResponse); SendMessageToClient(answerMessage, connectionId); }
private bool IsCanMakeDMarketOperation(int connectionId) { if (string.IsNullOrEmpty(Model.GetPlayerMarketAccessToken(connectionId))) { var dataLoadResponse = new DMarketDataLoadResponse(GetInventory(connectionId), ErrorCode.EmptyDMarketAccessToken); var answer = new AppLoadDMarketAnswerMessage(dataLoadResponse); answer.Error = NetworkMessageErrorType.DMarketError; SendMessageToClient(answer, connectionId); return(false); } return(true); }
private void OnDMarketDataLoaded(DMarketDataLoadResponse response) { View.WaitingForm.Hide(); if (!response.HaveError) { Controller.UpdateInventoryData(response.Inventory); ApplyState <InventoryIdleState>(); } else { View.MessageBoxForm.Show("Error", Controller.Widget.GetErrorMessage(response.Error)); View.MessageBoxForm.Closed += OnCloseFormClicked; } }
private void OnUnloadBulkTransferFinished(DMarketDataLoadResponse loadResponse) { BasicWidget.Logout(); if (!loadResponse.HaveError) { Controller.UpdateInventoryData(loadResponse.Inventory); } else { View.MessageBoxForm.Show("Error", Controller.Widget.GetErrorMessage(loadResponse.Error)); View.MessageBoxForm.Closed += OnCloseFormClicked; } }
private void SendDmarketDataUpdateAnswer(int connectionId) { var response = new DMarketDataLoadResponse(GetInventory(connectionId)); SendMessageToClient(new AppLoadDMarketAnswerMessage(response), connectionId); }
private void SendLoadDMarketLoadDataError(int connectionId, ErrorCode error) { var response = new DMarketDataLoadResponse(GetInventory(connectionId), error); SendMessageToClient(new AppLoadDMarketAnswerMessage(response), connectionId); }
public override void Deserialize(NetworkReader reader) { base.Deserialize(reader); Response = JsonConvert.DeserializeObject <DMarketDataLoadResponse>(reader.ReadString()); }
public InventoryBasicIntegrationAnswerMessage(DMarketDataLoadResponse response) { Response = response; }
public AppLoadDMarketAnswerMessage(DMarketDataLoadResponse response) { Response = response; }
private void OnUnloadBulkTransferInventory(DMarketDataLoadResponse dMarketDataLoadResponse) { Controller.View.WaitingForm.Hide(); Controller.ToPreviousScene.SafeRaise(); }