当前位置: 首页>>代码示例>>C#>>正文


C# Client.SendRoomResponse方法代码示例

本文整理汇总了C#中BrickEmulator.HabboHotel.Users.Client.SendRoomResponse方法的典型用法代码示例。如果您正苦于以下问题:C# Client.SendRoomResponse方法的具体用法?C# Client.SendRoomResponse怎么用?C# Client.SendRoomResponse使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在BrickEmulator.HabboHotel.Users.Client的用法示例。


在下文中一共展示了Client.SendRoomResponse方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: UpdateRoomIcon

        private void UpdateRoomIcon(Client Client, Request Request)
        {
            if (!Client.GetUser().IsInRoom)
            {
                return;
            }

            int Q = Request.PopWiredInt32();

            if (!Client.GetUser().GetRoom().GetRoomEngine().HasRights(Client.GetUser().HabboId, Rooms.RightsType.Founder))
            {
                return;
            }

            var Icons = new Dictionary<int, int>();

            int BackgroundIcon = Request.PopWiredInt32();

            if (BackgroundIcon < 1 || BackgroundIcon > 24)
            {
                BackgroundIcon = 1;
            }

            int ForegroundIcon = Request.PopWiredInt32();

            if (ForegroundIcon < 0 || ForegroundIcon > 11)
            {
                ForegroundIcon = 0;
            }

            int IconsAmount = Request.PopWiredInt32();

            for (int i = 0; i < IconsAmount; i++)
            {
                int SlotId = Request.PopWiredInt32();
                int Icon = Request.PopWiredInt32();

                if (SlotId < 0 || SlotId > 10 || Icon < 1 || Icon > 27)
                {
                    continue;
                }

                if (!Icons.ContainsKey(SlotId))
                {
                    Icons.Add(SlotId, Icon);
                }
            }

            int x = 0;

            StringBuilder Query = new StringBuilder();

            foreach (KeyValuePair<int, int> kvp in Icons)
            {
                if (x < Icons.Count)
                {
                    Query.Append(',');
                }

                Query.Append(kvp.Key);
                Query.Append('.');
                Query.Append(kvp.Value);

                x++;
            }

            Client.GetUser().GetRoom().Icon = new RoomIcon(Client.GetUser().GetRoom().Id, BackgroundIcon, ForegroundIcon, Query.ToString());

            Response Response = new Response();
            Response.Initialize(457);
            Response.AppendInt32(Client.GetUser().RoomId);
            Response.AppendBoolean(true);
            Response.Initialize(456);
            Response.AppendInt32(Client.GetUser().RoomId);
            Client.SendResponse(Response);

            Response Data = new Response(454);
            Data.AppendBoolean(false);
            Client.GetUser().GetRoom().GetNavigatorResponse(Data, false);
            Client.SendRoomResponse(Data);

            using (QueryReactor Reactor = BrickEngine.GetQueryReactor())
            {
                Reactor.SetQuery("UPDATE private_rooms SET nav_icon_bg = @bg, nav_icon_fg = @fg, nav_icons = @icons WHERE id = @roomid LIMIT 1");
                Reactor.AddParam("bg", BackgroundIcon);
                Reactor.AddParam("fg", ForegroundIcon);
                Reactor.AddParam("icons", Query.ToString());
                Reactor.AddParam("roomid", Client.GetUser().RoomId);
                Reactor.ExcuteQuery();
            }
        }
开发者ID:devMextur,项目名称:BrickEmulator,代码行数:91,代码来源:Rooms.cs

示例2: EndEditRoom


