Example #1
0
        public override void OnActivate(int pinID)
        {
            if (!GameUtility.Config_UseAssetBundles.Value)
            {
                this.ActivateOutputLinks(100);
            }
            else
            {
                switch (pinID)
                {
                case 0:
                    // ISSUE: object of a compiler-generated type is created
                    // ISSUE: variable of a compiler-generated type
                    FlowNode_VersusUnitDownload.\u003COnActivate\u003Ec__AnonStorey2D7 activateCAnonStorey2D7 = new FlowNode_VersusUnitDownload.\u003COnActivate\u003Ec__AnonStorey2D7();
                    // ISSUE: reference to a compiler-generated field
                    activateCAnonStorey2D7.pt = PunMonoSingleton <MyPhoton> .Instance;
                    // ISSUE: reference to a compiler-generated field
                    if (UnityEngine.Object.op_Inequality((UnityEngine.Object)activateCAnonStorey2D7.pt, (UnityEngine.Object)null))
                    {
                        // ISSUE: reference to a compiler-generated field
                        List <MyPhoton.MyPlayer> roomPlayerList = activateCAnonStorey2D7.pt.GetRoomPlayerList();
                        if (roomPlayerList != null && roomPlayerList.Count > 1)
                        {
                            // ISSUE: reference to a compiler-generated method
                            MyPhoton.MyPlayer myPlayer = roomPlayerList.Find(new Predicate <MyPhoton.MyPlayer>(activateCAnonStorey2D7.\u003C\u003Em__2CC));
                            if (myPlayer != null)
                            {
                                this.AddAssets(JSON_MyPhotonPlayerParam.Parse(myPlayer.json));
                                break;
                            }
                            break;
                        }
                        break;
                    }
                    break;

                case 1:
                    GameManager instance = MonoSingleton <GameManager> .Instance;
                    if (instance.AudienceRoom != null)
                    {
                        JSON_MyPhotonRoomParam myPhotonRoomParam = JSON_MyPhotonRoomParam.Parse(instance.AudienceRoom.json);
                        if (myPhotonRoomParam != null)
                        {
                            for (int index = 0; index < myPhotonRoomParam.players.Length; ++index)
                            {
                                if (myPhotonRoomParam.players[index] != null)
                                {
                                    myPhotonRoomParam.players[index].SetupUnits();
                                    this.AddAssets(myPhotonRoomParam.players[index]);
                                }
                            }
                            break;
                        }
                        break;
                    }
                    break;
                }
                this.StartCoroutine(this.AsyncDownload());
            }
        }
