Hi there.
I tried to fix the Char Overwrite bug today, kinda not successful. A player told me there are two ways of doing it:
Logging in a deleted character and just creating a new one at a certain slot, done via CE.
So far I've managed to block deleted characters.
When it comes to just creating a new character, the already released fixes don't seem to work for this.
I've googled a bit and found these SQL changes by Sedrika, Pumaa and Twilight:
For some reason, I still get fError = 1 when the player creates the character. From my understanding, it should check for the taken slot. However, it doesn't.
Another thing I came up with was:
This kinda worked, but the player went afk, so I couldnt test his way of doing it.
I also tried doing something in the code, it's more or less the same check, I just wanted to make sure.
If I now go to the creation screen on my account, restore the deleted character in that slot via DB and try to create a character, I successfully get fError = 2.
Question: Are there more checks neccessary or can this be bypassed?
Thanks in advance.
I tried to fix the Char Overwrite bug today, kinda not successful. A player told me there are two ways of doing it:
Logging in a deleted character and just creating a new one at a certain slot, done via CE.
So far I've managed to block deleted characters.
When it comes to just creating a new character, the already released fixes don't seem to work for this.
I've googled a bit and found these SQL changes by Sedrika, Pumaa and Twilight:
Code:
BEGIN if exists(select playerslot from CHARACTER_TBL where account = lower(@iaccount) and playerslot = 0 and isblock = 'F') if exists(select playerslot from CHARACTER_TBL where account = lower(@iaccount) and playerslot = 1 and isblock = 'F') if exists(select playerslot from CHARACTER_TBL where account = lower(@iaccount) and playerslot = 2 and isblock = 'F') begin select fError = '0', fText = 'Slot taken!' return end declare [MENTION=4037112]I1_[/MENTION]cnt int select [MENTION=4037112]I1_[/MENTION]cnt = count(*) from CHARACTER_TBL where account = @iaccount and isblock = 'F' if [MENTION=4037112]I1_[/MENTION]cnt > 2 begin SELECT fError = '0', fText = 'Too many chars!' RETURN end
Another thing I came up with was:
Code:
DECLARE [MENTION=303108]slot[/MENTION]counter int SELECT [MENTION=303108]slot[/MENTION]counter = count(playerslot) from CHARACTER_TBL where account = lower(@iaccount) and playerslot = [MENTION=2476276]iPlayer[/MENTION]slot and isblock ='F' if [MENTION=303108]slot[/MENTION]counter != 0 begin select fError = '2', fText = 'Slot taken!' return end
I also tried doing something in the code, it's more or less the same check, I just wanted to make sure.
Code:
sprintf(szQuery1337, "SELECT [isblock] FROM CHARACTER_01_DBF.dbo.CHARACTER_TBL WHERE [playerslot] = %d AND [isblock] = 'F' AND [account] = '%s'", nSlot, lpDbOverlappedPlus->AccountInfo.szAccount);
if (FALSE == qry->Exec(szQuery1337))
{
WriteLog("%s, %d\r\n\t%s", __FILE__, __LINE__, szQuery1337);
FreeRequest(lpDbOverlappedPlus);
return;
}
if (qry->Fetch())
{
if (lpDbOverlappedPlus->AccountInfo.szAccount)
{
WriteLog("Duplication of Character found!");
BanAccount(qry, lpDbOverlappedPlus, szAccName);
}
}
Question: Are there more checks neccessary or can this be bypassed?
Thanks in advance.