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


C# Client.SendResponse方法代码示例

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


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

示例1: ChatWithFriend

        private void ChatWithFriend(Client Client, Request Request)
        {
            int FriendId = Request.PopWiredInt32();

            if (!BrickEngine.GetMessengerHandler().HasFriend(Client.GetUser().HabboId, FriendId))
            {
                return;
            }

            BrickEmulator.HabboHotel.Users.Handlers.Messenger.Friend Friend = BrickEngine.GetMessengerHandler().GetFriend(Client.GetUser().HabboId, FriendId);

            if (Friend == null)
            {
                Response Respose = new Response(261);
                Respose.AppendInt32(6);
                Respose.AppendInt32(FriendId);
                Client.SendResponse(Respose);
                return;
            }

            if (Client.GetUser().Muted)
            {
                Response Respose = new Response(261);
                Respose.AppendInt32(4);
                Respose.AppendInt32(FriendId);
                Client.SendResponse(Respose);
                return;
            }

            if (Friend.IsAlive)
            {
                if (Friend.GetClient().GetUser().Muted)
                {
                    Response Respose = new Response(261);
                    Respose.AppendInt32(3);
                    Respose.AppendInt32(FriendId);
                    Client.SendResponse(Respose);
                }

                Response Response = new Response(134);
                Response.AppendInt32(Client.GetUser().HabboId);
                Response.AppendStringWithBreak(BrickEngine.CleanString(Request.PopFixedString()));

                Friend.GetClient().SendResponse(Response);
            }
            else
            {
                Response Respose = new Response(261);
                Respose.AppendInt32(5);
                Respose.AppendInt32(FriendId);
                Client.SendResponse(Respose);
            }
        }
开发者ID:devMextur,项目名称:BrickEmulator,代码行数:53,代码来源:Messenger.cs

示例2: GetEcotronInfo

 private void GetEcotronInfo(Client Client, Request Request)
 {
     Response Response = new Response(507);
     Response.AppendInt32(BrickEngine.GetEcotronReactor().GetTimerTime(Client.GetUser().HabboId));
     Response.AppendInt32(BrickEngine.GetEcotronReactor().GetTimeToWait(Client.GetUser().HabboId));
     Client.SendResponse(Response);
 }
开发者ID:devMextur,项目名称:BrickEmulator,代码行数:7,代码来源:Shop.cs

示例3: CreateRoom

        private void CreateRoom(Client Client, Request Request)
        {
            int Limit = BrickEngine.GetConfigureFile().CallIntKey("max.rooms.amount");
            int RoomAmount = BrickEngine.GetRoomReactor().GetMe(Client.GetUser().HabboId).Count;

            if (RoomAmount >= Limit)
            {
                Client.Notif("You're over the rooms limit, first delete a room before you create a new one.", false);
                return;
            }

            string RawName = Request.PopFixedString();
            string RawModel = Request.PopFixedString();

            int RoomId = -1;

            if ((RoomId = BrickEngine.GetRoomReactor().CreateRoom(Client, RawName, RawModel)) > 0)
            {
                Response Response = new Response(59);
                Response.AppendInt32(RoomId);
                Response.AppendStringWithBreak(BrickEngine.CleanString(RawName));
                Client.SendResponse(Response);
            }
            else
            {
                CheckRoomCreate(Client, null);
            }
        }
开发者ID:devMextur,项目名称:BrickEmulator,代码行数:28,代码来源:Navigator.cs

示例4: CheckRoomCreate

        private void CheckRoomCreate(Client Client, Request Request)
        {
            int Limit = BrickEngine.GetConfigureFile().CallIntKey("max.rooms.amount");
            int RoomAmount = BrickEngine.GetRoomReactor().GetMe(Client.GetUser().HabboId).Count;

            Response Response = new Response(512);
            Response.AppendBoolean(RoomAmount >= Limit);
            Response.AppendInt32(Limit);
            Client.SendResponse(Response);
        }
开发者ID:devMextur,项目名称:BrickEmulator,代码行数:10,代码来源:Navigator.cs

示例5: HandleTicket

        private void HandleTicket(Client Client, Request Request)
        {
            string Ticket = Request.PopFixedString();

            Client.ParseUser(BrickEngine.GetUserReactor().HandleTicket(Ticket));

            if (Client.IsValidUser)
            {
                if (BrickEngine.GetToolReactor().IsBanned(Client.GetUser().HabboId, Client.IPAddress))
                {
                    Client.Dispose();
                    return;
                }

                Response Userhash = new Response(439);
                Userhash.AppendStringWithBreak(Client.GetUser().Hash);
                Client.SendResponse(Userhash);

                Client.SendResponse(new Response(3));

                if (BrickEngine.GetConfigureFile().CallBooleanKey("welcomemessage.enabled"))
                {
                    Client.LongNotif(string.Empty);
                }

                Client.SendResponse(Client.GetUser().GetLoginResponse());

                Client.Authenticated = true;

                Client.SendResponse(BrickEngine.GetToolReactor().GetResponse(Client));
            }
            else
            {
                Client.Notif("Invalid Ticket, try again!", false);
                Client.Dispose();
            }
        }
