public void PlayPremiumResponse(IAsyncResult asr)
        {
            XmlRpcAsyncResult result         = (XmlRpcAsyncResult)asr;
            CardsProxy        clientProtocol = (CardsProxy)result.ClientProtocol;

            clientProtocol.Url = this.EndpointUri;
            try
            {
                XmlRpcRespStruct_Cards cards = clientProtocol.EndplayPremium(asr);
                this.mResponse = new XmlRpcCardsResponse(cards.mMessage, cards.mSuccessCode);
            }
            catch (Exception exception)
            {
                this.mResponse = new XmlRpcCardsResponse(exception.Message, 0);
            }
            try
            {
                if (this.FormsControl != null)
                {
                    this.FormsControl.Invoke(new CardsEndResponseDelegate(this.CallbackMethod.Invoke), new object[] { this, this.Response });
                }
            }
            catch (Exception exception2)
            {
                string message = exception2.Message;
            }
        }
        public void veteranLevelUpResponse(IAsyncResult asr)
        {
            XmlRpcAsyncResult result         = (XmlRpcAsyncResult)asr;
            CardsProxy        clientProtocol = (CardsProxy)result.ClientProtocol;

            clientProtocol.Url = this.EndpointUri;
            try
            {
                XmlRpcRespStruct_Cards cards = clientProtocol.EndgetVeteranLevel(asr);
                this.mResponse = new XmlRpcCardsResponse();
                XmlRpcRespStruct_Cards cards2 = new XmlRpcRespStruct_Cards {
                    mVeteranLv1          = cards.mVeteranLv1,
                    mVeteranLv2          = cards.mVeteranLv2,
                    mVeteranLv3          = cards.mVeteranLv3,
                    mVeteranLv4          = cards.mVeteranLv4,
                    mVeteranLv5          = cards.mVeteranLv5,
                    mVeteranLv6          = cards.mVeteranLv6,
                    mVeteranLv7          = cards.mVeteranLv7,
                    mVeteranLv8          = cards.mVeteranLv8,
                    mVeteranLv9          = cards.mVeteranLv9,
                    mVeteranLv10         = cards.mVeteranLv10,
                    mVeteranSecondsLeft  = cards.mVeteranSecondsLeft,
                    mMessage             = cards.mMessage,
                    mSuccessCode         = cards.mSuccessCode,
                    mVeteranCurrentLevel = cards.mVeteranCurrentLevel
                };
                this.mResponse.Response = cards2;
            }
            catch (Exception exception)
            {
                this.mResponse = new XmlRpcCardsResponse(exception.Message, 0);
            }
            try
            {
                if (this.FormsControl != null)
                {
                    this.FormsControl.Invoke(new CardsEndResponseDelegate(this.CallbackMethod.Invoke), new object[] { this, this.Response });
                }
            }
            catch (Exception exception2)
            {
                string message = exception2.Message;
            }
        }
        public XmlRpcCardsResponse playPremium(ICardsRequest req, int timeout)
        {
            this.mRequest = (XmlRpcCardsRequest)req;
            CardsProxy proxy = XmlRpcProxyGen.Create <CardsProxy>();

            proxy.Url     = this.EndpointUri;
            proxy.Timeout = timeout;
            XmlRpcRespStruct_Cards cards = proxy.playPremium(this.mRequest.Request);

            try
            {
                this.mResponse = new XmlRpcCardsResponse(cards.mMessage, cards.mSuccessCode);
            }
            catch (Exception exception)
            {
                this.mResponse = new XmlRpcCardsResponse(exception.Message, 0);
            }
            return(this.mResponse);
        }
        public void getFreeCardResponse(IAsyncResult asr)
        {
            XmlRpcAsyncResult result         = (XmlRpcAsyncResult)asr;
            CardsProxy        clientProtocol = (CardsProxy)result.ClientProtocol;

            clientProtocol.Url = this.EndpointUri;
            try
            {
                XmlRpcRespStruct_Cards cards = clientProtocol.EndgetVeteranLevel(asr);
                this.mResponse = new XmlRpcCardsResponse();
                XmlRpcRespStruct_Cards cards2 = new XmlRpcRespStruct_Cards {
                    mVeteranLv1          = cards.mVeteranLv1,
                    mVeteranLv2          = cards.mVeteranLv2,
                    mVeteranLv3          = cards.mVeteranLv3,
                    mVeteranLv4          = cards.mVeteranLv4,
                    mVeteranLv5          = cards.mVeteranLv5,
                    mVeteranLv6          = cards.mVeteranLv6,
                    mVeteranLv7          = cards.mVeteranLv7,
                    mVeteranLv8          = cards.mVeteranLv8,
                    mVeteranLv9          = cards.mVeteranLv9,
                    mVeteranLv10         = cards.mVeteranLv10,
                    mVeteranSecondsLeft  = cards.mVeteranSecondsLeft,
                    mMessage             = cards.mMessage,
                    mSuccessCode         = cards.mSuccessCode,
                    mVeteranCurrentLevel = cards.mVeteranCurrentLevel,
                    mStrings             = cards.mStrings
                };
                this.mResponse.Response = cards2;
            }
            catch (Exception exception)
            {
                this.mResponse = new XmlRpcCardsResponse(exception.Message, 0);
            }
            try
            {
                this.CallbackMethod(this, this.Response);
            }
            catch (Exception exception2)
            {
                string message = exception2.Message;
            }
        }
        public XmlRpcCardsResponse setVeteranData(ICardsRequest req, CardsEndResponseDelegate callbackHandler, Control ctrl, int timeout)
        {
            this.FormsControl   = ctrl;
            this.CallbackMethod = callbackHandler;
            this.mRequest       = (XmlRpcCardsRequest)req;
            CardsProxy proxy = XmlRpcProxyGen.Create <CardsProxy>();

            proxy.Url     = this.EndpointUri;
            proxy.Timeout = timeout;
            XmlRpcRespStruct_Cards cards = proxy.setVeteranData(this.mRequest.Request);

            try
            {
                this.mResponse = new XmlRpcCardsResponse(cards.mMessage, cards.mSuccessCode);
            }
            catch (Exception exception)
            {
                this.mResponse = new XmlRpcCardsResponse(exception.Message, 0);
            }
            return(this.mResponse);
        }
 public void veteranLevelUpResponse(IAsyncResult asr)
 {
     XmlRpcAsyncResult result = (XmlRpcAsyncResult) asr;
     CardsProxy clientProtocol = (CardsProxy) result.ClientProtocol;
     clientProtocol.Url = this.EndpointUri;
     try
     {
         XmlRpcRespStruct_Cards cards = clientProtocol.EndgetVeteranLevel(asr);
         this.mResponse = new XmlRpcCardsResponse();
         XmlRpcRespStruct_Cards cards2 = new XmlRpcRespStruct_Cards {
             mVeteranLv1 = cards.mVeteranLv1,
             mVeteranLv2 = cards.mVeteranLv2,
             mVeteranLv3 = cards.mVeteranLv3,
             mVeteranLv4 = cards.mVeteranLv4,
             mVeteranLv5 = cards.mVeteranLv5,
             mVeteranLv6 = cards.mVeteranLv6,
             mVeteranLv7 = cards.mVeteranLv7,
             mVeteranLv8 = cards.mVeteranLv8,
             mVeteranLv9 = cards.mVeteranLv9,
             mVeteranLv10 = cards.mVeteranLv10,
             mVeteranSecondsLeft = cards.mVeteranSecondsLeft,
             mMessage = cards.mMessage,
             mSuccessCode = cards.mSuccessCode,
             mVeteranCurrentLevel = cards.mVeteranCurrentLevel
         };
         this.mResponse.Response = cards2;
     }
     catch (Exception exception)
     {
         this.mResponse = new XmlRpcCardsResponse(exception.Message, 0);
     }
     try
     {
         if (this.FormsControl != null)
         {
             this.FormsControl.Invoke(new CardsEndResponseDelegate(this.CallbackMethod.Invoke), new object[] { this, this.Response });
         }
     }
     catch (Exception exception2)
     {
         string message = exception2.Message;
     }
 }
 public XmlRpcCardsResponse setVeteranData(ICardsRequest req, CardsEndResponseDelegate callbackHandler, Control ctrl, int timeout)
 {
     this.FormsControl = ctrl;
     this.CallbackMethod = callbackHandler;
     this.mRequest = (XmlRpcCardsRequest) req;
     CardsProxy proxy = XmlRpcProxyGen.Create<CardsProxy>();
     proxy.Url = this.EndpointUri;
     proxy.Timeout = timeout;
     XmlRpcRespStruct_Cards cards = proxy.setVeteranData(this.mRequest.Request);
     try
     {
         this.mResponse = new XmlRpcCardsResponse(cards.mMessage, cards.mSuccessCode);
     }
     catch (Exception exception)
     {
         this.mResponse = new XmlRpcCardsResponse(exception.Message, 0);
     }
     return this.mResponse;
 }
 public void PlayPremiumResponse(IAsyncResult asr)
 {
     XmlRpcAsyncResult result = (XmlRpcAsyncResult) asr;
     CardsProxy clientProtocol = (CardsProxy) result.ClientProtocol;
     clientProtocol.Url = this.EndpointUri;
     try
     {
         XmlRpcRespStruct_Cards cards = clientProtocol.EndplayPremium(asr);
         this.mResponse = new XmlRpcCardsResponse(cards.mMessage, cards.mSuccessCode);
     }
     catch (Exception exception)
     {
         this.mResponse = new XmlRpcCardsResponse(exception.Message, 0);
     }
     try
     {
         if (this.FormsControl != null)
         {
             this.FormsControl.Invoke(new CardsEndResponseDelegate(this.CallbackMethod.Invoke), new object[] { this, this.Response });
         }
     }
     catch (Exception exception2)
     {
         string message = exception2.Message;
     }
 }
 public XmlRpcCardsResponse playPremium(ICardsRequest req, int timeout)
 {
     this.mRequest = (XmlRpcCardsRequest) req;
     CardsProxy proxy = XmlRpcProxyGen.Create<CardsProxy>();
     proxy.Url = this.EndpointUri;
     proxy.Timeout = timeout;
     XmlRpcRespStruct_Cards cards = proxy.playPremium(this.mRequest.Request);
     try
     {
         this.mResponse = new XmlRpcCardsResponse(cards.mMessage, cards.mSuccessCode);
     }
     catch (Exception exception)
     {
         this.mResponse = new XmlRpcCardsResponse(exception.Message, 0);
     }
     return this.mResponse;
 }
 public void getFreeCardResponse(IAsyncResult asr)
 {
     XmlRpcAsyncResult result = (XmlRpcAsyncResult) asr;
     CardsProxy clientProtocol = (CardsProxy) result.ClientProtocol;
     clientProtocol.Url = this.EndpointUri;
     try
     {
         XmlRpcRespStruct_Cards cards = clientProtocol.EndgetVeteranLevel(asr);
         this.mResponse = new XmlRpcCardsResponse();
         XmlRpcRespStruct_Cards cards2 = new XmlRpcRespStruct_Cards {
             mVeteranLv1 = cards.mVeteranLv1,
             mVeteranLv2 = cards.mVeteranLv2,
             mVeteranLv3 = cards.mVeteranLv3,
             mVeteranLv4 = cards.mVeteranLv4,
             mVeteranLv5 = cards.mVeteranLv5,
             mVeteranLv6 = cards.mVeteranLv6,
             mVeteranLv7 = cards.mVeteranLv7,
             mVeteranLv8 = cards.mVeteranLv8,
             mVeteranLv9 = cards.mVeteranLv9,
             mVeteranLv10 = cards.mVeteranLv10,
             mVeteranSecondsLeft = cards.mVeteranSecondsLeft,
             mMessage = cards.mMessage,
             mSuccessCode = cards.mSuccessCode,
             mVeteranCurrentLevel = cards.mVeteranCurrentLevel,
             mStrings = cards.mStrings
         };
         this.mResponse.Response = cards2;
     }
     catch (Exception exception)
     {
         this.mResponse = new XmlRpcCardsResponse(exception.Message, 0);
     }
     try
     {
         this.CallbackMethod(this, this.Response);
     }
     catch (Exception exception2)
     {
         string message = exception2.Message;
     }
 }
 private void CashClickCallback(ICardsProvider provider, ICardsResponse response)
 {
     if (response.SuccessCode == 1)
     {
         StatTrackingClient.Instance().ActivateTrigger(0x13, null);
         foreach (int num in GameEngine.Instance.World.ProfileCardsSet)
         {
             GameEngine.Instance.World.ProfileCards.Remove(num);
         }
         GameEngine.Instance.World.ProfileCardsSet.Clear();
         this.fastCashInCheckBox.Enabled = true;
         this.lastCashResponse = (XmlRpcCardsResponse) response;
         WorldMap world = GameEngine.Instance.World;
         world.ProfileCardpoints += response.Newpoints.Value;
     }
     else
     {
         MyMessageBox.Show(response.Message, SK.Text("GENERIC_Error", "Error"));
         this.GetCardsAvailable(true);
         int height = this.RefreshCards(this.AvailablePanelContent, this.UICardList, 500);
         this.AvailablePanelContent.Size = new Size(this.AvailablePanel.Width, height);
         this.UpdateScrollbar(this.scrollbarAvailable, this.AvailablePanelContent);
         this.cashingIn = false;
         this.cardsButtons.Available = true;
         this.InitEmptyCards();
         this.RefreshSet();
         this.InitSpinners();
     }
 }
 private void CashClick()
 {
     if (!this.cashingIn && !this.buyingCard)
     {
         XmlRpcCardsProvider provider = XmlRpcCardsProvider.CreateForEndpoint(URLs.ProfileProtocol, URLs.ProfileServerAddressCards, URLs.ProfileServerPort, URLs.ProfileCardPath);
         XmlRpcCardsRequest req = new XmlRpcCardsRequest {
             UserGUID = RemoteServices.Instance.UserGuid.ToString().Replace("-", "")
         };
         string str = "";
         this.NumCardsCachingIn = 0;
         foreach (CustomSelfDrawPanel.UICard card in this.SetCards)
         {
             if (card.Visible)
             {
                 if (str.Length > 0)
                 {
                     str = str + ",";
                 }
                 str = str + card.UserID.ToString();
                 this.NumCardsCachingIn++;
             }
         }
         req.CardString = str;
         provider.cashInCards(req, new CardsEndResponseDelegate(this.CashClickCallback), this);
         for (int i = 0; i < this.SlotAnims.Length; i++)
         {
             this.SlotAnims[i].Visible = true;
             this.SlotAnims[i].Playing = !this.fastCashIn;
         }
         this.SlotHolder.Visible = true;
         this.cashingIn = true;
         this.lastCashResponse = null;
         this.cardsButtons.Available = false;
         this.spinspeed = 0x40;
         this.spinstart = DateTime.Now;
         if (!this.fastCashIn && !this.playingSpinSound)
         {
             this.playingSpinSound = true;
             GameEngine.Instance.playInterfaceSound("CardSpinners_spin");
             for (int j = 0; j < 5; j++)
             {
                 this.spinSoundStopPlayed[j] = false;
             }
             this.spinSoundSoundID = 1;
         }
         this.mainBackgroundImage.invalidate();
         this.DynamicLabel.Visible = false;
     }
 }