//.........这里部分代码省略.........
                Commands.Add("tags = @tags");
                Params.Add("tags", SplittedTags.ToString());
                Room.Tags = Tags;
            }

            if (!Room.AllowPets.Equals(AllowPets))
            {
                Commands.Add("allow_pets = @allow_pets");
                Params.Add("allow_pets", AllowPets ? 1 : 0);
                Room.AllowPets = AllowPets;
            }

            if (!Room.AllowPetsEat.Equals(AllowPetsEat))
            {
                Commands.Add("allow_pets_eat = @allow_pets_eat");
                Params.Add("allow_pets_eat", AllowPetsEat ? 1 : 0);
                Room.AllowPetsEat = AllowPetsEat;
            }

            if (!Room.AllowWalkthough.Equals(AllowWalkthough))
            {
                Commands.Add("allow_walkthough = @allow_walkthough");
                Params.Add("allow_walkthough", AllowWalkthough ? 1 : 0);
                Room.AllowWalkthough = AllowWalkthough;
            }

            if (!Room.AllowHideWall.Equals(AllowHideWall))
            {
                Commands.Add("allow_hidewall = @allow_hidewall");
                Params.Add("allow_hidewall", AllowHideWall ? 1 : 0);
                Room.AllowHideWall = AllowHideWall;
            }

            if (!Room.WallThick.Equals(WallThick))
            {
                Commands.Add("walls_thick = @walls_thick");
                Params.Add("walls_thick", WallThick);
                Room.WallThick = WallThick;
            }

            if (!Room.FloorThick.Equals(FloorThick))
            {
                Commands.Add("floors_thick = @floors_thick");
                Params.Add("floors_thick", FloorThick);
                Room.FloorThick = FloorThick;
            }

            Response Data = new Response(454);
            Data.AppendBoolean(true);
            Room.GetNavigatorResponse(Data, false);
            Client.SendRoomResponse(Data);

            Response Response = new Response();
            Response.Initialize(467);
            Response.AppendInt32(Client.GetUser().RoomId);
            Response.Initialize(456);
            Response.AppendInt32(Client.GetUser().RoomId);
            Client.SendResponse(Response);

            Response RoomStruct = new Response(472);
            RoomStruct.AppendBoolean(AllowHideWall);
            RoomStruct.AppendInt32(WallThick);
            RoomStruct.AppendInt32(FloorThick);
            Client.SendRoomResponse(RoomStruct);

            if (Commands.Count > 0)
            {
                using (QueryReactor Reactor = BrickEngine.GetQueryReactor())
                {
                    StringBuilder Builder = new StringBuilder();
                    Builder.Append("UPDATE private_rooms SET ");

                    int i = 0;

                    foreach (string Command in Commands)
                    {
                        i++;
                        Builder.Append(Command);

                        if (i < Commands.Count)
                        {
                            Builder.Append(", ");
                        }
                    }

                    Builder.Append(" WHERE id = @roomid LIMIT 1");

                    Reactor.SetQuery(Builder.ToString());

                    foreach (KeyValuePair<string, Object> kvp in Params)
                    {
                        Reactor.AddParam(kvp.Key, kvp.Value);
                    }

                    Reactor.AddParam("roomid", Room.Id);

                    Reactor.ExcuteQuery();
                }
            }
        }
开发者ID:devMextur,项目名称:BrickEmulator,代码行数:101,代码来源:Rooms.cs

示例3: Wave

        private void Wave(Client Client, Request Request)
        {
            if (!Client.GetUser().IsInRoom)
            {
                return;
            }

            Response Response = new Response(481);
            Response.AppendInt32(Client.GetUser().GetRoomUser().VirtualId);

            Client.SendRoomResponse(Response);
        }
开发者ID:devMextur,项目名称:BrickEmulator,代码行数:12,代码来源:Users.cs

示例4: UpdateEvent

        private void UpdateEvent(Client Client, Request Request)
        {
            if (!Client.GetUser().IsInRoom)
            {
                return;
            }

            if (!Client.GetUser().GetRoom().GetRoomEngine().HasRights(Client.GetUser().HabboId, Rooms.RightsType.Founder))
            {
                return;
            }

            int CategoryId = Request.PopWiredInt32();
            string Name = BrickEngine.CleanString(Request.PopFixedString());
            string Description = BrickEngine.CleanString(Request.PopFixedString());
            int TagCount = Request.PopWiredInt32();

            List<string> Tags = new List<string>();

            for (int i = 0; i < TagCount; i++)
            {
                Tags.Add(BrickEngine.CleanString(Request.PopFixedString()));
            }

            RoomEvent Event = null;

            if (Client.GetUser().GetRoom().Event == null)
            {
                Event = new RoomEvent(Client.GetUser().RoomId, Name, Description, CategoryId, Tags);

                Client.GetUser().GetRoom().Event = Event;

                // Friends alert
                BrickEngine.GetMessengerHandler().AlertFriends(Client.GetUser().HabboId, BrickEngine.GetMessengerHandler().GetAchievedResponse(Client.GetUser().HabboId, false, Name));
            }
            else
            {
                Event = Client.GetUser().GetRoom().Event;

                Event.Name = Name;
                Event.Description = Description;
                Event.Tags = Tags;
            }

            Response Response = new Response(370);
            Event.GetResponse(Response);

            Client.SendRoomResponse(Response);
        }