Example #2
0
        public override void OnActivate(int pinID)
        {
            MyPhoton pt = PunMonoSingleton <MyPhoton> .Instance;

            if (UnityEngine.Object.op_Inequality((UnityEngine.Object)pt, (UnityEngine.Object)null))
            {
                string roomParam = pt.GetRoomParam("started");
                if (roomParam != null)
                {
                    JSON_MyPhotonPlayerParam[] players = JSONParser.parseJSONObject <FlowNode_StartMultiPlay.PlayerList>(roomParam).players;
                    if (players.Length > 0)
                    {
                        JSON_MyPhotonPlayerParam photonPlayerParam = this.Type != FlowNode_BindMultiUnit.TargetType.Player ? Array.Find <JSON_MyPhotonPlayerParam>(players, (Predicate <JSON_MyPhotonPlayerParam>)(p => p.playerID != pt.GetMyPlayer().playerID)) : Array.Find <JSON_MyPhotonPlayerParam>(players, (Predicate <JSON_MyPhotonPlayerParam>)(p => p.playerID == pt.GetMyPlayer().playerID));
                        if (photonPlayerParam != null)
                        {
                            PartyData partyOfType = MonoSingleton <GameManager> .Instance.Player.FindPartyOfType(PlayerPartyTypes.RankMatch);

                            for (int index = 0; index < this.Targets.Length && index < photonPlayerParam.units.Length && (GlobalVars.SelectedMultiPlayRoomType != JSON_MyPhotonRoomParam.EType.RANKMATCH || partyOfType == null || index < partyOfType.VSWAITMEMBER_START); ++index)
                            {
                                photonPlayerParam.units[index].unit = new UnitData();
                                photonPlayerParam.units[index].unit.Deserialize(photonPlayerParam.units[index].unitJson);
                                DataSource.Bind <UnitData>(this.Targets[index], photonPlayerParam.units[index].unit);
                                GameParameter.UpdateAll(this.Targets[index]);
                                if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.Image, (UnityEngine.Object)null) && index == 0)
                                {
                                    DataSource.Bind <UnitData>(this.Image, photonPlayerParam.units[index].unit);
                                    GameParameter.UpdateAll(this.Image);
                                }
                            }
                        }
                    }
                }
            }
            this.ActivateOutputLinks(2);
        }
            public override void Begin(FlowNode_MultiPlayJoinRoom self)
            {
                MyPhoton instance = PunMonoSingleton <MyPhoton> .Instance;

                self.mJoinPlayerParam = JSON_MyPhotonPlayerParam.Create(0, 0);
                if (self.mJoinPlayerParam == null)
                {
                    self.FailureLobby();
                }
                else
                {
                    int lrange = -1;
                    int frange = -1;
                    int lv     = MonoSingleton <GameManager> .Instance.Player.CalcLevel();

                    int versusTowerFloor = MonoSingleton <GameManager> .Instance.Player.VersusTowerFloor;
                    MonoSingleton <GameManager> .Instance.GetRankMatchCondition(out lrange, out frange);

                    if (instance.JoinRoomCheckParam(GlobalVars.MultiPlayVersusKey, self.mJoinPlayerParam.Serialize(), lrange, frange, lv, versusTowerFloor))
                    {
                        return;
                    }
                    DebugUtility.Log("error:" + (object)instance.LastError);
                    self.FailureLobby();
                }
            }
        private void SendPlacementInfo()
        {
            MyPhoton pt = PunMonoSingleton <MyPhoton> .Instance;

            MyPhoton.MyPlayer myPlayer = pt.GetMyPlayer();
            if (myPlayer == null)
            {
                return;
            }
            JSON_MyPhotonPlayerParam param = JSON_MyPhotonPlayerParam.Parse(myPlayer.json);

            if (param.units != null)
            {
                for (int i = 0; i < param.units.Length; ++i)
                {
                    TacticsUnitController tacticsUnitController = this.m_Units.Find((Predicate <TacticsUnitController>)(data =>
                    {
                        if (data.Unit.OwnerPlayerIndex == pt.MyPlayerIndex)
                        {
                            return(data.UnitData.UnitParam.iname == param.units[i].unit.UnitParam.iname);
                        }
                        return(false);
                    }));
                    if (UnityEngine.Object.op_Inequality((UnityEngine.Object)tacticsUnitController, (UnityEngine.Object)null))
                    {
                        param.units[i].place = this.GetPlacementID(tacticsUnitController.Unit.x, tacticsUnitController.Unit.y);
                        PlayerPrefsUtility.SetInt(PlayerPrefsUtility.MULTITW_ID_KEY + (object)i, param.units[i].place, false);
                    }
                }
            }
            PlayerPrefsUtility.Save();
            pt.SetMyPlayerParam(param.Serialize());
        }
 public void Set(JSON_MyPhotonPlayerParam param)
 {
     this.playerID        = param.playerID;
     this.playerIndex     = param.playerIndex;
     this.playerName      = param.playerName;
     this.playerLevel     = param.playerLevel;
     this.FUID            = param.FUID;
     this.UID             = param.UID;
     this.totalAtk        = param.totalAtk;
     this.totalStatus     = param.totalStatus;
     this.rankpoint       = param.rankpoint;
     this.award           = param.award;
     this.state           = param.state;
     this.rankmatch_score = param.rankmatch_score;
     this.support_unit    = param.support_unit;
     this.draft_id        = param.draft_id;
     if (param.units == null)
     {
         return;
     }
     this.units = new Json_MyPhotonPlayerBinaryParam.UnitDataElem[param.units.Length];
     for (int index = 0; index < param.units.Length; ++index)
     {
         this.units[index]          = new Json_MyPhotonPlayerBinaryParam.UnitDataElem();
         this.units[index].slotID   = param.units[index].slotID;
         this.units[index].place    = param.units[index].place;
         this.units[index].unitJson = param.units[index].unitJson;
     }
 }
 public override void Begin(FlowNode_MultiPlayJoinRoom self)
 {
   MyPhoton instance = PunMonoSingleton<MyPhoton>.Instance;
   self.mJoinPlayerParam = JSON_MyPhotonPlayerParam.Create(0, 0);
   if (self.mJoinPlayerParam == null)
   {
     self.FailureLobby();
   }
   else
   {
     JSON_MyPhotonRoomParam myPhotonRoomParam = new JSON_MyPhotonRoomParam();
     myPhotonRoomParam.creatorName = MonoSingleton<GameManager>.Instance.Player.Name;
     myPhotonRoomParam.creatorLV = MonoSingleton<GameManager>.Instance.Player.CalcLevel();
     myPhotonRoomParam.creatorFUID = JSON_MyPhotonRoomParam.GetMyCreatorFUID();
     myPhotonRoomParam.roomid = GlobalVars.SelectedMultiPlayRoomID;
     myPhotonRoomParam.comment = GlobalVars.SelectedMultiPlayRoomComment;
     myPhotonRoomParam.passCode = GlobalVars.EditMultiPlayRoomPassCode;
     myPhotonRoomParam.iname = GlobalVars.SelectedQuestID;
     myPhotonRoomParam.type = (int) GlobalVars.SelectedMultiPlayRoomType;
     myPhotonRoomParam.isLINE = !self.IsLINE ? 0 : 1;
     QuestParam quest = MonoSingleton<GameManager>.Instance.FindQuest(GlobalVars.SelectedQuestID);
     MultiTowerFloorParam mtFloorParam = MonoSingleton<GameManager>.Instance.GetMTFloorParam(quest.iname);
     int selectedMultiTowerFloor = GlobalVars.SelectedMultiTowerFloor;
     if (instance.CreateRoom((int) quest.playerNum, GlobalVars.SelectedMultiPlayRoomName, myPhotonRoomParam.Serialize(), self.mJoinPlayerParam.Serialize(), mtFloorParam.tower_id, selectedMultiTowerFloor, -1, (string) null, (string) null, -1, true))
       return;
     self.FailureLobby();
   }
 }
 public override void Begin(FlowNode_MultiPlayJoinRoom self)
 {
   MyPhoton instance = PunMonoSingleton<MyPhoton>.Instance;
   if (string.IsNullOrEmpty(GlobalVars.SelectedMultiPlayRoomName))
   {
     self.FailureLobby();
   }
   else
   {
     QuestParam quest = MonoSingleton<GameManager>.Instance.FindQuest(GlobalVars.SelectedQuestID);
     if (quest == null)
     {
       DebugUtility.Log("illegal iname:" + GlobalVars.SelectedQuestID);
       self.IllegalQuest();
     }
     else
     {
       self.mJoinPlayerParam = JSON_MyPhotonPlayerParam.Create(0, 0);
       if (self.mJoinPlayerParam == null)
       {
         self.FailureLobby();
       }
       else
       {
         DebugUtility.Log("Joining name:" + GlobalVars.SelectedMultiPlayRoomName + " pnum:" + (object) quest.playerNum + " unum:" + (object) quest.unitNum);
         if (instance.JoinRoom(GlobalVars.SelectedMultiPlayRoomName, self.mJoinPlayerParam.Serialize(), GlobalVars.ResumeMultiplayPlayerID != 0))
           return;
         DebugUtility.Log("error:" + (object) instance.LastError);
         self.FailureLobby();
       }
     }
   }
 }
