Exemplo n.º 1
0
        private void SendLoadInventoryData(int connectionId, ErrorCode error = ErrorCode.None)
        {
            var dataLoadResponse = new DMarketDataLoadResponse(GetInventory(connectionId), error);
            var answerMessage    = new InventoryBasicIntegrationAnswerMessage(dataLoadResponse);

            SendMessageToClient(answerMessage, connectionId);
        }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
 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;
            }
        }
Exemplo n.º 5
0
        private void SendDmarketDataUpdateAnswer(int connectionId)
        {
            var response = new DMarketDataLoadResponse(GetInventory(connectionId));

            SendMessageToClient(new AppLoadDMarketAnswerMessage(response), connectionId);
        }
Exemplo n.º 6
0
        private void SendLoadDMarketLoadDataError(int connectionId, ErrorCode error)
        {
            var response = new DMarketDataLoadResponse(GetInventory(connectionId), error);

            SendMessageToClient(new AppLoadDMarketAnswerMessage(response), connectionId);
        }
Exemplo n.º 7
0
 public override void Deserialize(NetworkReader reader)
 {
     base.Deserialize(reader);
     Response = JsonConvert.DeserializeObject <DMarketDataLoadResponse>(reader.ReadString());
 }
Exemplo n.º 8
0
 public InventoryBasicIntegrationAnswerMessage(DMarketDataLoadResponse response)
 {
     Response = response;
 }
Exemplo n.º 9
0
 public AppLoadDMarketAnswerMessage(DMarketDataLoadResponse response)
 {
     Response = response;
 }
Exemplo n.º 10
0
 private void OnUnloadBulkTransferInventory(DMarketDataLoadResponse dMarketDataLoadResponse)
 {
     Controller.View.WaitingForm.Hide();
     Controller.ToPreviousScene.SafeRaise();
 }