Cleaned up char server set online/offline/char select functions. (bugreport:1359)
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@12670 54d463be-8e91-2dee-dedb-b68131a5f0ec
This commit is contained in:
parent
155416f712
commit
21802ff355
@ -3,6 +3,8 @@ Date Added
|
||||
AS OF SVN REV. 5091, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO INTO TRUNK.
|
||||
IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
|
||||
|
||||
2008/04/28
|
||||
* Cleaned up char server set online/offline/char select functions. (r12670) [Kevin]
|
||||
2008/04/26
|
||||
* Added script function hasquest. [Kevin]
|
||||
* Fixed OnGuildBreak. [Kevin]
|
||||
|
@ -245,23 +245,27 @@ void set_char_online(int map_id, int char_id, int account_id)
|
||||
struct online_char_data* character;
|
||||
struct mmo_charstatus *cp;
|
||||
|
||||
if ( char_id != 99 ) {
|
||||
if( SQL_ERROR == Sql_Query(sql_handle, "UPDATE `%s` SET `online`='1' WHERE `char_id`='%d'", char_db, char_id) )
|
||||
Sql_ShowDebug(sql_handle);
|
||||
}
|
||||
//Update DB
|
||||
if( SQL_ERROR == Sql_Query(sql_handle, "UPDATE `%s` SET `online`='1' WHERE `char_id`='%d'", char_db, char_id) )
|
||||
Sql_ShowDebug(sql_handle);
|
||||
|
||||
//Check to see for online conflicts
|
||||
character = (struct online_char_data*)idb_ensure(online_char_db, account_id, create_online_char_data);
|
||||
if (online_check && character->char_id != -1 && character->server > -1 && character->server != map_id)
|
||||
{
|
||||
//char == 99 Won't happen anymore, call set_char_charselect to set user "on char server"
|
||||
ShowNotice("set_char_online: Character %d:%d marked in map server %d, but map server %d claims to have (%d:%d) online!\n",
|
||||
character->account_id, character->char_id, character->server, map_id, account_id, char_id);
|
||||
mapif_disconnectplayer(server[character->server].fd, character->account_id, character->char_id, 2);
|
||||
}
|
||||
|
||||
//Update state data
|
||||
character->char_id = char_id;
|
||||
character->server = map_id;
|
||||
|
||||
if( character->server > -1 )
|
||||
server[character->server].users++;
|
||||
|
||||
//Get rid of disconnect timer
|
||||
if(character->waiting_disconnect != -1) {
|
||||
delete_timer(character->waiting_disconnect, chardb_waiting_disconnect);
|
||||
character->waiting_disconnect = -1;
|
||||
@ -271,6 +275,7 @@ void set_char_online(int map_id, int char_id, int account_id)
|
||||
cp = (struct mmo_charstatus*)idb_get(char_db_,char_id);
|
||||
inter_guild_CharOnline(char_id, cp?cp->guild_id:-1);
|
||||
|
||||
//Notify login server
|
||||
if (login_fd > 0 && !session[login_fd]->flag.eof)
|
||||
{
|
||||
WFIFOHEAD(login_fd,6);
|
||||
|
Loading…
x
Reference in New Issue
Block a user