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


C# GameClients.GameClient类代码示例

本文整理汇总了C#中Uber.HabboHotel.GameClients.GameClient的典型用法代码示例。如果您正苦于以下问题:C# GameClient类的具体用法?C# GameClient怎么用?C# GameClient使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


GameClient类属于Uber.HabboHotel.GameClients命名空间,在下文中一共展示了GameClient类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: parse

        public void parse(GameClient Session, ClientPacket Packet)
        {
            Room Room = UberEnvironment.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);

            if (Room == null)
            {
                return;
            }

            RoomUser User = Room.GetRoomUserByHabbo(Session.GetHabbo().Id);

            if (User == null || !User.CanWalk)
            {
                return;
            }

            int _moveX = Packet.PopWiredInt32();
            int _moveY = Packet.PopWiredInt32();

            if (_moveX == User.X && _moveY == User.Y)
            {
                return;
            }

            User.MoveTo(_moveX, _moveY);
        }
开发者ID:habb0,项目名称:uberEmu-stabilized,代码行数:26,代码来源:MoveAvatarMessageEvent.cs

示例2: parse

        public void parse(GameClient Session, ClientPacket Packet)
        {
            Room Room = UberEnvironment.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);

            if (Room == null || !Room.CheckRights(Session, true))
            {
                return;
            }

            foreach (uint UserId in Room.UsersWithRights)
            {
                RoomUser User = Room.GetRoomUserByHabbo(UserId);

                if (User != null && !User.IsBot)
                {
                    User.GetClient().SendPacket(new ServerPacket(43));
                }

                ServerPacket packet = new ServerPacket(511);
                packet.AppendUInt(Room.RoomId);
                packet.AppendUInt(UserId);
                Session.SendPacket(packet);
            }

            using (DatabaseClient dbClient = UberEnvironment.GetDatabase().GetClient())
            {
                dbClient.ExecuteQuery("DELETE FROM room_rights WHERE room_id = '" + Room.RoomId + "'");
            }

            Room.UsersWithRights.Clear();
        }
开发者ID:habb0,项目名称:uberEmu-stabilized,代码行数:31,代码来源:RemoveAllRightsMessageEvent.cs

示例3: parse

 public void parse(GameClient Session, ClientPacket Packet)
 {
     ServerPacket packet = new ServerPacket(611);
     packet.AppendBoolean(true);
     packet.AppendInt32(99999);
     Session.SendPacket(packet);
 }
开发者ID:habb0,项目名称:uberEmu-stabilized,代码行数:7,代码来源:GetMarketplaceCanMakeOfferEvent.cs

示例4: parse

        public void parse(GameClient Session, ClientPacket Packet)
        {
            uint Id = Packet.PopWiredUInt();

            RoomData Data = UberEnvironment.GetGame().GetRoomManager().GenerateRoomData(Id);

            if (Data == null || Session.GetHabbo().FavoriteRooms.Count >= 30 || Session.GetHabbo().FavoriteRooms.Contains(Id) || Data.Type == "public")
            {
                ServerPacket packet = new ServerPacket(33);
                packet.AppendInt32(-9001);
                Session.SendPacket(packet);

                return;
            }

            ServerPacket _packet = new ServerPacket(459);
            _packet.AppendUInt(Id);
            _packet.AppendBoolean(true);
            Session.SendPacket(_packet);

            Session.GetHabbo().FavoriteRooms.Add(Id);

            using (DatabaseClient dbClient = UberEnvironment.GetDatabase().GetClient())
            {
                dbClient.ExecuteQuery("INSERT INTO user_favorites (user_id,room_id) VALUES ('" + Session.GetHabbo().Id + "','" + Id + "')");
            }
        }
开发者ID:habb0,项目名称:uberEmu-stabilized,代码行数:27,代码来源:AddFavouriteRoomMessageEvent.cs

