Well, I can tell why now. This is actually my first time to know that killing monsters gets your guild skill points too
Well, that makes my fix in-fluent, I have done modifications to allow you to donate if the GP is already minus. You can decrease GP limit to "0x6FFFFFFF", but you'll still catch the bug later. You'll need to modify game server at this case, apparently, game server needs couple of patches anyways.
I'll have a look and maybe update the topic with game server modification instead of sro client.
Most of you should've faced this bug already, the bug is basically because joymax did not limit guild skill points or even make it unsigned.
The first thing that crossed my mind was doing it through game server, I did it actually but after testing in a live server, it actually caused a disconnect problem. Then I realized that it was because the value stored in the game server that I modified was fine, but SQL was not
I actually still could do it through game server, but a better idea crossed my mind, why don't we do it through sro client instead!
So, basically this limits guild point donation to provide positive values only. However, the bug can still occur if somebody donates with a packet injector unless you fix it in server-side too, but anyways who wants to harm himself with minus GP? Client-side shall be enough.
CInterfaceNetSender.h:
Code:
#pragma once
#include <iostream>
class CInterfaceNetSender
{
private:
char pad_0000[8504]; //0x0000
unsigned int GuildSkillPoints; //0x2138
char pad_2140[8]; //0x213C
std::wstring GuildName; //0x2140
std::wstring CharName; //0x2160
public:
void DonateGuildPoints(unsigned int GP);
};
CInterfaceNetSender.cpp:
Code:
#define GP_LIMIT 0x7FFFFFFF
void CInterfaceNetSender::DonateGuildPoints(unsigned int GP)
{
if (GuildSkillPoints == GP_LIMIT)
{
CGInterface* g_interface = CGInterface::GetInterface();
if (g_interface)
{
g_interface->HandleSystemMessages(1, L"You have reached maximum limit of guild skills points.");
g_interface->ShowBlueNotify(L"You have reached maximum limit of guild skills points.");
}
}
else
{
unsigned int TotalGP = GuildSkillPoints + GP;
if (TotalGP > GP_LIMIT && GuildSkillPoints < GP_LIMIT)
GP = GP_LIMIT - GuildSkillPoints;
reinterpret_cast<void(__thiscall*)(CInterfaceNetSender*, unsigned int)>(0x0081FAB0)(this, GP);
}
}
Hi #HB
Goodwork, i can't donate when reach limit but How to stop gain GP on training?
Well, I kinda forgot about this topic. The content of this thread is kinda useless since the bug still occurs by time, so I'll have a look today to create some codecave script in game server to limit the GP.
As the topic went, apparently my client hotfix won't work because GP is increased on killing monsters too.
I've implemented a server files patch since its the only way to fix this annoying bug in SRO files.
I posted before the game server fix, and I declared after testing the game server patch only that it causes disconnect issues and database isn't affected by the patch and stays minus.
I've scanned both GS and shard manager memories and found out that shard manager is the one responsible for modifying database value and also has stored memory for guilds instances just like GS.
So, I applied a patch for shard manager too, and it seems to be working fine now, SQL and memory values are equivalent. I'm gonna be testing it in a live productive server and posting a feedback whether there were any errors or issues after applying both GS and shard manager patches.
How The Patch Works: It basically prevents GP from exceeding maximum integer value (2147483647 | 7FFFFFFF).
Patch Details:
Using the GP reference in GS/SM, I've hooked where GP is modified, and did some conditions to check if GP exceeded INT_MAX (aka went minus), then will re-set it to INT_MAX.
Note: Please make sure your apply both GS and SM patches, otherwise you'll have some trouble going in.
After exploring, it seemed like a normal message that I had to skip, but in case of GP intended donation, shard manager needs to respond to game server, otherwise user will be frozen for 10 ~ 15 seconds.
So anyways, I handled both cases and modified the old shard manager patch, this is probably the last patch to maintain this original bug.
Download: Shard manager patch has been updated in main post.