Thank you very much...
What I am trying to do is this:
1) Where the KillPlayer() function in Player.cpp is, I added a KickPlayer() function.
2)Then, I do a mysql query to add the guid into a database with a field 'deletenow' that equals 'delete'.
3) Then I do a Player::DeleteFromDB().
(all the above was where the state is 'just died'....where the KillPlayer() function is in Player.cpp)
4)Then I go into the Player::SaveToDB() function because I know it is called when the player is logged out, in the KickPlayer() function. I add an If statement which uses a mysql query to check to see if that player's GUID has a 'delete' in the field i said above.
5) If it does have the delete, then the mysql query to save the player is not executed and another mysql query deletes it from that 'deletenow' database. If it does not have delete, it is.
My problem is, I cannot figure out which type of query to use. I can only get one of these to happen, and I'm not sure how I'm doing that..:
1) The INSERT query executes and the character is deleted, but the second DELETE query does not execute, so the GUID for that player stays in the 'delete' database
OR
2) The GUID never shows up in the database, because, I believe, the SELECT statement the checks to see if the character is to be deleted happens after the DELETE statement is executed, therefore the character is not deleted.
Which types of queries should I use for the INSERT, SELECT, and DELETE queries? Remember, INSERT is called when character dies, SELECT in the 'SaveToDB' function, and DELETE at the end of the SaveToDB function.
Thank you very much,
Mike