コード例 #1
0
        private void AddFriend(Client Client, SiteRequest Request)
        {
            int FriendId = Request.PopInt32();

            if (FriendId <= 0 || FriendId == Request.GetUserId())
            {
                return;
            }

            BrickEngine.GetMessengerHandler().RequestUser(Request.GetUserId(), FriendId);
        }
コード例 #2
0
        private void AddUserToGroup(Client Client, SiteRequest Request)
        {
            int ItemId = Request.PopInt32();

            if (ItemId <= 0)
            {
                return;
            }

            int FriendId = Request.PopInt32();

            if (FriendId <= 0)
            {
                return;
            }

            int CategoryId = Request.PopInt32();

            if (CategoryId <= 0)
            {
                return;
            }

            BrickEngine.GetMessengerHandler().AddUserToGroup(ItemId, Request.GetUserId(), FriendId, CategoryId);
        }
コード例 #3
0
        private void UpdateMotto(Client Client, SiteRequest Request)
        {
            string Motto = BrickEngine.CleanString(Request.PopStringToEnd());

            if (Client.GetUser().Motto.Equals(Motto))
            {
                return;
            }

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

            BrickEngine.GetStreamHandler().AddStream(Request.GetUserId(), HabboHotel.Users.Handlers.Messenger.Streaming.StreamType.EditedMotto, Motto);
        }
コード例 #4
0
        private void RemoveUserFromGroup(Client Client, SiteRequest Request)
        {
            int ItemId = Request.PopInt32();

            if (ItemId <= 0)
            {
                return;
            }

            BrickEngine.GetMessengerHandler().RemoveUserFromGroup(ItemId, Request.GetUserId());
        }
コード例 #5
0
        private Client GainUserClient(SiteRequest Request)
        {
            if (!BrickEngine.GetUserReactor().IsOnline(Request.GetUserId()))
            {
                return null;
            }

            SocketClient Client = BrickEngine.GetSocketShield().GetSocketClientByHabboId(Request.GetUserId());

            if (Client == null || !Client.GetClient().IsValidUser)
            {
                return null;
            }

            return Client.GetClient();
        }
コード例 #6
0
        private void EditUserGroup(Client Client, SiteRequest Request)
        {
            int GroupId = Request.PopInt32();

            if (GroupId <= 0)
            {
                return;
            }

            string Name = BrickEngine.CleanString(Request.PopString());

            if (string.IsNullOrEmpty(Name))
            {
                return;
            }

            if (!Regex.IsMatch(Name, @"^[a-zA-Z]+$"))
            {
                return;
            }

            if (Name.Length > 32)
            {
                Name = Name.Substring(32);
            }

            BrickEngine.GetMessengerHandler().RenameGroup(GroupId, Request.GetUserId(), Name);
        }
コード例 #7
0
        private void DeleteUserGroup(Client Client, SiteRequest Request)
        {
            int GroupId = Request.PopInt32();

            if (GroupId <= 0)
            {
                return;
            }

            BrickEngine.GetMessengerHandler().DeleteGroup(GroupId, Request.GetUserId());
        }
コード例 #8
0
        private void DeleteFriend(Client Client, SiteRequest Request)
        {
            int FriendId = Request.PopInt32();

            if (FriendId <= 0 || FriendId == Request.GetUserId())
            {
                return;
            }

            if (!BrickEngine.GetMessengerHandler().HasFriend(Request.GetUserId(), FriendId))
            {
                return;
            }

            BrickEmulator.HabboHotel.Users.Handlers.Messenger.Friend Friend = BrickEngine.GetMessengerHandler().GetFriend(Request.GetUserId(), FriendId);

            if (Friend == null)
            {
                return;
            }

            if (Friend.IsAlive)
            {
                Response Response = new Response(13);
                Response.AppendBoolean(false);
                Response.AppendBoolean(true);
                Response.AppendInt32(-1);
                Response.AppendInt32(Request.GetUserId());

                Friend.GetClient().SendResponse(Response);
            }

            if (Client != null)
            {
                Response MyResponse = new Response(13);
                MyResponse.AppendBoolean(false);
                MyResponse.AppendBoolean(true);
                MyResponse.AppendInt32(-1);
                MyResponse.AppendInt32(FriendId);
                Client.SendResponse(MyResponse);
            }

            BrickEngine.GetMessengerHandler().DeleteFriend(Request.GetUserId(), FriendId);
        }