diff options
66 files changed, 224 insertions, 93 deletions
diff --git a/src/admin/ladmin.cpp b/src/admin/ladmin.cpp index cf5735b..a4c0a36 100644 --- a/src/admin/ladmin.cpp +++ b/src/admin/ladmin.cpp @@ -39,12 +39,13 @@ #include "../io/tty.hpp" #include "../io/write.hpp" +#include "../net/ip.hpp" +#include "../net/socket.hpp" + #include "../mmo/config_parse.hpp" #include "../mmo/core.hpp" #include "../mmo/human_time_diff.hpp" -#include "../mmo/ip.hpp" #include "../mmo/mmo.hpp" -#include "../mmo/socket.hpp" #include "../mmo/utils.hpp" #include "../mmo/version.hpp" diff --git a/src/char/char.cpp b/src/char/char.cpp index ae7a10a..e84de03 100644 --- a/src/char/char.cpp +++ b/src/char/char.cpp @@ -54,13 +54,14 @@ #include "../io/tty.hpp" #include "../io/write.hpp" +#include "../net/socket.hpp" +#include "../net/timer.hpp" + #include "../mmo/config_parse.hpp" #include "../mmo/core.hpp" #include "../mmo/extract.hpp" #include "../mmo/human_time_diff.hpp" #include "../mmo/mmo.hpp" -#include "../mmo/socket.hpp" -#include "../mmo/timer.hpp" #include "../mmo/utils.hpp" #include "../mmo/version.hpp" diff --git a/src/char/char.hpp b/src/char/char.hpp index 64d4254..3ba455f 100644 --- a/src/char/char.hpp +++ b/src/char/char.hpp @@ -27,7 +27,8 @@ # include "../generic/array.hpp" -# include "../mmo/ip.hpp" +# include "../net/ip.hpp" + # include "../mmo/mmo.hpp" constexpr int MAX_MAP_SERVERS = 30; diff --git a/src/char/int_party.cpp b/src/char/int_party.cpp index 1084bed..472e493 100644 --- a/src/char/int_party.cpp +++ b/src/char/int_party.cpp @@ -33,10 +33,11 @@ #include "../io/read.hpp" #include "../io/write.hpp" +#include "../net/socket.hpp" + #include "../mmo/extract.hpp" #include "../mmo/ids.hpp" #include "../mmo/mmo.hpp" -#include "../mmo/socket.hpp" #include "char.hpp" #include "inter.hpp" diff --git a/src/char/int_party.hpp b/src/char/int_party.hpp index 3c448b0..ab42501 100644 --- a/src/char/int_party.hpp +++ b/src/char/int_party.hpp @@ -25,6 +25,8 @@ # include "../strings/fwd.hpp" +# include "../net/fwd.hpp" + # include "../mmo/fwd.hpp" void inter_party_init(void); diff --git a/src/char/int_storage.cpp b/src/char/int_storage.cpp index 850d99e..82aa07f 100644 --- a/src/char/int_storage.cpp +++ b/src/char/int_storage.cpp @@ -32,9 +32,10 @@ #include "../io/read.hpp" #include "../io/write.hpp" +#include "../net/socket.hpp" + #include "../mmo/extract.hpp" #include "../mmo/mmo.hpp" -#include "../mmo/socket.hpp" #include "../poison.hpp" diff --git a/src/char/int_storage.hpp b/src/char/int_storage.hpp index 9f241e3..83981b6 100644 --- a/src/char/int_storage.hpp +++ b/src/char/int_storage.hpp @@ -25,6 +25,8 @@ # include "../strings/fwd.hpp" +# include "../net/fwd.hpp" + # include "../mmo/fwd.hpp" void inter_storage_init(void); diff --git a/src/char/inter.cpp b/src/char/inter.cpp index 621134f..a7617c9 100644 --- a/src/char/inter.cpp +++ b/src/char/inter.cpp @@ -38,9 +38,10 @@ #include "../io/read.hpp" #include "../io/write.hpp" +#include "../net/socket.hpp" + #include "../mmo/extract.hpp" #include "../mmo/mmo.hpp" -#include "../mmo/socket.hpp" #include "char.hpp" #include "int_party.hpp" diff --git a/src/char/inter.hpp b/src/char/inter.hpp index 3e48460..bb3c9da 100644 --- a/src/char/inter.hpp +++ b/src/char/inter.hpp @@ -25,7 +25,7 @@ # include "../strings/fwd.hpp" -# include "../mmo/fwd.hpp" +# include "../net/fwd.hpp" bool inter_config(XString key, ZString value); void inter_init2(); diff --git a/src/compat/time_t.cpp b/src/compat/time_t.cpp new file mode 100644 index 0000000..b1a3fb8 --- /dev/null +++ b/src/compat/time_t.cpp @@ -0,0 +1,21 @@ +#include "time_t.hpp" +// time_t.cpp - time_t with a reliable representation +// +// Copyright © 2013-2014 Ben Longbons <b.r.longbons@gmail.com> +// +// This file is part of The Mana World (Athena server) +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see <http://www.gnu.org/licenses/>. + +#include "../poison.hpp" diff --git a/src/compat/time_t.hpp b/src/compat/time_t.hpp new file mode 100644 index 0000000..4e0ffb6 --- /dev/null +++ b/src/compat/time_t.hpp @@ -0,0 +1,27 @@ +#ifndef TMWA_COMPAT_TIMET_HPP +#define TMWA_COMPAT_TIMET_HPP +// time_t.hpp - time_t with a reliable representation +// +// Copyright © 2013-2014 Ben Longbons <b.r.longbons@gmail.com> +// +// This file is part of The Mana World (Athena server) +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see <http://www.gnu.org/licenses/>. + +# include "fwd.hpp" + +// TODO fix this ordering violation by promoting TimeT here +# include "../mmo/utils.hpp" + +#endif // TMWA_COMPAT_TIMET_HPP diff --git a/src/mmo/dumb_ptr.cpp b/src/generic/dumb_ptr.cpp index 77e3080..77e3080 100644 --- a/src/mmo/dumb_ptr.cpp +++ b/src/generic/dumb_ptr.cpp diff --git a/src/mmo/dumb_ptr.hpp b/src/generic/dumb_ptr.hpp index 3472d8b..ed18317 100644 --- a/src/mmo/dumb_ptr.hpp +++ b/src/generic/dumb_ptr.hpp @@ -1,5 +1,5 @@ -#ifndef TMWA_MMO_DUMB_PTR_HPP -#define TMWA_MMO_DUMB_PTR_HPP +#ifndef TMWA_GENERIC_DUMB_PTR_HPP +#define TMWA_GENERIC_DUMB_PTR_HPP // dumb_ptr.hpp - temporary new/delete wrappers // // Copyright © 2013 Ben Longbons <b.r.longbons@gmail.com> @@ -268,4 +268,4 @@ const char *convert_for_printf(dumb_string ds) return ds.c_str(); } -#endif // TMWA_MMO_DUMB_PTR_HPP +#endif // TMWA_GENERIC_DUMB_PTR_HPP diff --git a/src/generic/fwd.hpp b/src/generic/fwd.hpp index df8485f..fcb1fab 100644 --- a/src/generic/fwd.hpp +++ b/src/generic/fwd.hpp @@ -22,5 +22,8 @@ # include "../sanity.hpp" // meh, add more when I feel like it +template<class T> +class dumb_ptr; +class dumb_string; #endif // TMWA_GENERIC_FWD_HPP diff --git a/src/login/login.cpp b/src/login/login.cpp index 6b503af..96cd416 100644 --- a/src/login/login.cpp +++ b/src/login/login.cpp @@ -50,6 +50,9 @@ #include "../io/tty.hpp" #include "../io/write.hpp" +#include "../net/socket.hpp" +#include "../net/timer.hpp" + #include "../mmo/config_parse.hpp" #include "../mmo/core.hpp" #include "../mmo/extract.hpp" @@ -57,10 +60,8 @@ #include "../mmo/ids.hpp" #include "../mmo/md5more.hpp" #include "../mmo/mmo.hpp" -#include "../mmo/socket.hpp" -#include "../mmo/timer.hpp" -#include "../mmo/version.hpp" #include "../mmo/utils.hpp" +#include "../mmo/version.hpp" #include "../poison.hpp" diff --git a/src/map/atcommand.cpp b/src/map/atcommand.cpp index 2f08627..733050c 100644 --- a/src/map/atcommand.cpp +++ b/src/map/atcommand.cpp @@ -42,14 +42,15 @@ #include "../io/read.hpp" #include "../io/write.hpp" +#include "../net/socket.hpp" +#include "../net/timer.hpp" + #include "../mmo/config_parse.hpp" #include "../mmo/core.hpp" #include "../mmo/extract.hpp" #include "../mmo/human_time_diff.hpp" #include "../mmo/ids.hpp" #include "../mmo/mmo.hpp" -#include "../mmo/socket.hpp" -#include "../mmo/timer.hpp" #include "../mmo/utils.hpp" #include "../mmo/version.hpp" diff --git a/src/map/atcommand.hpp b/src/map/atcommand.hpp index 0a24163..a2aaf5b 100644 --- a/src/map/atcommand.hpp +++ b/src/map/atcommand.hpp @@ -25,8 +25,11 @@ # include "../strings/fwd.hpp" +# include "../generic/fwd.hpp" + +# include "../net/fwd.hpp" + # include "../mmo/fwd.hpp" -# include "../mmo/dumb_ptr.hpp" bool is_atcommand(Session *s, dumb_ptr<map_session_data> sd, ZString message, GmLevel gmlvl); diff --git a/src/map/battle.hpp b/src/map/battle.hpp index 6e73e70..b448073 100644 --- a/src/map/battle.hpp +++ b/src/map/battle.hpp @@ -27,8 +27,9 @@ # include "../strings/fwd.hpp" -# include "../mmo/dumb_ptr.hpp" -# include "../mmo/timer.t.hpp" +# include "../generic/fwd.hpp" + +# include "../net/timer.t.hpp" # include "magic-interpreter.t.hpp" # include "map.t.hpp" diff --git a/src/map/chrif.cpp b/src/map/chrif.cpp index 50c62a8..b5c5bf6 100644 --- a/src/map/chrif.cpp +++ b/src/map/chrif.cpp @@ -28,11 +28,12 @@ #include "../io/cxxstdio.hpp" +#include "../net/ip.hpp" +#include "../net/socket.hpp" +#include "../net/timer.hpp" + #include "../mmo/human_time_diff.hpp" -#include "../mmo/ip.hpp" #include "../mmo/mmo.hpp" -#include "../mmo/socket.hpp" -#include "../mmo/timer.hpp" #include "../mmo/utils.hpp" #include "battle.hpp" diff --git a/src/map/chrif.hpp b/src/map/chrif.hpp index 7ac16e5..321b3bd 100644 --- a/src/map/chrif.hpp +++ b/src/map/chrif.hpp @@ -25,8 +25,11 @@ # include "../strings/fwd.hpp" +# include "../generic/fwd.hpp" + +# include "../net/fwd.hpp" + # include "../mmo/fwd.hpp" -# include "../mmo/dumb_ptr.hpp" void chrif_setuserid(AccountName); void chrif_setpasswd(AccountPass); diff --git a/src/map/clif.cpp b/src/map/clif.cpp index 0a6406b..ce328f6 100644 --- a/src/map/clif.cpp +++ b/src/map/clif.cpp @@ -38,10 +38,11 @@ #include "../io/cxxstdio.hpp" #include "../io/write.hpp" -#include "../mmo/ip.hpp" +#include "../net/ip.hpp" +#include "../net/socket.hpp" +#include "../net/timer.hpp" + #include "../mmo/md5more.hpp" -#include "../mmo/socket.hpp" -#include "../mmo/timer.hpp" #include "../mmo/utils.hpp" #include "../mmo/version.hpp" diff --git a/src/map/clif.hpp b/src/map/clif.hpp index 19d5fd3..b2a5747 100644 --- a/src/map/clif.hpp +++ b/src/map/clif.hpp @@ -29,10 +29,12 @@ # include "../strings/fwd.hpp" +# include "../generic/fwd.hpp" + +# include "../net/timer.t.hpp" + # include "../mmo/fwd.hpp" -# include "../mmo/dumb_ptr.hpp" # include "../mmo/mmo.hpp" -# include "../mmo/timer.t.hpp" # include "battle.t.hpp" # include "map.t.hpp" diff --git a/src/map/intif.cpp b/src/map/intif.cpp index d0b1ea0..57c6048 100644 --- a/src/map/intif.cpp +++ b/src/map/intif.cpp @@ -29,8 +29,9 @@ #include "../io/cxxstdio.hpp" +#include "../net/socket.hpp" + #include "../mmo/mmo.hpp" -#include "../mmo/socket.hpp" #include "battle.hpp" #include "chrif.hpp" diff --git a/src/map/intif.hpp b/src/map/intif.hpp index e05d00f..c60e3c1 100644 --- a/src/map/intif.hpp +++ b/src/map/intif.hpp @@ -25,8 +25,11 @@ # include "../strings/fwd.hpp" +# include "../generic/fwd.hpp" + +# include "../net/fwd.hpp" + # include "../mmo/fwd.hpp" -# include "../mmo/dumb_ptr.hpp" int intif_parse(Session *); diff --git a/src/map/magic-expr.cpp b/src/map/magic-expr.cpp index ee422c1..2ae9b20 100644 --- a/src/map/magic-expr.cpp +++ b/src/map/magic-expr.cpp @@ -29,12 +29,11 @@ #include "../strings/vstring.hpp" #include "../strings/literal.hpp" +#include "../generic/dumb_ptr.hpp" #include "../generic/random.hpp" #include "../io/cxxstdio.hpp" -#include "../mmo/dumb_ptr.hpp" - #include "battle.hpp" #include "itemdb.hpp" #include "magic-expr-eval.hpp" diff --git a/src/map/magic-expr.hpp b/src/map/magic-expr.hpp index 7276fd2..1c4d00e 100644 --- a/src/map/magic-expr.hpp +++ b/src/map/magic-expr.hpp @@ -22,7 +22,7 @@ # include "fwd.hpp" -# include "../mmo/dumb_ptr.hpp" +# include "../generic/fwd.hpp" # include "../range/fwd.hpp" diff --git a/src/map/magic-interpreter-base.cpp b/src/map/magic-interpreter-base.cpp index baec6fb..b2ed0a5 100644 --- a/src/map/magic-interpreter-base.cpp +++ b/src/map/magic-interpreter-base.cpp @@ -26,7 +26,7 @@ #include "../io/cxxstdio.hpp" -#include "../mmo/timer.hpp" +#include "../net/timer.hpp" #include "magic.hpp" #include "magic-expr.hpp" diff --git a/src/map/magic-interpreter-base.hpp b/src/map/magic-interpreter-base.hpp index 1baefc6..7d75049 100644 --- a/src/map/magic-interpreter-base.hpp +++ b/src/map/magic-interpreter-base.hpp @@ -24,7 +24,9 @@ # include "../strings/fwd.hpp" -# include "../mmo/dumb_ptr.hpp" +# include "../generic/fwd.hpp" + +# include "../mmo/fwd.hpp" extern magic_conf_t magic_conf; /* Global magic conf */ extern env_t magic_default_env; /* Fake default environment */ diff --git a/src/map/magic-interpreter.hpp b/src/map/magic-interpreter.hpp index 8861e92..cf0991e 100644 --- a/src/map/magic-interpreter.hpp +++ b/src/map/magic-interpreter.hpp @@ -31,9 +31,11 @@ # include "../strings/fwd.hpp" # include "../strings/rstring.hpp" -# include "../mmo/dumb_ptr.hpp" +# include "../generic/fwd.hpp" + +# include "../net/timer.t.hpp" + # include "../mmo/ids.hpp" -# include "../mmo/timer.t.hpp" # include "../mmo/utils.hpp" # include "map.hpp" diff --git a/src/map/magic-stmt.cpp b/src/map/magic-stmt.cpp index 98cdb7e..f87eabf 100644 --- a/src/map/magic-stmt.cpp +++ b/src/map/magic-stmt.cpp @@ -30,7 +30,7 @@ #include "../io/cxxstdio.hpp" -#include "../mmo/timer.hpp" +#include "../net/timer.hpp" #include "battle.hpp" #include "clif.hpp" diff --git a/src/map/magic-stmt.hpp b/src/map/magic-stmt.hpp index 08c2b28..97fdf1f 100644 --- a/src/map/magic-stmt.hpp +++ b/src/map/magic-stmt.hpp @@ -24,7 +24,9 @@ # include "../range/fwd.hpp" -# include "../mmo/dumb_ptr.hpp" +# include "../strings/zstring.hpp" + +# include "../generic/fwd.hpp" # include "skill.t.hpp" diff --git a/src/map/magic-v2.cpp b/src/map/magic-v2.cpp index 510c619..1e2a330 100644 --- a/src/map/magic-v2.cpp +++ b/src/map/magic-v2.cpp @@ -27,13 +27,13 @@ #include "../strings/rstring.hpp" #include "../strings/literal.hpp" +#include "../generic/dumb_ptr.hpp" + #include "../io/cxxstdio.hpp" #include "../io/line.hpp" #include "../sexpr/parser.hpp" -#include "../mmo/dumb_ptr.hpp" - #include "itemdb.hpp" #include "magic-expr.hpp" #include "magic-interpreter.hpp" diff --git a/src/map/magic.cpp b/src/map/magic.cpp index 88ee1f1..b502d3e 100644 --- a/src/map/magic.cpp +++ b/src/map/magic.cpp @@ -24,9 +24,9 @@ #include "../strings/xstring.hpp" -#include "../io/cxxstdio.hpp" +#include "../generic/dumb_ptr.hpp" -#include "../mmo/dumb_ptr.hpp" +#include "../io/cxxstdio.hpp" #include "magic-expr.hpp" #include "magic-interpreter.hpp" diff --git a/src/map/magic.hpp b/src/map/magic.hpp index cd0ff99..e54661b 100644 --- a/src/map/magic.hpp +++ b/src/map/magic.hpp @@ -24,7 +24,7 @@ # include "../strings/fwd.hpp" -# include "../mmo/dumb_ptr.hpp" +# include "../generic/fwd.hpp" # include "map.t.hpp" # include "skill.t.hpp" diff --git a/src/map/map.cpp b/src/map/map.cpp index b845abc..dde617a 100644 --- a/src/map/map.cpp +++ b/src/map/map.cpp @@ -49,11 +49,12 @@ #include "../io/tty.hpp" #include "../io/write.hpp" +#include "../net/socket.hpp" +#include "../net/timer.hpp" + #include "../mmo/config_parse.hpp" #include "../mmo/core.hpp" #include "../mmo/extract.hpp" -#include "../mmo/socket.hpp" -#include "../mmo/timer.hpp" #include "../mmo/utils.hpp" #include "../mmo/version.hpp" diff --git a/src/map/map.hpp b/src/map/map.hpp index 2bc8e45..78d12f8 100644 --- a/src/map/map.hpp +++ b/src/map/map.hpp @@ -37,10 +37,12 @@ # include "../strings/vstring.hpp" # include "../generic/db.hpp" +# include "../generic/dumb_ptr.hpp" # include "../generic/matrix.hpp" -# include "../mmo/socket.hpp" -# include "../mmo/timer.t.hpp" +# include "../net/socket.hpp" +# include "../net/timer.t.hpp" + # include "../mmo/utils.hpp" # include "battle.t.hpp" diff --git a/src/map/mob.cpp b/src/map/mob.cpp index 923b369..731448b 100644 --- a/src/map/mob.cpp +++ b/src/map/mob.cpp @@ -38,10 +38,11 @@ #include "../io/cxxstdio.hpp" #include "../io/read.hpp" +#include "../net/socket.hpp" +#include "../net/timer.hpp" + #include "../mmo/config_parse.hpp" #include "../mmo/extract.hpp" -#include "../mmo/socket.hpp" -#include "../mmo/timer.hpp" #include "battle.hpp" #include "clif.hpp" diff --git a/src/map/mob.hpp b/src/map/mob.hpp index 48d7df5..8860ab5 100644 --- a/src/map/mob.hpp +++ b/src/map/mob.hpp @@ -25,10 +25,11 @@ # include "mob.t.hpp" -# include "../generic/random.t.hpp" +# include "../generic/fwd.hpp" # include "../generic/enum.hpp" +# include "../generic/random.t.hpp" -# include "../mmo/timer.t.hpp" +# include "../net/timer.t.hpp" # include "battle.t.hpp" # include "clif.t.hpp" diff --git a/src/map/npc.cpp b/src/map/npc.cpp index 32711d0..aee3d03 100644 --- a/src/map/npc.cpp +++ b/src/map/npc.cpp @@ -40,9 +40,10 @@ #include "../io/cxxstdio.hpp" #include "../io/read.hpp" +#include "../net/timer.hpp" + #include "../mmo/config_parse.hpp" #include "../mmo/extract.hpp" -#include "../mmo/timer.hpp" #include "../mmo/utils.hpp" #include "battle.hpp" diff --git a/src/map/npc.hpp b/src/map/npc.hpp index d8930c8..011ea50 100644 --- a/src/map/npc.hpp +++ b/src/map/npc.hpp @@ -27,7 +27,9 @@ # include "../strings/fwd.hpp" -# include "../mmo/timer.t.hpp" +# include "../generic/fwd.hpp" + +# include "../net/timer.t.hpp" # include "map.hpp" diff --git a/src/map/party.cpp b/src/map/party.cpp index 66dc2fa..f40b991 100644 --- a/src/map/party.cpp +++ b/src/map/party.cpp @@ -29,9 +29,10 @@ #include "../io/cxxstdio.hpp" +#include "../net/timer.hpp" + #include "../mmo/ids.hpp" #include "../mmo/mmo.hpp" -#include "../mmo/timer.hpp" #include "battle.hpp" #include "clif.hpp" diff --git a/src/map/party.hpp b/src/map/party.hpp index 4eaffb0..4670aee 100644 --- a/src/map/party.hpp +++ b/src/map/party.hpp @@ -27,8 +27,9 @@ # include "../strings/fwd.hpp" +# include "../generic/fwd.hpp" + # include "../mmo/fwd.hpp" -# include "../mmo/dumb_ptr.hpp" void do_init_party(void); struct party *party_search(PartyId party_id); diff --git a/src/map/pc.cpp b/src/map/pc.cpp index c9e67ea..9a1493f 100644 --- a/src/map/pc.cpp +++ b/src/map/pc.cpp @@ -39,8 +39,9 @@ #include "../io/cxxstdio.hpp" #include "../io/read.hpp" -#include "../mmo/socket.hpp" -#include "../mmo/timer.hpp" +#include "../net/socket.hpp" +#include "../net/timer.hpp" + #include "../mmo/utils.hpp" #include "atcommand.hpp" diff --git a/src/map/pc.hpp b/src/map/pc.hpp index 412953d..900ce97 100644 --- a/src/map/pc.hpp +++ b/src/map/pc.hpp @@ -27,6 +27,8 @@ # include "../strings/fwd.hpp" +# include "../generic/dumb_ptr.hpp" + # include "../mmo/utils.hpp" # include "clif.t.hpp" diff --git a/src/map/script.cpp b/src/map/script.cpp index 158a832..9cc17aa 100644 --- a/src/map/script.cpp +++ b/src/map/script.cpp @@ -48,11 +48,12 @@ #include "../io/read.hpp" #include "../io/write.hpp" +#include "../net/socket.hpp" +#include "../net/timer.hpp" + #include "../mmo/core.hpp" #include "../mmo/extract.hpp" #include "../mmo/human_time_diff.hpp" -#include "../mmo/socket.hpp" -#include "../mmo/timer.hpp" #include "../mmo/utils.hpp" #include "atcommand.hpp" diff --git a/src/map/script.hpp b/src/map/script.hpp index 11a9289..d42da2c 100644 --- a/src/map/script.hpp +++ b/src/map/script.hpp @@ -32,8 +32,7 @@ # include "../strings/zstring.hpp" # include "../generic/db.hpp" - -# include "../mmo/dumb_ptr.hpp" +# include "../generic/dumb_ptr.hpp" # include "map.t.hpp" diff --git a/src/map/skill.cpp b/src/map/skill.cpp index 8e67065..ad8e2e7 100644 --- a/src/map/skill.cpp +++ b/src/map/skill.cpp @@ -41,8 +41,9 @@ #include "../io/cxxstdio.hpp" #include "../io/read.hpp" +#include "../net/timer.hpp" + #include "../mmo/extract.hpp" -#include "../mmo/timer.hpp" #include "battle.hpp" #include "clif.hpp" diff --git a/src/map/skill.hpp b/src/map/skill.hpp index 3c162d5..0e566c6 100644 --- a/src/map/skill.hpp +++ b/src/map/skill.hpp @@ -30,6 +30,7 @@ # include "../strings/rstring.hpp" # include "../strings/literal.hpp" +# include "../generic/fwd.hpp" # include "../generic/array.hpp" # include "map.hpp" diff --git a/src/map/storage.hpp b/src/map/storage.hpp index 4101893..4de931f 100644 --- a/src/map/storage.hpp +++ b/src/map/storage.hpp @@ -23,8 +23,9 @@ # include "fwd.hpp" +# include "../generic/fwd.hpp" + # include "../mmo/fwd.hpp" -# include "../mmo/dumb_ptr.hpp" int storage_storageopen(dumb_ptr<map_session_data> sd); int storage_storageadd(dumb_ptr<map_session_data> sd, int index, int amount); diff --git a/src/map/tmw.hpp b/src/map/tmw.hpp index 14bf8cc..dae6e69 100644 --- a/src/map/tmw.hpp +++ b/src/map/tmw.hpp @@ -24,7 +24,7 @@ # include "../strings/fwd.hpp" -# include "../mmo/dumb_ptr.hpp" +# include "../generic/fwd.hpp" int tmw_CheckChatSpam(dumb_ptr<map_session_data> sd, XString message); void tmw_GmHackMsg(ZString line); diff --git a/src/map/trade.hpp b/src/map/trade.hpp index 1514999..9d542a4 100644 --- a/src/map/trade.hpp +++ b/src/map/trade.hpp @@ -23,7 +23,7 @@ # include "fwd.hpp" -# include "../mmo/dumb_ptr.hpp" +# include "../generic/fwd.hpp" void trade_traderequest(dumb_ptr<map_session_data> sd, BlockId target_id); void trade_tradeack(dumb_ptr<map_session_data> sd, int type); diff --git a/src/mmo/core.cpp b/src/mmo/core.cpp index 68b5863..21aa5f7 100644 --- a/src/mmo/core.cpp +++ b/src/mmo/core.cpp @@ -32,8 +32,8 @@ #include "../io/cxxstdio.hpp" -#include "socket.hpp" -#include "timer.hpp" +#include "../net/socket.hpp" +#include "../net/timer.hpp" #include "../poison.hpp" diff --git a/src/mmo/fwd.hpp b/src/mmo/fwd.hpp index 65e8dfe..eb8bc05 100644 --- a/src/mmo/fwd.hpp +++ b/src/mmo/fwd.hpp @@ -26,10 +26,7 @@ class MapName; class CharName; class CharPair; -class Session; - class HumanTimeDiff; -class IP4Address; class AccountId; class CharId; @@ -48,6 +45,4 @@ class VarName; class MapName; class CharName; -class TimerData; - #endif // TMWA_MMO_FWD_HPP diff --git a/src/mmo/md5more.cpp b/src/mmo/md5more.cpp index c311583..96b12a7 100644 --- a/src/mmo/md5more.cpp +++ b/src/mmo/md5more.cpp @@ -29,7 +29,8 @@ #include "../io/cxxstdio.hpp" #include "../io/read.hpp" -#include "../mmo/ip.hpp" +#include "../net/ip.hpp" + #include "../mmo/mmo.hpp" #include "../poison.hpp" diff --git a/src/mmo/md5more.hpp b/src/mmo/md5more.hpp index 4b9895d..f3ab363 100644 --- a/src/mmo/md5more.hpp +++ b/src/mmo/md5more.hpp @@ -27,6 +27,8 @@ # include "../io/fwd.hpp" +# include "../net/fwd.hpp" + MD5_state MD5_from_FILE(io::ReadFile& in); // whoever wrote this fails basic understanding of diff --git a/src/mmo/mmo.hpp b/src/mmo/mmo.hpp index 15c3fa5..c72d815 100644 --- a/src/mmo/mmo.hpp +++ b/src/mmo/mmo.hpp @@ -32,8 +32,9 @@ # include "../generic/array.hpp" # include "../generic/enum.hpp" +# include "../net/timer.t.hpp" + # include "ids.hpp" -# include "timer.t.hpp" // affects CharName # define NAME_IGNORING_CASE 1 diff --git a/src/net/fwd.hpp b/src/net/fwd.hpp new file mode 100644 index 0000000..ca54e8d --- /dev/null +++ b/src/net/fwd.hpp @@ -0,0 +1,30 @@ +#ifndef TMWA_NET_FWD_HPP +#define TMWA_NET_FWD_HPP +// net/fwd.hpp - list of type names for net lib +// +// Copyright © 2014 Ben Longbons <b.r.longbons@gmail.com> +// +// This file is part of The Mana World (Athena server) +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see <http://www.gnu.org/licenses/>. + +# include "../sanity.hpp" + +class Session; + +class IP4Address; + +class TimerData; + +#endif // TMWA_NET_FWD_HPP diff --git a/src/mmo/ip.cpp b/src/net/ip.cpp index 7c243ea..591faab 100644 --- a/src/mmo/ip.cpp +++ b/src/net/ip.cpp @@ -23,7 +23,7 @@ #include "../io/cxxstdio.hpp" -#include "extract.hpp" +#include "../mmo/extract.hpp" #include "../poison.hpp" diff --git a/src/mmo/ip.hpp b/src/net/ip.hpp index 88ad965..42a4689 100644 --- a/src/mmo/ip.hpp +++ b/src/net/ip.hpp @@ -1,5 +1,5 @@ -#ifndef TMWA_MMO_IP_HPP -#define TMWA_MMO_IP_HPP +#ifndef TMWA_NET_IP_HPP +#define TMWA_NET_IP_HPP // ip.hpp - classes to deal with IP addresses. // // Copyright © 2013 Ben Longbons <b.r.longbons@gmail.com> @@ -162,4 +162,4 @@ bool extract(XString str, IP4Address *iv); bool extract(XString str, IP4Mask *iv); -#endif // TMWA_MMO_IP_HPP +#endif // TMWA_NET_IP_HPP diff --git a/src/mmo/ip.py b/src/net/ip.py index e6a8183..e6a8183 100644 --- a/src/mmo/ip.py +++ b/src/net/ip.py diff --git a/src/mmo/ip_test.cpp b/src/net/ip_test.cpp index 3c4d2ef..3c4d2ef 100644 --- a/src/mmo/ip_test.cpp +++ b/src/net/ip_test.cpp diff --git a/src/mmo/socket.cpp b/src/net/socket.cpp index 1d6094c..6880bfa 100644 --- a/src/mmo/socket.cpp +++ b/src/net/socket.cpp @@ -34,9 +34,10 @@ #include "../io/cxxstdio.hpp" +// TODO get rid of ordering violations #include "../mmo/utils.hpp" +#include "../mmo/core.hpp" -#include "core.hpp" #include "timer.hpp" #include "../poison.hpp" @@ -431,6 +432,7 @@ void do_sendrecv(interval_t next_ms) if (!has_timers()) { PRINTF("Shutting down - nothing to do\n"_fmt); + // TODO hoist this runflag = false; } return; diff --git a/src/mmo/socket.hpp b/src/net/socket.hpp index ff10c64..94198f6 100644 --- a/src/mmo/socket.hpp +++ b/src/net/socket.hpp @@ -1,5 +1,5 @@ -#ifndef TMWA_MMO_SOCKET_HPP -#define TMWA_MMO_SOCKET_HPP +#ifndef TMWA_NET_SOCKET_HPP +#define TMWA_NET_SOCKET_HPP // socket.hpp - Network event system. // // Copyright © ????-2004 Athena Dev Teams @@ -31,16 +31,17 @@ # include "../compat/iter.hpp" # include "../compat/rawmem.hpp" +# include "../compat/time_t.hpp" # include "../strings/astring.hpp" # include "../strings/vstring.hpp" # include "../strings/xstring.hpp" +# include "../generic/dumb_ptr.hpp" + # include "../io/fd.hpp" -# include "dumb_ptr.hpp" # include "ip.hpp" -# include "utils.hpp" # include "timer.t.hpp" struct SessionData @@ -421,4 +422,4 @@ void RFIFO_WFIFO_CLONE(Session *rs, Session *ws, size_t len) static_cast<const uint8_t *>(RFIFOP(rs, 0)), len); } -#endif // TMWA_MMO_SOCKET_HPP +#endif // TMWA_NET_SOCKET_HPP diff --git a/src/mmo/timer.cpp b/src/net/timer.cpp index a85b8be..a85b8be 100644 --- a/src/mmo/timer.cpp +++ b/src/net/timer.cpp diff --git a/src/mmo/timer.hpp b/src/net/timer.hpp index ddb559f..8fd383d 100644 --- a/src/mmo/timer.hpp +++ b/src/net/timer.hpp @@ -1,5 +1,5 @@ -#ifndef TMWA_MMO_TIMER_HPP -#define TMWA_MMO_TIMER_HPP +#ifndef TMWA_NET_TIMER_HPP +#define TMWA_NET_TIMER_HPP // timer.hpp - Future event scheduler. // // Copyright © ????-2004 Athena Dev Teams @@ -47,4 +47,4 @@ tick_t file_modified(ZString name); /// Check if there are any events at all scheduled. bool has_timers(); -#endif // TMWA_MMO_TIMER_HPP +#endif // TMWA_NET_TIMER_HPP diff --git a/src/mmo/timer.t.hpp b/src/net/timer.t.hpp index 549959a..91d4b74 100644 --- a/src/mmo/timer.t.hpp +++ b/src/net/timer.t.hpp @@ -1,5 +1,5 @@ -#ifndef TMWA_MMO_TIMER_T_HPP -#define TMWA_MMO_TIMER_T_HPP +#ifndef TMWA_NET_TIMER_T_HPP +#define TMWA_NET_TIMER_T_HPP // timer.t.hpp - Future event scheduler. // // Copyright © ????-2004 Athena Dev Teams @@ -26,7 +26,7 @@ # include <chrono> # include <functional> -# include "dumb_ptr.hpp" +# include "../generic/dumb_ptr.hpp" /// An implementation of the C++ "clock" concept, exposing /// durations in milliseconds. @@ -85,4 +85,4 @@ public: bool operator !() { return !td; } }; -#endif // TMWA_MMO_TIMER_T_HPP +#endif // TMWA_NET_TIMER_T_HPP |