示例#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);
        }
示例#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);
        }
示例#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;
            }
        }
示例#5
0
        private void SendDmarketDataUpdateAnswer(int connectionId)
        {
            var response = new DMarketDataLoadResponse(GetInventory(connectionId));

            SendMessageToClient(new AppLoadDMarketAnswerMessage(response), connectionId);
        }
示例#6
0
        private void SendLoadDMarketLoadDataError(int connectionId, ErrorCode error)
        {
            var response = new DMarketDataLoadResponse(GetInventory(connectionId), error);

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