[PlusEMU] Emulator Development [UPDATED]

Status
Not open for further replies.

Paylee

Member
Feb 8, 2017
41
13
Sounds great. Sorry for asking, but have any idea when build3 will be released?


Sent from my iPhone using Tapatalk
 

Sledmore

Chaturbate Livestreamer
Staff member
FindRetros Moderator
Jul 24, 2010
5,194
3,901
Sounds great. Sorry for asking, but have any idea when build3 will be released?


Sent from my iPhone using Tapatalk

Hopefully tonight! (A good 10 hours).

I've pushed in room polls, hoping I can get someone to give them a look over as I seem to have no validation (on the client end) for selections etc, anyone know how this is handled? Can't find a poll on Habbo.

I've put (and moved existing SQL) into an SQLs/Release folder on the Git, so we can all keep up to date, those working on it. I've put the latest group forums SQL, room polls SQL & locale & server setting SQL in there, oh and staff picks.

Gonna maybe work on some other bits.
 
Just another heads up for those dev'ing, I added two new configuration options, well one is on behalf of @Damiens, he added a nice little check for scripters who change the release build.

game.revision=PRODUCTION-201701242205-837386173
game.legacy.figure_mutant=1

Now live in the config.ini, the first one will need to be updating as the SWF version gets updated, the second one is for using the older figure checker (you guys with custom figuredata/dodgy data will not have the issue). Just posting this here in advanced!
 
Small updates:
  • 'Improved' the football a little.
    • it'll no longer randomly move when it shouldn't (walking by it)
    • It'll now move 6 spaces on shoot, and 2 on dribble.
      • If anyone can fix the animation, that'd be great. I believe it sends 11 as extradata and the ObjectUpdataComposer.
  • 'Fixed' effects on purchase, the header was wrong and the type was set to 0 when it is now 1. These now work again on purchase.
 
Gonna work on HC now, I'll try and do it properly.
 

Calcium

Member
Jan 7, 2017
56
6
Hopefully tonight! (A good 10 hours).

I've pushed in room polls, hoping I can get someone to give them a look over as I seem to have no validation (on the client end) for selections etc, anyone know how this is handled? Can't find a poll on Habbo.

I've put (and moved existing SQL) into an SQLs/Release folder on the Git, so we can all keep up to date, those working on it. I've put the latest group forums SQL, room polls SQL & locale & server setting SQL in there, oh and staff picks.

Gonna maybe work on some other bits.
 
Just another heads up for those dev'ing, I added two new configuration options, well one is on behalf of @Damiens, he added a nice little check for scripters who change the release build.

game.revision=PRODUCTION-201701242205-837386173
game.legacy.figure_mutant=1

Now live in the config.ini, the first one will need to be updating as the SWF version gets updated, the second one is for using the older figure checker (you guys with custom figuredata/dodgy data will not have the issue). Just posting this here in advanced!
 
Small updates:
  • 'Improved' the football a little.
    • it'll no longer randomly move when it shouldn't (walking by it)
    • It'll now move 6 spaces on shoot, and 2 on dribble.
      • If anyone can fix the animation, that'd be great. I believe it sends 11 as extradata and the ObjectUpdataComposer.
  • 'Fixed' effects on purchase, the header was wrong and the type was set to 0 when it is now 1. These now work again on purchase.
 
Gonna work on HC now, I'll try and do it properly.

Thanks Craig!

Can you fix the wireds ?
 

Sledmore

Chaturbate Livestreamer
Staff member
FindRetros Moderator
Jul 24, 2010
5,194
3,901
Thanks Craig!

Can you fix the wireds ?

If you could provide me with a list I can give them ago, easier that way. :)
 
Question, get rid of the rare_id bullshit from `furniture` or not? (This is used to make rare items only go into the marketplace). Was a Habboon thing.
 

Steve123

Member
Feb 25, 2017
75
9
If you could provide me with a list I can give them ago, easier that way. :)
 
Question, get rid of the rare_id bullshit from `furniture` or not? (This is used to make rare items only go into the marketplace). Was a Habboon thing.
You mean is_rare? Yeah, it can go away. Please check the help and support page, I've got a fatal crash when you buy room bundles (some values aren't filled in with a zero or something else)
 

