public static byte GetFixedGuildLevelLimit(byte originalLevelLimit) { uint guildMemberMinPvpLevel = CGuildHelper.GetGuildMemberMinPvpLevel(); if ((uint)originalLevelLimit < guildMemberMinPvpLevel) { return((byte)guildMemberMinPvpLevel); } return(originalLevelLimit); }
public void SetChatTab(CChatChannelMgr.EChatTab type) { this.CurActiveChannels.Clear(); if (type == CChatChannelMgr.EChatTab.Normal) { this.CurActiveChannels.Add(2u); this.CurActiveChannels.Add(4u); CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo(); if (masterRoleInfo != null && masterRoleInfo.PvpLevel >= CGuildHelper.GetGuildMemberMinPvpLevel() && Singleton <CGuildSystem> .GetInstance() != null) { if (Singleton <CGuildSystem> .GetInstance().IsInNormalGuild()) { this.CurActiveChannels.Add(5u); } else { this.CurActiveChannels.Add(6u); } } this.ChatTab = type; } else if (type == CChatChannelMgr.EChatTab.Room) { this.CurActiveChannels.Add(1u); this.CurActiveChannels.Add(4u); this.ChatTab = type; } else if (type == CChatChannelMgr.EChatTab.Team) { this.CurActiveChannels.Add(0u); this.CurActiveChannels.Add(4u); this.ChatTab = type; } else if (type == CChatChannelMgr.EChatTab.Settle) { this.CurActiveChannels.Add(10u); this.ChatTab = type; } else if (type == CChatChannelMgr.EChatTab.GuildMatch) { if (Singleton <CGuildMatchSystem> .GetInstance().IsSelfInAnyTeam()) { this.CurActiveChannels.Add(3u); } this.CurActiveChannels.Add(5u); this.CurActiveChannels.Add(4u); this.ChatTab = type; } }
private void On_Guild_PrepareGuild_Join(CUIEvent uiEvent) { CUIListScript component = this.m_form.GetWidget(27).GetComponent <CUIListScript>(); PrepareGuildInfo prepareGuildInfoByIndex = this.m_Model.GetPrepareGuildInfoByIndex(component.GetSelectedIndex()); if (prepareGuildInfoByIndex != null && prepareGuildInfoByIndex.stBriefInfo.IsOnlyFriend && Singleton <CFriendContoller> .GetInstance().model.getFriendByName(prepareGuildInfoByIndex.stBriefInfo.stCreatePlayer.sName, CFriendModel.FriendType.GameFriend) == null) { Singleton <CUIManager> .GetInstance().OpenTips("Guild_Only_Friend_Can_Join_Tip", true, 1.5f, null, new object[0]); 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; } if (Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().m_extGuildInfo.dwLastQuitGuildTime != 0u) { int currentUTCTime = CRoleInfo.GetCurrentUTCTime(); uint dwConfValue = GameDataMgr.guildMiscDatabin.GetDataByKey(6u).dwConfValue; int num = (int)((ulong)(Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().m_extGuildInfo.dwLastQuitGuildTime + dwConfValue) - (ulong)((long)currentUTCTime)); TimeSpan timeSpan = new TimeSpan(0, 0, 0, num); if (num > 0) { Singleton <CUIManager> .GetInstance().OpenTips(Singleton <CTextManager> .GetInstance().GetText("Guild_Cannot_Apply_Tip", new string[] { ((int)timeSpan.get_TotalMinutes()).ToString(), timeSpan.get_Seconds().ToString() }), false, 1.5f, null, new object[0]); return; } } string text = Singleton <CTextManager> .GetInstance().GetText("Guild_Response_Tip"); Singleton <CUIManager> .GetInstance().OpenMessageBoxWithCancel(text, enUIEventID.Guild_PrepareGuild_Join_Confirm, enUIEventID.Guild_PrepareGuild_Join_Cancel, false); }
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); }