Exemplo n.º 1
0
        internal ServerMessage SerializeGroupMembers(ServerMessage Response, Guild Group, uint ReqType, GameClient Session, string SearchVal = "", int Page = 0)
        {
            if (Group == null || Session == null)
            {
                return(null);
            }
            if (Page < 1)
            {
                Page = 0;
            }
            List <List <GroupUser> > list = GroupManager.Split(this.GetGroupUsersByString(Group, SearchVal, ReqType));

            Response.AppendUInt(Group.Id);
            Response.AppendString(Group.Name);
            Response.AppendUInt(Group.RoomId);
            Response.AppendString(Group.Badge);
            switch (ReqType)
            {
            case 0u:
                Response.AppendInt32(Group.Members.Count);
                Response.AppendInt32(list[Page].Count);
                using (List <GroupUser> .Enumerator enumerator = list[Page].GetEnumerator())
                {
                    while (enumerator.MoveNext())
                    {
                        GroupUser current    = enumerator.Current;
                        Habbo     habboForId = CyberEnvironment.getHabboForId(current.Id);
                        if (habboForId == null)
                        {
                            Response.AppendInt32(0);
                            Response.AppendInt32(0);
                            Response.AppendString("");
                            Response.AppendString("");
                            Response.AppendString("");
                        }
                        else
                        {
                            Response.AppendInt32((current.Rank == 2) ? 0 : ((current.Rank == 1) ? 1 : 2));
                            Response.AppendUInt(habboForId.Id);
                            Response.AppendString(habboForId.Username);
                            Response.AppendString(habboForId.Look);
                            Response.AppendString("");
                        }
                    }
                    goto IL_367;
                }

            case 1u:
                break;

            case 2u:
            {
                List <List <uint> > list2 = GroupManager.Split(this.GetGroupRequestsByString(Group, SearchVal, ReqType));
                Response.AppendInt32(Group.Requests.Count);
                if (Group.Requests.Count > 0)
                {
                    Response.AppendInt32(list2[Page].Count);
                    using (List <uint> .Enumerator enumerator2 = list2[Page].GetEnumerator())
                    {
                        while (enumerator2.MoveNext())
                        {
                            uint  current2    = enumerator2.Current;
                            Habbo habboForId2 = CyberEnvironment.getHabboForId(current2);
                            if (habboForId2 == null)
                            {
                                Response.AppendInt32(0);
                                Response.AppendInt32(0);
                                Response.AppendString("");
                                Response.AppendString("");
                                Response.AppendString("");
                            }
                            else
                            {
                                Response.AppendInt32(3);
                                Response.AppendUInt(habboForId2.Id);
                                Response.AppendString(habboForId2.Username);
                                Response.AppendString(habboForId2.Look);
                                Response.AppendString("");
                            }
                        }
                        goto IL_367;
                    }
                }
                Response.AppendInt32(0);
                goto IL_367;
            }

            default:
                goto IL_367;
            }
            Response.AppendInt32(Group.Admins.Count);
            if (Group.Admins.Count > 0)
            {
                Response.AppendInt32(list[Page].Count);
                using (List <GroupUser> .Enumerator enumerator3 = list[Page].GetEnumerator())
                {
                    while (enumerator3.MoveNext())
                    {
                        GroupUser current3    = enumerator3.Current;
                        Habbo     habboForId3 = CyberEnvironment.getHabboForId(current3.Id);
                        if (habboForId3 == null)
                        {
                            Response.AppendInt32(0);
                            Response.AppendInt32(0);
                            Response.AppendString("");
                            Response.AppendString("");
                            Response.AppendString("");
                        }
                        else
                        {
                            Response.AppendInt32((current3.Rank == 2) ? 0 : ((current3.Rank == 1) ? 1 : 2));
                            Response.AppendUInt(habboForId3.Id);
                            Response.AppendString(habboForId3.Username);
                            Response.AppendString(habboForId3.Look);
                            Response.AppendString("");
                        }
                    }
                    goto IL_367;
                }
            }
            Response.AppendInt32(0);
IL_367:
            Response.AppendBoolean(Session.GetHabbo().Id == Group.CreatorId);
            Response.AppendInt32(14);
            Response.AppendInt32(Page);
            Response.AppendUInt(ReqType);
            Response.AppendString(SearchVal);
            return(Response);
        }
Exemplo n.º 2
0
		internal Game(int conns)
		{
            Logging.WriteLine("Starting modules...");
			this.ClientManager = new GameClientManager();
			this.BanManager = new ModerationBanManager();
			this.RoleManager = new RoleManager();
			this.Navigator = new Navigator();
			this.ItemManager = new ItemManager();
			this.Catalog = new Catalog();
			this.RoomManager = new RoomManager();
			this.PixelManager = new PixelManager();
			this.HotelView = new HotelView();
			this.ModerationTool = new ModerationTool();
			this.BotManager = new BotManager();
			this.questManager = new QuestManager();
			this.Events = new RoomEvents();
			this.groupManager = new GroupManager();
			this.talentManager = new TalentManager();
			this.VideoManager = new VideoManager();
			this.PinataHandler = new PinataHandler();
			this.PollManager = new PollManager();
            this.AntiMutant = new AntiMutant();
		}