diff options
author | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-09-22 13:53:54 +0000 |
---|---|---|
committer | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-09-22 13:53:54 +0000 |
commit | 2cbdcbe50c2f34b70cc39c8973ae5b051d304577 (patch) | |
tree | a156bd6e62705182a5c30c65fbdaaf8a8d6cfdf7 /src | |
parent | 12a64513a5a7eee6d1cd1cd48c82313d7f157c46 (diff) | |
download | hercules-2cbdcbe50c2f34b70cc39c8973ae5b051d304577.tar.gz hercules-2cbdcbe50c2f34b70cc39c8973ae5b051d304577.tar.bz2 hercules-2cbdcbe50c2f34b70cc39c8973ae5b051d304577.tar.xz hercules-2cbdcbe50c2f34b70cc39c8973ae5b051d304577.zip |
- Fixed the "map server claims to have char online, but this other map server also has it tagged as online" message triggering in some cases where it shouldn't.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@8846 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src')
-rw-r--r-- | src/char/char.c | 10 | ||||
-rw-r--r-- | src/char_sql/char.c | 8 |
2 files changed, 13 insertions, 5 deletions
diff --git a/src/char/char.c b/src/char/char.c index 4e42e9a5e..2d7e5af57 100644 --- a/src/char/char.c +++ b/src/char/char.c @@ -308,8 +308,12 @@ void set_char_online(int map_id, int char_id, int account_id) { character = 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)
{
- 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);
+ //char == 99 <- Character logging in, so someone has logged in while one
+ //char is still on map-server, so kick him out, but don't print "error"
+ //as this is normal behaviour. [Skotlex]
+ if (char_id != 99)
+ 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_fd[character->server], character->account_id, character->char_id, 2);
}
character->waiting_disconnect = 0;
@@ -1662,7 +1666,7 @@ int mmo_char_send006b(int fd, struct char_session_data *sd) { // const int offset = 4;
//#endif
- set_char_online(0, 99,sd->account_id);
+ set_char_online(-1, 99,sd->account_id);
found_num = 0;
for(i = 0; i < char_num; i++) {
diff --git a/src/char_sql/char.c b/src/char_sql/char.c index e9709b5d3..df1ed6b2e 100644 --- a/src/char_sql/char.c +++ b/src/char_sql/char.c @@ -222,8 +222,12 @@ void set_char_online(int map_id, int char_id, int account_id) { character = 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)
{
- 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);
+ //char == 99 <- Character logging in, so someone has logged in while one
+ //char is still on map-server, so kick him out, but don't print "error"
+ //as this is normal behaviour. [Skotlex]
+ if (char_id != 99)
+ 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_fd[character->server], character->account_id, character->char_id, 2);
}
character->char_id = (char_id==99)?-1:char_id;
|