public void GetSortedMembers(out SocialCharacterData[] sortedMembers) { var i = 0; var offlineMembers = new List <SocialCharacterData>(); sortedMembers = new SocialCharacterData[members.Count]; sortedMembers[i++] = members[leaderId]; SocialCharacterData tempMember; foreach (var memberId in members.Keys) { if (memberId.Equals(leaderId)) { continue; } tempMember = members[memberId]; if (!IsOnline(memberId)) { offlineMembers.Add(tempMember); continue; } sortedMembers[i++] = tempMember; } foreach (var offlineMember in offlineMembers) { sortedMembers[i++] = offlineMember; } }
public void GetSortedMembers(out SocialCharacterData[] sortedMembers, out byte[] sortedMemberRoles) { var i = 0; var offlineMembers = new List <SocialCharacterData>(); sortedMembers = new SocialCharacterData[members.Count]; sortedMemberRoles = new byte[members.Count]; sortedMembers[i] = members[leaderId]; sortedMemberRoles[i++] = LeaderRole; SocialCharacterData tempMember; foreach (var memberId in members.Keys) { if (memberId.Equals(leaderId)) { continue; } tempMember = members[memberId]; if (!IsOnline(memberId)) { offlineMembers.Add(tempMember); continue; } sortedMembers[i] = tempMember; sortedMemberRoles[i++] = memberRoles.ContainsKey(tempMember.id) ? memberRoles[tempMember.id] : LowestMemberRole; } foreach (var offlineMember in offlineMembers) { sortedMembers[i] = offlineMember; sortedMemberRoles[i++] = memberRoles.ContainsKey(offlineMember.id) ? memberRoles[offlineMember.id] : LowestMemberRole; } }
public void Show(GuildRoleData[] roles, SocialCharacterData member, byte guildRole) { base.Show(); characterId = member.id; if (uiTextName != null) { uiTextName.text = string.Format(nameFormat, string.IsNullOrEmpty(member.characterName) ? "Unknow" : member.characterName); } if (uiTextLevel != null) { uiTextLevel.text = string.Format(levelFormat, member.level.ToString("N0")); } if (dropdownRoles != null) { var options = new List <DropdownWrapper.OptionData>(); options.Add(new DropdownWrapper.OptionData("None")); for (var i = 1; i < roles.Length; ++i) { options.Add(new DropdownWrapper.OptionData(roles[i].roleName)); } dropdownRoles.options = options; dropdownRoles.value = guildRole; } }
public void Show(GuildRoleData[] roles, SocialCharacterData member, byte guildRole) { base.Show(); characterId = member.id; if (uiTextName != null) { uiTextName.text = string.Format( LanguageManager.GetText(formatKeyName), string.IsNullOrEmpty(member.characterName) ? LanguageManager.GetUnknowTitle() : member.characterName); } if (uiTextLevel != null) { uiTextLevel.text = string.Format( LanguageManager.GetText(formatKeyLevel), member.level.ToString("N0")); } if (dropdownRoles != null) { List <DropdownWrapper.OptionData> options = new List <DropdownWrapper.OptionData>(); options.Add(new DropdownWrapper.OptionData(LanguageManager.GetText(UILocaleKeys.UI_LABEL_NONE.ToString()))); for (int i = 1; i < roles.Length; ++i) { options.Add(new DropdownWrapper.OptionData(roles[i].roleName)); } dropdownRoles.options = options; dropdownRoles.value = guildRole; } }
public SocialCharacterData CreateMemberData(BasePlayerCharacterEntity playerCharacterEntity) { tempMemberData = new SocialCharacterData(); tempMemberData.id = playerCharacterEntity.Id; tempMemberData.characterName = playerCharacterEntity.CharacterName; tempMemberData.dataId = playerCharacterEntity.DataId; tempMemberData.level = playerCharacterEntity.Level; tempMemberData.currentHp = playerCharacterEntity.CurrentHp; tempMemberData.maxHp = playerCharacterEntity.CacheMaxHp; tempMemberData.currentMp = playerCharacterEntity.CurrentMp; tempMemberData.maxMp = playerCharacterEntity.CacheMaxMp; return(tempMemberData); }
public virtual void AddMember(SocialCharacterData memberData) { if (!members.ContainsKey(memberData.id)) { members.Add(memberData.id, memberData); return; } SocialCharacterData oldMemberData = members[memberData.id]; oldMemberData.characterName = memberData.characterName; oldMemberData.dataId = memberData.dataId; oldMemberData.level = memberData.level; members[memberData.id] = oldMemberData; }
public void OnClickKickFromGuild() { // If not in the guild or not leader, return if (!OwningCharacterCanKick() || MemberSelectionManager.SelectedUI == null) { return; } SocialCharacterData guildMember = MemberSelectionManager.SelectedUI.Data.socialCharacter; UISceneGlobal.Singleton.ShowMessageDialog(LanguageManager.GetText(UILocaleKeys.UI_GUILD_KICK_MEMBER.ToString()), string.Format(LanguageManager.GetText(UILocaleKeys.UI_GUILD_KICK_MEMBER_DESCRIPTION.ToString()), guildMember.characterName), false, true, true, false, null, () => { BasePlayerCharacterController.OwningCharacter.RequestKickFromGuild(guildMember.id); }); }
public void OnClickChangeLeader() { // If not in the party or not leader, return if (!OwningCharacterIsLeader() || MemberSelectionManager.SelectedUI == null) { return; } SocialCharacterData partyMember = MemberSelectionManager.SelectedUI.Data.socialCharacter; UISceneGlobal.Singleton.ShowMessageDialog(LanguageManager.GetText(UILocaleKeys.UI_PARTY_CHANGE_LEADER.ToString()), string.Format(LanguageManager.GetText(UILocaleKeys.UI_PARTY_CHANGE_LEADER_DESCRIPTION.ToString()), partyMember.characterName), false, true, true, false, null, () => { BasePlayerCharacterController.OwningCharacter.RequestChangePartyLeader(partyMember.id); }); }
public virtual void UpdateMember(SocialCharacterData memberData) { if (!members.ContainsKey(memberData.id)) { return; } SocialCharacterData oldMemberData = members[memberData.id]; oldMemberData.characterName = memberData.characterName; oldMemberData.dataId = memberData.dataId; oldMemberData.level = memberData.level; oldMemberData.currentHp = memberData.currentHp; oldMemberData.maxHp = memberData.maxHp; oldMemberData.currentMp = memberData.currentMp; oldMemberData.maxMp = memberData.maxMp; members[memberData.id] = oldMemberData; }
public override void AddMember(SocialCharacterData memberData) { base.AddMember(memberData); SetMemberRole(memberData.id, IsLeader(memberData.id) ? LeaderRole : LowestMemberRole); }
public void UpdateMember(SocialCharacterData memberData, byte guildRole) { base.UpdateMember(memberData); SetMemberRole(memberData.id, guildRole); }
public bool TryGetMember(string id, out SocialCharacterData result) { return(members.TryGetValue(id, out result)); }