summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Changelog-Trunk.txt9
-rw-r--r--conf-tmpl/Changelog.txt5
-rw-r--r--conf-tmpl/map_athena.conf18
-rw-r--r--conf-tmpl/maps_athena.conf1380
-rw-r--r--db/Changelog.txt5
-rw-r--r--db/map_cache.datbin0 -> 1576951 bytes
-rw-r--r--src/common/core.c1
-rw-r--r--src/map/atcommand.c30
-rw-r--r--src/map/atcommand.h2
-rw-r--r--src/map/map.c810
-rw-r--r--src/map/map.h3
-rw-r--r--src/tool/mapcache.c31
12 files changed, 807 insertions, 1487 deletions
diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt
index aa28accac..773a3c707 100644
--- a/Changelog-Trunk.txt
+++ b/Changelog-Trunk.txt
@@ -3,6 +3,15 @@ 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.
+2007/03/08
+ * Here comes the new mapcache system! [DracoRPG]
+ - The last and only big "feature" (kind of cleanup in fact) you'll see
+ - Totally removes GRF/GAT handling from map-server that only reads from cache
+ - The cache now also contains map indexes, and is mostly zipped (1.5MB atm)
+ - It is shipped with eA => 100% client-independant, no more missing maps
+ - If you want to add custom maps, the mapcache builder is available, doc
+ and Unix Makefile coming as soon as possible (VC8 project only ATM :/)
+ - Removed now useless AFM/AF2 support, as well as the startup screen notice
2007/03/07
* Corrected the define for NK no cardfix (def).
* Fixed the char sql server not escaping the server name before inserting
diff --git a/conf-tmpl/Changelog.txt b/conf-tmpl/Changelog.txt
index 41c5b2fbe..213371962 100644
--- a/conf-tmpl/Changelog.txt
+++ b/conf-tmpl/Changelog.txt
@@ -1,5 +1,10 @@
Date Added
+2007/03/08
+ * Adjustments for the new mapcache [DracoRPG]
+ - Removed ".gat" from map names in maps_athena.conf
+ - Removed read_map_from_cache option as there's no more choice to do
+ - Removed afm_dir option as there's no more need for AFM/AF2 support
2007/03/06
* Added the two new packet versions to battle/client.conf [Zephiris]
2007/03/05
diff --git a/conf-tmpl/map_athena.conf b/conf-tmpl/map_athena.conf
index 78ce98337..47f655caf 100644
--- a/conf-tmpl/map_athena.conf
+++ b/conf-tmpl/map_athena.conf
@@ -69,26 +69,12 @@ stdout_with_ansisequence: no
//Example: "console_silent: 7" Hides information, status and notice messages (1+2+4)
console_silent: 0
-//Preferred map loading method
-// 0: Read directly from grf
-// 1: Read from cache (with compression)
-// 2: Read from cache (without compression)
-// If the cache was not found it will read the maps from the GRF and copy
-// any necessary data into a newly created cache.
-// It is possible to reduce the map cache to 1MB for 400+ maps with compression
-// enabled. If all maps are already loaded in the cache, Athena can boot without
-// reading the grf files.
-read_map_from_cache: 1
-//
-//Where is the bitmap file stored?
-map_cache_file: db/mapinfo.txt
+//Where should the map data be read from?
+map_cache_file: db/map_cache.dat
//Where should all database data be read from?
db_path: db
-// Advanced Fusion Maps directory
-afm_dir: afm
-
// Enable the @guildspy and @partyspy at commands?
// Note that enabling them decreases packet sending performance.
enable_spy: no
diff --git a/conf-tmpl/maps_athena.conf b/conf-tmpl/maps_athena.conf
index f90ed37ca..f7b969aa1 100644
--- a/conf-tmpl/maps_athena.conf
+++ b/conf-tmpl/maps_athena.conf
@@ -1,764 +1,764 @@
//------------------------- Normal Maps ---------------------------
-map: alb_ship.gat
-map: alb2trea.gat
-map: alberta.gat
-map: alberta_in.gat
-map: alde_dun01.gat
-map: alde_dun02.gat
-map: alde_dun03.gat
-map: alde_dun04.gat
-map: aldeba_in.gat
-map: aldebaran.gat
-map: anthell01.gat
-map: anthell02.gat
-map: arena_room.gat
-map: c_tower1.gat
-map: c_tower2.gat
-map: c_tower3.gat
-map: c_tower4.gat
-//map: force_map1.gat
-//map: force_map2.gat
-//map: force_map3.gat
-map: force_1-1.gat
-map: force_1-2.gat
-map: force_1-3.gat
-map: force_2-1.gat
-map: force_2-2.gat
-map: force_2-3.gat
-map: force_3-1.gat
-map: force_3-2.gat
-map: force_3-3.gat
-map: gef_dun00.gat
-map: gef_dun01.gat
-map: gef_dun02.gat
-map: gef_dun03.gat
-map: gef_fild00.gat
-map: gef_fild01.gat
-map: gef_fild02.gat
-map: gef_fild03.gat
-map: gef_fild04.gat
-map: gef_fild05.gat
-map: gef_fild06.gat
-map: gef_fild07.gat
-map: gef_fild08.gat
-map: gef_fild09.gat
-map: gef_fild10.gat
-map: gef_fild11.gat
-map: gef_fild12.gat
-map: gef_fild13.gat
-map: gef_fild14.gat
-map: gef_tower.gat
-map: geffen.gat
-map: geffen_in.gat
-map: gl_cas01.gat
-map: gl_cas02.gat
-map: gl_church.gat
-map: gl_chyard.gat
-map: gl_dun01.gat
-map: gl_dun02.gat
-map: gl_in01.gat
-map: gl_knt01.gat
-map: gl_knt02.gat
-map: gl_prison.gat
-map: gl_prison1.gat
-map: gl_sew01.gat
-map: gl_sew02.gat
-map: gl_sew03.gat
-map: gl_sew04.gat
-map: gl_step.gat
-map: glast_01.gat
-//map: hunter_1-1.gat
-//map: hunter_2-1.gat
-//map: hunter_3-1.gat
-map: in_hunter.gat
-map: in_moc_16.gat
-map: in_orcs01.gat
-map: in_sphinx1.gat
-map: in_sphinx2.gat
-map: in_sphinx3.gat
-map: in_sphinx4.gat
-map: in_sphinx5.gat
-map: iz_dun00.gat
-map: iz_dun01.gat
-map: iz_dun02.gat
-map: iz_dun03.gat
-map: iz_dun04.gat
-map: izlu2dun.gat
-map: izlude.gat
-map: izlude_in.gat
-map: job_thief1.gat
-//map: knight_1-1.gat
-//map: knight_2-1.gat
-//map: knight_3-1.gat
-map: mjo_dun01.gat
-map: mjo_dun02.gat
-map: mjo_dun03.gat
-map: mjolnir_01.gat
-map: mjolnir_02.gat
-map: mjolnir_03.gat
-map: mjolnir_04.gat
-map: mjolnir_05.gat
-map: mjolnir_06.gat
-map: mjolnir_07.gat
-map: mjolnir_08.gat
-map: mjolnir_09.gat
-map: mjolnir_10.gat
-map: mjolnir_11.gat
-map: mjolnir_12.gat
-map: moc_castle.gat
-map: moc_fild01.gat
-map: moc_fild02.gat
-map: moc_fild03.gat
-map: moc_fild04.gat
-map: moc_fild05.gat
-map: moc_fild06.gat
-map: moc_fild07.gat
-map: moc_fild08.gat
-map: moc_fild09.gat
-map: moc_fild10.gat
-map: moc_fild11.gat
-map: moc_fild12.gat
-map: moc_fild13.gat
-map: moc_fild14.gat
-map: moc_fild15.gat
-map: moc_fild16.gat
-map: moc_fild17.gat
-map: moc_fild18.gat
-map: moc_fild19.gat
-map: moc_pryd01.gat
-map: moc_pryd02.gat
-map: moc_pryd03.gat
-map: moc_pryd04.gat
-map: moc_pryd05.gat
-map: moc_pryd06.gat
-map: moc_prydb1.gat
-map: moc_ruins.gat
-map: monk_in.gat
-map: morocc.gat
-map: morocc_in.gat
-map: new_zone01.gat
-map: new_zone02.gat
-map: new_zone03.gat
-map: new_zone04.gat
-//map: new_1-1.gat
-//map: new_1-2.gat
-//map: new_1-3.gat
-//map: new_1-4.gat
-//map: new_2-1.gat
-//map: new_2-2.gat
-//map: new_2-3.gat
-//map: new_2-4.gat
-//map: new_3-1.gat
-//map: new_3-2.gat
-//map: new_3-3.gat
-//map: new_3-4.gat
-//map: new_4-1.gat
-//map: new_4-2.gat
-//map: new_4-3.gat
-//map: new_4-4.gat
-//map: new_5-1.gat
-//map: new_5-2.gat
-//map: new_5-3.gat
-//map: new_5-4.gat
-map: orcsdun01.gat
-map: orcsdun02.gat
-//map: ordeal_a00.gat
-//map: ordeal_a02.gat
-map: ordeal_1-1.gat
-map: ordeal_1-2.gat
-//map: ordeal_1-3.gat
-//map: ordeal_1-4.gat
-map: ordeal_2-1.gat
-map: ordeal_2-2.gat
-//map: ordeal_2-3.gat
-//map: ordeal_2-4.gat
-map: ordeal_3-1.gat
-map: ordeal_3-2.gat
-//map: ordeal_3-3.gat
-//map: ordeal_3-4.gat
-map: pay_arche.gat
-map: pay_dun00.gat
-map: pay_dun01.gat
-map: pay_dun02.gat
-map: pay_dun03.gat
-map: pay_dun04.gat
-map: pay_fild01.gat
-map: pay_fild02.gat
-map: pay_fild03.gat
-map: pay_fild04.gat
-map: pay_fild05.gat
-map: pay_fild06.gat
-map: pay_fild07.gat
-map: pay_fild08.gat
-map: pay_fild09.gat
-map: pay_fild10.gat
-map: pay_fild11.gat
-//map: payon.gat //moved down to new maps
-//map: payon_in01.gat //moved down to new maps
-//map: payon_in02.gat //moved down to new maps
-//map: priest_1-1.gat
-//map: priest_2-1.gat
-//map: priest_3-1.gat
-map: prontera.gat
-map: prt_are_in.gat
-map: prt_are01.gat
-map: prt_castle.gat
-map: prt_church.gat
-map: prt_fild00.gat
-map: prt_fild01.gat
-map: prt_fild02.gat
-map: prt_fild03.gat
-map: prt_fild04.gat
-map: prt_fild05.gat
-map: prt_fild06.gat
-map: prt_fild07.gat
-map: prt_fild08.gat
-map: prt_fild09.gat
-map: prt_fild10.gat
-map: prt_fild11.gat
-map: prt_in.gat
-map: prt_maze01.gat
-map: prt_maze02.gat
-map: prt_maze03.gat
-map: prt_monk.gat
-map: prt_sewb1.gat
-map: prt_sewb2.gat
-map: prt_sewb3.gat
-map: prt_sewb4.gat
-//map: pvp_room.gat
-map: pvp_2vs2.gat
-map: pvp_c_room.gat
-map: pvp_n_1-1.gat
-map: pvp_n_1-2.gat
-map: pvp_n_1-3.gat
-map: pvp_n_1-4.gat
-map: pvp_n_1-5.gat
-map: pvp_n_2-1.gat
-map: pvp_n_2-2.gat
-map: pvp_n_2-3.gat
-map: pvp_n_2-4.gat
-map: pvp_n_2-5.gat
-map: pvp_n_3-1.gat
-map: pvp_n_3-2.gat
-map: pvp_n_3-3.gat
-map: pvp_n_3-4.gat
-map: pvp_n_3-5.gat
-map: pvp_n_4-1.gat
-map: pvp_n_4-2.gat
-map: pvp_n_4-3.gat
-map: pvp_n_4-4.gat
-map: pvp_n_4-5.gat
-map: pvp_n_5-1.gat
-map: pvp_n_5-2.gat
-map: pvp_n_5-3.gat
-map: pvp_n_5-4.gat
-map: pvp_n_5-5.gat
-map: pvp_n_6-1.gat
-map: pvp_n_6-2.gat
-map: pvp_n_6-3.gat
-map: pvp_n_6-4.gat
-map: pvp_n_6-5.gat
-map: pvp_n_7-1.gat
-map: pvp_n_7-2.gat
-map: pvp_n_7-3.gat
-map: pvp_n_7-4.gat
-map: pvp_n_7-5.gat
-map: pvp_n_8-1.gat
-map: pvp_n_8-2.gat
-map: pvp_n_8-3.gat
-map: pvp_n_8-4.gat
-map: pvp_n_8-5.gat
-map: pvp_n_room.gat
-map: pvp_y_1-1.gat
-map: pvp_y_1-2.gat
-map: pvp_y_1-3.gat
-map: pvp_y_1-4.gat
-map: pvp_y_1-5.gat
-map: pvp_y_2-1.gat
-map: pvp_y_2-2.gat
-map: pvp_y_2-3.gat
-map: pvp_y_2-4.gat
-map: pvp_y_2-5.gat
-map: pvp_y_3-1.gat
-map: pvp_y_3-2.gat
-map: pvp_y_3-3.gat
-map: pvp_y_3-4.gat
-map: pvp_y_3-5.gat
-map: pvp_y_4-1.gat
-map: pvp_y_4-2.gat
-map: pvp_y_4-3.gat
-map: pvp_y_4-4.gat
-map: pvp_y_4-5.gat
-map: pvp_y_5-1.gat
-map: pvp_y_5-2.gat
-map: pvp_y_5-3.gat
-map: pvp_y_5-4.gat
-map: pvp_y_5-5.gat
-map: pvp_y_6-1.gat
-map: pvp_y_6-2.gat
-map: pvp_y_6-3.gat
-map: pvp_y_6-4.gat
-map: pvp_y_6-5.gat
-map: pvp_y_7-1.gat
-map: pvp_y_7-2.gat
-map: pvp_y_7-3.gat
-map: pvp_y_7-4.gat
-map: pvp_y_7-5.gat
-map: pvp_y_8-1.gat
-map: pvp_y_8-2.gat
-map: pvp_y_8-3.gat
-map: pvp_y_8-4.gat
-map: pvp_y_8-5.gat
-map: pvp_y_room.gat
-//map: sword_1-1.gat
-//map: sword_2-1.gat
-//map: sword_3-1.gat
-map: treasure01.gat
-map: treasure02.gat
-//map: wizard_1-1.gat
-//map: wizard_2-1.gat
-//map: wizard_3-1.gat
-map: xmas.gat
-map: xmas_dun01.gat
-map: xmas_dun02.gat
-map: xmas_fild01.gat
-map: xmas_in.gat
+map: alb_ship
+map: alb2trea
+map: alberta
+map: alberta_in
+map: alde_dun01
+map: alde_dun02
+map: alde_dun03
+map: alde_dun04
+map: aldeba_in
+map: aldebaran
+map: anthell01
+map: anthell02
+map: arena_room
+map: c_tower1
+map: c_tower2
+map: c_tower3
+map: c_tower4
+//map: force_map1
+//map: force_map2
+//map: force_map3
+map: force_1-1
+map: force_1-2
+map: force_1-3
+map: force_2-1
+map: force_2-2
+map: force_2-3
+map: force_3-1
+map: force_3-2
+map: force_3-3
+map: gef_dun00
+map: gef_dun01
+map: gef_dun02
+map: gef_dun03
+map: gef_fild00
+map: gef_fild01
+map: gef_fild02
+map: gef_fild03
+map: gef_fild04
+map: gef_fild05
+map: gef_fild06
+map: gef_fild07
+map: gef_fild08
+map: gef_fild09
+map: gef_fild10
+map: gef_fild11
+map: gef_fild12
+map: gef_fild13
+map: gef_fild14
+map: gef_tower
+map: geffen
+map: geffen_in
+map: gl_cas01
+map: gl_cas02
+map: gl_church
+map: gl_chyard
+map: gl_dun01
+map: gl_dun02
+map: gl_in01
+map: gl_knt01
+map: gl_knt02
+map: gl_prison
+map: gl_prison1
+map: gl_sew01
+map: gl_sew02
+map: gl_sew03
+map: gl_sew04
+map: gl_step
+map: glast_01
+//map: hunter_1-1
+//map: hunter_2-1
+//map: hunter_3-1
+map: in_hunter
+map: in_moc_16
+map: in_orcs01
+map: in_sphinx1
+map: in_sphinx2
+map: in_sphinx3
+map: in_sphinx4
+map: in_sphinx5
+map: iz_dun00
+map: iz_dun01
+map: iz_dun02
+map: iz_dun03
+map: iz_dun04
+map: izlu2dun
+map: izlude
+map: izlude_in
+map: job_thief1
+//map: knight_1-1
+//map: knight_2-1
+//map: knight_3-1
+map: mjo_dun01
+map: mjo_dun02
+map: mjo_dun03
+map: mjolnir_01
+map: mjolnir_02
+map: mjolnir_03
+map: mjolnir_04
+map: mjolnir_05
+map: mjolnir_06
+map: mjolnir_07
+map: mjolnir_08
+map: mjolnir_09
+map: mjolnir_10
+map: mjolnir_11
+map: mjolnir_12
+map: moc_castle
+map: moc_fild01
+map: moc_fild02
+map: moc_fild03
+map: moc_fild04
+map: moc_fild05
+map: moc_fild06
+map: moc_fild07
+map: moc_fild08
+map: moc_fild09
+map: moc_fild10
+map: moc_fild11
+map: moc_fild12
+map: moc_fild13
+map: moc_fild14
+map: moc_fild15
+map: moc_fild16
+map: moc_fild17
+map: moc_fild18
+map: moc_fild19
+map: moc_pryd01
+map: moc_pryd02
+map: moc_pryd03
+map: moc_pryd04
+map: moc_pryd05
+map: moc_pryd06
+map: moc_prydb1
+map: moc_ruins
+map: monk_in
+map: morocc
+map: morocc_in
+map: new_zone01
+map: new_zone02
+map: new_zone03
+map: new_zone04
+//map: new_1-1
+//map: new_1-2
+//map: new_1-3
+//map: new_1-4
+//map: new_2-1
+//map: new_2-2
+//map: new_2-3
+//map: new_2-4
+//map: new_3-1
+//map: new_3-2
+//map: new_3-3
+//map: new_3-4
+//map: new_4-1
+//map: new_4-2
+//map: new_4-3
+//map: new_4-4
+//map: new_5-1
+//map: new_5-2
+//map: new_5-3
+//map: new_5-4
+map: orcsdun01
+map: orcsdun02
+//map: ordeal_a00
+//map: ordeal_a02
+map: ordeal_1-1
+map: ordeal_1-2
+//map: ordeal_1-3
+//map: ordeal_1-4
+map: ordeal_2-1
+map: ordeal_2-2
+//map: ordeal_2-3
+//map: ordeal_2-4
+map: ordeal_3-1
+map: ordeal_3-2
+//map: ordeal_3-3
+//map: ordeal_3-4
+map: pay_arche
+map: pay_dun00
+map: pay_dun01
+map: pay_dun02
+map: pay_dun03
+map: pay_dun04
+map: pay_fild01
+map: pay_fild02
+map: pay_fild03
+map: pay_fild04
+map: pay_fild05
+map: pay_fild06
+map: pay_fild07
+map: pay_fild08
+map: pay_fild09
+map: pay_fild10
+map: pay_fild11
+//map: payon //moved down to new maps
+//map: payon_in01 //moved down to new maps
+//map: payon_in02 //moved down to new maps
+//map: priest_1-1
+//map: priest_2-1
+//map: priest_3-1
+map: prontera
+map: prt_are_in
+map: prt_are01
+map: prt_castle
+map: prt_church
+map: prt_fild00
+map: prt_fild01
+map: prt_fild02
+map: prt_fild03
+map: prt_fild04
+map: prt_fild05
+map: prt_fild06
+map: prt_fild07
+map: prt_fild08
+map: prt_fild09
+map: prt_fild10
+map: prt_fild11
+map: prt_in
+map: prt_maze01
+map: prt_maze02
+map: prt_maze03
+map: prt_monk
+map: prt_sewb1
+map: prt_sewb2
+map: prt_sewb3
+map: prt_sewb4
+//map: pvp_room
+map: pvp_2vs2
+map: pvp_c_room
+map: pvp_n_1-1
+map: pvp_n_1-2
+map: pvp_n_1-3
+map: pvp_n_1-4
+map: pvp_n_1-5
+map: pvp_n_2-1
+map: pvp_n_2-2
+map: pvp_n_2-3
+map: pvp_n_2-4
+map: pvp_n_2-5
+map: pvp_n_3-1
+map: pvp_n_3-2
+map: pvp_n_3-3
+map: pvp_n_3-4
+map: pvp_n_3-5
+map: pvp_n_4-1
+map: pvp_n_4-2
+map: pvp_n_4-3
+map: pvp_n_4-4
+map: pvp_n_4-5
+map: pvp_n_5-1
+map: pvp_n_5-2
+map: pvp_n_5-3
+map: pvp_n_5-4
+map: pvp_n_5-5
+map: pvp_n_6-1
+map: pvp_n_6-2
+map: pvp_n_6-3
+map: pvp_n_6-4
+map: pvp_n_6-5
+map: pvp_n_7-1
+map: pvp_n_7-2
+map: pvp_n_7-3
+map: pvp_n_7-4
+map: pvp_n_7-5
+map: pvp_n_8-1
+map: pvp_n_8-2
+map: pvp_n_8-3
+map: pvp_n_8-4
+map: pvp_n_8-5
+map: pvp_n_room
+map: pvp_y_1-1
+map: pvp_y_1-2
+map: pvp_y_1-3
+map: pvp_y_1-4
+map: pvp_y_1-5
+map: pvp_y_2-1
+map: pvp_y_2-2
+map: pvp_y_2-3
+map: pvp_y_2-4
+map: pvp_y_2-5
+map: pvp_y_3-1
+map: pvp_y_3-2
+map: pvp_y_3-3
+map: pvp_y_3-4
+map: pvp_y_3-5
+map: pvp_y_4-1
+map: pvp_y_4-2
+map: pvp_y_4-3
+map: pvp_y_4-4
+map: pvp_y_4-5
+map: pvp_y_5-1
+map: pvp_y_5-2
+map: pvp_y_5-3
+map: pvp_y_5-4
+map: pvp_y_5-5
+map: pvp_y_6-1
+map: pvp_y_6-2
+map: pvp_y_6-3
+map: pvp_y_6-4
+map: pvp_y_6-5
+map: pvp_y_7-1
+map: pvp_y_7-2
+map: pvp_y_7-3
+map: pvp_y_7-4
+map: pvp_y_7-5
+map: pvp_y_8-1
+map: pvp_y_8-2
+map: pvp_y_8-3
+map: pvp_y_8-4
+map: pvp_y_8-5
+map: pvp_y_room
+//map: sword_1-1
+//map: sword_2-1
+//map: sword_3-1
+map: treasure01
+map: treasure02
+//map: wizard_1-1
+//map: wizard_2-1
+//map: wizard_3-1
+map: xmas
+map: xmas_dun01
+map: xmas_dun02
+map: xmas_fild01
+map: xmas_in
//---Ep3.0 Comodo ---
-map: beach_dun.gat
-map: beach_dun2.gat
-map: beach_dun3.gat
-map: cmd_fild01.gat
-map: cmd_fild02.gat
-map: cmd_fild03.gat
-map: cmd_fild04.gat
-map: cmd_fild05.gat
-map: cmd_fild06.gat
-map: cmd_fild07.gat
-map: cmd_fild08.gat
-map: cmd_fild09.gat
-map: cmd_in01.gat
-map: cmd_in02.gat
-map: comodo.gat
+map: beach_dun
+map: beach_dun2
+map: beach_dun3
+map: cmd_fild01
+map: cmd_fild02
+map: cmd_fild03
+map: cmd_fild04
+map: cmd_fild05
+map: cmd_fild06
+map: cmd_fild07
+map: cmd_fild08
+map: cmd_fild09
+map: cmd_in01
+map: cmd_in02
+map: comodo
//---EP3.1 Quiz Revolution ---
-map: quiz_00.gat
-map: quiz_01.gat
-map: g_room1-1.gat
-map: g_room1-2.gat
-map: g_room1-3.gat
-map: g_room2.gat
+map: quiz_00
+map: quiz_01
+map: g_room1-1
+map: g_room1-2
+map: g_room1-3
+map: g_room2
//--- Ep4.0 Turtle Island ---
-map: tur_dun01.gat
-map: tur_dun02.gat
-map: tur_dun03.gat
-map: tur_dun04.gat
-map: tur_dun05.gat
-map: tur_dun06.gat
+map: tur_dun01
+map: tur_dun02
+map: tur_dun03
+map: tur_dun04
+map: tur_dun05
+map: tur_dun06
//--- Ep4.1 The War of Emperium ---
-map: alde_gld.gat
-map: aldeg_cas01.gat
-map: aldeg_cas02.gat
-map: aldeg_cas03.gat
-map: aldeg_cas04.gat
-map: aldeg_cas05.gat
-map: gefg_cas01.gat
-map: gefg_cas02.gat
-map: gefg_cas03.gat
-map: gefg_cas04.gat
-map: gefg_cas05.gat
-map: gld_dun01.gat
-map: gld_dun02.gat
-map: gld_dun03.gat
-map: gld_dun04.gat
-map: guild_room.gat
-map: guild_vs1.gat
-map: guild_vs2.gat
-map: guild_vs3.gat
-map: guild_vs4.gat
-map: guild_vs5.gat
-map: guild_vs1-1.gat
-map: guild_vs1-2.gat
-map: guild_vs1-3.gat
-map: guild_vs1-4.gat
-map: guild_vs2-1.gat
-map: guild_vs2-2.gat
-//map: job_hunter.gat
-map: job_hunte.gat
-//map: job_knight.gat
-map: job_knt.gat
-//map: job_priest.gat
-map: job_prist.gat
-map: job_sword1.gat
-//map: job_wizard.gat
-map: job_wiz.gat
-map: pay_gld.gat
-map: payg_cas01.gat
-map: payg_cas02.gat
-map: payg_cas03.gat
-map: payg_cas04.gat
-map: payg_cas05.gat
-map: prt_gld.gat
-map: prtg_cas01.gat
-map: prtg_cas02.gat
-map: prtg_cas03.gat
-map: prtg_cas04.gat
-map: prtg_cas05.gat
+map: alde_gld
+map: aldeg_cas01
+map: aldeg_cas02
+map: aldeg_cas03
+map: aldeg_cas04
+map: aldeg_cas05
+map: gefg_cas01
+map: gefg_cas02
+map: gefg_cas03
+map: gefg_cas04
+map: gefg_cas05
+map: gld_dun01
+map: gld_dun02
+map: gld_dun03
+map: gld_dun04
+map: guild_room
+map: guild_vs1
+map: guild_vs2
+map: guild_vs3
+map: guild_vs4
+map: guild_vs5
+map: guild_vs1-1
+map: guild_vs1-2
+map: guild_vs1-3
+map: guild_vs1-4
+map: guild_vs2-1
+map: guild_vs2-2
+//map: job_hunter
+map: job_hunte
+//map: job_knight
+map: job_knt
+//map: job_priest
+map: job_prist
+map: job_sword1
+//map: job_wizard
+map: job_wiz
+map: pay_gld
+map: payg_cas01
+map: payg_cas02
+map: payg_cas03
+map: payg_cas04
+map: payg_cas05
+map: prt_gld
+map: prtg_cas01
+map: prtg_cas02
+map: prtg_cas03
+map: prtg_cas04
+map: prtg_cas05
//--- Ep5.0 Yuno ---
-map: alde_alche.gat
-map: in_rogue.gat
-map: job_cru.gat
-map: job_duncer.gat
-map: job_monk.gat
-map: job_sage.gat
-map: mag_dun01.gat
-map: mag_dun02.gat
-map: monk_test.gat
-map: quiz_test.gat
-map: yuno.gat
-map: yuno_fild01.gat
-map: yuno_fild02.gat
-map: yuno_fild03.gat
-map: yuno_fild04.gat
-map: yuno_in01.gat
-map: yuno_in02.gat
-map: yuno_in03.gat
-map: yuno_in04.gat
-map: yuno_in05.gat
+map: alde_alche
+map: in_rogue
+map: job_cru
+map: job_duncer
+map: job_monk
+map: job_sage
+map: mag_dun01
+map: mag_dun02
+map: monk_test
+map: quiz_test
+map: yuno
+map: yuno_fild01
+map: yuno_fild02
+map: yuno_fild03
+map: yuno_fild04
+map: yuno_in01
+map: yuno_in02
+map: yuno_in03
+map: yuno_in04
+map: yuno_in05
//--- Ep6.0 - Amatsu ---
// Requires: kRO 08-10-03 or newer
// or kRO Sakray 09-09-03 or newer
-map: ama_dun01.gat
-map: ama_dun02.gat
-map: ama_dun03.gat
-map: ama_fild01.gat
-map: ama_in01.gat
-map: ama_in02.gat
-map: ama_test.gat
-map: amatsu.gat
+map: ama_dun01
+map: ama_dun02
+map: ama_dun03
+map: ama_fild01
+map: ama_in01
+map: ama_in02
+map: ama_test
+map: amatsu
//--- Ep6.1 - Gon Ryun ---
-map: gon_dun01.gat
-map: gon_dun02.gat
-map: gon_dun03.gat
-map: gon_fild01.gat
-map: gon_in.gat
-map: gon_test.gat
-map: gonryun.gat
-map: sec_in01.gat
-map: sec_in02.gat
-map: sec_pri.gat
+map: gon_dun01
+map: gon_dun02
+map: gon_dun03
+map: gon_fild01
+map: gon_in
+map: gon_test
+map: gonryun
+map: sec_in01
+map: sec_in02
+map: sec_pri
//--- Ep6.2 - Umbala ---
// Requires: kRO 01-27-04 or newer
// or kRO Sakray 12-02-03 or newer
// or Akaru's SuperGRF 1.22 or newer
-map: umbala.gat
-map: um_dun01.gat
-map: um_dun02.gat
-map: um_fild01.gat
-map: um_fild02.gat
-map: um_fild03.gat
-map: um_fild04.gat
-map: um_in.gat
+map: umbala
+map: um_dun01
+map: um_dun02
+map: um_fild01
+map: um_fild02
+map: um_fild03
+map: um_fild04
+map: um_in
//--- Ep6.3 - Niflheim ---
// Requires: kRO 02-23-04 or newer
// or kRO Sakray 01-09-04 or newer
// or Akaru's SuperGRF 1.32 or newer
-map: niflheim.gat
-map: nif_fild01.gat
-map: nif_fild02.gat
-map: nif_in.gat
-map: yggdrasil01.gat
+map: niflheim
+map: nif_fild01
+map: nif_fild02
+map: nif_in
+map: yggdrasil01
//--- Ep6.4 - Valkyrie ---
// Requires: kRO ??-??-04 or newer
// or kRO Sakray 02-03-04 or newer
// or Akaru's SuperGRF 1.34 or newer
-map: valkyrie.gat
-map: himinn.gat
+map: valkyrie
+map: himinn
//--- Ep6.5 - Castle of Dragon (LouYang) ---
// Requires kRO Sakray 03-30 or newer
//(Akaru's SuperGRF required version: 1.52)
-map: lou_in01.gat
-map: lou_in02.gat
-map: lou_dun03.gat
-map: lou_dun02.gat
-map: lou_dun01.gat
-map: lou_fild01.gat
-map: louyang.gat
+map: lou_in01
+map: lou_in02
+map: lou_dun03
+map: lou_dun02
+map: lou_dun01
+map: lou_fild01
+map: louyang
//--- Ep6.6 - Novice Guild Siege ---
//Requires kRO Sakray 04-07 or newer
//(Akaru's SuperGRF required version: 1.53)
-//map: siege_test.gat
-map: n_castle.gat
-map: nguild_gef.gat
-map: nguild_prt.gat
-map: nguild_pay.gat
-map: nguild_alde.gat
+//map: siege_test
+map: n_castle
+map: nguild_gef
+map: nguild_prt
+map: nguild_pay
+map: nguild_alde
//--- Ep6.7 - Jawaii ---
//Requires kRO Sakray 06-22 or newer
//(Akaru's SuperGRF required version: 1.63)
-map: jawaii.gat
-map: jawaii_in.gat
+map: jawaii
+map: jawaii_in
// --- Ep6.8 - Geffenia ---
// Requires kRO Sakray 07-13 or newer
// (Akaru's SuperGRF required version: 1.64)
-map: gefenia01.gat
-map: gefenia02.gat
-map: gefenia03.gat
-map: gefenia04.gat
+map: gefenia01
+map: gefenia02
+map: gefenia03
+map: gefenia04
// --- Ep6.9 - New Payon ---
// Requires kRO Sakray 09-03
// -- dunno --
-map: payon.gat
-map: payon_in01.gat
-map: payon_in02.gat
-map: payon_in03.gat
-//same names as old maps except that payon_in03.gat got added
+map: payon
+map: payon_in01
+map: payon_in02
+map: payon_in03
+//same names as old maps except that payon_in03 got added
// --- Ep? - Ayothaya ---
// Requires kRO Sakray 09-21
// -- 2004-10-19sdata_k.gpf --
-map: ayothaya.gat
-map: ayo_in01.gat
-map: ayo_in02.gat
-map: ayo_fild01.gat
-map: ayo_fild02.gat
-map: ayo_dun01.gat
-map: ayo_dun02.gat
+map: ayothaya
+map: ayo_in01
+map: ayo_in02
+map: ayo_fild01
+map: ayo_fild02
+map: ayo_dun01
+map: ayo_dun02
// --- God item quests maps ---
// -- 2004-10-12sdata_k3.gpf --
-map: que_god01.gat
-map: que_god02.gat
+map: que_god01
+map: que_god02
// --- Ep? - Schwarzwald Republic ---
// -- 2004-12-28sdata_k.gpf --
-map: yuno_fild05.gat
-map: yuno_fild07.gat
-map: yuno_fild08.gat
-map: yuno_fild09.gat
-map: yuno_fild11.gat
-map: yuno_fild12.gat
+map: yuno_fild05
+map: yuno_fild07
+map: yuno_fild08
+map: yuno_fild09
+map: yuno_fild11
+map: yuno_fild12
// --- Turbo Track Arena ---
// -- 2005-03-08sdata_k.gpf --
-map: alde_tt02.gat
-map: turbo_n_1.gat
-map: turbo_n_4.gat
-map: turbo_n_8.gat
-map: turbo_n_16.gat
-map: turbo_e_4.gat
-map: turbo_e_8.gat
-map: turbo_e_16.gat
-map: turbo_room.gat
+map: alde_tt02
+map: turbo_n_1
+map: turbo_n_4
+map: turbo_n_8
+map: turbo_n_16
+map: turbo_e_4
+map: turbo_e_8
+map: turbo_e_16
+map: turbo_room
// --- Einbroch/Einbech ---
// -- 2005-03-15sdata_k.gpf --
-map: airplane.gat
-map: airport.gat
-map: einbech.gat
-map: einbroch.gat
-map: ein_dun01.gat
-map: ein_dun02.gat
-map: ein_fild06.gat
-map: ein_fild07.gat
-map: ein_fild08.gat
-map: ein_fild09.gat
-map: ein_fild10.gat
-map: ein_in01.gat
-map: que_sign01.gat
-map: que_sign02.gat
+map: airplane
+map: airport
+map: einbech
+map: einbroch
+map: ein_dun01
+map: ein_dun02
+map: ein_fild06
+map: ein_fild07
+map: ein_fild08
+map: ein_fild09
+map: ein_fild10
+map: ein_in01
+map: que_sign01
+map: que_sign02
// --- Einbroch and Lightalzen ---
// -- 2005-05-10sdata_k.gpf --
-map: ein_fild03.gat
-map: ein_fild04.gat
-map: lhz_fild02.gat
-map: lhz_fild03.gat
+map: ein_fild03
+map: ein_fild04
+map: lhz_fild02
+map: lhz_fild03
// --- Lighthalzen and Juperos Dungeon ---
// -- 2005-06-14sdata_k.gpf --
-map: yuno_pre.gat
-map: lhz_fild01.gat
-map: lighthalzen.gat
-map: lhz_in01.gat
-map: lhz_in02.gat
-map: lhz_in03.gat
-map: lhz_que01.gat
-map: lhz_dun01.gat
-map: lhz_dun02.gat
-map: lhz_dun03.gat
-map: lhz_cube.gat
-map: juperos_01.gat
-map: juperos_02.gat
-map: jupe_area1.gat
-map: jupe_area2.gat
-map: jupe_core.gat
-map: jupe_ele.gat
-map: jupe_ele_r.gat
-map: jupe_gate.gat
+map: yuno_pre
+map: lhz_fild01
+map: lighthalzen
+map: lhz_in01
+map: lhz_in02
+map: lhz_in03
+map: lhz_que01
+map: lhz_dun01
+map: lhz_dun02
+map: lhz_dun03
+map: lhz_cube
+map: juperos_01
+map: juperos_02
+map: jupe_area1
+map: jupe_area2
+map: jupe_core
+map: jupe_ele
+map: jupe_ele_r
+map: jupe_gate
// --- Lighthalzen & Juno Airport ---
-// -- resnametable clones of airport.gat and airplane.gat --
-map: y_airport.gat
-map: lhz_airport.gat
-map: airplane_01.gat
+// -- resnametable clones of airport and airplane --
+map: y_airport
+map: lhz_airport
+map: airplane_01
// --- Juperos Dungeon ---
// -- 2005-06-28sdata_k.gpf --
-map: jupe_cave.gat
+map: jupe_cave
// --- Quiz Revolution ---
// -- 2005-08-02sdata_k.gpf --
-map: quiz_02.gat
+map: quiz_02
// --- Hugel Field ---
// -- 2005-08-23sdata_k.gpf --
-map: hu_fild07.gat
-map: hu_fild05.gat
-map: hu_fild04.gat
-map: hu_fild01.gat
-map: yuno_fild06.gat
+map: hu_fild07
+map: hu_fild05
+map: hu_fild04
+map: hu_fild01
+map: yuno_fild06
// --- Star Knight And Soul Linker Job Change Maps ---
// -- 2005-08-23sdata_k.gpf --
-map: job_soul.gat
-map: job_star.gat
+map: job_soul
+map: job_star
// --- Abyss Lake, Thanatos Tower --
// -- 2005-09-13sdata_k.gpf - 2005-09-13sdata_k6.gpf --
-map: que_job01.gat
-map: que_job02.gat
-map: que_job03.gat
-map: abyss_01.gat
-map: abyss_02.gat
-map: abyss_03.gat
-map: thana_step.gat
-map: thana_boss.gat
-map: tha_scene01.gat
-map: tha_t01.gat
-map: tha_t02.gat
-map: tha_t03.gat
-map: tha_t04.gat
-map: tha_t07.gat
-map: tha_t05.gat
-map: tha_t06.gat
-map: tha_t08.gat
+map: que_job01
+map: que_job02
+map: que_job03
+map: abyss_01
+map: abyss_02
+map: abyss_03
+map: thana_step
+map: thana_boss
+map: tha_scene01
+map: tha_t01
+map: tha_t02
+map: tha_t03
+map: tha_t04
+map: tha_t07
+map: tha_t05
+map: tha_t06
+map: tha_t08
// --- Thanatos Tower ---
// -- 2005-09-21sdata_k.gpf --
-map: tha_t09.gat
-map: tha_t10.gat
-map: tha_t11.gat
-map: tha_t12.gat
+map: tha_t09
+map: tha_t10
+map: tha_t11
+map: tha_t12
// --- Auction Market ---
// -- 2005-11-29sdata_k.gpf --
-map: auction_01.gat
-map: auction_02.gat
+map: auction_01
+map: auction_02
// --- Garden City Hugel / Kiehl ---
// -- 2005-12-20sdata_k.gpf --
-map: hugel.gat
-map: hu_in01.gat
-map: que_bingo.gat
-map: que_hugel.gat
-map: p_track01.gat
-map: p_track02.gat
-map: odin_tem01.gat
-map: odin_tem02.gat
-map: odin_tem03.gat
-map: hu_fild02.gat
-map: hu_fild03.gat
-map: hu_fild06.gat
-map: ein_fild01.gat
-map: ein_fild02.gat
-map: ein_fild05.gat
-map: yuno_fild10.gat
-map: kh_kiehl02.gat
-map: kh_kiehl01.gat
-map: kh_dun02.gat
-map: kh_dun01.gat
-map: kh_mansion.gat
-map: kh_rossi.gat
-map: kh_school.gat
-map: kh_vila.gat
+map: hugel
+map: hu_in01
+map: que_bingo
+map: que_hugel
+map: p_track01
+map: p_track02
+map: odin_tem01
+map: odin_tem02
+map: odin_tem03
+map: hu_fild02
+map: hu_fild03
+map: hu_fild06
+map: ein_fild01
+map: ein_fild02
+map: ein_fild05
+map: yuno_fild10
+map: kh_kiehl02
+map: kh_kiehl01
+map: kh_dun02
+map: kh_dun01
+map: kh_mansion
+map: kh_rossi
+map: kh_school
+map: kh_vila
// --- Poring Arena (?) & Gunslinger/Ninja Job Map ---
// -- 2006-03-28sdata_k.gpf --
-map: poring_c01.gat
-map: poring_c02.gat
-map: que_ng.gat
+map: poring_c01
+map: poring_c02
+map: que_ng
// --- Arunafeltz & Ice Dungeon ---
// -- 2006-05-30sdata_k.gpf --
-map: rachel.gat
-map: ra_in01.gat
-map: ra_fild01.gat
-map: ra_fild02.gat
-map: ra_fild03.gat
-map: ra_fild04.gat
-map: ra_fild05.gat
-map: ra_fild06.gat
-map: ra_fild07.gat
-map: ra_fild08.gat
-map: ra_fild09.gat
-map: ra_fild10.gat
-map: ra_fild11.gat
-map: ra_fild12.gat
-map: ra_fild13.gat
-map: ra_san01.gat
-map: ra_san02.gat
-map: ra_san03.gat
-map: ra_san04.gat
-map: ra_san05.gat
-map: ra_temin.gat
-map: ra_temple.gat
-map: ra_temsky.gat
-map: que_rachel.gat
-map: ice_dun01.gat
-map: ice_dun02.gat
-map: ice_dun03.gat
-map: ice_dun04.gat
+map: rachel
+map: ra_in01
+map: ra_fild01
+map: ra_fild02
+map: ra_fild03
+map: ra_fild04
+map: ra_fild05
+map: ra_fild06
+map: ra_fild07
+map: ra_fild08
+map: ra_fild09
+map: ra_fild10
+map: ra_fild11
+map: ra_fild12
+map: ra_fild13
+map: ra_san01
+map: ra_san02
+map: ra_san03
+map: ra_san04
+map: ra_san05
+map: ra_temin
+map: ra_temple
+map: ra_temsky
+map: que_rachel
+map: ice_dun01
+map: ice_dun02
+map: ice_dun03
+map: ice_dun04
// --- Veins & Thor Dungeon ---
// -- 2006-12-19sdata_k.gpf --
-map: que_thor.gat
-map: thor_camp.gat
-map: thor_v01.gat
-map: thor_v02.gat
-map: thor_v03.gat
-map: veins.gat
-map: ve_in.gat
-map: ve_fild01.gat
-map: ve_fild02.gat
-map: ve_fild03.gat
-map: ve_fild04.gat
-map: ve_fild05.gat
-map: ve_fild06.gat
-map: ve_fild07.gat
+map: que_thor
+map: thor_camp
+map: thor_v01
+map: thor_v02
+map: thor_v03
+map: veins
+map: ve_in
+map: ve_fild01
+map: ve_fild02
+map: ve_fild03
+map: ve_fild04
+map: ve_fild05
+map: ve_fild06
+map: ve_fild07
//------------------------- Clone Maps ---------------------------
//------------------------- Extra Maps ---------------------------
@@ -766,60 +766,60 @@ map: ve_fild07.gat
// Ragnarok World Championship 2004
// Requires: RWC 2004 Client
// or Akaru's SuperGRF 1.64 or newer
-//map: rwc01.gat
-//map: rwc02.gat
-//map: rwc03.gat
+//map: rwc01
+//map: rwc02
+//map: rwc03
//Christmas & Sakura Special
//Requires Akaru's SuperGRF 1.1 or newer
-//map: prontera_x.gat
-//map: alberta_x.gat
-//map: aldebaran_x.gat
-//map: geffen_x.gat
-//map: izlude_x.gat
-//map: prt_church_x.gat
-//map: prontera_s.gat
-//map: pay_arche_s.gat
+//map: prontera_x
+//map: alberta_x
+//map: aldebaran_x
+//map: geffen_x
+//map: izlude_x
+//map: prt_church_x
+//map: prontera_s
+//map: pay_arche_s
//Fenced Lutie
//Requires Akaru's SuperGRF 1.23 or newer
-//map: xmas_old.gat
+//map: xmas_old
//Alpha Maps
//Requires adata.grf containing alpha maps and data
-//map: fay_vilg00.gat
-//map: fay_vilg01.gat
-//map: gef_vilg00.gat
-//map: gef_vilg01.gat
-//map: moc_dugn01.gat
-//map: moc_dugn02.gat
-//map: moc_fild01.gat
-//map: moc_fild02.gat
-//map: moc_fild03.gat
-//map: moc_fild04.gat
-//map: moc_intr00.gat
-//map: moc_intr01.gat
-//map: moc_intr02.gat
-//map: moc_intr04.gat
-//map: moc_vilg00.gat
-//map: moc_vilg01.gat
-//map: moc_vilg02.gat
-//map: probemap.gat
-//map: probemap02.gat
-//map: prt_cstl01.gat
-//map: prt_dugn00.gat
-//map: prt_dugn01.gat
-//map: prt_fild00.gat
-//map: prt_fild01.gat
-//map: prt_fild03.gat
-//map: prt_fild04.gat
-//map: prt_fild05.gat
-//map: prt_intr01.gat
-//map: prt_intr01_a.gat
-//map: prt_intr02.gat
-//map: prt_vilg00.gat
-//map: prt_vilg01.gat
-//map: prt_vilg02.gat
-//map: tank_test.gat
-//map: tank_test2.gat
-//map: test.gat
+//map: fay_vilg00
+//map: fay_vilg01
+//map: gef_vilg00
+//map: gef_vilg01
+//map: moc_dugn01
+//map: moc_dugn02
+//map: moc_fild01
+//map: moc_fild02
+//map: moc_fild03
+//map: moc_fild04
+//map: moc_intr00
+//map: moc_intr01
+//map: moc_intr02
+//map: moc_intr04
+//map: moc_vilg00
+//map: moc_vilg01
+//map: moc_vilg02
+//map: probemap
+//map: probemap02
+//map: prt_cstl01
+//map: prt_dugn00
+//map: prt_dugn01
+//map: prt_fild00
+//map: prt_fild01
+//map: prt_fild03
+//map: prt_fild04
+//map: prt_fild05
+//map: prt_intr01
+//map: prt_intr01_a
+//map: prt_intr02
+//map: prt_vilg00
+//map: prt_vilg01
+//map: prt_vilg02
+//map: tank_test
+//map: tank_test2
+//map: test
diff --git a/db/Changelog.txt b/db/Changelog.txt
index 30cf9bad3..a2e396d8d 100644
--- a/db/Changelog.txt
+++ b/db/Changelog.txt
@@ -19,7 +19,10 @@
-----
========================
-
+03/08
+ * Added new map_cache.dat containing every map you need at the moment [DracoRPG]
+ - Beware as it was built by a little-endian (i386), for a little-endian!
+ - It will be updated by devs when new maps will be added to eA
03/07
* Updated skills that shouldn't ignore the target's cards: Smoking, Fling,
Zenynage. [Skotlex]
diff --git a/db/map_cache.dat b/db/map_cache.dat
new file mode 100644
index 000000000..34b8942ee
--- /dev/null
+++ b/db/map_cache.dat
Binary files differ
diff --git a/src/common/core.c b/src/common/core.c
index 94d7272ad..5924a0aa6 100644
--- a/src/common/core.c
+++ b/src/common/core.c
@@ -199,7 +199,6 @@ static void display_title(void)
ShowMessage(""CL_XXBL" ("CL_BOLD" ( e | n | g | l | i | s | h ) ( A | t | h | e | n | a ) "CL_XXBL")"CL_CLL""CL_NORMAL"\n"); // 1: bold char, 0: normal char
ShowMessage(""CL_XXBL" ("CL_BOLD" \\_/ \\_/ \\_/ \\_/ \\_/ \\_/ \\_/ \\_/ \\_/ \\_/ \\_/ \\_/ \\_/ "CL_XXBL")"CL_CLL""CL_NORMAL"\n"); // 1: bold char, 0: normal char
ShowMessage(""CL_XXBL" ("CL_BOLD" "CL_XXBL")"CL_CLL""CL_NORMAL"\n"); // yellow writing (33)
- ShowMessage(""CL_XXBL" ("CL_BT_YELLOW" Advanced Fusion Maps (c) 2003-2005 The Fusion Project "CL_XXBL")"CL_CLL""CL_NORMAL"\n"); // yellow writing (33)
ShowMessage(""CL_WTBL" (=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=)"CL_CLL""CL_NORMAL"\n\n"); // reset color
ShowInfo("SVN Revision: '"CL_WHITE"%s"CL_RESET"'.\n", get_svn_revision());
diff --git a/src/map/atcommand.c b/src/map/atcommand.c
index 1e3af7424..fbd7a28ff 100644
--- a/src/map/atcommand.c
+++ b/src/map/atcommand.c
@@ -100,7 +100,6 @@ ACMD_FUNC(produce);
ACMD_FUNC(memo);
ACMD_FUNC(gat);
ACMD_FUNC(packet);
-ACMD_FUNC(waterlevel);
ACMD_FUNC(statuspoint);
ACMD_FUNC(skillpoint);
ACMD_FUNC(zeny);
@@ -390,7 +389,6 @@ static AtCommandInfo atcommand_info[] = {
{ AtCommand_GAT, "@gat", 99, atcommand_gat }, // debug function
{ AtCommand_Packet, "@packet", 99, atcommand_packet }, // debug function
{ AtCommand_Packet, "@packetmode", 99, atcommand_packet }, // debug function
- { AtCommand_WaterLevel, "@waterlevel", 99, atcommand_waterlevel }, // debug function
{ AtCommand_StatusPoint, "@stpoint", 60, atcommand_statuspoint },
{ AtCommand_SkillPoint, "@skpoint", 60, atcommand_skillpoint },
{ AtCommand_Zeny, "@zeny", 60, atcommand_zeny },
@@ -3936,32 +3934,6 @@ int atcommand_packet(const int fd, struct map_session_data* sd, const char* comm
}
/*==========================================
- * @waterlevel [Skotlex]
- *------------------------------------------
- */
-int atcommand_waterlevel(const int fd, struct map_session_data* sd, const char* command, const char* message)
-{
- int newlevel;
- if (!message || !*message || sscanf(message, "%d", &newlevel) < 1) {
- sprintf(atcmd_output, "%s's current water level: %d", map[sd->bl.m].name, map_waterheight(map[sd->bl.m].name));
- clif_displaymessage(fd, atcmd_output);
- return 0;
- }
-
- if (map_setwaterheight(sd->bl.m, map[sd->bl.m].name, newlevel)) {
- if (newlevel > 0)
- sprintf(atcmd_output, "%s's water level changed to: %d", map[sd->bl.m].name, newlevel);
- else
- sprintf(atcmd_output, "Removed %s's water level information.", map[sd->bl.m].name);
- clif_displaymessage(fd, atcmd_output);
- } else {
- sprintf(atcmd_output, "Failed to change %s's water level.", map[sd->bl.m].name);
- clif_displaymessage(fd, atcmd_output);
- }
- return 0;
-}
-
-/*==========================================
* @stpoint (Rewritten by [Yor])
*------------------------------------------
*/
@@ -5475,8 +5447,6 @@ int atcommand_mapinfo(const int fd, struct map_session_data* sd, const char* com
}
sprintf(atcmd_output, "Map Name: %s | Players In Map: %d | NPCs In Map: %d | Chats In Map: %d", atcmd_player_name, map[m_id].users, map[m_id].npc_num, chat_num);
clif_displaymessage(fd, atcmd_output);
- if (map[m_id].flag.alias)
- strcat(atcmd_output, "This map is an alias (a named clone of some other map).");
clif_displaymessage(fd, "------ Map Flags ------");
strcpy(atcmd_output,"PvP Flags: ");
if (map[m_id].flag.pvp)
diff --git a/src/map/atcommand.h b/src/map/atcommand.h
index 644237245..dfcbd2de7 100644
--- a/src/map/atcommand.h
+++ b/src/map/atcommand.h
@@ -58,7 +58,6 @@ enum AtCommandType {
AtCommand_Model,
AtCommand_Go,
AtCommand_Spawn,
- //AtCommand_Monster, // removed for Skots [Reddozen]
AtCommand_MonsterSmall,
AtCommand_MonsterBig,
AtCommand_KillMonster,
@@ -68,7 +67,6 @@ enum AtCommandType {
AtCommand_Memo,
AtCommand_GAT,
AtCommand_Packet,
- AtCommand_WaterLevel,
AtCommand_StatusPoint,
AtCommand_SkillPoint,
AtCommand_Zeny,
diff --git a/src/map/map.c b/src/map/map.c
index 658628b55..2ae720ddf 100644
--- a/src/map/map.c
+++ b/src/map/map.c
@@ -142,8 +142,6 @@ static int block_free_count = 0, block_free_lock = 0;
static struct block_list *bl_list[BL_LIST_MAX];
static int bl_list_count = 0;
-static char afm_dir[1024] = ""; // [Valaris]
-
struct map_data map[MAX_MAP_PER_SERVER];
int map_num = 0;
@@ -161,11 +159,7 @@ struct charid2nick {
int req_id;
};
-// «Þ«Ã«×«­«ã«Ã«·«å××éÄ«Õ«é«°(map_athana.conf?ªÎread_map_from_cacheªÇò¦E)
-// 0:××éĪ·ªÊª¤ 1:Þª?õêÜÁðí 2:?õêÜÁðí
-int map_read_flag = READ_FROM_GAT;
-char map_cache_file[256]="db/map.info"; // «Þ«Ã«×«­«ã«Ã«·«å«Õ«¡«¤«E£
-
+char map_cache_file[256]="db/map_cache.dat";
char db_path[256] = "db";
char motd_txt[256] = "conf/motd.txt";
char help_txt[256] = "conf/help.txt";
@@ -2432,328 +2426,58 @@ int map_eraseipport(unsigned short mapindex,unsigned long ip,int port)
return 0;
}
-#define NO_WATER 1000000
-
-static int map_setwaterheight_sub(int m) {
- char fn[256];
- char *gat;
- int x,y;
- int wh;
- struct gat_1cell {float high[4]; int type;} *p = NULL;
-
- if (m < 0)
- return 0;
- wh = map[m].water_height;
-
- sprintf(fn,"data\\%s",mapindex_id2name(map[m].index));
-
- // read & convert fn
- // again, might not need to be unsigned char
- gat = (char *) grfio_read (fn);
- if (gat == NULL)
- return 0;
-
- for (y = 0; y < map[m].ys; y++) {
- p = (struct gat_1cell*)(gat+y*map[m].xs*20+14);
- for (x = 0; x < map[m].xs; x++) {
- if (wh != NO_WATER && p->type == 0) //Set water cell
- map[m].gat[x+y*map[m].xs] = (p->high[0]>wh || p->high[1]>wh || p->high[2]>wh || p->high[3]>wh) ? 3 : 0;
- else //Remove water cell
- map[m].gat[x+y*map[m].xs] = p->type==3?0:p->type;
- p++;
- }
- }
- aFree(gat);
- return 1;
-}
-int map_setwaterheight(int m, char *mapname, int height) {
- if (height < 0)
- height = NO_WATER;
- map[m].water_height = height;
- return map_setwaterheight_sub(m);
-}
-
-/* map_readwaterheight
- * Reads from the .rsw for each map
- * Returns water height (or NO_WATER if file doesn't exist)
- * or other error is encountered.
- * This receives a map-name, and changes the extension to rsw if it isn't set already.
- * Assumed path for file is data/mapname.rsw
- * Credits to LittleWolf
- */
-int map_waterheight(char *mapname) {
- char fn[256];
- char *rsw, *found;
- float whtemp;
- int wh;
-
- //Look up for the rsw
- if(!strstr(mapname,"data\\"))
- sprintf(fn,"data\\%s", mapname);
- else
- strcpy(fn, mapname);
-
- found = grfio_find_file(fn);
- if (!found)
- ; //Stick to the current fn
- else if(!strstr(found,"data\\"))
- sprintf(fn,"data\\%s", found);
- else
- strcpy(fn, found);
-
- rsw = strstr(fn, ".");
- if (rsw && strstr(fn, ".rsw") == NULL)
- sprintf(rsw,".rsw");
- // read & convert fn
- // again, might not need to be unsigned char
- rsw = (char *) grfio_read (fn);
- if (rsw)
- { //Load water height from file
- whtemp = *(float*)(rsw+166);
- wh = (int) whtemp;
- aFree(rsw);
- return wh;
- }
- ShowWarning("Failed to find water level for (%s)\n", mapname, fn);
- return NO_WATER;
-}
-
/*==========================================
-* ƒ}ƒbƒvƒLƒƒƒbƒVƒ…‚ɒljÁ‚·‚é
+* Map cache reading
*===========================================*/
-// ƒ}ƒbƒvƒLƒƒƒbƒVƒ…‚ÌÅ‘å’l
-#define MAX_MAP_CACHE 768
+// This is the main header found at the very beginning of the file
+/*struct map_cache_head {
+ long filesize;
+ unsigned short map_count;
+};*/
-//Šeƒ}ƒbƒv‚²‚Æ‚ÌŬŒÀî•ñ‚ð“ü‚ê‚é‚à‚ÌAREAD_FROM_BITMAP—p
+// This is the header appended before every compressed map cells info
struct map_cache_info {
- char fn[32];//ƒtƒ@ƒCƒ‹–¼
- int xs,ys; //•‚Æ‚‚³
- int water_height;
- int pos; // ƒf[ƒ^‚ª“ü‚ê‚Ä‚ ‚éêŠ
- int compressed; // zilb’Ê‚¹‚é‚悤‚É‚·‚éˆ×‚Ì—\–ñ
- int compressed_len; // zilb’Ê‚¹‚é‚悤‚É‚·‚éˆ×‚Ì—\–ñ
-}; // 56 byte
-
-struct map_cache_head {
- int sizeof_header;
- int sizeof_map;
- // ã‚Ì‚Q‚‰ü•Ï•s‰Â
- int nmaps; // ƒ}ƒbƒv‚̌”
- int filesize;
+ char name[MAP_NAME_LENGTH];
+ unsigned short index;
+ short xs;
+ short ys;
+ long len;
};
-struct {
- struct map_cache_head head;
- struct map_cache_info *map;
- FILE *fp;
- int dirty;
-} map_cache;
+FILE *map_cache_fp;
-static int map_cache_open(char *fn);
-static void map_cache_close(void);
-static int map_cache_read(struct map_data *m);
-static int map_cache_write(struct map_data *m);
-
-static int map_cache_open(char *fn)
+int map_readmap(struct map_data *m)
{
- if (map_cache.fp)
- map_cache_close();
- map_cache.fp = fopen(fn, "r+b");
- if (map_cache.fp) {
- fread(&map_cache.head,1,sizeof(struct map_cache_head),map_cache.fp);
- fseek(map_cache.fp,0,SEEK_END);
- if(
- map_cache.head.sizeof_header == sizeof(struct map_cache_head) &&
- map_cache.head.sizeof_map == sizeof(struct map_cache_info) &&
- map_cache.head.filesize == ftell(map_cache.fp)
- ) {
- // ƒLƒƒƒbƒVƒ…“Ç‚ÝbݬŒ÷
- map_cache.map = (struct map_cache_info *) aMalloc(sizeof(struct map_cache_info) * map_cache.head.nmaps);
- fseek(map_cache.fp,sizeof(struct map_cache_head),SEEK_SET);
- fread(map_cache.map,sizeof(struct map_cache_info),map_cache.head.nmaps,map_cache.fp);
+ int i;
+ unsigned short map_count;
+ struct map_cache_info info;
+ unsigned long size;
+ unsigned char *buf;
+
+ fseek(map_cache_fp, 0, SEEK_SET);
+ fread(&map_count, sizeof(map_count), 1, map_cache_fp);
+
+ for(i = 0; i < map_count; i++) {
+ fread(&info, sizeof(info), 1, map_cache_fp);
+ if(strcmp(m->name, info.name) == 0) { // Map found
+ m->index = info.index;
+ m->xs = info.xs;
+ m->ys = info.ys;
+ m->gat = (unsigned char *)aMalloc(m->xs*m->ys); // Allocate room for map cells data
+ buf = aMalloc(info.len); // Allocate a temp buffer to read the zipped map
+ fread(buf, info.len, 1, map_cache_fp);
+ size = m->xs*m->ys;
+ decode_zip(m->gat, &size, buf, info.len); // Unzip the map from the buffer
+ aFree(buf);
return 1;
- }
- fclose(map_cache.fp);
+ } else // Map not found, jump to the beginning of the next map info header
+ fseek(map_cache_fp, info.len, SEEK_CUR);
}
- // “Ç‚ÝbÝ‚ÉŽ¸”s‚µ‚½‚Ì‚ÅV‹K‚É쬂·‚é
- map_cache.fp = fopen(fn,"wb");
- if(map_cache.fp) {
- memset(&map_cache.head,0,sizeof(struct map_cache_head));
- map_cache.map = (struct map_cache_info *) aCalloc(sizeof(struct map_cache_info),MAX_MAP_CACHE);
- map_cache.head.nmaps = MAX_MAP_CACHE;
- map_cache.head.sizeof_header = sizeof(struct map_cache_head);
- map_cache.head.sizeof_map = sizeof(struct map_cache_info);
- map_cache.head.filesize = sizeof(struct map_cache_head);
- map_cache.head.filesize += sizeof(struct map_cache_info) * map_cache.head.nmaps;
-
- map_cache.dirty = 1;
- return 1;
- }
return 0;
}
-static void map_cache_close(void)
-{
- if(!map_cache.fp) { return; }
- if(map_cache.dirty) {
- fseek(map_cache.fp,0,SEEK_SET);
- fwrite(&map_cache.head,1,sizeof(struct map_cache_head),map_cache.fp);
- fwrite(map_cache.map,map_cache.head.nmaps,sizeof(struct map_cache_info),map_cache.fp);
- }
- fclose(map_cache.fp);
- aFree(map_cache.map);
- map_cache.fp = NULL;
- return;
-}
-
-int map_cache_read(struct map_data *m)
-{
- int i;
- if(!map_cache.fp) { return 0; }
- for(i = 0;i < map_cache.head.nmaps ; i++) {
- if(!strcmp(m->name,map_cache.map[i].fn)) {
- if(map_cache.map[i].compressed == 0) {
- // ”ñˆ³kƒtƒ@ƒCƒ‹
- int size = map_cache.map[i].xs * map_cache.map[i].ys;
- m->xs = map_cache.map[i].xs;
- m->ys = map_cache.map[i].ys;
- m->water_height = map_cache.map[i].water_height;
- m->gat = (unsigned char *)aCalloc(m->xs * m->ys,sizeof(unsigned char));
- fseek(map_cache.fp,map_cache.map[i].pos,SEEK_SET);
- if(fread(m->gat,1,size,map_cache.fp) == size) {
- // ¬Œ÷
- return 1;
- } else {
- // ‚È‚º‚©ƒtƒ@ƒCƒ‹Œã”¼‚ªŒ‡‚¯‚Ä‚é‚Ì‚Å“Ç‚Ý’¼‚µ
- m->xs = 0; m->ys = 0; aFree(m->gat); m->gat = NULL;
- return 0;
- }
- } else if(map_cache.map[i].compressed == 1) {
- // ˆ³kƒtƒ‰ƒO=1 : zlib
- unsigned char *buf;
- unsigned long dest_len;
- int size_compress = map_cache.map[i].compressed_len;
- m->xs = map_cache.map[i].xs;
- m->ys = map_cache.map[i].ys;
- m->water_height = map_cache.map[i].water_height;
- m->gat = (unsigned char *)aMalloc(m->xs * m->ys * sizeof(unsigned char));
- buf = (unsigned char*)aMalloc(size_compress);
- fseek(map_cache.fp,map_cache.map[i].pos,SEEK_SET);
- if(fread(buf,1,size_compress,map_cache.fp) != size_compress) {
- // ‚È‚º‚©ƒtƒ@ƒCƒ‹Œã”¼‚ªŒ‡‚¯‚Ä‚é‚Ì‚Å“Ç‚Ý’¼‚µ
- ShowError("fread error\n");
- aFree(m->gat); m->xs = 0; m->ys = 0; m->gat = NULL;
- aFree(buf);
- return 0;
- }
- dest_len = m->xs * m->ys;
- decode_zip(m->gat,&dest_len,buf,size_compress);
- if(dest_len != map_cache.map[i].xs * map_cache.map[i].ys) {
- // ³í‚ɉ𓀂ªo—ˆ‚Ä‚È‚¢
- aFree(m->gat); m->xs = 0; m->ys = 0; m->gat = NULL;
- aFree(buf);
- return 0;
- }
- aFree(buf);
- return 1;
- }
- }
- }
- return 0;
-}
-
-static int map_cache_write(struct map_data *m)
-{
- int i;
- unsigned long len_new , len_old;
- char *write_buf;
- if(!map_cache.fp) { return 0; }
- for(i = 0;i < map_cache.head.nmaps ; i++) {
- if(!strcmp(m->name,map_cache.map[i].fn)) {
- // “¯‚¶ƒGƒ“ƒgƒŠ[‚ª‚ ‚ê‚Îã‘‚«
- if(map_cache.map[i].compressed == 0) {
- len_old = map_cache.map[i].xs * map_cache.map[i].ys;
- } else if(map_cache.map[i].compressed == 1) {
- len_old = map_cache.map[i].compressed_len;
- } else {
- // ƒTƒ|[ƒg‚³‚ê‚Ä‚È‚¢Œ`Ž®‚È‚Ì‚Å’·‚³‚O
- len_old = 0;
- }
- if(map_read_flag == 2) {
- // ˆ³k•Û‘¶
- // ‚³‚·‚ª‚É‚Q”{‚É–c‚ê‚鎖‚Í‚È‚¢‚Æ‚¢‚¤Ž–‚Å
- write_buf = (char *) aMalloc(m->xs * m->ys * 2);
- len_new = m->xs * m->ys * 2;
- encode_zip((unsigned char *) write_buf,&len_new,m->gat,m->xs * m->ys);
- map_cache.map[i].compressed = 1;
- map_cache.map[i].compressed_len = len_new;
- } else {
- len_new = m->xs * m->ys;
- write_buf = (char *) m->gat;
- map_cache.map[i].compressed = 0;
- map_cache.map[i].compressed_len = 0;
- }
- if(len_new <= len_old) {
- // ƒTƒCƒY‚ª“¯‚¶‚©¬‚³‚­‚È‚Á‚½‚Ì‚Åꊂ͕ςí‚ç‚È‚¢
- fseek(map_cache.fp,map_cache.map[i].pos,SEEK_SET);
- fwrite(write_buf,1,len_new,map_cache.fp);
- } else {
- // V‚µ‚¢êŠ‚É“o˜^
- fseek(map_cache.fp,map_cache.head.filesize,SEEK_SET);
- fwrite(write_buf,1,len_new,map_cache.fp);
- map_cache.map[i].pos = map_cache.head.filesize;
- map_cache.head.filesize += len_new;
- }
- map_cache.map[i].xs = m->xs;
- map_cache.map[i].ys = m->ys;
- map_cache.map[i].water_height = m->water_height;
- map_cache.dirty = 1;
- if(map_read_flag == 2) {
- aFree(write_buf);
- }
- return 0;
- }
- }
- // “¯‚¶ƒGƒ“ƒgƒŠ‚ª–³‚¯‚ê‚Α‚«bß‚éꊂð’T‚·
- for(i = 0;i < map_cache.head.nmaps ; i++) {
- if(map_cache.map[i].fn[0] == 0) {
- // V‚µ‚¢êŠ‚É“o˜^
- if(map_read_flag == 2) {
- write_buf = (char *) aMalloc(m->xs * m->ys * 2);
- len_new = m->xs * m->ys * 2;
- encode_zip((unsigned char *) write_buf,&len_new,m->gat,m->xs * m->ys);
- map_cache.map[i].compressed = 1;
- map_cache.map[i].compressed_len = len_new;
- } else {
- len_new = m->xs * m->ys;
- write_buf = (char *) m->gat;
- map_cache.map[i].compressed = 0;
- map_cache.map[i].compressed_len = 0;
- }
- strncpy(map_cache.map[i].fn,m->name,sizeof(map_cache.map[0].fn));
- fseek(map_cache.fp,map_cache.head.filesize,SEEK_SET);
- fwrite(write_buf,1,len_new,map_cache.fp);
- map_cache.map[i].pos = map_cache.head.filesize;
- map_cache.map[i].xs = m->xs;
- map_cache.map[i].ys = m->ys;
- map_cache.map[i].water_height = m->water_height;
- map_cache.head.filesize += len_new;
- map_cache.dirty = 1;
- if(map_read_flag == 2)
- aFree(write_buf);
- return 0;
- }
- }
- // ‘‚«bß‚È‚©‚Á‚½
- return 1;
-}
-
-/*==========================================
- * ?‚Ý?‚Þmap‚ð’ljÁ‚·‚é
- *------------------------------------------
- */
int map_addmap(char *mapname) {
if (strcmpi(mapname,"clear")==0) {
map_num=0;
@@ -2770,10 +2494,6 @@ int map_addmap(char *mapname) {
return 0;
}
-/*==========================================
- * Removes the map in the index passed.
- *------------------------------------------
- */
static void map_delmapid(int id)
{
ShowNotice("Removing map [ %s ] from maplist\n",map[id].name);
@@ -2781,10 +2501,6 @@ static void map_delmapid(int id)
map_num--;
}
-/*==========================================
- * ?‚Ý?‚Þmap‚ð휂·‚é
- *------------------------------------------
- */
int map_delmap(char *mapname) {
int i;
@@ -2803,323 +2519,29 @@ int map_delmap(char *mapname) {
return 0;
}
-////////////////////////////////////////////////
-
-/*
- Advanced Fusion Maps Support
- (c) 2003-2004, The Fusion Project
- - AlexKreuz
-
- The following code has been provided by me for eAthena
- under the GNU GPL. It provides Advanced Fusion
- Map, the map format desgined by me for Fusion, support
- for the eAthena emulator.
-
- I understand that because it is under the GPL
- that other emulators may very well use this code in their
- GNU project as well.
-
- The AFM map format was not originally a part of the GNU
- GPL. It originated from scratch by my own hand. I understand
- that distributing this code to read the AFM maps with eAthena
- causes the GPL to apply to this code. But the actual AFM
- maps are STILL copyrighted to the Fusion Project. By choosing
-
- In exchange for that 'act of faith' I ask for the following.
-
- A) Give credit where it is due. If you use this code, do not
- place your name on the changelog. Credit should be given
- to AlexKreuz.
- B) As an act of courtesy, ask me and let me know that you are putting
- AFM support in your project. You will have my blessings if you do.
- C) Use the code in its entirety INCLUDING the copyright message.
- Although the code provided may now be GPL, the AFM maps are not
- and so I ask you to display the copyright message on the STARTUP
- SCREEN as I have done here. (refer to core.c)
- "Advanced Fusion Maps (c) 2003-2004 The Fusion Project"
-
- Without this copyright, you are NOT entitled to bundle or distribute
- the AFM maps at all. On top of that, your "support" for AFM maps
- becomes just as shady as your "support" for Gravity GRF files.
-
- The bottom line is this. I know that there are those of you who
- would like to use this code but aren't going to want to provide the
- proper credit. I know this because I speak frome experience. If
- you are one of those people who is going to try to get around my
- requests, then save your breath because I don't want to hear it.
-
- I have zero faith in GPL and I know and accept that if you choose to
- not display the copyright for the AFMs then there is absolutely nothing
- I can do about it. I am not about to start a legal battle over something
- this silly.
-
- Provide the proper credit because you believe in the GPL. If you choose
- not to and would rather argue about it, consider the GPL failed.
-
- October 18th, 2004
- - AlexKreuz
- - The Fusion Project
- */
-static int map_loadafm (struct map_data *m, char *fn)
-{
- // check if .afm file exists
- FILE *afm_file = fopen(fn, "r");
- if (afm_file != NULL) {
- int x,y,xs,ys;
- char afm_line[65535];
- int afm_size[2];
- char *str;
-
- //Gotta skip the first two lines which are just a header of sorts.
- str = fgets(afm_line, sizeof(afm_line)-1, afm_file);
- str = fgets(afm_line, sizeof(afm_line)-1, afm_file);
- str = fgets(afm_line, sizeof(afm_line)-1, afm_file);
- if (!str) return 0;
- sscanf(str , "%d%d", &afm_size[0], &afm_size[1]);
-
- xs = m->xs = afm_size[0];
- ys = m->ys = afm_size[1];
- m->water_height = map_waterheight(m->name);
- // check this, unsigned where it might not need to be
- m->gat = (unsigned char*)aMallocA(xs * ys);
-
- for (y = 0; y < ys; y++) {
- str = fgets(afm_line, sizeof(afm_line)-1, afm_file);
- for (x = 0; x < xs; x++)
- m->gat[x+y*xs] = str[x]-48;
- }
-
- fclose(afm_file);
- return 1;
- }
-
- return 0;
-}
-/*==================================
- * .AFM format
- *----------------------------------
- */
-int map_readafm (struct map_data *m)
-{
- char afm_name[256] = "";
- char fn[256], *p;
-
- // convert map name to .afm
- if(!strstr(m->name, ".afm")) {
- // check if it's necessary to replace the extension - speeds up loading a bit
- strncpy(afm_name, m->name, strlen(m->name) - 4);
- strcat(afm_name, ".afm");
- } else {
- strcpy(afm_name, m->name);
- }
-
- sprintf(fn, "%s\\%s", afm_dir, afm_name);
- for (p = &fn[0]; *p != 0; p++)
- if (*p == '\\') *p = '/'; // * At the time of Unix
-
- return map_loadafm(m, fn);
-}
-/*==================================
- * .AF2 format
- *----------------------------------
- */
-int map_readaf2 (struct map_data *m)
-{
- FILE *af2_file;
- char af2_name[256] = "";
- char fn[256], *p, *out;
-
- // convert map name to .af2
- p = out = m->name;
- while ((p = strchr(p, '/')) != NULL)
- out = ++p;
- strncpy (af2_name, out, strlen(out));
- // grr, this is so troublesome >.< [celest]
- p = strrchr (af2_name, '.');
- if (p) *p++ = 0;
- strcat(af2_name, ".af2");
- sprintf(fn, "%s\\%s", afm_dir, af2_name);
- for (p = &fn[0]; *p != 0; p++)
- if (*p == '\\') *p = '/'; // * At the time of Unix
-
- // check if .af2 file exists
- af2_file = fopen(fn, "r");
- if (af2_file != NULL) {
- char out_file[256];
-
- fclose(af2_file);
-
- // convert map name to .out
- strncpy (out_file, out, strlen(out));
- p = strrchr (out_file, '.');
- if (p) *p++ = 0;
- strcat(out_file, ".out");
-
- // unzip .out file and use loadafm()
- if (deflate_file(fn, out_file) &&
- map_loadafm(m, out_file))
- {
- unlink (out_file);
- return 1;
- }
- }
-
- return 0;
-}
-
-
-/*==========================================
- * ƒ}ƒbƒv1–‡“Ç‚ÝbÝ
- * ===================================================*/
-//static int map_readmap(int m,char *fn, char *alias, int *map_cache, int maxmap) {
-
-/*==================================
- * .GAT format
- *----------------------------------
- */
-int map_readgat (struct map_data *m)
-{
- char fn[256];
- char *gat;
- int wh,x,y,xs,ys;
- struct gat_1cell {float high[4]; int type;} *p = NULL;
-
- if (strstr(m->name,".gat") == NULL)
- return 0;
-
- sprintf(fn,"data\\%s",m->name);
-
- // read & convert fn
- // again, might not need to be unsigned char
- gat = (char *) grfio_read (fn);
- if (gat == NULL)
- return 0;
-
- xs = m->xs = *(int*)(gat+6);
- ys = m->ys = *(int*)(gat+10);
- m->gat = (unsigned char *)aMallocA((m->xs * m->ys)*sizeof(unsigned char));
-
- m->water_height = wh = map_waterheight(m->name);
- for (y = 0; y < ys; y++) {
- p = (struct gat_1cell*)(gat+y*xs*20+14);
- for (x = 0; x < xs; x++) {
- if (wh != NO_WATER && p->type == 0)
- // …ê”»’è
- m->gat[x+y*xs] = (p->high[0]>wh || p->high[1]>wh || p->high[2]>wh || p->high[3]>wh) ? 3 : 0;
- else
- m->gat[x+y*xs] = p->type;
- p++;
- }
- }
-
- aFree(gat);
-
- return 1;
-}
-
-//////////////////////////////////////////////////////
-
-static int map_cache_init (void);
-static int map_readafm_init (void);
-static int map_readaf2_init (void);
-static int map_readgat_init (void);
-
-// Todo: Properly implement this system as plugins/safer code [Celest]
-enum {
- MAP_CACHE = 0, // jAthena map cache
- MAP_AFM, // Advanced Fusion Map
- MAP_AF2, // Advanced Fusion Map
- MAP_GAT, // GRF map
- MAP_MAXSOURCE
-};
-// in descending order
-int (*mapsource_init[MAP_MAXSOURCE])(void) = {
- map_cache_init,
- map_readafm_init,
- map_readaf2_init,
- map_readgat_init
-};
-int (*mapsource_read[MAP_MAXSOURCE])(struct map_data *) = {
- map_cache_read,
- map_readafm,
- map_readaf2,
- map_readgat
-};
-void (*mapsource_final[MAP_MAXSOURCE])(void) = {
- map_cache_close,
- NULL,
- NULL,
- NULL
-};
-
-static int map_cache_init (void)
-{
- if (map_read_flag >= READ_FROM_BITMAP && map_cache_open(map_cache_file)) {
- ShowMessage("[cache] ");
- return 1;
- }
-
- return 0;
-}
-static int map_readafm_init (void)
-{
- ShowMessage("[afm] ");
- return 1;
-}
-static int map_readaf2_init (void)
-{
- // check if AFM loading is available,
- // otherwise disable AF2 loading
- if (mapsource_read[1] != NULL) {
- ShowMessage("[af2] ");
- return 1;
- }
-
- return 0;
-}
-static int map_readgat_init (void)
-{
- ShowMessage("[gat] ");
- return 1;
-}
-
/*======================================
* Initiate maps loading stage
*--------------------------------------
*/
-int map_readallmaps (void)
+int map_readallmaps()
{
- // pre-loading stage
int i;
int maps_removed = 0;
- int maps_cached = 0;
- ShowMessage(CL_GREEN"[Status]"CL_RESET": Loading Maps with... "CL_WHITE);
-
- for (i = 0; i < MAP_MAXSOURCE; i++) {
- if (mapsource_init[i] && // check if source requires initialisation
- mapsource_init[i]() == 0) // if init failed
- {
- // remove all loading methods associated with this source
- mapsource_init[i] = NULL;
- mapsource_read[i] = NULL;
- mapsource_final[i] = NULL;
- }
- }
+ if(!(map_cache_fp = fopen(map_cache_file, "rb")))
+ ShowError("Unable to open map cache file "CL_WHITE"%s"CL_RESET"\n", map_cache_file);
- ShowMessage(CL_RESET"\n");
+ ShowStatus("Loading maps...\n");
- // initiate map loading
- for (i = 0; i < map_num; i++)
+ for(i = 0; i < map_num; i++)
{
- int success = 0;
static int lasti = -1;
static int last_time = -1;
int j = i*20/map_num;
+ size_t size;
// show progress
- if (map_num && //avoid map-server crashing if there are 0 maps
- (j != lasti || last_time != time(0)))
+ if(j != lasti || last_time != time(0))
{
char progress[21] = " ";
char c = '-';
@@ -3141,99 +2563,52 @@ int map_readallmaps (void)
fflush(stdout);
}
- // pre-init some data
- map[i].alias = NULL;
+ if(!map_readmap(&map[i])) {
+ map_delmapid(i);
+ maps_removed++;
+ i--;
+ continue;
+ }
+
+ if (uidb_get(map_db,(unsigned int)map[i].index) != NULL) {
+ ShowWarning("Map %s already loaded!\n", map[i].name);
+ if (map[i].gat) {
+ aFree(map[i].gat);
+ map[i].gat = NULL;
+ }
+ map_delmapid(i);
+ maps_removed++;
+ i--;
+ continue;
+ }
+
map[i].m = i;
- memset (map[i].moblist, 0, sizeof(map[i].moblist)); //Initialize moblist [Skotlex]
+ memset(map[i].moblist, 0, sizeof(map[i].moblist)); //Initialize moblist [Skotlex]
map[i].mob_delete_timer = -1; //Initialize timer [Skotlex]
- if (battle_config.pk_mode)
+ if(battle_config.pk_mode)
map[i].flag.pvp = 1; // make all maps pvp for pk_mode [Valaris]
- for (j = 0; j < MAP_MAXSOURCE; j++)
- {
- if (mapsource_read[j] && // check if map source is valid
- mapsource_read[j](&map[i])) // check if map source is available
- {
- // successful, now initialise map
- size_t size;
- char *alias;
-
- if (map[i].alias && (alias = strstr(map[i].name, "<")) != NULL) { // alias has been set by one of the sources
- *alias++ = '\0';
- }
- if (map[i].alias)
- map[i].index = mapindex_name2id(map[i].alias);
- else
- map[i].index = mapindex_name2id(map[i].name);
-
- if (!map[i].index) {
- if (map[i].alias)
- ShowWarning("Map %s (alias %s) is not in the map-index cache!\n", map[i].name, map[i].alias);
- else
- ShowWarning("Map %s is not in the map-index cache!\n", map[i].name);
- success = 0; //Can't load a map that isn't in our cache.
- if (map[i].gat) {
- aFree(map[i].gat);
- map[i].gat = NULL;
- }
- break;
- }
- if (uidb_get(map_db,(unsigned int)map[i].index) != NULL) {
- ShowWarning("Map %s already loaded!\n", map[i].name);
- success = 0; //Can't load a map already in the db
- if (map[i].gat) {
- aFree(map[i].gat);
- map[i].gat = NULL;
- }
- break;
- }
-
- map[i].cell = (unsigned char *)aCalloc(map[i].xs * map[i].ys, sizeof(unsigned char));
+ map[i].cell = (unsigned char *)aCalloc(map[i].xs * map[i].ys, sizeof(unsigned char));
#ifdef CELL_NOSTACK
- map[i].cell_bl = (unsigned char *)aCalloc(map[i].xs * map[i].ys, sizeof(unsigned char));
+ map[i].cell_bl = (unsigned char *)aCalloc(map[i].xs * map[i].ys, sizeof(unsigned char));
#endif
- map[i].bxs = (map[i].xs + BLOCK_SIZE - 1) / BLOCK_SIZE;
- map[i].bys = (map[i].ys + BLOCK_SIZE - 1) / BLOCK_SIZE;
-
- // default experience multiplicator
- map[i].jexp = 100;
- map[i].bexp = 100;
-
- size = map[i].bxs * map[i].bys * sizeof(struct block_list*);
- map[i].block = (struct block_list**)aCalloc(size, 1);
- map[i].block_mob = (struct block_list**)aCalloc(size, 1);
-
- size = map[i].bxs * map[i].bys * sizeof(int);
- map[i].block_count = (int*)aCallocA(size, 1);
- map[i].block_mob_count = (int*)aCallocA(size, 1);
-
- uidb_put(map_db, (unsigned int)map[i].index, &map[i]);
-
- // cache our map if necessary
- if (j != MAP_CACHE && mapsource_read[MAP_CACHE] != NULL) { // map data is not cached yet
- map_cache_write(&map[i]);
- maps_cached++;
- }
-
- // next map
- success = 1;
- break;
- }
- }
+ map[i].bxs = (map[i].xs + BLOCK_SIZE - 1) / BLOCK_SIZE;
+ map[i].bys = (map[i].ys + BLOCK_SIZE - 1) / BLOCK_SIZE;
+
+ // default experience multiplicators
+ map[i].jexp = 100;
+ map[i].bexp = 100;
+
+ size = map[i].bxs * map[i].bys * sizeof(struct block_list*);
+ map[i].block = (struct block_list**)aCalloc(size, 1);
+ map[i].block_mob = (struct block_list**)aCalloc(size, 1);
- // no sources have been found, so remove map from list
- if (!success) {
- map_delmapid(i);
- maps_removed++;
- i--;
- }
- }
+ size = map[i].bxs * map[i].bys * sizeof(int);
+ map[i].block_count = (int*)aCallocA(size, 1);
+ map[i].block_mob_count = (int*)aCallocA(size, 1);
- // unload map sources
- for (i = 0; i < MAP_MAXSOURCE; i++) {
- if (mapsource_final[i])
- mapsource_final[i]();
+ uidb_put(map_db, (unsigned int)map[i].index, &map[i]);
}
// finished map loading
@@ -3241,9 +2616,7 @@ int map_readallmaps (void)
ShowInfo("Successfully loaded '"CL_WHITE"%d"CL_RESET"' maps.%30s\n",map_num,"");
if (maps_removed)
- ShowNotice("Maps Removed: '"CL_WHITE"%d"CL_RESET"'\n",maps_removed);
- if (maps_cached)
- ShowNotice("Maps Added to Cache: '"CL_WHITE"%d"CL_RESET"'\n",maps_cached);
+ ShowNotice("Maps removed: '"CL_WHITE"%d"CL_RESET"'\n",maps_removed);
return 0;
}
@@ -3409,19 +2782,10 @@ int map_config_read(char *cfgName) {
strcpy(charhelp_txt, w2);
} else if (strcmpi(w1, "mapreg_txt") == 0) {
strcpy(mapreg_txt, w2);
- } else if(strcmpi(w1,"read_map_from_cache") == 0){
- if (atoi(w2) == 2)
- map_read_flag = READ_FROM_BITMAP_COMPRESSED;
- else if (atoi(w2) == 1)
- map_read_flag = READ_FROM_BITMAP;
- else
- map_read_flag = READ_FROM_GAT;
} else if(strcmpi(w1,"map_cache_file") == 0) {
strncpy(map_cache_file,w2,255);
} else if(strcmpi(w1,"db_path") == 0) {
strncpy(db_path,w2,255);
- } else if(strcmpi(w1,"afm_dir") == 0) {
- strcpy(afm_dir, w2);
} else if (strcmpi(w1, "console") == 0) {
if(strcmpi(w2,"on") == 0 || strcmpi(w2,"yes") == 0 ) {
console = 1;
@@ -3740,9 +3104,6 @@ void do_final(void) {
ShowStatus("Terminating...\n");
- //we probably don't need the cache open at all times 'yet', so this is closed by mapsource_final [celest]
- //map_cache_close();
-
for (i = 0; i < map_num; i++)
if (map[i].m >= 0)
map_foreachinmap(cleanup_sub, i, BL_ALL);
@@ -3761,9 +3122,8 @@ void do_final(void) {
do_final_atcommand();
do_final_battle();
- do_final_chrif(); // ‚±‚Ì“à•”‚ŃLƒƒƒ‰‚ð‘S‚ÄØ’f‚·‚é
+ do_final_chrif();
do_final_npc();
-// map_removenpc();
do_final_script();
do_final_itemdb();
do_final_storage();
@@ -3804,8 +3164,6 @@ void do_final(void) {
pc_db->destroy(pc_db, NULL);
charid_db->destroy(charid_db, NULL);
-//#endif
-
#ifndef TXT_ONLY
map_sql_close();
if(charsave_method)
diff --git a/src/map/map.h b/src/map/map.h
index 9a3df879f..087f1e4e4 100644
--- a/src/map/map.h
+++ b/src/map/map.h
@@ -1073,18 +1073,15 @@ struct map_data {
#ifdef CELL_NOSTACK
unsigned char *cell_bl; //Holds amount of bls in any given cell.
#endif
- char *alias; // [MouseJstr]
struct block_list **block;
struct block_list **block_mob;
int *block_count,*block_mob_count;
int m;
short xs,ys;
short bxs,bys;
- int water_height;
int npc_num;
int users;
struct map_flag {
- unsigned alias : 1;
unsigned nomemo : 1;
unsigned noteleport : 1;
unsigned noreturn : 1;
diff --git a/src/tool/mapcache.c b/src/tool/mapcache.c
index f2d638d34..30c057f87 100644
--- a/src/tool/mapcache.c
+++ b/src/tool/mapcache.c
@@ -14,7 +14,7 @@
char grf_list_file[256] = "tools/mapcache/grf_files.txt";
char map_list_file[256] = "tools/mapcache/map_list.txt";
-char map_cache_file[256] = "map_cache.dat";
+char map_cache_file[256] = "db/map_cache.dat";
#define MAP_NAME_LENGTH 16
#define NO_WATER 1000000
@@ -26,6 +26,9 @@ struct map_data {
unsigned char *cells;
};
+// This is the main header found at the very beginning of the file
+unsigned short map_count;
+
// This is the header appended before every compressed map cells info
struct map_cache_info {
char name[MAP_NAME_LENGTH];
@@ -35,16 +38,10 @@ struct map_cache_info {
long len;
};
-// This is the main header found at the very beginning of the file
-struct map_cache_head {
- short sizeof_header;
- short sizeof_mapinfo;
- long filesize;
- unsigned short map_count;
-} header;
-
FILE *map_cache_fp;
+int filesize;
+
// Read map from GRF's GAT and RSW files
int read_map(char *name, struct map_data *m)
@@ -118,11 +115,11 @@ void cache_map(char *name, unsigned short index, struct map_data *m)
info.len = len;
// Append map header then compressed cells at the end of the file
- fseek(map_cache_fp, header.filesize, SEEK_SET);
+ fseek(map_cache_fp, filesize, SEEK_SET);
fwrite(&info, sizeof(struct map_cache_info), 1, map_cache_fp);
fwrite(write_buf, 1, len, map_cache_fp);
- header.map_count++;
- header.filesize += header.sizeof_mapinfo + len;
+ map_count++;
+ filesize += sizeof(struct map_cache_info) + len;
free(write_buf);
free(m->cells);
@@ -161,10 +158,8 @@ int main(int argc, char *argv[])
}
// Initialize the main header
- header.sizeof_header = sizeof(struct map_cache_head);
- header.sizeof_mapinfo = sizeof(struct map_cache_info);
- header.map_count = 0;
- header.filesize = sizeof(struct map_cache_head);
+ map_count = 0;
+ filesize = sizeof(map_count);
// Read and process the map list
while(fgets(line, 1020, list)){
@@ -190,13 +185,13 @@ int main(int argc, char *argv[])
printf("Closing map cache: %s\n", map_cache_file);
// Write the main header and close the map cache
fseek(map_cache_fp, 0, SEEK_SET);
- fwrite(&header, sizeof(struct map_cache_head), 1, map_cache_fp);
+ fwrite(&map_count, sizeof(map_count), 1, map_cache_fp);
fclose(map_cache_fp);
printf("Finalizing grfio\n");
grfio_final();
- printf("%d maps cached\n", header.map_count);
+ printf("%d maps cached\n", map_count);
return 0;
}