Example #8
0
        private void SetUp()
        {
            string str = string.Empty;

            if (this.Type == AwardItem.PlayerType.Player)
            {
                PlayerData dataOfClass = DataSource.FindDataOfClass <PlayerData>(((Component)this).get_gameObject(), (PlayerData)null);
                if (dataOfClass != null)
                {
                    str = dataOfClass.SelectedAward;
                }
            }
            else if (this.Type == AwardItem.PlayerType.Friend)
            {
                FriendData dataOfClass = DataSource.FindDataOfClass <FriendData>(((Component)this).get_gameObject(), (FriendData)null);
                if (dataOfClass != null)
                {
                    str = dataOfClass.SelectAward;
                }
            }
            else if (this.Type == AwardItem.PlayerType.ArenaPlayer)
            {
                ArenaPlayer dataOfClass = DataSource.FindDataOfClass <ArenaPlayer>(((Component)this).get_gameObject(), (ArenaPlayer)null);
                if (dataOfClass != null)
                {
                    str = dataOfClass.SelectAward;
                }
            }
            else if (this.Type == AwardItem.PlayerType.MultiPlayer)
            {
                JSON_MyPhotonPlayerParam dataOfClass = DataSource.FindDataOfClass <JSON_MyPhotonPlayerParam>(((Component)this).get_gameObject(), (JSON_MyPhotonPlayerParam)null);
                if (dataOfClass != null)
                {
                    str = dataOfClass.award;
                }
            }
            else if (this.Type == AwardItem.PlayerType.ChatPlayer)
            {
                ChatPlayerData dataOfClass = DataSource.FindDataOfClass <ChatPlayerData>(((Component)this).get_gameObject(), (ChatPlayerData)null);
                if (dataOfClass != null)
                {
                    str = dataOfClass.award;
                }
            }
            this.mSelectedAward = str;
            if (!string.IsNullOrEmpty(this.mSelectedAward))
            {
                AwardParam awardParam = MonoSingleton <GameManager> .Instance.MasterParam.GetAwardParam(this.mSelectedAward);

                if (awardParam != null)
                {
                    this.mAwardParam = awardParam;
                }
            }
            else
            {
                this.mAwardParam = (AwardParam)null;
            }
            this.IsDone = true;
        }
Example #9
0
            public override void Begin(FlowNode_MultiPlayJoinRoom self)
            {
                MyPhoton instance = PunMonoSingleton <MyPhoton> .Instance;

                self.mJoinPlayerParam = JSON_MyPhotonPlayerParam.Create(0, 0);
                if (self.mJoinPlayerParam == null)
                {
                    self.FailureLobby();
                }
                else
                {
                    int lvRange = -1;
                    int lv      = MonoSingleton <GameManager> .Instance.Player.CalcLevel();

                    int    rankMatchScore = MonoSingleton <GameManager> .Instance.Player.RankMatchScore;
                    int    rankMatchClass = (int)MonoSingleton <GameManager> .Instance.Player.RankMatchClass;
                    string deviceId       = MonoSingleton <GameManager> .Instance.DeviceId;
                    if (instance.JoinRankMatchRoomCheckParam(self.mJoinPlayerParam.Serialize(), lv, lvRange, deviceId, rankMatchScore, 900, 100, rankMatchClass, MonoSingleton <GameManager> .Instance.RankMatchMatchedEnemies))
                    {
                        return;
                    }
                    DebugUtility.Log("error:" + (object)instance.LastError);
                    self.FailureLobby();
                }
            }
Example #10
0
            public override void Begin(FlowNode_MultiPlayJoinRoom self)
            {
                GameManager instance1 = MonoSingleton <GameManager> .Instance;
                MyPhoton    instance2 = PunMonoSingleton <MyPhoton> .Instance;

                self.mJoinPlayerParam = JSON_MyPhotonPlayerParam.Create(0, 0);
                if (self.mJoinPlayerParam == null)
                {
                    self.FailureLobby();
                }
                else
                {
                    JSON_MyPhotonRoomParam myPhotonRoomParam = new JSON_MyPhotonRoomParam();
                    myPhotonRoomParam.creatorName = MonoSingleton <GameManager> .Instance.Player.Name;
                    myPhotonRoomParam.creatorLV   = MonoSingleton <GameManager> .Instance.Player.CalcLevel();

                    myPhotonRoomParam.creatorFUID = JSON_MyPhotonRoomParam.GetMyCreatorFUID();
                    myPhotonRoomParam.roomid      = GlobalVars.SelectedMultiPlayRoomID;
                    myPhotonRoomParam.comment     = GlobalVars.SelectedMultiPlayRoomComment;
                    myPhotonRoomParam.passCode    = GlobalVars.EditMultiPlayRoomPassCode;
                    myPhotonRoomParam.iname       = GlobalVars.SelectedQuestID;
                    myPhotonRoomParam.type        = (int)GlobalVars.SelectedMultiPlayRoomType;
                    myPhotonRoomParam.isLINE      = !self.IsLINE ? 0 : 1;
                    myPhotonRoomParam.vsmode      = instance1.GetVSMode(-1L) != VS_MODE.THREE_ON_THREE ? 1 : 0;
                    int    creatorLv      = myPhotonRoomParam.creatorLV;
                    string deviceId       = MonoSingleton <GameManager> .Instance.DeviceId;
                    int    rankMatchScore = MonoSingleton <GameManager> .Instance.Player.RankMatchScore;
                    int    rankMatchClass = (int)MonoSingleton <GameManager> .Instance.Player.RankMatchClass;
                    if (instance2.CreateRoom(GlobalVars.SelectedMultiPlayRoomName, myPhotonRoomParam.Serialize(), self.mJoinPlayerParam.Serialize(), creatorLv, deviceId, rankMatchScore, rankMatchClass))
                    {
                        return;
                    }
                    self.FailureLobby();
                }
            }
 public override void OnActivate(int pinID)
 {
     if (pinID == 100)
     {
         // ISSUE: object of a compiler-generated type is created
         // ISSUE: variable of a compiler-generated type
         FlowNode_VersusAward.\u003COnActivate\u003Ec__AnonStorey218 activateCAnonStorey218 = new FlowNode_VersusAward.\u003COnActivate\u003Ec__AnonStorey218();
         // ISSUE: reference to a compiler-generated field
         activateCAnonStorey218.pt = PunMonoSingleton <MyPhoton> .Instance;
         JSON_MyPhotonPlayerParam data = (JSON_MyPhotonPlayerParam)null;
         // ISSUE: reference to a compiler-generated field
         List <MyPhoton.MyPlayer> roomPlayerList = activateCAnonStorey218.pt.GetRoomPlayerList();
         if (roomPlayerList != null)
         {
             if (this.MyPlayer)
             {
                 data = JSON_MyPhotonPlayerParam.Create(0, 0);
             }
             else
             {
                 // ISSUE: reference to a compiler-generated method
                 MyPhoton.MyPlayer myPlayer = roomPlayerList.Find(new Predicate <MyPhoton.MyPlayer>(activateCAnonStorey218.\u003C\u003Em__215));
                 if (myPlayer != null)
                 {
                     data = JSON_MyPhotonPlayerParam.Parse(myPlayer.json);
                 }
             }
         }
         if (data != null)
         {
             DataSource.Bind <JSON_MyPhotonPlayerParam>(this.BindObj, data);
         }
     }
     this.ActivateOutputLinks(200);
 }
