//37 - "MESSENGER_ACCEPTBUDDY": "@e"
        public void Listener37()
        {
            int userid = ArgumentEncoding.decodeInt(mPacketBody);

            InstanceManager.Game.Messenger.AcceptBuddy(mUserInfo.userId, userid);
            Listener15();
        }
Exemplo n.º 2
0
        //158 - "SETBADGE": "B^"
        public void Listener158()
        {
            int    badgeLen = Base64Encoding.DecodeInt(mPacketBody.Substring(0, 2));
            string badge    = mPacketBody.Substring(2, badgeLen);

            if (ArgumentEncoding.decodeInt(mPacketBody.Substring(mPacketBody.Length - 1, 1)) == 1)
            {
                if (mUserInfo.Badges.Contains(badge))
                {
                    mUserInfo.sBadge = badge;
                }
            }
            else
            {
                if (mUserInfo.sBadge == badge)
                {
                    mUserInfo.sBadge = "";
                }
            }

            InstanceManager.Game.Users.SetBadge(mUserInfo.userId, mUserInfo.sBadge);

            mUserInfo = InstanceManager.Game.Users.GetUser(mUserInfo.userId);

            mMessage.Init(228); //Cd
            mMessage.appendArgumentInt(mRoomInstance.GetUser(mSessionID).RoomUserID);
            mMessage.appendString(mUserInfo.sBadge);
            mMessage.appendChar(2);
            mRoomInstance.RoomBroadcast(mMessage);
        }
        //198 - "CHANGECALLCATEGORY": "CF"
        public void Listener198()
        {
            string payload  = FuseMessage.getArgument(1, mPacketBody);
            int    callId   = ArgumentEncoding.decodeInt(payload);
            int    priority = ArgumentEncoding.decodeInt(mPacketBody.Substring(payload.Length + 2));

            InstanceManager.Game.Moderation.UpgradeCFH(callId, priority, mUserInfo);
        }
        //199 - "MESSAGETOCALLER": "CG"
        public void Listener199()
        {
            int    callId  = ArgumentEncoding.decodeInt(FuseMessage.getArgument(1, mPacketBody));
            string message = FuseMessage.getArgument(2, mPacketBody);

            message = SpecialFiltering.FilterChars("2,9", message);
            InstanceManager.Game.Moderation.ReplyCallForHelp(callId, message, mUserInfo);
        }
Exemplo n.º 5
0
        //155 - "REMOVEALLRIGHTS": "B["
        public void Listener155()
        {
            int      roomId = ArgumentEncoding.decodeInt(mPacketBody);
            RoomInfo info   = InstanceManager.Game.Rooms.GetRoom(roomId);

            if (mUserInfo.userId == info.RoomOwner)
            {
                InstanceManager.Game.Rooms.DeleteAllRights(roomId);
            }
        }
Exemplo n.º 6
0
 private void btnArgDecode_Click(object sender, EventArgs e)
 {
     try
     {
         txtArgOutput.Text = ArgumentEncoding.decodeInt(txtArgInput.Text).ToString();
     }
     catch
     {
         MessageBox.Show("Invalid input.");
     }
 }
        //40 - "MESSENGER_REMOVEBUDDY": "@h"
        public void Listener40()
        {
            int userid = ArgumentEncoding.decodeInt(mPacketBody.Substring(1));

            InstanceManager.Game.Messenger.DeleteBuddy(mUserInfo.userId, userid);

            mMessage.Init(138); //BJ
            mMessage.appendArgumentInt(1);
            mMessage.appendArgumentInt(userid);
            SendMessage(mMessage);
        }
Exemplo n.º 8
0
        //150 - NAVIGATE": "BV"
        public void Listener150()
        {
            int    hideFull = ArgumentEncoding.decodeInt(mPacketBody.Substring(0, 1));
            string navId    = mPacketBody.Substring(1);

            navId = navId.Substring(0, navId.Length - 1);
            int navCat = ArgumentEncoding.decodeInt(navId);

            mMessage.Init(220); //C\
            mMessage.appendString(InstanceManager.Game.Navigator.GetNavigatorResponse(navCat, hideFull, mUserInfo));
            SendMessage(mMessage);
        }
Exemplo n.º 9
0
        //152 - "GETFLATCAT": "BX"
        public void Listener152()
        {
            int      roomId = ArgumentEncoding.decodeInt(mPacketBody);
            RoomInfo info   = InstanceManager.Game.Rooms.GetRoom(roomId);

            if (info != null)
            {
                mMessage.Init(222); //C^
                mMessage.appendString(ArgumentEncoding.encodeInt(info.RoomID));
                mMessage.appendString(ArgumentEncoding.encodeInt(info.RoomCategory));
                SendMessage(mMessage);
            }
        }