Steve123

Member
Feb 25, 2017
75
9
If you could provide me with a list I can give them ago, easier that way. :)
 
Question, get rid of the rare_id bullshit from `furniture` or not? (This is used to make rare items only go into the marketplace). Was a Habboon thing.
The blue ones aren't working properly (but they work). The ones who are not circled or crossed don't work / are not coded.
You must be registered for see images attach
 

Bjork

Member
Feb 7, 2012
73
29
Unfortunatly (imo) these days, wireds have become the most important element to attract people to his hotel. In mine, back in the past, they always asked everyday to add missing ones or to fix the broken ones :/
 

Damien

Don't need glasses if you can C#
Feb 26, 2012
425
638
Unfortunatly (imo) these days, wireds have become the most important element to attract people to his hotel. In mine, back in the past, they always asked everyday to add missing ones or to fix the broken ones :/
I had users complain there was a few missing wired, so I coded them all including leaderboards and they never get used haha.

I'll gladly make a commit for all of them, but I want to go over all the wired properly and handle a few things differently.
 

JynX

Posting Freak
Feb 6, 2016
710
438
A suggestion to something that was always a pain in my ass would have to be the way permission rights are sorted so if you have a right and a rank you have to add that right to each and every rank. I think it'd be cleaner and far easier to have it kind of like the command permissions where that rank or > can use that right so there isn't 230+ rows just for simple permissions ( )
 

Jerry

not rly active lol
Jul 8, 2013
1,956
522
A suggestion to something that was always a pain in my ass would have to be the way permission rights are sorted so if you have a right and a rank you have to add that right to each and every rank. I think it'd be cleaner and far easier to have it kind of like the command permissions where that rank or > can use that right so there isn't 230+ rows just for simple permissions ( )
The developer for my hotel re-did the code for permissions last night he said it was legit "so cancer". I'll post for the code for them in a bit.
 
Okay, so...

Go to GameClient.cs and remove this code:
Code:
PermissionGroup PermissionGroup = null;
                    if (PlusEnvironment.GetGame().GetPermissionManager().TryGetGroup(_habbo.Rank, out PermissionGroup))
                    {
                        if (!String.IsNullOrEmpty(PermissionGroup.Badge))
                            if (!_habbo.GetBadgeComponent().HasBadge(PermissionGroup.Badge))
                                _habbo.GetBadgeComponent().GiveBadge(PermissionGroup.Badge, true, this);
                    }

Go to Permission.cs and replace everything with this:
Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Plus.HabboHotel.Permissions
{
    public class Permission
    {
        #region Variables
        public string Right { get; set; }
        public int GroupId { get; set; }
        public int SubscriptionId { get; set; }
        #endregion

        #region Constructor
        public Permission(string Right, int GroupId, int SubscriptionId)
        {
            this.Right = Right;
            this.GroupId = GroupId;
            this.SubscriptionId = SubscriptionId;
        }
        #endregion
    }
}

Go to PermissionManager.cs and replace everything with this:
Code:
using System;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Collections.Generic;
using log4net;
using Plus.Database.Interfaces;
using System.Data;
using Plus.HabboHotel.Users;

namespace Plus.HabboHotel.Permissions
{
    public sealed class PermissionManager
    {
        #region Variables
        private static readonly ILog log = LogManager.GetLogger("Plus.HabboHotel.Permissions.PermissionManager");

        private readonly Dictionary<string, Permission> _commands;
        private readonly Dictionary<string, Permission> _permissions;
        #endregion

        public PermissionManager()
        {
            this._commands = new Dictionary<string, Permission>();
            this._permissions = new Dictionary<string, Permission>();
        }

