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; myPhotonRoomParam.draft_type = !GlobalVars.IsVersusDraftMode ? 0 : 1; int plv = -1; int floor = -1; int audienceMax = (int)MonoSingleton <GameManager> .Instance.MasterParam.FixParam.AudienceMax; string uid = (string)null; string luid = (string)null; if (GlobalVars.SelectedMultiPlayVersusType == VERSUS_TYPE.Tower) { plv = myPhotonRoomParam.creatorLV; floor = MonoSingleton <GameManager> .Instance.Player.VersusTowerFloor; uid = MonoSingleton <GameManager> .Instance.DeviceId; luid = MonoSingleton <GameManager> .Instance.VersusLastUid; } if (instance2.CreateRoom((int)self.VERSUS_PLAYER_MAX, GlobalVars.SelectedMultiPlayRoomName, myPhotonRoomParam.Serialize(), self.mJoinPlayerParam.Serialize(), GlobalVars.MultiPlayVersusKey, floor, plv, luid, uid, audienceMax, false)) { return; } self.FailureLobby(); } }
public override void Begin(FlowNode_MultiPlayJoinRoom self) { MyPhoton instance = PunMonoSingleton <MyPhoton> .Instance; QuestParam quest = MonoSingleton <GameManager> .Instance.FindQuest(GlobalVars.SelectedQuestID); if (quest == null || !quest.IsMulti || ((int)quest.playerNum < 1 || (int)quest.unitNum < 1) || ((int)quest.unitNum > 11 || quest.map == null || quest.map.Count <= 0)) { DebugUtility.Log("illegal iname:" + GlobalVars.SelectedQuestID); self.IllegalQuest(); } else { DebugUtility.Log("CreateRoom quest:" + quest.iname + " desc:" + quest.name); 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.unitlv = !GlobalVars.SelectedMultiPlayLimit ? 0 : GlobalVars.MultiPlayJoinUnitLv; DebugUtility.Log("create isLINE:" + (object)myPhotonRoomParam.isLINE + " iname:" + myPhotonRoomParam.iname + " roomid:" + (object)myPhotonRoomParam.roomid + " appID:" + GlobalVars.SelectedMultiPlayPhotonAppID + " token:" + GlobalVars.SelectedMultiPlayRoomName + " comment:" + myPhotonRoomParam.comment + " pass:"******" type:" + (object)myPhotonRoomParam.type + " json:" + myPhotonRoomParam.Serialize()); if (instance.CreateRoom((int)quest.playerNum, GlobalVars.SelectedMultiPlayRoomName, myPhotonRoomParam.Serialize(), self.mJoinPlayerParam.Serialize(), (string)null, -1, -1, (string)null, (string)null, -1, false)) { return; } self.FailureLobby(); } } }