Example #12
0
        public void Refresh()
        {
            JSON_MyPhotonPlayerParam dataOfClass = DataSource.FindDataOfClass <JSON_MyPhotonPlayerParam>(((Component)this).get_gameObject(), (JSON_MyPhotonPlayerParam)null);

            if (dataOfClass != null)
            {
                if (Object.op_Inequality((Object)this.EmptyObj, (Object)null))
                {
                    this.EmptyObj.SetActive(false);
                }
                if (Object.op_Inequality((Object)this.ValidObj, (Object)null))
                {
                    this.ValidObj.SetActive(true);
                }
                if (Object.op_Inequality((Object)this.LeaderUnit, (Object)null) && dataOfClass.units != null)
                {
                    dataOfClass.SetupUnits();
                    DataSource.Bind <UnitData>(this.LeaderUnit, dataOfClass.units[0].unit);
                }
                if (Object.op_Inequality((Object)this.Name, (Object)null))
                {
                    this.Name.set_text(dataOfClass.playerName);
                }
                if (Object.op_Inequality((Object)this.Lv, (Object)null))
                {
                    this.Lv.set_text(dataOfClass.playerLevel.ToString());
                }
                if (Object.op_Inequality((Object)this.Total, (Object)null))
                {
                    this.Total.set_text(dataOfClass.totalAtk.ToString());
                }
                if (Object.op_Inequality((Object)this.ReadyObj, (Object)null))
                {
                    this.ReadyObj.SetActive(dataOfClass.state != 4);
                }
                if (Object.op_Inequality((Object)this.Award, (Object)null))
                {
                    this.Award.get_gameObject().SetActive(false);
                    this.Award.get_gameObject().SetActive(true);
                }
                GameParameter.UpdateAll(((Component)this).get_gameObject());
            }
            else
            {
                if (Object.op_Inequality((Object)this.EmptyObj, (Object)null))
                {
                    this.EmptyObj.SetActive(true);
                }
                if (Object.op_Inequality((Object)this.ValidObj, (Object)null))
                {
                    this.ValidObj.SetActive(false);
                }
                if (!Object.op_Inequality((Object)this.ReadyObj, (Object)null))
                {
                    return;
                }
                this.ReadyObj.SetActive(false);
            }
        }
Example #13
0
 private void AddAssets(JSON_MyPhotonPlayerParam param)
 {
     if (param == null)
     {
         return;
     }
     AssetManager.PrepareAssets(AssetPath.UnitSkinImage(param.units[0].unit.UnitParam, param.units[0].unit.GetSelectedSkin(-1), param.units[0].unit.CurrentJobId));
 }
        public string GetOwnerName()
        {
            JSON_MyPhotonPlayerParam owner = this.GetOwner();

            if (owner == null)
            {
                return(this.creatorName);
            }
            return(owner.playerName);
        }
        public int GetOwnerLV()
        {
            JSON_MyPhotonPlayerParam owner = this.GetOwner();

            if (owner == null)
            {
                return(this.creatorLV);
            }
            return(owner.playerLevel);
        }
Example #16
0
            public override void Begin(VersusDraftReady self)
            {
                MyPhoton instance1 = PunMonoSingleton <MyPhoton> .Instance;

                MyPhoton.MyPlayer myPlayer = instance1.GetMyPlayer();
                int         num1           = myPlayer != null ? myPlayer.playerID : 0;
                int         myPlayerIndex  = instance1.MyPlayerIndex;
                GameManager instance2      = MonoSingleton <GameManager> .Instance;
                JSON_MyPhotonPlayerParam photonPlayerParam = new JSON_MyPhotonPlayerParam();
                PlayerData player = instance2.Player;

                photonPlayerParam.playerID    = num1;
                photonPlayerParam.playerIndex = myPlayerIndex;
                photonPlayerParam.playerName  = player.Name;
                photonPlayerParam.playerLevel = player.Lv;
                photonPlayerParam.FUID        = player.FUID;
                photonPlayerParam.UID         = MonoSingleton <GameManager> .Instance.DeviceId;
                photonPlayerParam.award       = player.SelectedAward;
                int num2 = 0;
                int num3 = 0;
                int num4 = 0;
                List <JSON_MyPhotonPlayerParam.UnitDataElem> unitDataElemList = new List <JSON_MyPhotonPlayerParam.UnitDataElem>();

                for (int index = 0; index < VersusDraftList.VersusDraftPartyUnits.Count; ++index)
                {
                    UnitData versusDraftPartyUnit = VersusDraftList.VersusDraftPartyUnits[index];
                    if (versusDraftPartyUnit != null)
                    {
                        unitDataElemList.Add(new JSON_MyPhotonPlayerParam.UnitDataElem()
                        {
                            slotID = num2,
                            place  = VersusDraftList.VersusDraftPartyPlaces.Count <= index ? index : VersusDraftList.VersusDraftPartyPlaces[index],
                            unit   = versusDraftPartyUnit
                        });
                        num3 = num3 + (int)versusDraftPartyUnit.Status.param.atk + (int)versusDraftPartyUnit.Status.param.mag;
                        num4 = num4 + (int)((double)(int)versusDraftPartyUnit.Status.param.hp * (double)MonoSingleton <GameManager> .Instance.MasterParam.mStatusCoefficient.HP) + (int)((double)(int)versusDraftPartyUnit.Status.param.atk * (double)MonoSingleton <GameManager> .Instance.MasterParam.mStatusCoefficient.Attack) + (int)((double)(int)versusDraftPartyUnit.Status.param.def * (double)MonoSingleton <GameManager> .Instance.MasterParam.mStatusCoefficient.Defense) + (int)((double)(int)versusDraftPartyUnit.Status.param.mag * (double)MonoSingleton <GameManager> .Instance.MasterParam.mStatusCoefficient.MagAttack) + (int)((double)(int)versusDraftPartyUnit.Status.param.mnd * (double)MonoSingleton <GameManager> .Instance.MasterParam.mStatusCoefficient.MagDefense) + (int)((double)(int)versusDraftPartyUnit.Status.param.dex * (double)MonoSingleton <GameManager> .Instance.MasterParam.mStatusCoefficient.Dex) + (int)((double)(int)versusDraftPartyUnit.Status.param.spd * (double)MonoSingleton <GameManager> .Instance.MasterParam.mStatusCoefficient.Speed) + (int)((double)(int)versusDraftPartyUnit.Status.param.cri * (double)MonoSingleton <GameManager> .Instance.MasterParam.mStatusCoefficient.Critical) + (int)((double)(int)versusDraftPartyUnit.Status.param.luk * (double)MonoSingleton <GameManager> .Instance.MasterParam.mStatusCoefficient.Luck) + (int)((double)versusDraftPartyUnit.GetCombination() * (double)MonoSingleton <GameManager> .Instance.MasterParam.mStatusCoefficient.Combo) + (int)((double)(int)versusDraftPartyUnit.Status.param.mov * (double)MonoSingleton <GameManager> .Instance.MasterParam.mStatusCoefficient.Move) + (int)((double)(int)versusDraftPartyUnit.Status.param.jmp * (double)MonoSingleton <GameManager> .Instance.MasterParam.mStatusCoefficient.Jump);
                        ++num2;
                    }
                }
                photonPlayerParam.units       = unitDataElemList.ToArray();
                photonPlayerParam.totalAtk    = num3;
                photonPlayerParam.totalStatus = Mathf.FloorToInt((float)(num4 / unitDataElemList.Count));
                photonPlayerParam.rankpoint   = player.VERSUS_POINT;
                photonPlayerParam.draft_id    = VersusDraftList.DraftID;
                instance1.SetMyPlayerParam(photonPlayerParam.Serialize());
                byte[] msg = GameUtility.Object2Binary <VersusDraftReady.VersusReadyMessageData>(new VersusDraftReady.VersusReadyMessageData()
                {
                    h    = 1,
                    pidx = myPlayerIndex,
                    pid  = num1
                });
                instance1.SendRoomMessageBinary(true, msg, MyPhoton.SEND_TYPE.Normal, false);
                FlowNode_GameObject.ActivateOutputLinks((Component)self, 2);
            }
        public static JSON_MyPhotonPlayerParam Parse(string json)
        {
            if (string.IsNullOrEmpty(json))
            {
                return(new JSON_MyPhotonPlayerParam());
            }
            JSON_MyPhotonPlayerParam jsonObject = JSONParser.parseJSONObject <JSON_MyPhotonPlayerParam>(json);

            jsonObject.SetupUnits();
            return(jsonObject);
        }