示例5: parse

        public void parse(GameClient Session, ClientPacket Packet)
        {
            int count = Packet.PopWiredInt32();

            List<uint> UserIds = new List<uint>();

            for (int i = 0; i < count; i++)
            {
                UserIds.Add(Packet.PopWiredUInt());
            }

            string message = UberEnvironment.FilterInjectionChars(Packet.PopFixedString(), true);

            ServerPacket Message = new ServerPacket(135);
            Message.AppendUInt(Session.GetHabbo().Id);
            Message.AppendStringWithBreak(message);

            foreach (uint Id in UserIds)
            {
                if (!Session.GetHabbo().GetMessenger().FriendshipExists(Session.GetHabbo().Id, Id))
                {
                    continue;
                }

                GameClient Client = UberEnvironment.GetGame().GetClientManager().GetClientByHabbo(Id);

                if (Client == null)
                {
                    return;
                }

                Client.SendPacket(Message);
            }
        }
开发者ID:habb0,项目名称:uberEmu-stabilized,代码行数:34,代码来源:SendRoomInviteMessageEvent.cs

示例6: parse

        public void parse(GameClient Session, ClientPacket Packet)
        {
            Packet.PopWiredInt32();

            Room Room = UberEnvironment.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);

            if (Room == null || !Room.CheckRights(Session, true))
            {
                return;
            }

            RoomItem Item = Room.GetItem(Packet.PopWiredUInt());

            if (Item == null)
            {
                return;
            }

            switch (Item.GetBaseItem().InteractionType.ToLower())
            {
                case "postit":

                    return; // not allowed to pick up post.its
            }

            Room.RemoveFurniture(Session, Item.Id);
            Session.GetHabbo().GetInventoryComponent().AddItem(Item.Id, Item.BaseItem, Item.ExtraData);
            Session.GetHabbo().GetInventoryComponent().UpdateItems(false);
        }
开发者ID:habb0,项目名称:uberEmu-stabilized,代码行数:29,代码来源:PickupObjectMessageEvent.cs

示例7: parse

        public void parse(GameClient Session, ClientPacket Packet)
        {
            Room Room = UberEnvironment.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);

            if (Room == null || Room.IsPublic || (!Room.AllowPets && !Room.CheckRights(Session, true)))
            {
                return;
            }

            uint PetId = Packet.PopWiredUInt();
            RoomUser PetUser = Room.GetPet(PetId);

            if (PetUser == null || PetUser.PetData == null || PetUser.PetData.OwnerId != Session.GetHabbo().Id)
            {
                return;
            }

            PetUser.PetData.OnRespect();
            Session.GetHabbo().DailyPetRespectPoints--;

            using (DatabaseClient dbClient = UberEnvironment.GetDatabase().GetClient())
            {
                dbClient.AddParamWithValue("userid", Session.GetHabbo().Id);
                dbClient.ExecuteQuery("UPDATE users SET daily_pet_respect_points = daily_pet_respect_points - 1 WHERE id = @userid LIMIT 1");
            }
        }
开发者ID:habb0,项目名称:uberEmu-stabilized,代码行数:26,代码来源:RespectPetMessageEvent.cs