        public void Init()
        {
            this._permissions.Clear();
            this._commands.Clear();

            using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor())
            {
                dbClient.SetQuery("SELECT * FROM `permissions_commands`");
                DataTable GetCommands = dbClient.GetTable();

                if (GetCommands != null)
                {
                    foreach (DataRow Row in GetCommands.Rows)
                    {
                         this._commands.Add(Convert.ToString(Row["command"]), new Permission(Convert.ToString(Row["command"]), Convert.ToInt32(Row["group_id"]), Convert.ToInt32(Row["subscription_id"])));
                    }
                }

                dbClient.SetQuery("SELECT * FROM `permissions_rights`");
                DataTable GetPermissions = dbClient.GetTable();

                if (GetPermissions != null)
                {
                    foreach (DataRow Row in GetPermissions.Rows)
                    {
                        this._permissions.Add(Convert.ToString(Row["right"]), new Permission(Convert.ToString(Row["right"]), Convert.ToInt32(Row["group_id"]), Convert.ToInt32(Row["subscription_id"])));
                    }
                }
            }

            log.Info("Loaded " + this._permissions.Count + " permissions.");
            log.Info("Loaded " + this._commands.Count + " permissions commands.");
        }

        public List<string> GetPermissionsForPlayer(Habbo Player)
        {
            return this._permissions.Where(x => Player.Rank >= x.Value.GroupId && Player.VIPRank >= x.Value.SubscriptionId).Select(x => x.Key).ToList();
        }

        public List<string> GetCommandsForPlayer(Habbo Player)
        {
            return this._commands.Where(x => Player.Rank >= x.Value.GroupId && Player.VIPRank >= x.Value.SubscriptionId).Select(x => x.Key).ToList();
        }
    }
}

Delete the following files:
  • PermissionCommand.cs
  • PermissionGroup.cs
That's all, feel free to commit these changes to the repo since I don't have access. o/
 
Oh, and here's the SQL:

Delete the tables:
  • permissions
  • permissions_groups
  • permissions_subscriptions
Code:
/*
Navicat MySQL Data Transfer

Source Server         : HoloRP
Source Server Version : 50505
Source Host           : localhost:3306
Source Database       : holo

Target Server Type    : MYSQL
Target Server Version : 50505
File Encoding         : 65001

Date: 2017-02-26 13:37:36
*/

SET FOREIGN_KEY_CHECKS=0;

