Issue Information
-
#007646
-
0 - None Assigned
-
Fixed
Issue Confirmations
-
Yes (0)No (0)
0
bg mapflag + instance + reloadscript = mapserver crash
Posted by purityz on 11 August 2013 - 10:23 AM
if you're using reloadscript when they are a instance map that using battleground mapflag. mapserver will crash.
after clicking this npc, try to use @reloadscript then mapserver will crash.
also, I dont know if is this a bug.
I cannot creating IOT_NONE <OwnerType> instance without player attach to a script.
if I do mapserver will report "script_rid2sd: fatal error ! player not attached".
*****edit*****
if you do it this way
it wont crash after @reloadscript
bat_c01 mapflag battleground 2 morocc,150,150,5 script testtestsss 1002,{ set .@id,instance_create("bg instance",0,IOT_NONE); instance_attachmap("bat_c01", .@id,1,"mymapname"); instance_init .@id; warp "mymapname",0,0; }
after clicking this npc, try to use @reloadscript then mapserver will crash.
also, I dont know if is this a bug.
I cannot creating IOT_NONE <OwnerType> instance without player attach to a script.
if I do mapserver will report "script_rid2sd: fatal error ! player not attached".
*****edit*****
if you do it this way
morocc,150,150,5 script testtestsss 1002,{ set .@id,instance_create("bg instance",0,IOT_NONE); instance_attachmap("bat_c01", .@id,1,"mymapname"); instance_init .@id; //set mapflag here setmapflag "mymapname",mf_battleground,2; warp "mymapname",0,0; }
it wont crash after @reloadscript
also if you use instance_attachmap like this
after instance destroy or timeout. attached map are not remove, they're still in (maybe) MAPDB.
using this script first time you click. it will create instance. attach prontera to that instance and named it "mymapname". In the end, remove them.
second times you click it will thow this error.
instance_attachmap("prontera", .@id,1,"mymapname");
after instance destroy or timeout. attached map are not remove, they're still in (maybe) MAPDB.
morocc,150,150,5 script testtestsss 1002,{ set .@id,instance_create("prontera instance",0,IOT_NONE); instance_attachmap("prontera", .@id,1,"mymapname"); //remove instance instance_detachmap "mymapname",.@id; instance_destroy .@id; }
using this script first time you click. it will create instance. attach prontera to that instance and named it "mymapname". In the end, remove them.
second times you click it will thow this error.
[Error]: instance_add_map: trying to create instanced map with existent name 'mymapname'
[Error]: buildin_instance_attachmap: instance creation failed (prontera): -2
Edited by purityz, 11 August 2013 - 03:31 PM.
could you please make a crash dump and post it here. it may help to fix the issue thanks!
this is a fix to problem that map are not being remove from mapdb after instance destroy.
in map.c
to
in map.c
void map_removemapdb(struct map_data *m) { index2mapid[m->index] = -1; }
to
void map_removemapdb(struct map_data *m) { index2mapid[m->index] = -1; if(strdb_iget(mapindex_db, m->name)){ strdb_remove(mapindex_db, m->name); } }
new information.
not only mapflag battleground that make server crash.
also mapflag gvg.
not only mapflag battleground that make server crash.
also mapflag gvg.
changed status to: Fixed
Fixed in https://github.com/H...d2a2c5692e12115
Thank you for all the scenarios. I fixed all the bugs to the extent I could debug, also fixed the player attached error you reported (it was due to the IOT constants being missing in db/const.txt, server thought they were player variables and that was why the rid2sd error came up)
Thank you for all the scenarios. I fixed all the bugs to the extent I could debug, also fixed the player attached error you reported (it was due to the IOT constants being missing in db/const.txt, server thought they were player variables and that was why the rid2sd error came up)