public void ShowLoudSpeaker(COMDT_CHAT_MSG_HORN data) { this.m_loudSpeakerCount = 0; this.m_timerLoudSpeaker = Singleton <CTimerManager> .instance.AddTimer(0x3e8, 0, new CTimer.OnTimeUpHandler(this.OnTimerLoudSpeaker)); if (Singleton <BattleLogic> .instance.isRuning) { this.loudSpeakerList.Clear(); } else { CUIFormScript form = Singleton <CUIManager> .instance.GetForm(LobbyForm.FORM_PATH); if (form != null) { CUIAutoScroller component = form.GetWidget(5).GetComponent <CUIAutoScroller>(); if (component != null) { GameObject widget = form.GetWidget(6); if (widget != null) { string rawText = UT.Bytes2String(data.szContent); string str = CChatUT.Build_4_LoudSpeaker_EntryString(data.stFrom.ullUid, (uint)data.stFrom.iLogicWorldID, rawText); component.SetText(CUIUtility.RemoveEmoji(str)); component.gameObject.CustomSetActive(true); widget.CustomSetActive(true); component.StopAutoScroll(); component.StartAutoScroll(true); } } } } }
public FriendInGame(ulong uid, uint worldID, COM_ACNT_GAME_STATE state, uint startTime, string nickName = "") { this.ullUid = uid; this.dwLogicWorldID = worldID; this.State = state; this.nickName = CUIUtility.RemoveEmoji(nickName); this.startTime = startTime; }
private void On_Invite_RefuseReason_Send(CUIEvent uievent) { CSPkg cSPkg = NetworkModule.CreateDefaultCSPKG(2021u); cSPkg.stPkgData.get_stInviteJoinGameRsp().bIndex = (byte)uievent.m_eventParams.tag; cSPkg.stPkgData.get_stInviteJoinGameRsp().bResult = 14; cSPkg.stPkgData.get_stInviteJoinGameRsp().szDenyReason = UT.String2Bytes(CUIUtility.RemoveEmoji(this.m_inputFiled.text)); Singleton <NetworkModule> .GetInstance().SendLobbyMsg(ref cSPkg, false); Singleton <WatchController> .GetInstance().Stop(); Singleton <CMailSys> .get_instance().AddFriendInviteMail(uievent, CMailSys.enProcessInviteType.Refuse); }
private void On_Friend_Verify_Send(CUIEvent uievent) { if (uievent == null) { Singleton <CUIManager> .instance.CloseForm(CFriendContoller.VerifyFriendFormPath); } else { CUIFormScript srcFormScript = uievent.m_srcFormScript; if (srcFormScript == null) { Singleton <CUIManager> .instance.CloseForm(CFriendContoller.VerifyFriendFormPath); } else { InputField component = srcFormScript.GetWidget(0).GetComponent <InputField>(); if (component == null) { Singleton <CUIManager> .instance.CloseForm(CFriendContoller.VerifyFriendFormPath); } else { string veriyText = CUIUtility.RemoveEmoji(component.text).Trim(); if (this.ullUid == 0) { Singleton <CUIManager> .instance.CloseForm(CFriendContoller.VerifyFriendFormPath); } else { if (this.m_bAddSearchFirend) { FriendSysNetCore.Send_Request_BeFriend(this.ullUid, this.dwLogicWorldId, veriyText); } else { FriendSysNetCore.Send_Request_BeFriend(this.ullUid, this.dwLogicWorldId, veriyText); Singleton <CFriendContoller> .instance.model.Remove(CFriendModel.FriendType.Recommend, this.ullUid, this.dwLogicWorldId); } this.ullUid = 0L; this.dwLogicWorldId = 0; this.m_bAddSearchFirend = false; this._inputName = null; Singleton <CUIManager> .instance.CloseForm(CFriendContoller.VerifyFriendFormPath); } } } } }
public Player AddPlayer(uint playerId, COM_PLAYERCAMP camp, int campPos = 0, uint level = 1u, bool isComputer = false, string name = null, int headIconId = 0, int logicWrold = 0, ulong uid = 0uL, uint vipLv = 0u, string openId = null, uint gradeOfRank = 0u, uint classOfRank = 0u, uint wangZheCnt = 0u, int honorId = 0, int honorLevel = 0, GameIntimacyData IntimacyData = null, ulong privacyBits = 0uL) { Player result = null; if (playerId == 0u) { DebugHelper.Assert(false, "Try to create player by Id 0"); } else if (this._players.ContainsKey(playerId)) { DebugHelper.Assert(false, "Try to create player which is already existed, ID is {0}", new object[] { playerId }); result = this.GetPlayer(playerId); } else { Player player = new Player(); player.PlayerId = playerId; player.LogicWrold = logicWrold; player.PlayerUId = uid; player.PlayerCamp = camp; player.CampPos = campPos; player.Level = (int)level; player.HeadIconId = headIconId; player.Computer = isComputer; player.Name = CUIUtility.RemoveEmoji(name); player.isGM = false; player.VipLv = vipLv; player.OpenId = openId; player.GradeOfRank = gradeOfRank; player.ClassOfRank = classOfRank; player.WangZheCnt = wangZheCnt; player.HonorId = honorId; player.HonorLevel = honorLevel; player.IntimacyData = IntimacyData; player.privacyBits = privacyBits; this._players.Add(playerId, player); result = player; } DebugHelper.Assert((long)this._players.get_Count() <= 10L, "超出Player最大数量"); return(result); }
public Player AddPlayer(uint playerId, COM_PLAYERCAMP camp, int campPos = 0, uint level = 1, bool isComputer = false, string name = null, int headIconId = 0, int logicWrold = 0, ulong uid = 0, uint vipLv = 0, string openId = null, uint gradeOfRank = 0, uint classOfRank = 0, int honorId = 0, int honorLevel = 0) { Player player = null; if (playerId == 0) { DebugHelper.Assert(false, "Try to create player by Id 0"); } else if (this._players.ContainsKey(playerId)) { object[] inParameters = new object[] { playerId }; DebugHelper.Assert(false, "Try to create player which is already existed, ID is {0}", inParameters); player = this.GetPlayer(playerId); } else { Player player2 = new Player { PlayerId = playerId, LogicWrold = logicWrold, PlayerUId = uid, PlayerCamp = camp, CampPos = campPos, Level = (int)level, HeadIconId = headIconId, Computer = isComputer, Name = CUIUtility.RemoveEmoji(name), isGM = false, VipLv = vipLv, OpenId = openId, GradeOfRank = gradeOfRank, ClassOfRank = classOfRank, HonorId = honorId, HonorLevel = honorLevel }; this._players.Add(playerId, player2); player = player2; } DebugHelper.Assert(this._players.Count <= 10L, "超出Player最大数量"); return(player); }
public void ShowNormal(SCPKG_INVITE_JOIN_GAME_REQ info) { string text = CUIUtility.RemoveEmoji(StringHelper.UTF8BytesToString(ref info.stInviterInfo.szName)); stUIEventParams stUIEventParams = default(stUIEventParams); stUIEventParams.tag = (int)info.bIndex; int num = 15; int.TryParse(Singleton <CTextManager> .get_instance().GetText("MessageBox_Close_Time"), ref num); this.form = Singleton <CUIManager> .GetInstance().OpenForm(string.Format("{0}{1}", "UGUI/Form/Common/", "Form_BeInvited.prefab"), false, false); GameObject gameObject = this.form.transform.Find("Panel/Panel/normal").gameObject; if (gameObject != null) { gameObject.CustomSetActive(true); } GameObject gameObject2 = this.form.transform.Find("Panel/Panel/refuse").gameObject; if (gameObject2 != null) { gameObject2.CustomSetActive(false); } this.listNode = this.form.transform.Find("Panel/Panel/refuse/reasonPanel/DropList").gameObject; this.listScript = this.listNode.transform.Find("List").GetComponent <CUIListScript>(); this.m_inputFiled = this.form.transform.Find("Panel/Panel/refuse/reasonPanel/InputField").GetComponent <InputField>(); this.m_sendBtn = this.form.transform.Find("Panel/Panel/refuse/btnGroup/Button_Send").gameObject; this.form.transform.Find("Panel/Panel/refuse/MatchInfo").GetComponent <Text>().text = Singleton <CTextManager> .get_instance().GetText("Invite_Refuse_Title"); if (this.form != null) { string text2 = null; string text3 = null; if (info.bInviteType == 1) { ResDT_LevelCommonInfo pvpMapCommonInfo = CLevelCfgLogicManager.GetPvpMapCommonInfo(info.stInviteDetail.get_stRoomDetail().bMapType, info.stInviteDetail.get_stRoomDetail().dwMapId); stUIEventParams.heroId = (uint)info.stInviteDetail.get_stRoomDetail().bMapType; stUIEventParams.weakGuideId = info.stInviteDetail.get_stRoomDetail().dwMapId; if (pvpMapCommonInfo != null) { text2 = Singleton <CTextManager> .get_instance().GetText("Invite_Map_Desc", new string[] { ((int)(pvpMapCommonInfo.bMaxAcntNum / 2)).ToString(), ((int)(pvpMapCommonInfo.bMaxAcntNum / 2)).ToString(), Utility.UTF8Convert(pvpMapCommonInfo.szName) }); } text3 = Singleton <CTextManager> .GetInstance().GetText("Invite_Match_Type_4"); } else if (info.bInviteType == 2) { ResDT_LevelCommonInfo pvpMapCommonInfo2 = CLevelCfgLogicManager.GetPvpMapCommonInfo(info.stInviteDetail.get_stTeamDetail().bMapType, info.stInviteDetail.get_stTeamDetail().dwMapId); stUIEventParams.heroId = (uint)info.stInviteDetail.get_stTeamDetail().bMapType; stUIEventParams.weakGuideId = info.stInviteDetail.get_stTeamDetail().dwMapId; if (pvpMapCommonInfo2 != null) { text2 = Singleton <CTextManager> .get_instance().GetText("Invite_Map_Desc", new string[] { ((int)(pvpMapCommonInfo2.bMaxAcntNum / 2)).ToString(), ((int)(pvpMapCommonInfo2.bMaxAcntNum / 2)).ToString(), Utility.UTF8Convert(pvpMapCommonInfo2.szName) }); } if (info.stInviteDetail.get_stTeamDetail().bMapType == 3) { text3 = Singleton <CTextManager> .GetInstance().GetText("Invite_Match_Type_1"); } else { text3 = Singleton <CTextManager> .GetInstance().GetText((info.stInviteDetail.get_stTeamDetail().bPkAI != 1) ? "Invite_Match_Type_3" : "Invite_Match_Type_2"); } } string text4 = Singleton <CTextManager> .get_instance().GetText("Be_Invited_Tips", new string[] { text3, text2 }); this.form.m_formWidgets[8].GetComponent <Text>().text = text4; uint dwRelationMask = info.stInviterInfo.dwRelationMask; string text5; if ((dwRelationMask & 1u) > 0u) { text5 = Singleton <CTextManager> .get_instance().GetText("Invite_Src_Type_1"); stUIEventParams.tag2 = 0; } else if ((dwRelationMask & 2u) > 0u) { text5 = Singleton <CTextManager> .get_instance().GetText("Invite_Src_Type_4"); stUIEventParams.tag2 = 1; } else if ((dwRelationMask & 4u) > 0u) { text5 = Singleton <CTextManager> .get_instance().GetText("Invite_Src_Type_5"); stUIEventParams.tag2 = 2; CSDT_LBS_USER_INFO lBSUserInfo = Singleton <CFriendContoller> .get_instance().model.GetLBSUserInfo(info.stInviterInfo.ullUid, info.stInviterInfo.dwLogicWorldID, CFriendModel.LBSGenderType.Both); if (lBSUserInfo != null) { stUIEventParams.tagUInt = lBSUserInfo.dwGameSvrEntity; } } else { text5 = Singleton <CTextManager> .get_instance().GetText("Invite_Src_Type_1"); stUIEventParams.tag2 = 3; } string text6 = string.Format(Singleton <CTextManager> .get_instance().GetText("Be_Invited_FromType"), text5); this.form.m_formWidgets[6].GetComponent <Text>().text = text6; stUIEventParams.tagStr = string.Format("<color=#FFFFFF>{0}</color> {1} {2}", text, text4, text6); stUIEventParams.commonUInt64Param1 = info.stInviterInfo.ullUid; stUIEventParams.taskId = info.stInviterInfo.dwLogicWorldID; stUIEventParams.tag3 = (int)info.bInviteType; if (num != 0) { Transform transform = this.form.transform.Find("closeTimer"); if (transform != null) { this.timerScript = transform.GetComponent <CUITimerScript>(); if (this.timerScript != null) { this.timerScript.enabled = true; this.timerScript.SetTotalTime((float)num); this.timerScript.StartTimer(); this.timerScript.m_eventIDs[1] = enUIEventID.Invite_TimeOut; this.timerScript.m_eventParams[1] = stUIEventParams; } } } this.form.m_formWidgets[0].GetComponent <CUIEventScript>().SetUIEvent(enUIEventType.Click, enUIEventID.Invite_RefuseReason_Send, stUIEventParams); this.form.m_formWidgets[1].GetComponent <CUIEventScript>().SetUIEvent(enUIEventType.Click, enUIEventID.Invite_AcceptInvite, stUIEventParams); this.form.m_formWidgets[5].GetComponent <Text>().text = text; COM_SNSGENDER bGender = info.stInviterInfo.bGender; Image component = this.form.m_formWidgets[4].GetComponent <Image>(); component.gameObject.CustomSetActive(bGender != 0); if (bGender == 1) { CUIUtility.SetImageSprite(component, string.Format("{0}icon/Ico_boy.prefab", "UGUI/Sprite/Dynamic/"), null, true, false, false, false); } else if (bGender == 2) { CUIUtility.SetImageSprite(component, string.Format("{0}icon/Ico_girl.prefab", "UGUI/Sprite/Dynamic/"), null, true, false, false, false); } CUIHttpImageScript component2 = this.form.m_formWidgets[3].GetComponent <CUIHttpImageScript>(); component2.SetImageUrl(Singleton <ApolloHelper> .GetInstance().ToSnsHeadUrl(StringHelper.UTF8BytesToString(ref info.stInviterInfo.szHeadUrl))); MonoSingleton <NobeSys> .GetInstance().SetHeadIconBk(this.form.m_formWidgets[2].GetComponent <Image>(), (int)info.stInviterInfo.dwHeadImgId); MonoSingleton <NobeSys> .GetInstance().SetHeadIconBkEffect(this.form.m_formWidgets[2].GetComponent <Image>(), (int)info.stInviterInfo.dwHeadImgId, this.form, 1f); this.form.m_formWidgets[7].CustomSetActive(info.stInviterInfo.bGradeOfRank > 0); if (info.stInviterInfo.bGradeOfRank > 0) { CLadderView.ShowRankDetail(this.form.m_formWidgets[7], info.stInviterInfo.bGradeOfRank, 0u, 1u, false, true, false, true, true); } } }
private void On_Guild_PrepareGuild_Create(CUIEvent uiEvent) { Singleton <BeaconHelper> .GetInstance().m_curBuyDianInfo.buy_dia_channel = "3"; Singleton <BeaconHelper> .GetInstance().m_curBuyDianInfo.call_back_time = Time.time; Singleton <BeaconHelper> .GetInstance().m_curBuyPropInfo.buy_prop_channel = "3"; Singleton <BeaconHelper> .GetInstance().m_curBuyPropInfo.buy_prop_id_time = Time.time; int currentUTCTime = CRoleInfo.GetCurrentUTCTime(); if (Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().m_extGuildInfo.dwLastCreateGuildTime != 0) { uint num2 = GameDataMgr.guildMiscDatabin.GetDataByKey((uint)3).dwConfValue; if (currentUTCTime < (Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().m_extGuildInfo.dwLastCreateGuildTime + num2)) { Singleton <CUIManager> .GetInstance().OpenTips("Guild_Last_Create_Time_Tip", true, 1.5f, null, new object[0]); return; } } CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo(); uint dwConfValue = GameDataMgr.guildMiscDatabin.GetDataByKey((uint)5).dwConfValue; if (masterRoleInfo.DianQuan < dwConfValue) { CUICommonSystem.OpenDianQuanNotEnoughTip(); } else { uint num4 = GameDataMgr.guildMiscDatabin.GetDataByKey((uint)10).dwConfValue; if ((num4 != 0) && (num4 > Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().PvpLevel)) { string[] args = new string[] { num4.ToString() }; Singleton <CUIManager> .GetInstance().OpenTips(Singleton <CTextManager> .GetInstance().GetText("Guild_Join_Level_Limit", args), false, 1.5f, null, new object[0]); } else { string str = CUIUtility.RemoveEmoji(this.m_form.GetWidget(0).GetComponent <Text>().text).Trim(); if (string.IsNullOrEmpty(str)) { Singleton <CUIManager> .GetInstance().OpenTips("Guild_Input_Guild_Name_Empty", true, 1.5f, null, new object[0]); } else if (!Utility.IsValidText(str)) { Singleton <CUIManager> .GetInstance().OpenTips("Guild_Input_Guild_Name_Invalid", true, 1.5f, null, new object[0]); } else if (string.IsNullOrEmpty(CUIUtility.RemoveEmoji(this.m_form.GetWidget(1).GetComponent <Text>().text).Trim())) { Singleton <CUIManager> .GetInstance().OpenTips("Guild_Input_Guild_Bulletin_Empty", true, 1.5f, null, new object[0]); } else { uint num5 = GameDataMgr.guildMiscDatabin.GetDataByKey((uint)2).dwConfValue; uint num6 = GameDataMgr.guildMiscDatabin.GetDataByKey((uint)1).dwConfValue; TimeSpan span = new TimeSpan(0, 0, 0, (int)num5); string[] textArray2 = new string[] { span.TotalHours.ToString(), num6.ToString() }; string text = Singleton <CTextManager> .GetInstance().GetText("Guild_Create_Tip", textArray2); Singleton <CUIManager> .GetInstance().OpenMessageBoxWithCancel(text, enUIEventID.Guild_PrepareGuild_Create_Confirm, enUIEventID.Guild_PrepareGuild_Create_Cancel, false); } } } }
private void On_EndEdit(string content) { Singleton <InBattleMsgMgr> .instance.HideView(); if (this.m_inputField != null) { this.m_inputField.set_text(string.Empty); } if (this.intimeMSecond_StartTime != 0uL) { uint num = (uint)(Singleton <FrameSynchr> .GetInstance().LogicFrameTick - this.intimeMSecond_StartTime); if ((ulong)num < (ulong)((long)this.intimeMSecond)) { if (this.intimeSendCount + 1 > this.intimeMaxCount) { if (this.m_inputButton != null) { this.m_inputButton.StartCooldown(this.intime_cd, new Action(this.OnBlockCDEnd)); } InBattleInputChat inputChat = Singleton <InBattleMsgMgr> .instance.m_InputChat; if (inputChat != null) { InBattleInputChat.InBatChatEntity ent = inputChat.ConstructEnt(this.m_inCDTxt, InBattleInputChat.InBatChatEntity.EType.System); inputChat.Add(ent); } this.intimeSendCount = 0; return; } } else { this.intimeSendCount = 0; } } InBattleInputChat inputChat2 = Singleton <InBattleMsgMgr> .instance.m_InputChat; if (inputChat2 == null) { return; } if (string.IsNullOrEmpty(content)) { return; } content = CUIUtility.RemoveEmoji(content); if (this.m_inputText != null) { this.m_inputText.CustomSetActive(false); } SLevelContext curLvelContext = Singleton <BattleLogic> .instance.GetCurLvelContext(); if (curLvelContext != null && !Singleton <InBattleMsgMgr> .instance.ShouldBeThroughNet(curLvelContext)) { InBattleInputChat inputChat3 = Singleton <InBattleMsgMgr> .instance.m_InputChat; if (inputChat3 != null) { InBattleInputChat.InBatChatEntity ent2 = inputChat3.ConstructEnt(this.m_inWramBattle, InBattleInputChat.InBatChatEntity.EType.System); inputChat3.Add(ent2); } } else if (!string.IsNullOrEmpty(content)) { InBattleMsgNetCore.SendInBattleMsg_InputChat(content, (byte)inputChat2.m_curChatCamp); } if (this.intimeSendCount == 0) { this.intimeMSecond_StartTime = Singleton <FrameSynchr> .GetInstance().LogicFrameTick; } this.intimeSendCount++; }
private void On_Guild_PrepareGuild_Create(CUIEvent uiEvent) { Singleton <BeaconHelper> .GetInstance().m_curBuyDianInfo.buy_dia_channel = "3"; Singleton <BeaconHelper> .GetInstance().m_curBuyDianInfo.call_back_time = Time.time; Singleton <BeaconHelper> .GetInstance().m_curBuyPropInfo.buy_prop_channel = "3"; Singleton <BeaconHelper> .GetInstance().m_curBuyPropInfo.buy_prop_id_time = Time.time; int currentUTCTime = CRoleInfo.GetCurrentUTCTime(); if (Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().m_extGuildInfo.dwLastCreateGuildTime != 0u) { uint dwConfValue = GameDataMgr.guildMiscDatabin.GetDataByKey(3u).dwConfValue; if ((long)currentUTCTime < (long)((ulong)(Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().m_extGuildInfo.dwLastCreateGuildTime + dwConfValue))) { Singleton <CUIManager> .GetInstance().OpenTips("Guild_Last_Create_Time_Tip", true, 1.5f, null, new object[0]); return; } } CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo(); uint dwConfValue2 = GameDataMgr.guildMiscDatabin.GetDataByKey(5u).dwConfValue; if (masterRoleInfo.DianQuan < (ulong)dwConfValue2) { CUICommonSystem.OpenDianQuanNotEnoughTip(); return; } uint guildMemberMinPvpLevel = CGuildHelper.GetGuildMemberMinPvpLevel(); if (guildMemberMinPvpLevel != 0u && guildMemberMinPvpLevel > Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().PvpLevel) { Singleton <CUIManager> .GetInstance().OpenTips(Singleton <CTextManager> .GetInstance().GetText("Guild_Join_Level_Limit", new string[] { guildMemberMinPvpLevel.ToString() }), false, 1.5f, null, new object[0]); return; } Text component = this.m_form.GetWidget(0).GetComponent <Text>(); string text = CUIUtility.RemoveEmoji(component.text).Trim(); if (string.IsNullOrEmpty(text)) { Singleton <CUIManager> .GetInstance().OpenTips("Guild_Input_Guild_Name_Empty", true, 1.5f, null, new object[0]); return; } if (!Utility.IsValidText(text)) { Singleton <CUIManager> .GetInstance().OpenTips("Guild_Input_Guild_Name_Invalid", true, 1.5f, null, new object[0]); return; } Text component2 = this.m_form.GetWidget(1).GetComponent <Text>(); string text2 = CUIUtility.RemoveEmoji(component2.text).Trim(); if (string.IsNullOrEmpty(text2)) { Singleton <CUIManager> .GetInstance().OpenTips("Guild_Input_Guild_Bulletin_Empty", true, 1.5f, null, new object[0]); return; } uint dwConfValue3 = GameDataMgr.guildMiscDatabin.GetDataByKey(2u).dwConfValue; uint dwConfValue4 = GameDataMgr.guildMiscDatabin.GetDataByKey(1u).dwConfValue; TimeSpan timeSpan = new TimeSpan(0, 0, 0, (int)dwConfValue3); string text3 = Singleton <CTextManager> .GetInstance().GetText("Guild_Create_Tip", new string[] { timeSpan.get_TotalHours().ToString(), dwConfValue4.ToString() }); Singleton <CUIManager> .GetInstance().OpenMessageBoxWithCancel(text3, enUIEventID.Guild_PrepareGuild_Create_Confirm, enUIEventID.Guild_PrepareGuild_Create_Cancel, false); }
private void OnChangeName(CUIEvent uiEvent) { CUIFormScript srcFormScript = uiEvent.m_srcFormScript; if (srcFormScript == null) { return; } InputField component = srcFormScript.GetWidget(0).GetComponent <InputField>(); string text = CUIUtility.RemoveEmoji(component.get_text()).Trim(); if (this.m_curChangeType == RES_CHANGE_NAME_TYPE.RES_CHANGE_NAME_TYPE_PLAYER) { switch (Utility.CheckRoleName(text)) { case Utility.NameResult.Vaild: if (!this.CheckNameChangeCardCount()) { return; } this.SendChangeNameReq(text); break; case Utility.NameResult.Null: Singleton <CUIManager> .GetInstance().OpenTips("NameChange_Null", true, 1.5f, null, new object[0]); break; case Utility.NameResult.OutOfLength: Singleton <CUIManager> .GetInstance().OpenTips("RoleRegister_NameOutOfLength", true, 1.5f, null, new object[0]); break; case Utility.NameResult.InVaildChar: Singleton <CUIManager> .GetInstance().OpenTips("NameChange_InvalidName", true, 1.5f, null, new object[0]); break; } } else if (this.m_curChangeType == RES_CHANGE_NAME_TYPE.RES_CHANGE_NAME_TYPE_GUILD) { if (string.IsNullOrEmpty(text)) { Singleton <CUIManager> .GetInstance().OpenTips("Guild_Input_Guild_Name_Empty", true, 1.5f, null, new object[0]); } else if (!Utility.IsValidText(text)) { Singleton <CUIManager> .GetInstance().OpenTips("Guild_Input_Guild_Name_Invalid", true, 1.5f, null, new object[0]); } else { if (!this.CheckNameChangeCardCount()) { return; } this.SendChangeNameReq(text); } } else if (this.m_curChangeType == RES_CHANGE_NAME_TYPE.RES_CHANGE_NAME_TYPE_TRANSDATA_PLAYER) { switch (Utility.CheckRoleName(text)) { case Utility.NameResult.Vaild: this.SendTransDataRenameReq(text); break; case Utility.NameResult.Null: Singleton <CUIManager> .GetInstance().OpenTips("NameChange_Null", true, 1.5f, null, new object[0]); break; case Utility.NameResult.OutOfLength: Singleton <CUIManager> .GetInstance().OpenTips("RoleRegister_NameOutOfLength", true, 1.5f, null, new object[0]); break; case Utility.NameResult.InVaildChar: Singleton <CUIManager> .GetInstance().OpenTips("NameChange_InvalidName", true, 1.5f, null, new object[0]); break; } } }
public void battleInvitation(SCPKG_INVITE_JOIN_GAME_REQ info) { if (!this.m_bInstall) { return; } if (!this.m_bStart) { return; } try { string text = CUIUtility.RemoveEmoji(StringHelper.UTF8BytesToString(ref info.stInviterInfo.szName)); ulong ullUid = info.stInviterInfo.ullUid; string text2 = string.Empty; ulong num = 0uL; CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .instance.GetMasterRoleInfo(); if (masterRoleInfo != null) { text2 = masterRoleInfo.Name; num = masterRoleInfo.playerUllUID; } string text3 = string.Empty; if (info.bInviteType == 1) { ResDT_LevelCommonInfo pvpMapCommonInfo = CLevelCfgLogicManager.GetPvpMapCommonInfo(info.stInviteDetail.stRoomDetail.bMapType, info.stInviteDetail.stRoomDetail.dwMapId); if (pvpMapCommonInfo != null) { text3 = Singleton <CTextManager> .instance.GetText("Invite_Map_Desc", new string[] { ((int)(pvpMapCommonInfo.bMaxAcntNum / 2)).ToString(), ((int)(pvpMapCommonInfo.bMaxAcntNum / 2)).ToString(), Utility.UTF8Convert(pvpMapCommonInfo.szName) }); } } else if (info.bInviteType == 2) { ResDT_LevelCommonInfo pvpMapCommonInfo2 = CLevelCfgLogicManager.GetPvpMapCommonInfo(info.stInviteDetail.stTeamDetail.bMapType, info.stInviteDetail.stTeamDetail.dwMapId); if (pvpMapCommonInfo2 != null) { text3 = Singleton <CTextManager> .instance.GetText("Invite_Map_Desc", new string[] { ((int)(pvpMapCommonInfo2.bMaxAcntNum / 2)).ToString(), ((int)(pvpMapCommonInfo2.bMaxAcntNum / 2)).ToString(), Utility.UTF8Convert(pvpMapCommonInfo2.szName) }); } } string jsonString = string.Format("{{ \"user_id\" : \"{0}\",\"user_name\" : \" {1} \", \"friend_id\":\" {2} \",\"friend_name\":\" {3} \",\"battle_mode\":\" {4} \"}}", new object[] { num, text2, ullUid, text, text3 }); TGALive.battleInvitation(jsonString); } catch (Exception ex) { Debug.Log("TGA" + ex.ToString()); } }