Example #18
0
        private void OnOpenItemDetail(GameObject go)
        {
            JSON_MyPhotonPlayerParam dataOfClass = DataSource.FindDataOfClass <JSON_MyPhotonPlayerParam>(go, (JSON_MyPhotonPlayerParam)null);

            if (dataOfClass == null || dataOfClass.playerID <= 0)
            {
                return;
            }
            GlobalVars.SelectedMultiPlayerParam = dataOfClass;
            FlowNode_GameObject.ActivateOutputLinks((Component)this, 101);
        }
Example #19
0
            public override void Begin(VersusDraftReady self)
            {
                MyPhoton instance = PunMonoSingleton <MyPhoton> .Instance;
                List <JSON_MyPhotonPlayerParam> myPlayersStarted = instance.GetMyPlayersStarted();
                List <MyPhoton.MyPlayer>        roomPlayerList   = instance.GetRoomPlayerList();

                for (int index1 = 0; index1 < roomPlayerList.Count; ++index1)
                {
                    JSON_MyPhotonPlayerParam param = JSON_MyPhotonPlayerParam.Parse(roomPlayerList[index1].json);
                    int index2 = myPlayersStarted.FindIndex((Predicate <JSON_MyPhotonPlayerParam>)(sp => sp.playerID == param.playerID));
                    if (index2 > -1)
                    {
                        myPlayersStarted[index2] = param;
                    }
                }
                if (roomPlayerList.Count < 2)
                {
                    MyPhoton.MyPlayer        player            = instance.GetMyPlayer();
                    JSON_MyPhotonPlayerParam photonPlayerParam = myPlayersStarted.Find((Predicate <JSON_MyPhotonPlayerParam>)(sp => sp.playerID != player.playerID));
                    int num1 = 0;
                    int num2 = 0;
                    int num3 = 0;
                    List <JSON_MyPhotonPlayerParam.UnitDataElem> unitDataElemList = new List <JSON_MyPhotonPlayerParam.UnitDataElem>();
                    for (int index = 0; index < VersusDraftList.VersusDraftUnitDataListEnemy.Count && index < 3; ++index)
                    {
                        UnitData unitData = VersusDraftList.VersusDraftUnitDataListEnemy[index];
                        if (unitData != null)
                        {
                            unitDataElemList.Add(new JSON_MyPhotonPlayerParam.UnitDataElem()
                            {
                                slotID = num1,
                                place  = index,
                                unit   = unitData
                            });
                            num2 = num2 + (int)unitData.Status.param.atk + (int)unitData.Status.param.mag;
                            num3 = num3 + (int)((double)(int)unitData.Status.param.hp * (double)MonoSingleton <GameManager> .Instance.MasterParam.mStatusCoefficient.HP) + (int)((double)(int)unitData.Status.param.atk * (double)MonoSingleton <GameManager> .Instance.MasterParam.mStatusCoefficient.Attack) + (int)((double)(int)unitData.Status.param.def * (double)MonoSingleton <GameManager> .Instance.MasterParam.mStatusCoefficient.Defense) + (int)((double)(int)unitData.Status.param.mag * (double)MonoSingleton <GameManager> .Instance.MasterParam.mStatusCoefficient.MagAttack) + (int)((double)(int)unitData.Status.param.mnd * (double)MonoSingleton <GameManager> .Instance.MasterParam.mStatusCoefficient.MagDefense) + (int)((double)(int)unitData.Status.param.dex * (double)MonoSingleton <GameManager> .Instance.MasterParam.mStatusCoefficient.Dex) + (int)((double)(int)unitData.Status.param.spd * (double)MonoSingleton <GameManager> .Instance.MasterParam.mStatusCoefficient.Speed) + (int)((double)(int)unitData.Status.param.cri * (double)MonoSingleton <GameManager> .Instance.MasterParam.mStatusCoefficient.Critical) + (int)((double)(int)unitData.Status.param.luk * (double)MonoSingleton <GameManager> .Instance.MasterParam.mStatusCoefficient.Luck) + (int)((double)unitData.GetCombination() * (double)MonoSingleton <GameManager> .Instance.MasterParam.mStatusCoefficient.Combo) + (int)((double)(int)unitData.Status.param.mov * (double)MonoSingleton <GameManager> .Instance.MasterParam.mStatusCoefficient.Move) + (int)((double)(int)unitData.Status.param.jmp * (double)MonoSingleton <GameManager> .Instance.MasterParam.mStatusCoefficient.Jump);
                            ++num1;
                        }
                    }
                    photonPlayerParam.units       = unitDataElemList.ToArray();
                    photonPlayerParam.totalAtk    = num2;
                    photonPlayerParam.totalStatus = Mathf.FloorToInt((float)(num3 / unitDataElemList.Count));
                    photonPlayerParam.draft_id    = -1;
                }
                if (instance.IsOldestPlayer())
                {
                    instance.UpdateRoomParam("started", (object)new FlowNode_StartMultiPlay.PlayerList()
                    {
                        players = myPlayersStarted.ToArray()
                    }.Serialize());
                }
                FlowNode_GameObject.ActivateOutputLinks((Component)self, 3);
            }