-- ----------------------------
-- Table structure for permissions_rights
-- ----------------------------
DROP TABLE IF EXISTS `permissions_rights`;
CREATE TABLE `permissions_rights` (
  `right` varchar(45) NOT NULL DEFAULT '',
  `group_id` int(11) NOT NULL DEFAULT '1',
  `subscription_id` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`right`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- ----------------------------
-- Records of permissions_rights
-- ----------------------------
INSERT INTO `permissions_rights` VALUES ('all_groups_admin', '8', '0');
INSERT INTO `permissions_rights` VALUES ('all_groups_member', '7', '0');
INSERT INTO `permissions_rights` VALUES ('all_groups_owner', '9', '0');
INSERT INTO `permissions_rights` VALUES ('ambassador', '2', '0');
INSERT INTO `permissions_rights` VALUES ('bot_edit_any_override', '7', '0');
INSERT INTO `permissions_rights` VALUES ('bot_place_any_override', '7', '0');
INSERT INTO `permissions_rights` VALUES ('can_create_room', '7', '0');
INSERT INTO `permissions_rights` VALUES ('change_motto', '8', '0');
INSERT INTO `permissions_rights` VALUES ('corporation_rights', '5', '0');
INSERT INTO `permissions_rights` VALUES ('mod_alert', '4', '0');
INSERT INTO `permissions_rights` VALUES ('mod_ban_any', '4', '0');
INSERT INTO `permissions_rights` VALUES ('mod_caution', '4', '0');
INSERT INTO `permissions_rights` VALUES ('mod_disconnect_any', '7', '0');
INSERT INTO `permissions_rights` VALUES ('mod_kick', '4', '0');
INSERT INTO `permissions_rights` VALUES ('mod_mute', '4', '0');
INSERT INTO `permissions_rights` VALUES ('mod_mute_any', '6', '0');
INSERT INTO `permissions_rights` VALUES ('mod_soft_ban', '4', '0');
INSERT INTO `permissions_rights` VALUES ('mod_tickets', '4', '0');
INSERT INTO `permissions_rights` VALUES ('mod_tool', '4', '0');
INSERT INTO `permissions_rights` VALUES ('mod_trade_lock', '4', '0');
INSERT INTO `permissions_rights` VALUES ('mod_trade_lock_any', '6', '0');
INSERT INTO `permissions_rights` VALUES ('roleplay_corp_manager', '9', '0');
INSERT INTO `permissions_rights` VALUES ('room_any_owner', '8', '0');
INSERT INTO `permissions_rights` VALUES ('room_any_rights', '6', '0');
INSERT INTO `permissions_rights` VALUES ('room_ban_override', '0', '0');
INSERT INTO `permissions_rights` VALUES ('room_delete_any', '8', '0');
INSERT INTO `permissions_rights` VALUES ('room_enter_full', '0', '0');
INSERT INTO `permissions_rights` VALUES ('room_enter_locked', '0', '0');
INSERT INTO `permissions_rights` VALUES ('room_ignore_mute', '4', '0');
INSERT INTO `permissions_rights` VALUES ('room_item_place_exchange_anywhere', '6', '0');
INSERT INTO `permissions_rights` VALUES ('room_item_save_branding_items', '6', '0');
INSERT INTO `permissions_rights` VALUES ('room_item_take', '6', '0');
INSERT INTO `permissions_rights` VALUES ('room_item_use_any_stack_tile', '6', '0');
INSERT INTO `permissions_rights` VALUES ('room_item_wired_rewards', '1', '0');
INSERT INTO `permissions_rights` VALUES ('room_override_custom_config', '4', '0');
INSERT INTO `permissions_rights` VALUES ('room_trade_override', '4', '0');
INSERT INTO `permissions_rights` VALUES ('room_whisper_override', '4', '0');
INSERT INTO `permissions_rights` VALUES ('staff_ignore_advertisement_reports', '7', '0');
INSERT INTO `permissions_rights` VALUES ('staff_ignore_mod_alert', '7', '0');
INSERT INTO `permissions_rights` VALUES ('use_any_bubble', '5', '0');
INSERT INTO `permissions_rights` VALUES ('vip', '0', '1');
INSERT INTO `permissions_rights` VALUES ('word_filter_override', '7', '0');
 
Last edited:

Damien

Don't need glasses if you can C#
Feb 26, 2012
425
638
The permissions are far from "cancer". It allows you to allocate set functions for the various different ranks. Maybe you want to add a manager rank and don't want them to have all the moderation rights and vice versa.

If you're lazy you'd use them code above, but it's set up how it is for a reason.

Anyhow, there are areas for improvement and I'll take a look into it later tonight, without removing the functionality of what it's designed for.
 

Velaski

winner
Aug 4, 2015
562
165
Also, with permissions_commands, I didn't want to keep adding unto it. Instead of command_(command), I used command_user if it was a user command, command_vip, if the command was VIP. In the command cs file, just do this:

Code:
public string PermissionsRequired => "command_user";
And the query:
PHP:
INSERT INTO `permissions_commands` VALUES ('command_user', '1', '0');
This is just easy for when creating commands, I don'tneed to keep going into my database to add the command, when I can just reference command_user from my user commands and not need to enter the database at all. Your choice tho...
 

Haid

Member
Dec 20, 2011
363
448
The permissions are far from "cancer". It allows you to allocate set functions for the various different ranks. Maybe you want to add a manager rank and don't want them to have all the moderation rights and vice versa.

If you're lazy you'd use them code above, but it's set up how it is for a reason.

Anyhow, there are areas for improvement and I'll take a look into it later tonight, without removing the functionality of what it's designed for.
Agreed, would hate to see permissions "dumbed down" because it takes more than 2 seconds to set them up.
 

Sledmore

Chaturbate Livestreamer
Staff member
FindRetros Moderator
Jul 24, 2010
5,194
3,901
Hey,

Sorry stayed up for ~24 hours and legit died. Git is back up now, the box is 2 GB snd Gitlab seems to be a monster, I'm going to just assume it had a memory leak and caused err 500. I also locked myself out as I changed my SSH key, fun times. Hopefully I assigned my work iMac to it, so can have a look at it tomorrow.
 
Yeah, I understand the permissions are not the most appealing - but they're just simply done that way for the most flexibility, I'm pretty sure Matty did those, and probably due to Eubbo being so big - I also adapted those to use on Habboon, because it gave me the freedom of just assigning one value to one rank but not the other etc.
 
Ps, nice to see some activity in this thread, you guys made 2 pages while I was ko'd in bed!
 

Sledmore

Chaturbate Livestreamer
Staff member
FindRetros Moderator
Jul 24, 2010
5,194
3,901
Halting on this next release just for a couple more days, but have been working on a lot.

The current list, just strolling down the Git:
  • Added staff picks.
  • Fixed an issue with removing favourite groups.
  • Fixed a small exploit (changing revision) @Damiens
  • Improved validation on room settings (and also fixed the issue that caused it in the first place).
  • Added a configurable option for figuredata checking (you'll be able to use the old one which was issue free, just not as good).
  • Started work on the recycler (maybe got further not sure how he went with it) @Bjork
  • Major improvements to Item Interactions @Damiens
  • Added an option to alternate between basic and advanced SSO @Damiens
  • Group forums have been added, with the exception of unread messages. Will do this hopefully before release.
  • Fixed an issue where your picked up pet wouldn't go into your inventory until reload.
  • Added room polls (although I have no validation, any insights?)
  • Slight improvements to the football. It now shoots! (6 spaces), doesn't moving willy-nilly.
  • Updated AvatarEffectAddedComposer, you can now purchase effects from the catalog.
  • Marketplace packets were.. all wrong, my fault (this is from having no hotel for xx months).
  • Gamemap & room model loading improvements.
Just got a few little bits to finish, I have started on HC, just need to do gifts/badges etc. It is configurable, so you can turn it on/off.

As time goes on, I'm going to try and make most of the texts go from the server_locale table, and make the emulator more configurable for you guys, so it's easier to just get going without having to change too much.

Maybe give this till Wednesday for the release? Really suck at deadlines. :D
 

Calcium

Member
Jan 7, 2017
56
6
Halting on this next release just for a couple more days, but have been working on a lot.

The current list, just strolling down the Git:
  • Added staff picks.
  • Fixed an issue with removing favourite groups.
  • Fixed a small exploit (changing revision) @Damiens
  • Improved validation on room settings (and also fixed the issue that caused it in the first place).
  • Added a configurable option for figuredata checking (you'll be able to use the old one which was issue free, just not as good).
  • Started work on the recycler (maybe got further not sure how he went with it) @Bjork
  • Major improvements to Item Interactions @Damiens
  • Added an option to alternate between basic and advanced SSO @Damiens
  • Group forums have been added, with the exception of unread messages. Will do this hopefully before release.
  • Fixed an issue where your picked up pet wouldn't go into your inventory until reload.
  • Added room polls (although I have no validation, any insights?)
  • Slight improvements to the football. It now shoots! (6 spaces), doesn't moving willy-nilly.
  • Updated AvatarEffectAddedComposer, you can now purchase effects from the catalog.
  • Marketplace packets were.. all wrong, my fault (this is from having no hotel for xx months).
  • Gamemap & room model loading improvements.
Just got a few little bits to finish, I have started on HC, just need to do gifts/badges etc. It is configurable, so you can turn it on/off.

As time goes on, I'm going to try and make most of the texts go from the server_locale table, and make the emulator more configurable for you guys, so it's easier to just get going without having to change too much.

Maybe give this till Wednesday for the release? Really suck at deadlines. :D


Why have the boon.pw Habbo Club ?
This is your hotel and your emulator right ?
 

Sledmore

Chaturbate Livestreamer
Staff member
FindRetros Moderator
Jul 24, 2010
5,194
3,901
Why have the boon.pw Habbo Club ?
This is your hotel and your emulator right ?

I left Boon maybe 10 month ago now. However, I did their Habbo Club. Rather than copy & paste code, I can just start over and find a better approach.
 
Status
Not open for further replies.

Users who are viewing this thread

Top