private void SetPrepareGuildListItem(CUIListElementScript listElementScript, PrepareGuildInfo info) { Transform transform = listElementScript.transform; Image component = transform.Find("imgIcon").GetComponent <Image>(); Text component2 = transform.Find("txtName").GetComponent <Text>(); Text component3 = transform.Find("txtCreator").GetComponent <Text>(); Text component4 = transform.Find("txtMemCnt").GetComponent <Text>(); CUITimerScript component5 = transform.Find("timeoutTimer").GetComponent <CUITimerScript>(); GameObject gameObject = transform.Find("imgOnlyFriend").gameObject; string prefabPath = CUIUtility.s_Sprite_Dynamic_GuildHead_Dir + info.stBriefInfo.dwHeadId; component.SetSprite(prefabPath, this.m_form, true, false, false, false); component2.text = info.stBriefInfo.sName; component3.text = info.stBriefInfo.stCreatePlayer.sName; component4.text = (int)(info.stBriefInfo.bMemCnt - 1) + "/" + GameDataMgr.guildMiscDatabin.GetDataByKey(1u).dwConfValue; uint num = info.stBriefInfo.dwRequestTime + GameDataMgr.guildMiscDatabin.GetDataByKey(2u).dwConfValue; int num2 = (int)((ulong)num - (ulong)((long)CRoleInfo.GetCurrentUTCTime())); if (num2 < 0) { num2 = 0; } TimeSpan timeSpan = new TimeSpan(0, 0, 0, num2); component5.SetTotalTime((float)timeSpan.get_TotalSeconds()); component5.StartTimer(); gameObject.CustomSetActive(info.stBriefInfo.IsOnlyFriend); }
public CGuildModel() { this.m_CurrentPrepareGuildInfo = new PrepareGuildInfo(); this.m_CurrentGuildInfo = new GuildInfo(); this.m_PlayerGuildLastState = COM_PLAYER_GUILD_STATE.COM_PLAYER_GUILD_STATE_NULL; this.m_PrepareGuildOldestRequestTime = 4294967295u; this.m_GuildDic = new DictionaryView <ulong, GuildInfo>(); this.m_PrepareGuildDic = new DictionaryView <ulong, PrepareGuildInfo>(); this.m_ApplicantDic = new Dictionary <ulong, stApplicantInfo>(); this.m_AppliedGuildDic = new Dictionary <ulong, stAppliedGuildInfo>(); this.m_InvitedFriendDic = new Dictionary <ulong, stInvitedFriend>(); this.m_IsLocalDataInited = false; this.m_IsInited = false; this.m_InvitePlayerUuid = 0uL; this.m_InviteGuildUuid = 0uL; this.m_InviteGuildLogicWorldId = 0; this.m_InvitGuildName = null; this.m_recommendInfoDic = new Dictionary <ulong, stRecommendInfo>(); this.m_recommendTimeInfoDic = new Dictionary <ulong, int>(); this.m_inviteTimeInfoDic = new Dictionary <ulong, int>(); this.RankpointMemberInfoList = new List <KeyValuePair <ulong, MemberRankInfo> >(); this.RankpointRankInfoLists = new ListView <RankpointRankInfo> [4]; for (int i = 0; i < this.RankpointRankInfoLists.Length; i++) { this.RankpointRankInfoLists[i] = new ListView <RankpointRankInfo>(); } this.RankpointRankGottens = new bool[4]; this.RankpointRankLastGottenTimes = new int[4]; }
private void On_Guild_Prepare_Guild_List_Element_Enabled(CUIEvent uiEvent) { PrepareGuildInfo prepareGuildInfoByIndex = this.m_Model.GetPrepareGuildInfoByIndex(uiEvent.m_srcWidgetIndexInBelongedList); if (prepareGuildInfoByIndex != null) { this.SetPrepareGuildListItem(uiEvent.m_srcWidgetScript as CUIListElementScript, prepareGuildInfoByIndex); } }
public void AddPrepareGuildInfo(PrepareGuildInfo info) { try { this.m_PrepareGuildDic.Add(info.stBriefInfo.uulUid, info); } catch (Exception) { } }
private void On_Guild_PrepareGuild_Join_Confirm(CUIEvent uiEvent) { if (!this.m_Model.IsInGuildStep()) { PrepareGuildInfo prepareGuildInfoByIndex = this.m_Model.GetPrepareGuildInfoByIndex(this.m_form.GetWidget(0x1b).GetComponent <CUIListScript>().GetSelectedIndex()); Singleton <CUIManager> .GetInstance().OpenSendMsgAlert(5, enUIEventID.None); Singleton <EventRouter> .GetInstance().BroadCastEvent <PrepareGuildInfo>("PrepareGuild_Join", prepareGuildInfoByIndex); } }
private void RequestJoinPrepareGuild(PrepareGuildInfo info) { if (info == null) { DebugHelper.Assert(false, "CGuildListController.RequestJoinPrepareGuild(): info is null!!!"); return; } CSPkg cSPkg = NetworkModule.CreateDefaultCSPKG(2211u); cSPkg.stPkgData.get_stJoinPrepareGuildReq().ullGuildID = info.stBriefInfo.uulUid; Singleton <NetworkModule> .GetInstance().SendLobbyMsg(ref cSPkg, false); }
private void RequestJoinPrepareGuild(PrepareGuildInfo info) { if (info == null) { DebugHelper.Assert(false, "CGuildListController.RequestJoinPrepareGuild(): info is null!!!"); } else { CSPkg msg = NetworkModule.CreateDefaultCSPKG(0x8a3); msg.stPkgData.stJoinPrepareGuildReq.ullGuildID = info.stBriefInfo.uulUid; Singleton <NetworkModule> .GetInstance().SendLobbyMsg(ref msg, false); } }
private void OnReceiveSearchPrepareGuildSuccess(PrepareGuildInfo prepareGuildInfo, int searchType) { if (!Singleton <CGuildSystem> .GetInstance().IsInNormalGuild()) { this.m_Model.ClearPrepareGuildInfoList(); this.m_Model.AddPrepareGuildInfo(prepareGuildInfo); if (searchType == 0) { this.m_View.RefreshPrepareGuildPanel(true, 0, true); } else if (searchType == 1) { this.m_View.OpenForm(CGuildListView.Tab.PrepareGuild, false); this.m_View.RefreshPrepareGuildPanel(true, 0, true); } } }
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_Join(CUIEvent uiEvent) { PrepareGuildInfo prepareGuildInfoByIndex = this.m_Model.GetPrepareGuildInfoByIndex(this.m_form.GetWidget(0x1b).GetComponent <CUIListScript>().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, 1f, null, new object[0]); } else { uint dwConfValue = GameDataMgr.guildMiscDatabin.GetDataByKey(10).dwConfValue; if ((dwConfValue != 0) && (dwConfValue > Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().PvpLevel)) { string[] args = new string[] { dwConfValue.ToString() }; Singleton <CUIManager> .GetInstance().OpenTips(Singleton <CTextManager> .GetInstance().GetText("Guild_Join_Level_Limit", args), false, 1f, null, new object[0]); } else { if (Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().m_extGuildInfo.dwLastQuitGuildTime != 0) { int num2 = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().getCurrentTimeSinceLogin(); uint num3 = GameDataMgr.guildMiscDatabin.GetDataByKey(6).dwConfValue; int seconds = ((int)(Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().m_extGuildInfo.dwLastQuitGuildTime + num3)) - num2; TimeSpan span = new TimeSpan(0, 0, 0, seconds); if (seconds > 0) { string[] textArray2 = new string[] { ((int)span.TotalMinutes).ToString(), span.Seconds.ToString() }; Singleton <CUIManager> .GetInstance().OpenTips(Singleton <CTextManager> .GetInstance().GetText("Guild_Cannot_Apply_Tip", textArray2), false, 1f, 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_Prepare_Guild_Select(CUIEvent uiEvent) { int selectedIndex = uiEvent.m_srcWidget.GetComponent <CUIListScript>().GetSelectedIndex(); PrepareGuildInfo prepareGuildInfoByIndex = this.m_Model.GetPrepareGuildInfoByIndex(selectedIndex); DebugHelper.Assert(prepareGuildInfoByIndex != null); if (prepareGuildInfoByIndex == null) { return; } CUIHttpImageScript component = this.m_form.GetWidget(35).GetComponent <CUIHttpImageScript>(); component.SetImageUrl(CGuildHelper.GetHeadUrl(prepareGuildInfoByIndex.stBriefInfo.stCreatePlayer.szHeadUrl)); Image component2 = this.m_form.GetWidget(45).GetComponent <Image>(); MonoSingleton <NobeSys> .GetInstance().SetNobeIcon(component2, CGuildHelper.GetNobeLevel(prepareGuildInfoByIndex.stBriefInfo.stCreatePlayer.uulUid, prepareGuildInfoByIndex.stBriefInfo.stCreatePlayer.stVip.level), false); Image component3 = this.m_form.GetWidget(44).GetComponent <Image>(); MonoSingleton <NobeSys> .GetInstance().SetHeadIconBk(component3, CGuildHelper.GetNobeHeadIconId(prepareGuildInfoByIndex.stBriefInfo.stCreatePlayer.uulUid, prepareGuildInfoByIndex.stBriefInfo.stCreatePlayer.stVip.headIconId)); Text component4 = this.m_form.GetWidget(14).GetComponent <Text>(); component4.text = prepareGuildInfoByIndex.stBriefInfo.stCreatePlayer.sName; Text component5 = this.m_form.GetWidget(15).GetComponent <Text>(); component5.text = Singleton <CTextManager> .GetInstance().GetText("Common_Level_Format", new string[] { prepareGuildInfoByIndex.stBriefInfo.stCreatePlayer.dwLevel.ToString() }); Text component6 = this.m_form.GetWidget(16).GetComponent <Text>(); component6.text = prepareGuildInfoByIndex.stBriefInfo.stCreatePlayer.dwGameEntity.ToString(); Text component7 = this.m_form.GetWidget(21).GetComponent <Text>(); component7.text = prepareGuildInfoByIndex.stBriefInfo.sBulletin; }
private void On_Guild_Prepare_Guild_Select(CUIEvent uiEvent) { int selectedIndex = uiEvent.m_srcWidget.GetComponent <CUIListScript>().GetSelectedIndex(); PrepareGuildInfo prepareGuildInfoByIndex = this.m_Model.GetPrepareGuildInfoByIndex(selectedIndex); DebugHelper.Assert(prepareGuildInfoByIndex != null); if (prepareGuildInfoByIndex != null) { this.m_form.GetWidget(0x23).GetComponent <CUIHttpImageScript>().SetImageUrl(CGuildHelper.GetHeadUrl(prepareGuildInfoByIndex.stBriefInfo.stCreatePlayer.szHeadUrl)); Image component = this.m_form.GetWidget(0x2d).GetComponent <Image>(); MonoSingleton <NobeSys> .GetInstance().SetNobeIcon(component, CGuildHelper.GetNobeLevel(prepareGuildInfoByIndex.stBriefInfo.stCreatePlayer.uulUid, prepareGuildInfoByIndex.stBriefInfo.stCreatePlayer.stVip.level), false); Image image = this.m_form.GetWidget(0x2c).GetComponent <Image>(); MonoSingleton <NobeSys> .GetInstance().SetHeadIconBk(image, CGuildHelper.GetNobeHeadIconId(prepareGuildInfoByIndex.stBriefInfo.stCreatePlayer.uulUid, prepareGuildInfoByIndex.stBriefInfo.stCreatePlayer.stVip.headIconId)); this.m_form.GetWidget(14).GetComponent <Text>().text = prepareGuildInfoByIndex.stBriefInfo.stCreatePlayer.sName; string[] args = new string[] { prepareGuildInfoByIndex.stBriefInfo.stCreatePlayer.dwLevel.ToString() }; this.m_form.GetWidget(15).GetComponent <Text>().text = Singleton <CTextManager> .GetInstance().GetText("Common_Level_Format", args); this.m_form.GetWidget(0x10).GetComponent <Text>().text = prepareGuildInfoByIndex.stBriefInfo.stCreatePlayer.dwGameEntity.ToString(); this.m_form.GetWidget(0x15).GetComponent <Text>().text = prepareGuildInfoByIndex.stBriefInfo.sBulletin; } }
public void OnRequestJoinPrepareGuild(PrepareGuildInfo info) { this.m_Model.SetPlayerGuildStateToTemp(); this.RequestJoinPrepareGuild(info); }
private void OnRequestPrepareGuldInfoSuccess(PrepareGuildInfo info) { this.m_View.RefreshPrepareGuildPanel(false, 0, false); }
private void OnReceivePrepareGuildCreateSuccess(PrepareGuildInfo info) { Singleton <CUIManager> .GetInstance().OpenTips("Guild_Prepare_Guild_Created_Tip", true, 1.5f, null, new object[0]); this.m_View.SelectTabElement(CGuildListView.Tab.PrepareGuild, true); }
private void OnReceivePrepareGuildJoinFailed(PrepareGuildInfo info) { this.m_View.RefreshPrepareGuildPanel(false, 0, false); }