Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

Habbo Badges Generator [PHP 7.0]

Newbie Spellweaver
Joined
Feb 16, 2013
Messages
14
Reaction score
10
Habbo Badges Generator for PHP 7.0 or higher.

Almost all hotels have a badge generator, created by me(you can see the credits) for get the group badges work. (AzureCMS has a custom based generator)

In a few days, PHP Group will release his new version 7.0, it's fine but there is 1 compatibily issue and that is the new version doesn't parse hex code from string to decimal, and you will get black images.

It can be easily fixed adding hex2bin, but I prefered to improve the code a little, and now it's about 30% more faster.

This version only works for PHP 7.0

DOWNLOADS

https://github.com/XdrAzure/hbg

REQUIREMENTS

- PHP 7.0 or higher.

TUTORIAL

If you have already a Generator, just only remplaze badge.php in habbo-imaging.
If not, put all habbo-imaging content.

MY OTHER PROGRAMS

Azure Habbo Scout V4: https://forum.ragezone.com/f353/azure-habbo-scout-r4-developers-1062156/
Azure Habbo Files Extractor: https://forum.ragezone.com/f353/azure-habbo-files-extractor-r4-1061609/
Azure Habbo Packets Updater: https://forum.ragezone.com/f353/ahpu-azure-habbo-packets-updater-1081884/

CREDITS

Me (Xdr)
Original creators
Jaym/Kreechin (HoloCMS)


If I helped you a lot, you can donate me in PP: xdr@outlook.es
You have a good day :)
 
Newbie Spellweaver
Joined
Feb 16, 2013
Messages
14
Reaction score
10
"This version only works for PHP 7.0"

How is this usefull? PHP 7.0 shouldn't even be used in production mode and isn't finished yet, there's no stable release
I know.

In a few days, PHP Group will release his new version 7.0

Let's say... this is anticipation for day-1 release, imagine that day I can't post, and one hotel updates to PHP 7, so he doesn't needs to wait :)
 
Experienced Elementalist
Joined
Jul 14, 2012
Messages
244
Reaction score
147
I know.



Let's say... this is anticipation for day-1 release, imagine that day I can't post, and one hotel updates to PHP 7, so he doesn't needs to wait :)

I wouldn't recommend any website or hotel to update to php 7 as soon as it's released, I myself will also wait a few months, maybe longer untill I'm sure most bugs or exploits are gone
 
Junior Spellweaver
Joined
May 21, 2011
Messages
154
Reaction score
47
Why are you using the 'goto' statement if the only thing you had to do is just removing the exclamation mark in the 'if' statement? AND tell me why you are mixing alternative syntax with traditional syntax!? ( talking about the if, else, while, for(each) statements )
 
Newbie Spellweaver
Joined
Feb 16, 2013
Messages
14
Reaction score
10
Why are you using the 'goto' statement if the only thing you had to do is just removing the exclamation mark in the 'if' statement? AND tell me why you are mixing alternative syntax with traditional syntax!? ( talking about the if, else, while, for(each) statements )
1. About 'goto': I prefer that than if(...) { if(...) { if(...) { }}}. There aren't performance issues.
2. Where? There are only traditional syntax.
 
Newbie Spellweaver
Joined
Jun 24, 2012
Messages
71
Reaction score
14
Hi I've been using this Generator, and it was giving me blank images, only on BASES, I read the file and I noticed this:

Can someone explain me this line:

$partKey = substr($partCode, 0, (strlen($partCode) == 6 || (!$isSymbol && strlen($partCode) == 5)) ? 3 : 2);

Why ( (strlen($partCode) == 6 || (!$isSymbol && strlen($partCode) == 5)) ? 3 : 2)?

Why 3? I solved the base problem by just using 2, why would you take 3 chars
 
Newbie Spellweaver
Joined
Feb 16, 2013
Messages
14
Reaction score
10
Hi I've been using this Generator, and it was giving me blank images, only on BASES, I read the file and I noticed this:

Can someone explain me this line:

$partKey = substr($partCode, 0, (strlen($partCode) == 6 || (!$isSymbol && strlen($partCode) == 5)) ? 3 : 2);

Why ( (strlen($partCode) == 6 || (!$isSymbol && strlen($partCode) == 5)) ? 3 : 2)?

Why 3? I solved the base problem by just using 2, why would you take 3 chars
I followed Habbo standard, when Habbo had 'Habbo group pages', the badge editor(web) only had 2 length, and then they released client inside badge editor, that have 2-3 length partKey and working together (compatibility).

I think your problem is your emulator that you are using generating non-standard codes or you are using diferent database group codes.

I suggest use this code:

Code:
        public string GenerateGuildImage(ClientMessage message)        {
            var count = message.ReadIntegerPositiveOrNeutral();
            if (count < 2)
                throw new Exception("Not valid habbo value");


            string badgeCode = "b";


            for (var i = 1; i != count + 1; i++)
            {
                var integer = message.ReadIntegerPositiveOrNeutral();


                if (i%3 == 0)
                {
                    if (integer > 0 && i != 3)
                        badgeCode += integer;
                }
                else
                    badgeCode += $"{integer:00}";


                if (i != count && i % 3 == 0)
                    badgeCode += "s";
            }


            return badgeCode;
        }
 
Back
Top