开发者ID:devMextur,项目名称:BrickEmulator,代码行数:37,代码来源:Generic.cs

示例6: ClearLoading

        public void ClearLoading(Client Client, Boolean Reset)
        {
            if (Client.GetUser().IsInRoom)
            {
                Client.GetUser().RoomId = -1;
            }

            if (Client.GetUser().IsLoadingRoom)
            {
                Client.GetUser().PreparingRoomId = -1;
            }

            if (Reset)
            {
                Client.SendResponse(new Response(18));
            }
        }
开发者ID:devMextur,项目名称:BrickEmulator,代码行数:17,代码来源:Rooms.cs

示例7: GetEcotronPackage

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

            int ItemAmount = Request.PopWiredInt32();

            if (ItemAmount < 5 || ItemAmount > 5)
            {
                return;
            }

            var ItemList = new List<int>();

            for (int i = 0; i < ItemAmount; i++)
            {
                int ItemId = Request.PopWiredInt32();

                ItemList.Add(ItemId);
            }

            if (BrickEngine.GetEcotronReactor().GainReward(Client))
            {
                foreach (int ItemId in ItemList)
                {
                    BrickEngine.GetItemReactor().RemoveItem(ItemId);
                }

                Client.SendResponse(new Response(101));

                foreach (int ItemId in ItemList)
                {
                    using (QueryReactor Reactor = BrickEngine.GetQueryReactor())
                    {
                        Reactor.SetQuery("DELETE FROM items WHERE id = @itemid LIMIT 1");
                        Reactor.AddParam("itemid", ItemId);
                        Reactor.ExcuteQuery();
                    }
                }
            }
        }
开发者ID:devMextur,项目名称:BrickEmulator,代码行数:43,代码来源:Shop.cs

示例8: AcceptRequests

        private void AcceptRequests(Client Client, Request Request)
        {
            int Amount = Request.PopWiredInt32();

            for (int i = 0; i < Amount; i++)
            {
                int UserId = Request.PopWiredInt32();

                BrickEmulator.HabboHotel.Users.Handlers.Messenger.Friend Friend = new BrickEmulator.HabboHotel.Users.Handlers.Messenger.Friend(UserId);

                if (Friend.IsAlive)
                {
                    // Send Response (come online) >> Friend
                    Friend.GetClient().SendResponse(BrickEngine.GetMessengerHandler().GetStatusMessage(Friend.HabboId, Client.GetUser(), true));

                    // Send Response (come online) >> MySELF
                    Client.SendResponse(BrickEngine.GetMessengerHandler().GetStatusMessage(Client.GetUser().HabboId, Friend.GetClient().GetUser(), true));
                }

                BrickEngine.GetMessengerHandler().AcceptRequest(UserId, Client.GetUser().HabboId);
            }
        }
开发者ID:devMextur,项目名称:BrickEmulator,代码行数:22,代码来源:Messenger.cs

示例9: HandleSessionDetails

 private void HandleSessionDetails(Client Client, Request Request)
 {
     Response Response = new Response(257);
     Response.AppendInt32(9);
     Response.AppendBoolean(false);
     Response.AppendBoolean(false);
     Response.AppendBoolean(true);
     Response.AppendBoolean(true);
     Response.AppendInt32(3);
     Response.AppendBoolean(false);
     Response.AppendInt32(2);
     Response.AppendBoolean(false);
     Response.AppendInt32(4);
     Response.AppendBoolean(true);
     Response.AppendInt32(5);
     Response.AppendStringWithBreak("dd-MM-yyyy");
     Response.AppendInt32(7);
     Response.AppendBoolean(false);
     Response.AppendInt32(8);
     Response.AppendStringWithBreak("http://");
     Response.AppendInt32(9);
     Response.AppendBoolean(false);
     Client.SendResponse(Response);
 }
开发者ID:devMextur,项目名称:BrickEmulator,代码行数:24,代码来源:Generic.cs

