public Rank(BinaryReader reader, bool Offline = false) { Name = reader.ReadString(); Options = (RankOptions)reader.ReadByte(); if (!Offline) Index = reader.ReadInt32(); int Membercount = reader.ReadInt32(); for (int j = 0; j < Membercount; j++) Members.Add(new GuildMember(reader, Offline)); }
public void StatusChanged(RankOptions status) { Notice.Enabled = false; NoticeEditButton.Index = 85; MyOptions = status; if (MyOptions.HasFlag(RankOptions.CanChangeNotice)) NoticeEditButton.Visible = true; else NoticeEditButton.Visible = false; if (MyOptions.HasFlag(RankOptions.CanChangeRank)) RankButton.Visible = true; else RankButton.Visible = false; if ((MyOptions.HasFlag(RankOptions.CanStoreItem)) || (MyOptions.HasFlag(RankOptions.CanRetrieveItem))) StorageButton.Visible = true; else StorageButton.Visible = false; BuffsButton.Visible = true; }
public void MyRankChanged(Rank New) { MyOptions = New.Options; MapObject.User.GuildRankName = New.Name; GuildMember Member = null; int OldRank = MyRankId; MyRankId = New.Index; if (OldRank >= Ranks.Count) return; for (int i = 0; i < Ranks[OldRank].Members.Count; i++) if (Ranks[OldRank].Members[i].name == MapObject.User.Name) { Member = Ranks[OldRank].Members[i]; Ranks[OldRank].Members.Remove(Member); break; } if (Member == null) return; if (Ranks.Count <= New.Index) { Ranks[MyRankId].Members.Add(Member); MembersChanged = true; return; } Ranks[New.Index].Members.Add(Member); ResetButtonStats(); UpdateMembers(); }
public void RankChangeRecieved(Rank New) { for (int i = 0; i < Ranks.Count; i++) if (Ranks[i].Index == New.Index) { if (Ranks[i].Name == MapObject.User.GuildRankName) for (int j = 0; j < Ranks[i].Members.Count; j++) if (Ranks[i].Members[j].name == MapObject.User.Name) { MapObject.User.GuildRankName = New.Name; MyOptions = New.Options; ResetButtonStats(); UpdateMembers(); } if (Ranks[i].Name == New.Name) { Ranks[i] = New; } else { Ranks[i] = New; RefreshMemberList(); } } UpdateRanks(); }
protected override void ReadPacket(BinaryReader reader) { GuildName = reader.ReadString(); GuildRankName = reader.ReadString(); Level = reader.ReadByte(); Experience = reader.ReadInt64(); MaxExperience = reader.ReadInt64(); Gold = reader.ReadUInt32(); SparePoints = reader.ReadByte(); MemberCount = reader.ReadInt32(); MaxMembers = reader.ReadInt32(); Voting = reader.ReadBoolean(); ItemCount = reader.ReadByte(); BuffCount = reader.ReadByte(); MyOptions = (RankOptions)reader.ReadByte(); MyRankId = reader.ReadInt32(); }