示例8: SellItem

        public void SellItem(GameClient Session, uint ItemId, int SellingPrice)
        {
            UserItem Item = Session.GetHabbo().GetInventoryComponent().GetItem(ItemId);

            if (Item == null || SellingPrice > 10000 || !CanSellItem(Item))
            {
                ServerPacket packet = new ServerPacket(610);
                packet.AppendBoolean(false);
                Session.SendPacket(packet);

                return;
            }

            int Comission = CalculateComissionPrice(SellingPrice);
            int TotalPrice = SellingPrice + Comission;
            int ItemType = 1;

            if (Item.GetBaseItem().Type == "i")
            {
                ItemType++;
            }

            using (DatabaseClient dbClient = UberEnvironment.GetDatabase().GetClient())
            {
                dbClient.AddParamWithValue("public_name", Item.GetBaseItem().PublicName);
                dbClient.AddParamWithValue("extra_data", Item.ExtraData);
                dbClient.ExecuteQuery("INSERT INTO catalog_marketplace_offers (item_id,user_id,asking_price,total_price,public_name,sprite_id,item_type,timestamp,extra_data) VALUES ('" + Item.BaseItem + "','" + Session.GetHabbo().Id + "','" + SellingPrice + "','" + TotalPrice + "',@public_name,'" + Item.GetBaseItem().SpriteId + "','" + ItemType + "','" + UberEnvironment.GetUnixTimestamp() + "',@extra_data)");
            }

            Session.GetHabbo().GetInventoryComponent().RemoveItem(ItemId);

            ServerPacket p610 = new ServerPacket(610);
            p610.AppendBoolean(true);
            Session.SendPacket(p610);
        }
开发者ID:habb0,项目名称:uberEmu-stabilized,代码行数:35,代码来源:Marketplace.cs

示例9: parse

        public void parse(GameClient Session, ClientPacket Packet)
        {
            if (Session.GetHabbo().GetMessenger() == null)
            {
                return;
            }

            int Amount = Packet.PopWiredInt32();

            for (int i = 0; i < Amount; i++)
            {
                uint RequestId = Packet.PopWiredUInt();

                MessengerRequest MessRequest = Session.GetHabbo().GetMessenger().GetRequest(RequestId);

                if (MessRequest == null)
                {
                    continue;
                }

                if (MessRequest.To != Session.GetHabbo().Id)
                {
                    // not this user's request. filthy haxxor!
                    return;
                }

                if (!Session.GetHabbo().GetMessenger().FriendshipExists(MessRequest.To, MessRequest.From))
                {
                    Session.GetHabbo().GetMessenger().CreateFriendship(MessRequest.From);
                }

                Session.GetHabbo().GetMessenger().HandleRequest(RequestId);
            }
        }
开发者ID:habb0,项目名称:uberEmu-stabilized,代码行数:34,代码来源:AcceptBuddyMessageEvent.cs

示例10: parse

        public void parse(GameClient Session, ClientPacket Packet)
        {
            ServerPacket packet = new ServerPacket(267);
            packet.AppendBoolean(Session.GetHabbo().HasFuse("fuse_use_wardrobe"));

            if (Session.GetHabbo().HasFuse("fuse_use_wardrobe"))
            {
                DataTable WardrobeData = null;

                using (DatabaseClient dbClient = UberEnvironment.GetDatabase().GetClient())
                {
                    dbClient.AddParamWithValue("userid", Session.GetHabbo().Id);
                    WardrobeData = dbClient.ReadDataTable("SELECT * FROM user_wardrobe WHERE user_id = @userid");
                }

                if (WardrobeData == null)
                {
                    packet.AppendInt32(0);
                }
                else
                {
                    packet.AppendInt32(WardrobeData.Rows.Count);

                    foreach (DataRow Row in WardrobeData.Rows)
                    {
                        packet.AppendUInt((uint)Row["slot_id"]);
                        packet.AppendStringWithBreak((string)Row["look"]);
                        packet.AppendStringWithBreak((string)Row["gender"]);
                    }
                }
            }
            Session.SendPacket(packet);
        }
开发者ID:habb0,项目名称:uberEmu-stabilized,代码行数:33,代码来源:GetWardrobeMessageEvent.cs

示例11: parse

        public void parse(GameClient Session, ClientPacket Packet)
        {
            Room Room = UberEnvironment.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);

            if (Room == null)
            {
                return;
            }

            RoomItem Item = Room.GetItem(Packet.PopWiredUInt());

            if (Item == null)
            {
                return;
            }

            Boolean hasRights = false;

            if (Room.CheckRights(Session))
            {
                hasRights = true;
            }

            Item.Interactor.OnTrigger(Session, Item, Packet.PopWiredInt32(), hasRights);
        }
