private void SetStartingCountyCallback(SetStartingCounty_ReturnType returnData)
 {
     if (returnData.Success)
     {
         if (returnData.availableCounties == null)
         {
             if (returnData.villageID >= 0)
             {
                 GameEngine.Instance.World.setVillageName(returnData.villageID, returnData.villageName);
                 GameEngine.Instance.World.addUserVillage(returnData.villageID);
                 GameEngine.Instance.World.updateWorldMapOwnership();
                 this.m_parent.closing = true;
                 GameEngine.Instance.closeNoVillagePopup(true);
                 GameEngine.Instance.World.setResearchData(returnData.m_researchData);
                 InterfaceMgr.Instance.selectUserVillage(returnData.villageID, false);
             }
             else
             {
                 this.delayedRetry = DateTime.Now;
             }
         }
         else
         {
             bool flag = false;
             for (int i = 0; i < returnData.availableCounties.Count; i += 4)
             {
                 if (returnData.availableCounties[i] == this.selectedCounty)
                 {
                     flag = true;
                     break;
                 }
             }
             if (flag)
             {
                 this.retries++;
                 if (this.retries < 2)
                 {
                     Thread.Sleep(0x7d0);
                     RemoteServices.Instance.set_SetStartingCounty_UserCallBack(new RemoteServices.SetStartingCounty_UserCallBack(this.SetStartingCountyCallback));
                     RemoteServices.Instance.SetStartingCounty(this.selectedCounty);
                     return;
                 }
             }
             this.importCounties(returnData.availableCounties);
             this.btnEnterGame.Enabled = true;
             this.closePopup();
             MyMessageBox.Show(SK.Text("SelectVillageAreaPopup_Village_Placement_Error_Message", "The server failed to find you a village, please try again."), SK.Text("SelectVillageAreaPopup_Village_Placement_Error", "Village Placement Error"));
         }
     }
 }
Exemplo n.º 2
0
 public void OurRemoteAsyncCallBack_SetStartingCounty(IAsyncResult ar)
 {
     RemoteAsyncDelegate_SetStartingCounty asyncDelegate = (RemoteAsyncDelegate_SetStartingCounty) ((AsyncResult) ar).AsyncDelegate;
     try
     {
         this.storeRPCresult(ar, asyncDelegate.EndInvoke(ar));
     }
     catch (Exception exception)
     {
         SetStartingCounty_ReturnType returnData = new SetStartingCounty_ReturnType();
         this.manageRemoteExpection(ar, returnData, exception);
     }
 }