示例10: GetBadges

        public void GetBadges(Client Client, Request Request)
        {
            var Badges = BrickEngine.GetBadgeHandler().GetBadgesForUser(Client.GetUser().HabboId);
            var Equiped = BrickEngine.GetBadgeHandler().GetEquipedBadges(Client.GetUser().HabboId);

            Response Response = new Response(229);
            Response.AppendInt32(Badges.Count);

            foreach (Badge Badge in Badges)
            {
                Response.AppendInt32(BrickEngine.GetBadgeHandler().GetIdForBadge(Badge.BadgeCode));
                Response.AppendStringWithBreak(Badge.BadgeCode);
            }

            Response.AppendInt32(Equiped.Count);

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

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

示例11: GetPrivates

 private void GetPrivates(Client Client, Request Request)
 {
     Client.SendResponse(BrickEngine.GetNavigatorManager().GetPrivateResponse());
 }
开发者ID:devMextur,项目名称:BrickEmulator,代码行数:4,代码来源:Navigator.cs

示例12: GetLastVisitedRooms

 private void GetLastVisitedRooms(Client Client, Request Request)
 {
     Client.SendResponse(BrickEngine.GetNavigatorManager().GetLastVisited(Client));
 }
开发者ID:devMextur,项目名称:BrickEmulator,代码行数:4,代码来源:Navigator.cs

示例13: SearchRooms

        private void SearchRooms(Client Client, Request Request)
        {
            string Query = string.Empty;

            if (Request.Length > 3)
            {
                Query = Request.PopFixedString();
            }

            Client.SendResponse(BrickEngine.GetNavigatorManager().GetSearchResponse(Query));
        }
开发者ID:devMextur,项目名称:BrickEmulator,代码行数:11,代码来源:Navigator.cs

示例14: PurchaseItem

        public void PurchaseItem(int Id, Client Client, string ExtraData, int PageId)
        {
            ShopItem Item = null;

            if ((Item = GetShopItem(Id)) == null)
            {
                return;
            }

            Boolean CreditsToLow = false;
            Boolean PixelsToLow = false;

            if (Client.GetUser().Credits < Item.CreditsCost)
            {
                CreditsToLow = true;
            }

            if (Client.GetUser().Pixels < Item.PixelsCost)
            {
                PixelsToLow = true;
            }

            if (CreditsToLow || PixelsToLow)
            {
                Response Response = new Response(68);
                Response.AppendBoolean(CreditsToLow);
                Response.AppendBoolean(PixelsToLow);
                Client.SendResponse(Response);
                return;
            }

            if (Item.CreditsCost > 0)
            {
                Client.GetUser().Credits -= Item.CreditsCost;
                Client.GetUser().UpdateCredits(true);
            }

            if (Item.PixelsCost > 0)
            {
                Client.GetUser().Pixels -= Item.PixelsCost;
                Client.GetUser().UpdatePixels(true);
            }

            if (!Item.GetBaseItem(Item.InternalItemIds[0]).InternalType.ToLower().Equals("e"))
            {
                if (Item.GetBaseItem(Item.InternalItemIds[0]).ExternalType.ToLower().Equals("membership"))
                {
                    Client.SendResponse(Item.GetPurchaseResponse(true));

                    ShopClubItem ClubItem = GetClubItem(Id);

                    if (Item == null)
                    {
                        return;
                    }

                    int Type = (ClubItem.MemberShipType.ToUpper() == "VIP") ? 1 : 0;
                    int Months = ClubItem.MonthsAmount;

                    BrickEngine.GetMembershipHandler().DeliverMembership(Client.GetUser().HabboId, Type, Months);

                    BrickEngine.GetPacketHandler().GetMembershipParams(Client, null);

                    Response Rights = new Response(2);

                    if (Client.GetUser().GetMembership() != null)
                    {
                        Rights.AppendInt32(Type + 1);
                    }
                    else
                    {
                        Rights.AppendInt32(0);
                    }

                    Client.SendResponse(Rights);

                    BrickEngine.GetAchievementReactor().UpdateUsersAchievement(Client, 8);
                    BrickEngine.GetAchievementReactor().UpdateUsersAchievement(Client, 9);
                }
                else
                {
                    if (Item.IsDeal)
                    {
                        var FloorItems = new List<int>();
                        var WallItems = new List<int>();

                        Client.SendResponse(Item.GetPurchaseResponse(false));

                        Response ShowItems = new Response(832);
                        ShowItems.AppendInt32(Item.InternalItemIds.Count);

                        for (int i = 0; i < Item.Amount; i++)
                        {
                            foreach (int ItemId in Item.InternalItemIds)
                            {
                                if (Item.GetBaseItem(ItemId).InternalType.ToLower().Equals("s"))
                                {
                                    FloorItems.Add(BrickEngine.GetItemReactor().InsertItem(Client.GetUser().HabboId, ItemId, ExtraData, -1));
                                }
                                else
//.........这里部分代码省略.........
开发者ID:devMextur,项目名称:BrickEmulator,代码行数:101,代码来源:ShopReactor.cs

示例15: GetPetInfo

        // 3001
        private void GetPetInfo(Client Client, Request Request)
        {
            if (!Client.GetUser().IsInRoom)
            {
                // Outside room placing FTW.
                return;
            }

            int PetId = Request.PopWiredInt32();

            if (PetId <= 0)
            {
                return;
            }

            PetInfo Info = BrickEngine.GetPetReactor().GetPetInfo(PetId);

            if (Info == null)
            {
                return;
            }

            Client.SendResponse(Info.GetInfoResponse());
        }
开发者ID:devMextur,项目名称:BrickEmulator,代码行数:25,代码来源:Rooms.cs


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