Esempio n. 1
0
 public GroupRequest(WorldClient pFrom, Group pGroup, string pInvited)
 {
     this.CrationTimeStamp = DateTime.Now;
     this.InvitedClient = ClientManager.Instance.GetClientByCharname(pInvited);
     this.InviterClient = pFrom;
     this.Group = pGroup;
 }
Esempio n. 2
0
        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;
        }
Esempio n. 3
0
 public bool Equals(Group other)
 {
     return other.Id.Equals(this.Id);
 }
Esempio n. 4
0
        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;
        }
Esempio n. 5
0
 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;
 }