Example #20
0
        public override void OnActivate(int pinID)
        {
            if (!GameUtility.Config_UseAssetBundles.Value)
            {
                this.ActivateOutputLinks(100);
            }
            else
            {
                switch (pinID)
                {
                case 0:
                    MyPhoton pt = PunMonoSingleton <MyPhoton> .Instance;
                    if (UnityEngine.Object.op_Inequality((UnityEngine.Object)pt, (UnityEngine.Object)null))
                    {
                        List <MyPhoton.MyPlayer> roomPlayerList = pt.GetRoomPlayerList();
                        if (roomPlayerList != null && roomPlayerList.Count > 1)
                        {
                            MyPhoton.MyPlayer myPlayer = roomPlayerList.Find((Predicate <MyPhoton.MyPlayer>)(p => p.playerID != pt.GetMyPlayer().playerID));
                            if (myPlayer != null)
                            {
                                this.AddAssets(JSON_MyPhotonPlayerParam.Parse(myPlayer.json));
                                break;
                            }
                            break;
                        }
                        break;
                    }
                    break;

                case 1:
                    GameManager instance = MonoSingleton <GameManager> .Instance;
                    if (instance.AudienceRoom != null)
                    {
                        JSON_MyPhotonRoomParam myPhotonRoomParam = JSON_MyPhotonRoomParam.Parse(instance.AudienceRoom.json);
                        if (myPhotonRoomParam != null)
                        {
                            for (int index = 0; index < myPhotonRoomParam.players.Length; ++index)
                            {
                                if (myPhotonRoomParam.players[index] != null)
                                {
                                    myPhotonRoomParam.players[index].SetupUnits();
                                    this.AddAssets(myPhotonRoomParam.players[index]);
                                }
                            }
                            break;
                        }
                        break;
                    }
                    break;
                }
                this.StartCoroutine(this.AsyncDownload());
            }
        }
