
Originally Posted by
XxMurphyxX
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;
}