开发者ID:devMextur,项目名称:BrickEmulator,代码行数:49,代码来源:Rooms.cs

示例5: UpdateBadge

        private void UpdateBadge(Client Client, Request Request)
        {
            var Badges = BrickEngine.GetBadgeHandler().GetBadgesForUser(Client.GetUser().HabboId);;

            // Null every badge ready for update
            foreach (Badge Badge in Badges)
            {
                Badge.SlotId = 0;
            }

            // Check new badge updates
            while (Request.RemainingLength > 0)
            {
                int SlotId = Request.PopWiredInt32();
                string Badge = Request.PopFixedString();

                Badge SelectedBadge = BrickEngine.GetBadgeHandler().GetBadge(Badge, Client.GetUser().HabboId);

                if (SelectedBadge != null)
                {
                    SelectedBadge.SlotId = SlotId;
                }
            }

            // Cache Equiped Badges Again for Update
            var Equiped = BrickEngine.GetBadgeHandler().GetEquipedBadges(Client.GetUser().HabboId);

            // Send update response
            Response Response = new Response(228);
            Response.AppendInt32(Client.GetUser().HabboId);
            Response.AppendInt32(Equiped.Count);

            foreach (Badge Badge in Equiped)
            {
                Response.AppendInt32(Badge.SlotId);
                Response.AppendStringWithBreak(Badge.BadgeCode);
            }

            if (Client.GetUser().IsInRoom)
            {
                Client.SendRoomResponse(Response);
            }
            else
            {
                Client.SendResponse(Response);
            }

            foreach (Badge Badge in Badges)
            {
                using (QueryReactor Reactor = BrickEngine.GetQueryReactor())
                {
                    Reactor.SetQuery("UPDATE user_badges SET slot_id = @slotid WHERE badge = @badge AND user_id = @habboid LIMIT 1");
                    Reactor.AddParam("slotid", Badge.SlotId);
                    Reactor.AddParam("badge", Badge.BadgeCode);
                    Reactor.AddParam("habboid", Client.GetUser().HabboId);
                    Reactor.ExcuteQuery();
                }
            }
        }
开发者ID:devMextur,项目名称:BrickEmulator,代码行数:59,代码来源:Users.cs

示例6: RespectUser

        private void RespectUser(Client Client, Request Request)
        {
            if (!Client.GetUser().IsInRoom)
            {
                return;
            }

            if (Client.GetUser().RespectLeft < 0)
            {
                return;
            }

            int HabboId = Request.PopWiredInt32();

            VirtualRoomUser TriggeredUser = Client.GetUser().GetRoom().GetRoomEngine().GetUserByHabboId(HabboId);

            if (TriggeredUser == null)
            {
                return;
            }

            TriggeredUser.GetClient().GetUser().RespectGained++;

            Response Response = new Response(440);
            Response.AppendInt32(HabboId);
            Response.AppendInt32(TriggeredUser.GetClient().GetUser().RespectGained);
            Client.SendRoomResponse(Response);

            Client.GetUser().RespectLeft--;
            Client.GetUser().RespectGiven++;

            // Update TriggeredUser
            using (QueryReactor Reactor = BrickEngine.GetQueryReactor())
            {
                Reactor.SetQuery("UPDATE users SET respect_gained = respect_gained + 1 WHERE id = @habboid LIMIT 1");
                Reactor.AddParam("habboid", HabboId);
                Reactor.ExcuteQuery();
            }

            // Update Left
            using (QueryReactor Reactor = BrickEngine.GetQueryReactor())
            {
                Reactor.SetQuery("UPDATE users SET respect_left = respect_left - 1 WHERE id = @habboid LIMIT 1");
                Reactor.AddParam("habboid", Client.GetUser().HabboId);
                Reactor.ExcuteQuery();
            }

            // Update Given
            using (QueryReactor Reactor = BrickEngine.GetQueryReactor())
            {
                Reactor.SetQuery("UPDATE users SET respect_given = respect_given + 1 WHERE id = @habboid LIMIT 1");
                Reactor.AddParam("habboid", Client.GetUser().HabboId);
                Reactor.ExcuteQuery();
            }
        }
开发者ID:devMextur,项目名称:BrickEmulator,代码行数:55,代码来源:Users.cs

示例7: EndTyping

        private void EndTyping(Client Client, Request Request)
        {
            if (!Client.GetUser().IsInRoom)
            {
                return;
            }

            Response Response = new Response(361);
            Response.AppendInt32(Client.GetUser().GetRoomUser().VirtualId);
            Response.AppendBoolean(false);

            Client.SendRoomResponse(Response);
        }