Example #21
0
 public override void OnActivate(int pinID)
 {
     if (pinID == 100)
     {
         GameManager instance          = MonoSingleton <GameManager> .Instance;
         JSON_MyPhotonPlayerParam data = (JSON_MyPhotonPlayerParam)null;
         if (instance.AudienceMode)
         {
             MyPhoton.MyRoom audienceRoom = instance.AudienceRoom;
             if (audienceRoom != null)
             {
                 JSON_MyPhotonRoomParam myPhotonRoomParam = JSON_MyPhotonRoomParam.Parse(audienceRoom.json);
                 if (myPhotonRoomParam != null && myPhotonRoomParam.players != null && myPhotonRoomParam.players.Length >= this.ROOM_MAX_PLAYERCNT)
                 {
                     data = myPhotonRoomParam.players[!this.MyPlayer ? 1 : 0];
                 }
             }
         }
         else
         {
             // ISSUE: object of a compiler-generated type is created
             // ISSUE: variable of a compiler-generated type
             FlowNode_VersusAward.\u003COnActivate\u003Ec__AnonStorey2D6 activateCAnonStorey2D6 = new FlowNode_VersusAward.\u003COnActivate\u003Ec__AnonStorey2D6();
             // ISSUE: reference to a compiler-generated field
             activateCAnonStorey2D6.pt = PunMonoSingleton <MyPhoton> .Instance;
             // ISSUE: reference to a compiler-generated field
             List <MyPhoton.MyPlayer> roomPlayerList = activateCAnonStorey2D6.pt.GetRoomPlayerList();
             if (roomPlayerList != null)
             {
                 if (this.MyPlayer)
                 {
                     data = JSON_MyPhotonPlayerParam.Create(0, 0);
                 }
                 else
                 {
                     // ISSUE: reference to a compiler-generated method
                     MyPhoton.MyPlayer myPlayer = roomPlayerList.Find(new Predicate <MyPhoton.MyPlayer>(activateCAnonStorey2D6.\u003C\u003Em__2CB));
                     if (myPlayer != null)
                     {
                         data = JSON_MyPhotonPlayerParam.Parse(myPlayer.json);
                     }
                 }
             }
         }
         if (data != null)
         {
             DataSource.Bind <JSON_MyPhotonPlayerParam>(this.BindObj, data);
         }
     }
     this.ActivateOutputLinks(200);
 }
 public override void Begin(FlowNode_StartMultiPlay self)
 {
     using (List <MyPhoton.MyPlayer> .Enumerator enumerator = PunMonoSingleton <MyPhoton> .Instance.GetRoomPlayerList().GetEnumerator())
     {
         while (enumerator.MoveNext())
         {
             if (JSON_MyPhotonPlayerParam.Parse(enumerator.Current.json).state != 2)
             {
                 self.FailureStartMulti();
                 break;
             }
         }
     }
 }
        private List <Unit> LoadMultiTower()
        {
            List <MyPhoton.MyPlayer> roomPlayerList = PunMonoSingleton <MyPhoton> .Instance.GetRoomPlayerList();

            List <Unit> unitList = new List <Unit>();

            if (this.m_Players == null)
            {
                this.m_Players = new List <MyPhoton.MyPlayer>((IEnumerable <MyPhoton.MyPlayer>)roomPlayerList);
            }
            for (int index1 = 0; index1 < roomPlayerList.Count; ++index1)
            {
                JSON_MyPhotonPlayerParam photonPlayerParam = JSON_MyPhotonPlayerParam.Parse(roomPlayerList[index1].json);
                if (photonPlayerParam != null)
                {
                    for (int index2 = 0; index2 < photonPlayerParam.units.Length; ++index2)
                    {
                        if (photonPlayerParam.units[index2] != null && photonPlayerParam.units[index2].sub == 0)
                        {
                            int      index3   = photonPlayerParam.units[index2].place >= 0 ? photonPlayerParam.units[index2].place : index2;
                            UnitData unitdata = new UnitData();
                            if (unitdata != null)
                            {
                                unitdata.Deserialize(photonPlayerParam.units[index2].unitJson);
                                DownloadUtility.DownloadUnit(unitdata.UnitParam, (JobData[])null);
                                Unit unit = new Unit();
                                if (unit != null && unit.Setup(unitdata, this.CurrentMap.PartyUnitSettings[index3], (Unit.DropItem)null, (Unit.DropItem)null))
                                {
                                    unit.OwnerPlayerIndex = photonPlayerParam.playerIndex;
                                    unitList.Add(unit);
                                }
                            }
                        }
                    }
                }
            }
            int count = this.CurrentMap.NPCUnitSettings.Count;
            List <NPCSetting> npcUnitSettings = this.CurrentMap.NPCUnitSettings;

            for (int index = 0; index < count; ++index)
            {
                DownloadUtility.DownloadUnit(npcUnitSettings[index]);
                Unit unit = new Unit();
                if (unit.Setup((UnitData)null, (UnitSetting)npcUnitSettings[index], (Unit.DropItem)null, (Unit.DropItem)null))
                {
                    unitList.Add(unit);
                }
            }
            return(unitList);
        }
 private void SendPlacementInfo()
 {
     // ISSUE: object of a compiler-generated type is created
     // ISSUE: variable of a compiler-generated type
     MultiPlayVersusReady.\u003CSendPlacementInfo\u003Ec__AnonStorey34F infoCAnonStorey34F = new MultiPlayVersusReady.\u003CSendPlacementInfo\u003Ec__AnonStorey34F();
     // ISSUE: reference to a compiler-generated field
     infoCAnonStorey34F.pt = PunMonoSingleton <MyPhoton> .Instance;
     // ISSUE: reference to a compiler-generated field
     MyPhoton.MyPlayer myPlayer = infoCAnonStorey34F.pt.GetMyPlayer();
     if (myPlayer == null)
     {
         return;
     }
     // ISSUE: reference to a compiler-generated field
     infoCAnonStorey34F.param = JSON_MyPhotonPlayerParam.Parse(myPlayer.json);
     // ISSUE: reference to a compiler-generated field
     if (infoCAnonStorey34F.param.units != null)
     {
         // ISSUE: object of a compiler-generated type is created
         // ISSUE: variable of a compiler-generated type
         MultiPlayVersusReady.\u003CSendPlacementInfo\u003Ec__AnonStorey350 infoCAnonStorey350 = new MultiPlayVersusReady.\u003CSendPlacementInfo\u003Ec__AnonStorey350();
         // ISSUE: reference to a compiler-generated field
         infoCAnonStorey350.\u003C\u003Ef__ref\u0024847 = infoCAnonStorey34F;
         // ISSUE: reference to a compiler-generated field
         // ISSUE: reference to a compiler-generated field
         // ISSUE: reference to a compiler-generated field
         // ISSUE: reference to a compiler-generated field
         for (infoCAnonStorey350.i = 0; infoCAnonStorey350.i < infoCAnonStorey34F.param.units.Length; ++infoCAnonStorey350.i)
         {
             // ISSUE: reference to a compiler-generated method
             TacticsUnitController tacticsUnitController = this.m_Units.Find(new Predicate <TacticsUnitController>(infoCAnonStorey350.\u003C\u003Em__3B0));
             if (UnityEngine.Object.op_Inequality((UnityEngine.Object)tacticsUnitController, (UnityEngine.Object)null))
             {
                 // ISSUE: reference to a compiler-generated field
                 // ISSUE: reference to a compiler-generated field
                 infoCAnonStorey34F.param.units[infoCAnonStorey350.i].place = this.GetPlacementID(tacticsUnitController.Unit.x, tacticsUnitController.Unit.y);
                 // ISSUE: reference to a compiler-generated field
                 // ISSUE: reference to a compiler-generated field
                 // ISSUE: reference to a compiler-generated field
                 PlayerPrefsUtility.SetInt(PlayerPrefsUtility.MULTITW_ID_KEY + (object)infoCAnonStorey350.i, infoCAnonStorey34F.param.units[infoCAnonStorey350.i].place, false);
             }
         }
     }
     PlayerPrefsUtility.Save();
     // ISSUE: reference to a compiler-generated field
     // ISSUE: reference to a compiler-generated field
     infoCAnonStorey34F.pt.SetMyPlayerParam(infoCAnonStorey34F.param.Serialize());
 }
 public override void Begin(FlowNode_MultiPlayJoinRoom self)
 {
   MyPhoton instance = PunMonoSingleton<MyPhoton>.Instance;
   self.mJoinPlayerParam = JSON_MyPhotonPlayerParam.Create(0, 0);
   if (self.mJoinPlayerParam == null)
   {
     self.FailureLobby();
   }
   else
   {
     if (instance.JoinRandomRoom(self.VERSUS_PLAYER_MAX, self.mJoinPlayerParam.Serialize(), GlobalVars.MultiPlayVersusKey, GlobalVars.SelectedMultiPlayRoomName, -1, -1))
       return;
     DebugUtility.Log("error:" + (object) instance.LastError);
     self.FailureLobby();
   }
 }
Example #26
0
        public int GetCanCharengeFloor()
        {
            List <MyPhoton.MyPlayer> roomPlayerList = PunMonoSingleton <MyPhoton> .Instance.GetRoomPlayerList();

            int num = int.MaxValue;

            for (int index = 0; index < roomPlayerList.Count; ++index)
            {
                JSON_MyPhotonPlayerParam photonPlayerParam = JSON_MyPhotonPlayerParam.Parse(roomPlayerList[index].json);
                if (num > photonPlayerParam.mtChallengeFloor)
                {
                    num = photonPlayerParam.mtChallengeFloor;
                }
            }
            return(num);
        }