Exemplo n.º 10
0
        //38 - "MESSENGER_DECLINEBUDDY": "@f"
        public void Listener38()
        {
            if (ArgumentEncoding.decodeInt(mPacketBody.Substring(1)) == 0)
            {
                InstanceManager.Game.Messenger.RejectAllBuddys(mUserInfo.userId);
            }
            else
            {
                int userid = ArgumentEncoding.decodeInt(mPacketBody.Substring(1));

                InstanceManager.Game.Messenger.RejectBuddy(mUserInfo.userId, userid);
            }
        }
Exemplo n.º 11
0
        //154 - "GETSPACENODEUSERS": "BZ"
        public void Listener154()
        {
            int    roomId  = ArgumentEncoding.decodeInt(mPacketBody);
            string payload = "";

            if (InstanceManager.Game.Rooms.InstanceExists(roomId))
            {
                payload = InstanceManager.Game.Rooms.GetRoomInstance(roomId).UserList;
            }

            mMessage.Init(223); //C_
            mMessage.appendString(payload);
            SendMessage(mMessage);
        }
Exemplo n.º 12
0
        //153 - "SETFLATCAT": "BY"
        public void Listener153()
        {
            int          roomId = ArgumentEncoding.decodeInt(mPacketBody);
            int          catId  = ArgumentEncoding.decodeInt(mPacketBody.Substring(ArgumentEncoding.getLength(roomId)) + 1);
            RoomInfo     info   = InstanceManager.Game.Rooms.GetRoom(roomId);
            RoomCategory cat    = InstanceManager.Game.Rooms.GetCategory(catId);

            if (info != null && cat != null)
            {
                if (cat.PlayerCategory)
                {
                    info.RoomCategory = catId;
                    InstanceManager.Game.Rooms.UpdateRoom(info);
                }
            }
        }
Exemplo n.º 13
0
        //18 - "ADD_FAVORITE_ROOM": "@S"
        public void Listener19()
        {
            int        roomId   = ArgumentEncoding.decodeInt(mPacketBody.Substring(1));
            List <int> favRooms = InstanceManager.Game.Users.GetFavouriteRooms(mUserInfo.userId);

            if (favRooms.Count < int.Parse(Users.UserSettings.MaxFavouriteRooms))
            {
                if (!favRooms.Contains(roomId))
                {
                    InstanceManager.Game.Users.AddFavouriteRoom(mUserInfo.userId, roomId);
                }
            }
            else
            {
                ReportError("nav_error_toomanyfavrooms", false);
            }
        }
Exemplo n.º 14
0
        private void DoBan()
        {
            string banReason = FuseMessage.getArgument(1, mPayload);
            string banExtra  = FuseMessage.getArgument(2, mPayload);
            string banUser   = FuseMessage.getArgument(3, mPayload);
            string banLast   = mPayload.Substring(FuseMessage.getArgumentEnd(3, mPayload));

            int  banHours   = ArgumentEncoding.decodeInt(banLast);
            bool banIp      = ArgumentEncoding.decodeInt(banLast.Substring(ArgumentEncoding.getLength(banHours) + 1)) > 0;
            bool banMachine = ArgumentEncoding.decodeInt(banLast.Substring(ArgumentEncoding.getLength(banHours))) > 0;

            long targetSession = InstanceManager.Sessions.GetSessionFromUser(banUser);

            if (targetSession != -1)
            {
                UserInfo user = InstanceManager.Sessions.GetSession(targetSession).mUserInfo;
                InstanceManager.Game.Moderation.ModeratorBan(null, user.userId, mUserInfo.userId, banReason, banHours, targetSession, mSessionID, banMachine, banIp, banExtra);
            }
        }
Exemplo n.º 15
0
        //200 - "MODERATIONACTION": "CH"
        public void Listener200()
        {
            int commandCat = ArgumentEncoding.decodeInt(mPacketBody.Substring(0, 1));
            int commandId  = ArgumentEncoding.decodeInt(mPacketBody.Substring(1, 1));

            mPayload = mPacketBody.Substring(2);

            //User Command
            if (commandCat == 0)
            {
                switch (commandId)
                {
                case 0:     //Alert
                    DoAlert();
                    break;

                case 1:     //Kick
                    DoKick();
                    break;

                case 2:     //Ban
                    DoBan();
                    break;
                }
            }

            //Room Command
            if (commandCat == 1)
            {
                switch (commandId)
                {
                case 0:     //Room Alert
                    DoRoomAlert();
                    break;

                case 1:     //Room Kick
                    DoRoomKick();
                    break;
                }
            }
        }
Exemplo n.º 16
0
        //2 - "room_directory": "@B"
        public void Listener2()
        {
            int roomId = InstanceManager.Sessions.GetSession(mSessionID).mRoomID;

            if (roomId != 0)
            {
                InstanceManager.Game.Rooms.GetRoomInstance(roomId).RemoveUser(mSessionID);
            }

            int requestType = Base64Encoding.DecodeInt(mPacketBody.Substring(0, 1));

            roomId = ArgumentEncoding.decodeInt(mPacketBody.Substring(1));

            mMessage.Init(19); //@S
            SendMessage(mMessage);

            if (requestType == 1) // Public
            {
                enterRoom(roomId, false);
            }
        }
