Customizing some very specific things.
Re: Customizing some very specific things.
There is no call to just fully delete an account entirely. Front end management is not implemented or done at all by us, and is typically up to the server host to handle.
Look at the lobby server code to see what tables get created when an account is created.
Keep in mind if you do not clean up all the tables properly after deleting an account (and all characters linked to that account) you are going to get database errors or character mishaps that are unwanted.
There is a stored proc to cleanup character data (see triggers.sql) though which can help with part of the cleanup if you just want to kill the character and not the whole account.
Look at the lobby server code to see what tables get created when an account is created.
Keep in mind if you do not clean up all the tables properly after deleting an account (and all characters linked to that account) you are going to get database errors or character mishaps that are unwanted.
There is a stored proc to cleanup character data (see triggers.sql) though which can help with part of the cleanup if you just want to kill the character and not the whole account.
-
- Posts: 81
- Joined: Sat May 03, 2014 7:05 pm
Re: Customizing some very specific things.
Yes it is just the one character not the whole account I want to delete. That is all. There has to be code to delete a specific character, as this is something a client can do in the lobby. I'm pretty sure I can just copy paste that code (might have to import a library) into the code that detects homepoint packet.
Detect homepoint packet.
Detect player is dead.
Force log out the player.
Delete the player's character.
First 3 already coded in, it's the fourth one that I am having trouble finding, don't see any code labled or resembling where we delete player characters. Slowly making my way through it all though.
Edit: Found it -.-;
Detect homepoint packet.
Detect player is dead.
Force log out the player.
Delete the player's character.
First 3 already coded in, it's the fourth one that I am having trouble finding, don't see any code labled or resembling where we delete player characters. Slowly making my way through it all though.
Edit: Found it -.-;
Code: Select all
//delete char
uint32 ContentID = RBUFL(session[fd]->rdata, 0x1C);
uint32 CharID = RBUFL(session[fd]->rdata, 0x20);
ShowInfo(CL_WHITE"lobbyview_parse" CL_RESET":attempt to delete char:<" CL_WHITE"%d" CL_RESET"> from ip:<%s>\n", CharID, ip2str(sd->client_addr, NULL));
uint8 sendsize = 0x20;
LOBBY_ACTION_DONE(ReservePacket);
unsigned char hash[16];
md5(ReservePacket, hash, sendsize);
memcpy(ReservePacket + 12, hash, 16);
memcpy(session[fd]->wdata, ReservePacket, sendsize);
WFIFOSET(fd, sendsize);
RFIFOSKIP(fd, session[fd]->rdata_size);
RFIFOFLUSH(fd);
//Выполнение удаления персонажа из основных таблиц
//Достаточно удалить значение из таблицы chars, все остальное сделает mysql-сервер
const char *pfmtQuery = "DELETE FROM chars WHERE charid = %i AND accid = %i";
Sql_Query(SqlHandle, pfmtQuery, CharID, sd->accid);
break;
}
-
- Posts: 81
- Joined: Sat May 03, 2014 7:05 pm
Re: Customizing some very specific things.
Ok I guess literally I can just do
What is the easiest and fastest way to get a character's charid and accid from within the game?
Code: Select all
const char *pfmtQuery = "DELETE FROM chars WHERE charid = %i AND accid = %i";
Sql_Query(SqlHandle, pfmtQuery, CharID, AccID);
Re: Customizing some very specific things.
the map server doesn't have accid anywhere
CBaseEntity::id has the charid
CBaseEntity::id has the charid
-
- Posts: 81
- Joined: Sat May 03, 2014 7:05 pm
Re: Customizing some very specific things.
Looking at the character list in chars, every character has a unique ID anyways, right? Would
Do the job? Or would that give me issues in the future?
I'll try out this code and test if it works...
Code: Select all
const char *pfmtQuery = "DELETE FROM chars WHERE charid = %i";
Sql_Query(SqlHandle, pfmtQuery, Pchar->ID);
I'll try out this code and test if it works...
Code: Select all
case 0x0B: // homepoint
{
if (!PChar->isDead())
return;
const char *pfmtQuery = "DELETE FROM chars WHERE charid = %i";
Sql_Query(SqlHandle, pfmtQuery, PChar->id);
PChar->status = STATUS_SHUTDOWN;
PChar->pushPacket(new CServerIPPacket(PChar, 1));
-
- Posts: 81
- Joined: Sat May 03, 2014 7:05 pm
Re: Customizing some very specific things.
Ok, it works, also found the code to lower death timer from 60 misn to 2 mins. Taking off the skill cap on synthing levels was really easy, now I have one last big thing to figure out, and that's augments.
Re: Customizing some very specific things.
Keep in mind as I said before, the auto-homepoint bug still exists so people may never see that 2minute timer and just get deleted.
-
- Posts: 81
- Joined: Sat May 03, 2014 7:05 pm
Re: Customizing some very specific things.
I think I am fine with that, it's an annoyance but part of me doesn't even want to have a timer period.
Now, does anyone know of a good database that has a list of armor by ID? Or better yet, can I detect what slot an item is in the server?
I have no problem, but I would like to be able to detect if the piece of gear is say, a helm or sword or hand to hand or etc.
How hard is this to do? If there's a database of items sorted by ID then I can probably just do something like...
Since I am 99% sure ffxi sorts it's weapons by ID already, this brute force method should work, but if there already exists a cleaner method then that would save me a lot of work.
Now, does anyone know of a good database that has a list of armor by ID? Or better yet, can I detect what slot an item is in the server?
I have
Code: Select all
if (PItem->isType(ITEM_ARMOR)) {
How hard is this to do? If there's a database of items sorted by ID then I can probably just do something like...
Code: Select all
if (PItem->isType(ITEM_ARMOR)) {
uint16 armorID = PItem->getID;
if (armorID < 1) {
//its this slot
}
else if (armorID < 2) {
//its this slot
}
else (armorID < 3) {
//its this slot
}
else (armorID < 4) {
//its this slot
}
Re: Customizing some very specific things.
have you tried looking in item_armor.hmasterurat wrote:Or better yet, can I detect what slot an item is in the server?
-
- Posts: 81
- Joined: Sat May 03, 2014 7:05 pm
Re: Customizing some very specific things.
Thats exactly what I was looking for. Is SlotType or SlotID the one I want for detecting what type of armor it is?