public GroupRequest(WorldClient pFrom, Group pGroup, string pInvited) { this.CrationTimeStamp = DateTime.Now; this.InvitedClient = ClientManager.Instance.GetClientByCharname(pInvited); this.InviterClient = pFrom; this.Group = pGroup; }
public Group CreateNewGroup(WorldClient pMaster) { Group grp = new Group(GetNextId()); GroupMember mstr = new GroupMember(pMaster, GroupRole.Master); pMaster.Character.GroupMember = mstr; pMaster.Character.Group = grp; grp.AddMember(mstr); AddGroup(grp); grp.CreateInDatabase(); SendNewPartyInterPacket(grp.Id); return grp; }
internal static Group ReadFromDatabase(long pId) { // Note - put datatables int using statements! Group g = new Group(pId); DataTable gdata = null; using (DatabaseClient dbClient = Program.DatabaseManager.GetClient()) { gdata = dbClient.ReadDataTable("SELECT * FROM `groups` WHERE Id = " + pId + ""); } if (gdata != null) foreach (DataRow row in gdata.Rows) for (int i = 1; i < 4; i++) { string memColName = string.Format("Member{0}", i); if (row.IsNull(memColName)) continue; UInt16 mem = (ushort)row[memColName]; g.Members.Add(GroupMember.LoadFromDatabase(mem)); } return g; }
private void AddGroup(Group pGroup) { this.groups.Add(pGroup); this.groupsByMaster.Add(pGroup.Master.Name, pGroup); this.groupsById.Add(pGroup.Id, pGroup); pGroup.BrokeUp += this.OnGroupBrokeUp; pGroup.ChangedMaster += OnGroupChangedMaster; }
public bool Equals(Group other) { return other.Id.Equals(this.Id); }