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 (UnityEngine.Object.op_Equality((UnityEngine.Object)PunMonoSingleton <MyPhoton> .Instance, (UnityEngine.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;
            PlayerPartyTypes partyType = PlayerPartyTypes.Multiplay;

            switch (GlobalVars.SelectedMultiPlayRoomType)
            {
            case JSON_MyPhotonRoomParam.EType.RAID:
                partyType = PlayerPartyTypes.Multiplay;
                break;

            case JSON_MyPhotonRoomParam.EType.VERSUS:
                partyType = PlayerPartyTypes.Versus;
                break;

            case JSON_MyPhotonRoomParam.EType.TOWER:
                partyType = PlayerPartyTypes.MultiTower;
                break;
            }
            QuestParam           quest = (QuestParam)null;
            PartyData            party;
            int                  length;
            List <PartyEditData> teams;

            if (partyType == PlayerPartyTypes.Versus || partyType == PlayerPartyTypes.MultiTower)
            {
                party  = player.Partys[(int)partyType];
                length = party.MAX_UNIT;
                int lastSelectionIndex;
                teams = PartyUtility.LoadTeamPresets(partyType, out lastSelectionIndex);
            }
            else
            {
                party  = player.Partys[(int)partyType];
                length = party.MAX_UNIT;
                if (!string.IsNullOrEmpty(GlobalVars.SelectedQuestID))
                {
                    quest = MonoSingleton <GameManager> .Instance.FindQuest(GlobalVars.SelectedQuestID);

                    if (quest != null)
                    {
                        length = (int)quest.unitNum;
                    }
                }
                int lastSelectionIndex;
                teams = PartyUtility.LoadTeamPresets(partyType, out lastSelectionIndex);
            }
            UnitData[] unitDataArray = new UnitData[length];
            if (teams != null && teams.Count > 0)
            {
                PartyUtility.ResetToDefaultTeamIfNeeded(partyType, quest, teams);
                UnitData[] units = teams[0].Units;
                for (int index = 0; index < unitDataArray.Length && index < units.Length; ++index)
                {
                    unitDataArray[index] = units[index];
                }
            }
            else
            {
                for (int index = 0; index < unitDataArray.Length; ++index)
                {
                    long unitUniqueId = party.GetUnitUniqueID(index);
                    unitDataArray[index] = MonoSingleton <GameManager> .Instance.Player.FindUnitDataByUniqueID(unitUniqueId);
                }
            }
            int  num1 = 0;
            int  num2 = 0;
            bool flag = GlobalVars.SelectedMultiPlayRoomType == JSON_MyPhotonRoomParam.EType.TOWER;

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

            for (int index = 0; index < unitDataArray.Length; ++index)
            {
                UnitData unitData = unitDataArray[index];
                if (unitData != null)
                {
                    unitDataElemList.Add(new JSON_MyPhotonPlayerParam.UnitDataElem()
                    {
                        slotID = num1++,
                        place  = !flag ? player.GetVersusPlacement(PlayerPrefsUtility.VERSUS_ID_KEY + (object)index) : -1,
                        sub    = index < party.MAX_MAINMEMBER || party.MAX_SUBMEMBER <= 0 ? 0 : 1,
                        unit   = unitData
                    });
                    num2 = num2 + (int)unitData.Status.param.atk + (int)unitData.Status.param.mag;
                }
            }
            photonPlayerParam.units            = unitDataElemList.ToArray();
            photonPlayerParam.totalAtk         = num2;
            photonPlayerParam.rankpoint        = player.VERSUS_POINT;
            photonPlayerParam.mtChallengeFloor = MonoSingleton <GameManager> .Instance.GetMTChallengeFloor();

            photonPlayerParam.mtClearedFloor = MonoSingleton <GameManager> .Instance.GetMTClearedMaxFloor();

            return(photonPlayerParam);
        }
        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 (UnityEngine.Object.op_Equality((UnityEngine.Object)PunMonoSingleton <MyPhoton> .Instance, (UnityEngine.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;
            PlayerPartyTypes partyType = PlayerPartyTypes.Multiplay;

            switch (GlobalVars.SelectedMultiPlayRoomType)
            {
            case JSON_MyPhotonRoomParam.EType.RAID:
                partyType = PlayerPartyTypes.Multiplay;
                break;

            case JSON_MyPhotonRoomParam.EType.VERSUS:
                partyType = PlayerPartyTypes.Versus;
                break;

            case JSON_MyPhotonRoomParam.EType.TOWER:
                partyType = PlayerPartyTypes.MultiTower;
                break;

            case JSON_MyPhotonRoomParam.EType.RANKMATCH:
                partyType = PlayerPartyTypes.RankMatch;
                break;
            }
            QuestParam           quest = (QuestParam)null;
            PartyData            party;
            int                  length;
            List <PartyEditData> teams;

            switch (partyType)
            {
            case PlayerPartyTypes.Versus:
                party  = player.Partys[(int)partyType];
                length = party.MAX_MAINMEMBER;
                int lastSelectionIndex1;
                teams = PartyUtility.LoadTeamPresets(partyType, out lastSelectionIndex1, false);
                if (!string.IsNullOrEmpty(GlobalVars.SelectedQuestID))
                {
                    quest = MonoSingleton <GameManager> .Instance.FindQuest(GlobalVars.SelectedQuestID);

                    break;
                }
                break;

            case PlayerPartyTypes.MultiTower:
                party  = player.Partys[(int)partyType];
                length = party.MAX_UNIT;
                int lastSelectionIndex2;
                teams = PartyUtility.LoadTeamPresets(partyType, out lastSelectionIndex2, false);
                break;

            case PlayerPartyTypes.RankMatch:
                party  = player.Partys[(int)partyType];
                length = party.MAX_MAINMEMBER;
                int lastSelectionIndex3;
                teams = PartyUtility.LoadTeamPresets(partyType, out lastSelectionIndex3, false);
                if (!string.IsNullOrEmpty(GlobalVars.SelectedQuestID))
                {
                    quest = MonoSingleton <GameManager> .Instance.FindQuest(GlobalVars.SelectedQuestID);

                    break;
                }
                break;

            default:
                party  = player.Partys[(int)partyType];
                length = party.MAX_UNIT;
                if (!string.IsNullOrEmpty(GlobalVars.SelectedQuestID))
                {
                    quest = MonoSingleton <GameManager> .Instance.FindQuest(GlobalVars.SelectedQuestID);

                    if (quest != null)
                    {
                        length = (int)quest.unitNum;
                    }
                }
                PartyEditData partyEditData = new PartyEditData(string.Empty, party);
                teams = new List <PartyEditData>();
                teams.Add(partyEditData);
                break;
            }
            UnitData[] unitDataArray = new UnitData[length];
            if (teams != null && teams.Count > 0)
            {
                PartyUtility.ResetToDefaultTeamIfNeeded(partyType, quest, teams);
                UnitData[] units = teams[0].Units;
                for (int index = 0; index < unitDataArray.Length && index < units.Length; ++index)
                {
                    unitDataArray[index] = units[index];
                }
            }
            else
            {
                for (int index = 0; index < unitDataArray.Length; ++index)
                {
                    long unitUniqueId = party.GetUnitUniqueID(index);
                    unitDataArray[index] = MonoSingleton <GameManager> .Instance.Player.FindUnitDataByUniqueID(unitUniqueId);
                }
            }
            int  num1 = 0;
            int  num2 = 0;
            int  num3 = 0;
            bool flag = GlobalVars.SelectedMultiPlayRoomType == JSON_MyPhotonRoomParam.EType.TOWER;

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

            for (int index = 0; index < unitDataArray.Length; ++index)
            {
                UnitData unitData = unitDataArray[index];
                if (unitData != null)
                {
                    unitDataElemList.Add(new JSON_MyPhotonPlayerParam.UnitDataElem()
                    {
                        slotID = num1++,
                        place  = !flag ? (partyType != PlayerPartyTypes.RankMatch ? player.GetVersusPlacement(PlayerPrefsUtility.VERSUS_ID_KEY + (object)index) : player.GetVersusPlacement(PlayerPrefsUtility.RANKMATCH_ID_KEY + (object)index)) : -1,
                        sub    = index < party.MAX_MAINMEMBER || party.MAX_SUBMEMBER <= 0 ? 0 : 1,
                        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);
                }
            }
            photonPlayerParam.units            = unitDataElemList.ToArray();
            photonPlayerParam.totalAtk         = num2;
            photonPlayerParam.totalStatus      = Mathf.FloorToInt((float)(num3 / unitDataElemList.Count));
            photonPlayerParam.rankpoint        = player.VERSUS_POINT;
            photonPlayerParam.mtChallengeFloor = MonoSingleton <GameManager> .Instance.GetMTChallengeFloor();

            photonPlayerParam.mtClearedFloor = MonoSingleton <GameManager> .Instance.GetMTClearedMaxFloor();

            photonPlayerParam.rankmatch_score = MonoSingleton <GameManager> .Instance.Player.RankMatchScore;
            UnitData unitDataByUniqueId = MonoSingleton <GameManager> .Instance.Player.FindUnitDataByUniqueID((long)GlobalVars.SelectedSupportUnitUniqueID);

            photonPlayerParam.support_unit = unitDataByUniqueId.Serialize();
            photonPlayerParam.draft_id     = VersusDraftList.DraftID;
            return(photonPlayerParam);
        }