Exemplo n.º 17
0
 //93 - "DANCE": "A]"
 public void Listener93()
 {
     if (!mRoomInstance.HasUniqueStatus(mSessionID, "sit") && !mRoomInstance.HasUniqueStatus(mSessionID, "lay") && !mRoomInstance.HasUniqueStatus(mSessionID, "swim"))
     {
         if (mPacketBody.Length == 0)
         {
             mRoomInstance.RemoveUniqueStatuses(mSessionID, "");
             ApplyUniqueStatus("dance", 0, null, true, 0, 0, null);
         }
         else
         {
             if (InstanceManager.Game.Roles.HasRight(mUserInfo.iRole, "fuse_use_club_dance"))
             {
                 int danceId = ArgumentEncoding.decodeInt(mPacketBody);
                 if (danceId >= 0 && danceId <= 4)
                 {
                     mRoomInstance.RemoveUniqueStatuses(mSessionID, "");
                     ApplyUniqueStatus("dance", 0, danceId.ToString(), true, 0, 0, null);
                 }
             }
         }
     }
 }
Exemplo n.º 18
0
        //19 - "DEL_FAVORITE_ROOM": "@T"
        public void Listener20()
        {
            int roomId = ArgumentEncoding.decodeInt(mPacketBody.Substring(1));

            InstanceManager.Game.Users.DeleteFavouriteRoom(mUserInfo.userId, roomId);
        }
Exemplo n.º 19
0
        //190 - "SCR_BUY": "B~"
        public void Listener190()
        {
            if (FuseMessage.getArgument(1, mPacketBody) == "club_habbo")
            {
                int months       = 0;
                int deduct       = 9999;
                int purchaseType = ArgumentEncoding.decodeInt(mPacketBody.Substring(12));
                if (purchaseType == 1)
                {
                    deduct = 25;
                    months = 1;
                }
                if (purchaseType == 2)
                {
                    deduct = 60;
                    months = 3;
                }
                if (purchaseType == 3)
                {
                    deduct = 105;
                    months = 6;
                }

                if (mUserInfo.iCredits - deduct >= 0)
                {
                    mUserInfo.iCredits -= deduct;
                    for (int i = 1; i <= months; i++)
                    {
                        if (mUserInfo.ClubDaysRemaining == 0)
                        {
                            mUserInfo.ClubDaysRemaining = 31;
                        }
                        else
                        {
                            mUserInfo.ClubMonthsRemaining++;
                        }
                        if (mUserInfo.iRole == int.Parse(Users.UserSettings.DefaultRole))
                        {
                            mUserInfo.iRole = int.Parse(Users.UserSettings.ClubRole);
                        }
                    }
                    mUserInfo.ClubLastUpdate = DateTime.Now;

                    InstanceManager.Game.Users.UpdateUser(mUserInfo);
                    mUserInfo = InstanceManager.Game.Users.GetUser(mUserInfo.userId);

                    mMessage.Init(2); //@B
                    mMessage.appendString(InstanceManager.Game.Roles.GenerateRightsList(mUserInfo.iRole));
                    SendMessage(mMessage);

                    mMessage.Init(8); //@H
                    mMessage.appendString(Settings.ClientClubAllowedSets);
                    SendMessage(mMessage);

                    mMessage.Init(6); //@F
                    mMessage.appendString(mUserInfo.iCredits.ToString() + ".0");
                    SendMessage(mMessage);

                    mMessage.Init(7); //@G
                    mMessage.appendString("club_habbo");
                    mMessage.appendChar(2);
                    mMessage.appendArgumentInt(mUserInfo.ClubDaysRemaining);
                    mMessage.appendArgumentInt(mUserInfo.ClubMonthsPassed);
                    mMessage.appendArgumentInt(mUserInfo.ClubMonthsRemaining);
                    mMessage.appendArgumentInt(1);
                    SendMessage(mMessage);

                    mMessage.Init(229); //Ce
                    int badgeCount = InstanceManager.Game.Roles.GetBadgeCount(mUserInfo.iRole);
                    mMessage.appendString(ArgumentEncoding.encodeInt(badgeCount));
                    if (badgeCount > 0)
                    {
                        mMessage.appendString(InstanceManager.Game.Roles.GenerateBadgeList(mUserInfo.iRole));
                        mUserInfo.Badges = InstanceManager.Game.Roles.GetBadges(mUserInfo.iRole);
                    }
                    mMessage.appendString("HH");
                    SendMessage(mMessage);
                }
            }
        }
Exemplo n.º 20
0
        //48 - "PICK_CRYFORHELP": "@p"
        public void Listener48()
        {
            int callId = ArgumentEncoding.decodeInt(FuseMessage.getArgument(1, mPacketBody));

            InstanceManager.Game.Moderation.PickupCallForHelp(callId, mUserInfo);
        }