Example #27
0
        public static JSON_MyPhotonPlayerParam Create(int playerID = 0, int playerIndex = 0)
        {
            JSON_MyPhotonPlayerParam photonPlayerParam = new JSON_MyPhotonPlayerParam();

            if (photonPlayerParam == null)
            {
                return((JSON_MyPhotonPlayerParam)null);
            }
            if (Object.op_Equality((Object)PunMonoSingleton <MyPhoton> .Instance, (Object)null))
            {
                return((JSON_MyPhotonPlayerParam)null);
            }
            PlayerData player = MonoSingleton <GameManager> .Instance.Player;

            photonPlayerParam.playerID    = playerID;
            photonPlayerParam.playerIndex = playerIndex;
            photonPlayerParam.playerName  = player.Name;
            photonPlayerParam.playerLevel = player.Lv;
            photonPlayerParam.FUID        = player.FUID;
            photonPlayerParam.UID         = MonoSingleton <GameManager> .Instance.DeviceId;
            photonPlayerParam.award       = player.SelectedAward;
            PartyData partyData = GlobalVars.SelectedMultiPlayRoomType != JSON_MyPhotonRoomParam.EType.VERSUS ? player.Partys[2] : player.Partys[7];
            int       num       = 0;

            photonPlayerParam.leaderID = partyData.LeaderIndex;
            List <JSON_MyPhotonPlayerParam.UnitDataElem> unitDataElemList = new List <JSON_MyPhotonPlayerParam.UnitDataElem>();

            for (int index = 0; index < partyData.MAX_UNIT; ++index)
            {
                long     unitUniqueId       = partyData.GetUnitUniqueID(index);
                UnitData unitDataByUniqueId = player.FindUnitDataByUniqueID(unitUniqueId);
                if (unitDataByUniqueId != null)
                {
                    unitDataElemList.Add(new JSON_MyPhotonPlayerParam.UnitDataElem()
                    {
                        slotID = index,
                        place  = player.GetVersusPlacement(PlayerData.VERSUS_ID_KEY + (object)index),
                        unit   = unitDataByUniqueId
                    });
                    num = num + (int)unitDataByUniqueId.Status.param.atk + (int)unitDataByUniqueId.Status.param.mag;
                }
            }
            photonPlayerParam.units     = unitDataElemList.ToArray();
            photonPlayerParam.totalAtk  = num;
            photonPlayerParam.rankpoint = player.VERSUS_POINT;
            return(photonPlayerParam);
        }
        public JSON_MyPhotonPlayerParam GetOwner()
        {
            if (this.players == null)
            {
                return((JSON_MyPhotonPlayerParam)null);
            }
            JSON_MyPhotonPlayerParam photonPlayerParam = (JSON_MyPhotonPlayerParam)null;

            foreach (JSON_MyPhotonPlayerParam player in this.players)
            {
                if (player.playerIndex > 0 && (photonPlayerParam == null || player.playerIndex < photonPlayerParam.playerIndex))
                {
                    photonPlayerParam = player;
                }
            }
            return(photonPlayerParam);
        }
 public override void OnActivate(int pinID)
 {
     if (pinID == 100)
     {
         GameManager instance          = MonoSingleton <GameManager> .Instance;
         JSON_MyPhotonPlayerParam data = (JSON_MyPhotonPlayerParam)null;
         if (instance.AudienceMode)
         {
             MyPhoton.MyRoom audienceRoom = instance.AudienceRoom;
             if (audienceRoom != null)
             {
                 JSON_MyPhotonRoomParam myPhotonRoomParam = JSON_MyPhotonRoomParam.Parse(audienceRoom.json);
                 if (myPhotonRoomParam != null && myPhotonRoomParam.players != null && myPhotonRoomParam.players.Length >= this.ROOM_MAX_PLAYERCNT)
                 {
                     data = myPhotonRoomParam.players[!this.MyPlayer ? 1 : 0];
                 }
             }
         }
         else
         {
             MyPhoton pt = PunMonoSingleton <MyPhoton> .Instance;
             List <MyPhoton.MyPlayer> roomPlayerList = pt.GetRoomPlayerList();
             if (roomPlayerList != null)
             {
                 if (this.MyPlayer)
                 {
                     data = JSON_MyPhotonPlayerParam.Create(0, 0);
                 }
                 else
                 {
                     MyPhoton.MyPlayer myPlayer = roomPlayerList.Find((Predicate <MyPhoton.MyPlayer>)(p => p.playerID != pt.GetMyPlayer().playerID));
                     if (myPlayer != null)
                     {
                         data = JSON_MyPhotonPlayerParam.Parse(myPlayer.json);
                     }
                 }
             }
         }
         if (data != null)
         {
             DataSource.Bind <JSON_MyPhotonPlayerParam>(this.BindObj, data);
         }
     }
     this.ActivateOutputLinks(200);
 }
Example #30
0
 public void Refresh(List <MyPhoton.MyPlayer> _new_players)
 {
     for (int i = 0; i < _new_players.Count; ++i)
     {
         if (_new_players[i].photonPlayerID > -1)
         {
             this.tmp_entry_member = this.room_members.Find((Predicate <ChatUtility.RoomMember>)(a => a.PlayerId == _new_players[i].playerID));
             if (this.tmp_entry_member == null)
             {
                 JSON_MyPhotonPlayerParam photonPlayerParam = JSON_MyPhotonPlayerParam.Parse(_new_players[i].json);
                 ChatUtility.RoomMember   roomMember        = new ChatUtility.RoomMember();
                 roomMember.SetParam(_new_players[i].photonPlayerID, _new_players[i].playerID, photonPlayerParam.UID, photonPlayerParam.playerName);
                 if (!this.entry_members.Contains(roomMember))
                 {
                     this.entry_members.Add(roomMember);
                 }
             }
         }
     }
     for (int i = 0; i < this.room_members.Count; ++i)
     {
         if (this.room_members[i].PhotonPlayerId > -1)
         {
             this.tmp_leave_member = _new_players.Find((Predicate <MyPhoton.MyPlayer>)(a => a.playerID == this.room_members[i].PlayerId));
             if (this.tmp_leave_member == null && !this.leave_members.Contains(this.room_members[i]))
             {
                 this.leave_members.Add(this.room_members[i]);
             }
         }
     }
     for (int index = 0; index < this.entry_members.Count; ++index)
     {
         if (!this.room_members.Contains(this.entry_members[index]))
         {
             this.room_members.Add(this.entry_members[index]);
         }
     }
     for (int index = 0; index < this.leave_members.Count; ++index)
     {
         if (this.room_members.Contains(this.leave_members[index]))
         {
             this.room_members.Remove(this.leave_members[index]);
         }
     }
 }