summaryrefslogtreecommitdiff
path: root/src/map/map.c
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-11-17 13:57:15 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-11-17 13:57:15 +0000
commitdf0e00d81b399b7a8d9c597e82ead0f0ac56c43e (patch)
tree781103fdf49ba52b591658b1d0368f3d80a293a5 /src/map/map.c
parentfce7bbbc1e5db15e7a0500427265f18a577e2f14 (diff)
downloadhercules-df0e00d81b399b7a8d9c597e82ead0f0ac56c43e.tar.gz
hercules-df0e00d81b399b7a8d9c597e82ead0f0ac56c43e.tar.bz2
hercules-df0e00d81b399b7a8d9c597e82ead0f0ac56c43e.tar.xz
hercules-df0e00d81b399b7a8d9c597e82ead0f0ac56c43e.zip
- Updated map_quit to handle removing of players who are not even authenticated yet.
- New connection requests are now also blocked when there's a player already online but hasn't finished loading yet. - Because of these changes, the friendlist notification when people join has been moved to LoadEndAck from pc_authok git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9241 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/map.c')
-rw-r--r--src/map/map.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/map/map.c b/src/map/map.c
index 75c428293..12039e914 100644
--- a/src/map/map.c
+++ b/src/map/map.c
@@ -290,7 +290,7 @@ int map_freeblock_unlock_sub(char *file, int lineno)
if ((--block_free_lock) == 0) {
int i;
for (i = 0; i < block_free_count; i++)
- { //Directly calling aFree shouldn't be a leak, as Free remembers the size the original pointed to memory was allocated with? [Skotlex]
+ {
// aFree(block_free[i]);
// _mfree(block_free[i], file, lineno, __func__);
_mfree(block_free[i], file, ((block_free[i]?block_free[i]->type:0)*100000)+lineno, __func__);
@@ -300,7 +300,7 @@ int map_freeblock_unlock_sub(char *file, int lineno)
} else if (block_free_lock < 0) {
if (battle_config.error_log)
ShowError("map_freeblock_unlock: lock count < 0 !\n");
- block_free_lock = 0; // 次回以降のロックに支障が出てくるのでリセット
+ block_free_lock = 0;
}
return block_free_lock;
@@ -1660,8 +1660,12 @@ void map_deliddb(struct block_list *bl) {
*/
int map_quit(struct map_session_data *sd) {
- //nullpo_retr(0, sd); //Utterly innecessary, all invokations to this function already have an SD non-null check.
- //Learn to use proper coding and stop relying on nullpo_'s for safety :P [Skotlex]
+ if(!sd->state.auth) { //Removing a player that hasn't even finished loading
+ idb_remove(pc_db,sd->status.account_id);
+ idb_remove(charid_db,sd->status.char_id);
+ idb_remove(id_db,sd->bl.id);
+ return 0;
+ }
if(!sd->state.waitingdisconnect) {
if (sd->npc_timer_id != -1) //Cancel the event timer.
npc_timerevent_quit(sd);