开发者ID:habb0,项目名称:uberEmu-stabilized,代码行数:25,代码来源:UseFurnitureMessageEvent.cs

示例12: parse

        public void parse(GameClient Session, ClientPacket Packet)
        {
            Room Room = UberEnvironment.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);

            if (Room == null)
            {
                return;
            }

            RoomUser User = Room.GetRoomUserByHabbo(Packet.PopWiredUInt());

            if (User == null || User.IsBot)
            {
                return;
            }

            ServerPacket packet = new ServerPacket(350);
            packet.AppendUInt(User.GetClient().GetHabbo().Id);
            packet.AppendInt32(User.GetClient().GetHabbo().Tags.Count);

            foreach (string Tag in User.GetClient().GetHabbo().Tags)
            {
                packet.AppendStringWithBreak(Tag);
            }

            Session.SendPacket(packet);
        }
开发者ID:habb0,项目名称:uberEmu-stabilized,代码行数:27,代码来源:GetUserTagsMessageEvent.cs

示例13: parse

        public void parse(GameClient Session, ClientPacket Packet)
        {
            if (Session.GetHabbo().GetMessenger() == null)
            {
                return;
            }

            // Remove all = @f I H
            // Remove specific = @f H I <reqid>

            int Mode = Packet.PopWiredInt32();
            int Amount = Packet.PopWiredInt32();

            if (Mode == 0 && Amount == 1)
            {
                uint RequestId = Packet.PopWiredUInt();

                Session.GetHabbo().GetMessenger().HandleRequest(RequestId);
            }
            else if (Mode == 1)
            {
                Session.GetHabbo().GetMessenger().HandleAllRequests();
            }
            else { } // todo: remove breakpoint - eventually -, but leave for a while to make sure the structure is correct and this never happens
        }
开发者ID:habb0,项目名称:uberEmu-stabilized,代码行数:25,代码来源:DeclineBuddyMessageEvent.cs

示例14: OnTrigger

        public override void OnTrigger(GameClient Session, RoomItem Item, int Request, bool UserHasRights)
        {
            RoomUser User = Item.GetRoom().GetRoomUserByHabbo(Session.GetHabbo().Id);

            if (User == null)
            {
                return;
            }

            if (Item.GetRoom().TilesTouching(Item.X, Item.Y, User.X, User.Y))
            {
                if (Item.ExtraData != "-1")
                {
                    if (Request == -1)
                    {
                        Item.ExtraData = "0";
                        Item.UpdateState();
                    }
                    else
                    {
                        Item.ExtraData = "-1";
                        Item.UpdateState(false, true);
                        Item.ReqUpdate(4);
                    }
                }
            }
            else
            {
                User.MoveTo(Item.SquareInFront);
            }
        }
开发者ID:habb0,项目名称:uberEmu-stabilized,代码行数:31,代码来源:FurniInteractor.cs

示例15: parse

        public void parse(GameClient Session, ClientPacket Packet)
        {
            Room Room = UberEnvironment.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);

            if (Room == null || !Room.CheckRights(Session, true) || Room.Event == null)
            {
                return;
            }

            int _category = Packet.PopWiredInt32();
            string _name = UberEnvironment.FilterInjectionChars(Packet.PopFixedString());
            string _description = UberEnvironment.FilterInjectionChars(Packet.PopFixedString());
            int _count = Packet.PopWiredInt32();

            Room.Event.Category = _category;
            Room.Event.Name = _name;
            Room.Event.Description = _description;
            Room.Event.Tags = new List<string>();

            for (int i = 0; i < _count; i++)
            {
                Room.Event.Tags.Add(UberEnvironment.FilterInjectionChars(Packet.PopFixedString()));
            }

            Room.SendMessage(Room.Event.Serialize(Session));
        }
开发者ID:habb0,项目名称:uberEmu-stabilized,代码行数:26,代码来源:EditEventMessageEvent.cs


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