From 92725cef35bead1b7e6b934e3861b46393b74797 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 28 Nov 2014 16:38:32 +0300 Subject: Move data files into data directory. --- src/Makefile.am | 8 ++++---- src/map/clif.c | 4 ++-- src/map/data/mapd.c | 39 +++++++++++++++++++++++++++++++++++++++ src/map/data/mapd.h | 12 ++++++++++++ src/map/data/session.c | 46 ++++++++++++++++++++++++++++++++++++++++++++++ src/map/data/session.h | 13 +++++++++++++ src/map/lang.c | 2 +- src/map/mapd.c | 39 --------------------------------------- src/map/mapd.h | 12 ------------ src/map/npc.c | 2 +- src/map/parse.c | 2 +- src/map/pc.c | 2 +- src/map/script.c | 4 ++-- src/map/session.c | 46 ---------------------------------------------- src/map/session.h | 13 ------------- 15 files changed, 122 insertions(+), 122 deletions(-) create mode 100644 src/map/data/mapd.c create mode 100644 src/map/data/mapd.h create mode 100644 src/map/data/session.c create mode 100644 src/map/data/session.h delete mode 100644 src/map/mapd.c delete mode 100644 src/map/mapd.h delete mode 100644 src/map/session.c delete mode 100644 src/map/session.h diff --git a/src/Makefile.am b/src/Makefile.am index d7966c2..514a0b7 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -19,8 +19,6 @@ MAP_SRC = map/clif.c \ map/init.c \ map/lang.c \ map/lang.h \ - map/mapd.c \ - map/mapd.h \ map/npc.c \ map/npc.h \ map/parse.c \ @@ -34,8 +32,10 @@ MAP_SRC = map/clif.c \ map/scriptdefines.h \ map/send.c \ map/send.h \ - map/session.c \ - map/session.h \ + map/data/mapd.c \ + map/data/mapd.h \ + map/data/session.c \ + map/data/session.h \ map/struct/mapdext.h \ map/struct/sessionext.h \ map/utils/formatutils.c \ diff --git a/src/map/clif.c b/src/map/clif.c index 0ea0983..5868c5e 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -17,9 +17,9 @@ #include "map/clif.h" #include "map/lang.h" -#include "map/mapd.h" #include "map/send.h" -#include "map/session.h" +#include "map/data/mapd.h" +#include "map/data/session.h" #include "map/struct/mapdext.h" #include "map/struct/sessionext.h" diff --git a/src/map/data/mapd.c b/src/map/data/mapd.c new file mode 100644 index 0000000..6ce239c --- /dev/null +++ b/src/map/data/mapd.c @@ -0,0 +1,39 @@ +// Copyright (c) Copyright (c) Hercules Dev Team, licensed under GNU GPL. +// Copyright (c) 2014 Evol developers + +#include +#include +#include + +#include "../../../common/HPMi.h" +#include "../../../common/malloc.h" +#include "../../../common/mmo.h" +#include "../../../common/socket.h" +#include "../../../common/strlib.h" +#include "../../../map/map.h" + +#include "map/data/mapd.h" +#include "map/struct/mapdext.h" + +struct MapdExt *mapd_get(int m) +{ + struct map_data *md = &map->list[m]; + struct MapdExt *data = getFromMAPD(md, 0); + if (!data) + { + data = mapd_create(); + addToMAPD(md, data, 0, true); + } + return data; +} + +struct MapdExt *mapd_create(void) +{ + struct MapdExt *data = NULL; + CREATE(data, struct MapdExt, 1); + if (!data) + return NULL; + data->mask = 0; + data->invisible = false; + return data; +} diff --git a/src/map/data/mapd.h b/src/map/data/mapd.h new file mode 100644 index 0000000..a0878ae --- /dev/null +++ b/src/map/data/mapd.h @@ -0,0 +1,12 @@ +// Copyright (c) Copyright (c) Hercules Dev Team, licensed under GNU GPL. +// Copyright (c) 2014 Evol developers + +#ifndef EVOL_MAP_MAPD +#define EVOL_MAP_MAPD + +struct MapdExt; + +struct MapdExt *mapd_get(int fd); +struct MapdExt *mapd_create(void); + +#endif // EVOL_MAP_MAPD diff --git a/src/map/data/session.c b/src/map/data/session.c new file mode 100644 index 0000000..fd1c0d5 --- /dev/null +++ b/src/map/data/session.c @@ -0,0 +1,46 @@ +// Copyright (c) Copyright (c) Hercules Dev Team, licensed under GNU GPL. +// Copyright (c) 2014 Evol developers + +#include +#include +#include + +#include "../../../common/HPMi.h" +#include "../../../common/malloc.h" +#include "../../../common/mmo.h" +#include "../../../common/socket.h" +#include "../../../common/strlib.h" +#include "../../../map/pc.h" + +#include "map/data/session.h" +#include "map/struct/sessionext.h" + +struct SessionExt *session_get(int fd) +{ + struct SessionExt *data = getFromSession(session[fd], 0); + if (!data) + { + data = session_create(); + addToSession(session[fd], data, 0, true); + } + return data; +} + +struct SessionExt *session_get_bysd(struct map_session_data *sd) +{ + if (!sd) + return NULL; + + return session_get(sd->fd); +} + +struct SessionExt *session_create(void) +{ + struct SessionExt *data = NULL; + CREATE(data, struct SessionExt, 1); + if (!data) + return NULL; + data->clientVersion = 0; + data->language = 0; + return data; +} diff --git a/src/map/data/session.h b/src/map/data/session.h new file mode 100644 index 0000000..40b05e6 --- /dev/null +++ b/src/map/data/session.h @@ -0,0 +1,13 @@ +// Copyright (c) Copyright (c) Hercules Dev Team, licensed under GNU GPL. +// Copyright (c) 2014 Evol developers + +#ifndef EVOL_MAP_SESSION +#define EVOL_MAP_SESSION + +struct SessionExt; + +struct SessionExt *session_get(int fd); +struct SessionExt *session_get_bysd(struct map_session_data *sd); +struct SessionExt *session_create(void); + +#endif // EVOL_MAP_SESSION diff --git a/src/map/lang.c b/src/map/lang.c index 66cdb0d..6264cef 100644 --- a/src/map/lang.c +++ b/src/map/lang.c @@ -14,7 +14,7 @@ #include "../../../map/pc.h" #include "map/lang.h" -#include "map/session.h" +#include "map/data/session.h" #include "map/struct/sessionext.h" #define MAX_LANGS 100 diff --git a/src/map/mapd.c b/src/map/mapd.c deleted file mode 100644 index 7b72d6d..0000000 --- a/src/map/mapd.c +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Copyright (c) Hercules Dev Team, licensed under GNU GPL. -// Copyright (c) 2014 Evol developers - -#include -#include -#include - -#include "../../../common/HPMi.h" -#include "../../../common/malloc.h" -#include "../../../common/mmo.h" -#include "../../../common/socket.h" -#include "../../../common/strlib.h" -#include "../../../map/map.h" - -#include "map/mapd.h" -#include "map/struct/mapdext.h" - -struct MapdExt *mapd_get(int m) -{ - struct map_data *md = &map->list[m]; - struct MapdExt *data = getFromMAPD(md, 0); - if (!data) - { - data = mapd_create(); - addToMAPD(md, data, 0, true); - } - return data; -} - -struct MapdExt *mapd_create(void) -{ - struct MapdExt *data = NULL; - CREATE(data, struct MapdExt, 1); - if (!data) - return NULL; - data->mask = 0; - data->invisible = false; - return data; -} diff --git a/src/map/mapd.h b/src/map/mapd.h deleted file mode 100644 index a0878ae..0000000 --- a/src/map/mapd.h +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (c) Copyright (c) Hercules Dev Team, licensed under GNU GPL. -// Copyright (c) 2014 Evol developers - -#ifndef EVOL_MAP_MAPD -#define EVOL_MAP_MAPD - -struct MapdExt; - -struct MapdExt *mapd_get(int fd); -struct MapdExt *mapd_create(void); - -#endif // EVOL_MAP_MAPD diff --git a/src/map/npc.c b/src/map/npc.c index f5a07ea..7478f0f 100644 --- a/src/map/npc.c +++ b/src/map/npc.c @@ -14,7 +14,7 @@ #include "../../../map/npc.h" #include "../../../map/pc.h" -#include "map/mapd.h" +#include "map/data/mapd.h" #include "map/struct/mapdext.h" #include "map/npc.h" diff --git a/src/map/parse.c b/src/map/parse.c index 954e45c..0d09163 100644 --- a/src/map/parse.c +++ b/src/map/parse.c @@ -12,7 +12,7 @@ #include "../../../common/strlib.h" #include "map/parse.h" -#include "map/session.h" +#include "map/data/session.h" #include "map/struct/sessionext.h" void map_parse_version(int fd) diff --git a/src/map/pc.c b/src/map/pc.c index 5e82c19..524c130 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -14,7 +14,7 @@ #include "../../../map/pc.h" #include "map/pc.h" -#include "map/session.h" +#include "map/data/session.h" #include "map/struct/sessionext.h" int langScriptId; diff --git a/src/map/script.c b/src/map/script.c index f387714..e762583 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -20,10 +20,10 @@ #include "map/script.h" #include "map/clif.h" #include "map/lang.h" -#include "map/mapd.h" #include "map/scriptdefines.h" #include "map/send.h" -#include "map/session.h" +#include "map/data/mapd.h" +#include "map/data/session.h" #include "map/struct/mapdext.h" #include "map/struct/sessionext.h" #include "map/utils/formatutils.h" diff --git a/src/map/session.c b/src/map/session.c deleted file mode 100644 index 7291772..0000000 --- a/src/map/session.c +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Copyright (c) Hercules Dev Team, licensed under GNU GPL. -// Copyright (c) 2014 Evol developers - -#include -#include -#include - -#include "../../../common/HPMi.h" -#include "../../../common/malloc.h" -#include "../../../common/mmo.h" -#include "../../../common/socket.h" -#include "../../../common/strlib.h" -#include "../../../map/pc.h" - -#include "map/session.h" -#include "map/struct/sessionext.h" - -struct SessionExt *session_get(int fd) -{ - struct SessionExt *data = getFromSession(session[fd], 0); - if (!data) - { - data = session_create(); - addToSession(session[fd], data, 0, true); - } - return data; -} - -struct SessionExt *session_get_bysd(struct map_session_data *sd) -{ - if (!sd) - return NULL; - - return session_get(sd->fd); -} - -struct SessionExt *session_create(void) -{ - struct SessionExt *data = NULL; - CREATE(data, struct SessionExt, 1); - if (!data) - return NULL; - data->clientVersion = 0; - data->language = 0; - return data; -} diff --git a/src/map/session.h b/src/map/session.h deleted file mode 100644 index 40b05e6..0000000 --- a/src/map/session.h +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) Copyright (c) Hercules Dev Team, licensed under GNU GPL. -// Copyright (c) 2014 Evol developers - -#ifndef EVOL_MAP_SESSION -#define EVOL_MAP_SESSION - -struct SessionExt; - -struct SessionExt *session_get(int fd); -struct SessionExt *session_get_bysd(struct map_session_data *sd); -struct SessionExt *session_create(void); - -#endif // EVOL_MAP_SESSION -- cgit v1.2.3-60-g2f50