示例#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;
 }
示例#2
0
文件: Group.cs 项目: Dextan/Estrella
        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;
        }
示例#3
0
文件: Group.cs 项目: Dextan/Estrella
 public bool Equals(Group other)
 {
     return other.Id.Equals(this.Id);
 }
示例#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;
        }
示例#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;
 }