开发者ID:devMextur,项目名称:BrickEmulator,代码行数:13,代码来源:Users.cs

示例8: Dance

        private void Dance(Client Client, Request Request)
        {
            if (!Client.GetUser().IsInRoom)
            {
                return;
            }

            int DanceId = Request.PopWiredInt32();

            Client.GetUser().GetRoomUser().DanceId = DanceId;

            Response Response = new Response(480);
            Response.AppendInt32(Client.GetUser().GetRoomUser().VirtualId);
            Response.AppendInt32(DanceId);

            Client.SendRoomResponse(Response);
        }
开发者ID:devMextur,项目名称:BrickEmulator,代码行数:17,代码来源:Users.cs

示例9: ChangeName

        private void ChangeName(Client Client, Request Request)
        {
            string Username = BrickEngine.CleanString(Request.PopFixedString());

            Boolean UpdatedName = false;

            if (!Client.GetUser().Username.ToLower().Equals(Username.ToLower()))
            {
                foreach (VirtualRoom Room in BrickEngine.GetRoomReactor().GetMe(Client.GetUser().HabboId))
                {
                    if (Room.InternalState.Equals(RoomRunningState.Alive))
                    {
                        Boolean IsMatch = false;

                        if (Regex.IsMatch(Room.Name.ToLower(), Client.GetUser().Username.ToLower()))
                        {
                            Room.Name = Room.Name.Replace(Client.GetUser().Username, Username);
                            IsMatch = true;
                        }

                        if (Regex.IsMatch(Room.Description.ToLower(), Client.GetUser().Username.ToLower()))
                        {
                            Room.Description = Room.Description.Replace(Client.GetUser().Username, Username);
                            IsMatch = true;
                        }

                        if (IsMatch)
                        {
                            using (QueryReactor Reactor = BrickEngine.GetQueryReactor())
                            {
                                Reactor.SetQuery("UPDATE private_rooms SET name = @name, description = @desc WHERE id = @roomid LIMIT 1");
                                Reactor.AddParam("name", Room.Name);
                                Reactor.AddParam("desc", Room.Description);
                                Reactor.AddParam("roomid", Room.Id);
                                Reactor.ExcuteQuery();
                            }

                            Response Data = new Response(454);
                            Data.AppendBoolean(true);
                            Room.GetNavigatorResponse(Data, false);
                            Client.SendRoomResponse(Data);
                        }
                    }
                }

                Client.GetUser().Username = Username;
                Client.GetUser().RefreshUser();

                Client.Notif("Successfully changed name, reload your room to see changes.", false);

                if (Client.GetUser().EnableShowOnline)
                {
                    lock (Client.GetUser().MessengerLocker)
                    {
                        BrickEngine.GetMessengerHandler().AlertStatusFriends(Client.GetUser(), true);
                    }
                }

                UpdatedName = true;
            }

            Client.GetUser().ProgressedNewbie = true;

            Response Response = new Response();
            Response.Initialize(571);
            Response.AppendBoolean(false);
            Response.AppendStringWithBreak(Username);
            Response.AppendBoolean(false);
            Response.Initialize(570);
            Response.AppendBoolean(false);
            Response.AppendStringWithBreak(Username);
            Response.AppendBoolean(false);
            Client.SendResponse(Response);

            BrickEngine.GetAchievementReactor().UpdateUsersAchievement(Client, 4);

            using (QueryReactor Reactor = BrickEngine.GetQueryReactor())
            {
                Reactor.SetQuery("UPDATE users SET changed_name = '1' WHERE id = @habboid");
                Reactor.AddParam("habboid", Client.GetUser().HabboId);
                Reactor.ExcuteQuery();
            }

            if (UpdatedName)
            {
                using (QueryReactor Reactor = BrickEngine.GetQueryReactor())
                {
                    Reactor.SetQuery("UPDATE users SET username = @username WHERE id = @habboid");
                    Reactor.AddParam("habboid", Client.GetUser().HabboId);
                    Reactor.AddParam("username", Username);
                    Reactor.ExcuteQuery();
                }
            }
        }
开发者ID:devMextur,项目名称:BrickEmulator,代码行数:94,代码来源:Users.cs


注:本文中的BrickEmulator.HabboHotel.Users.Client.SendRoomResponse方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。