summaryrefslogtreecommitdiff
path: root/src/char/char.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/char/char.hpp')
-rw-r--r--src/char/char.hpp28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/char/char.hpp b/src/char/char.hpp
index 4c11073..a9c786f 100644
--- a/src/char/char.hpp
+++ b/src/char/char.hpp
@@ -1,5 +1,4 @@
-#ifndef TMWA_CHAR_CHAR_HPP
-#define TMWA_CHAR_CHAR_HPP
+#pragma once
// char.hpp - Character server.
//
// Copyright © ????-2004 Athena Dev Teams
@@ -21,15 +20,19 @@
// 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"
+#include "fwd.hpp"
-# include "../strings/fwd.hpp"
+#include "../strings/fwd.hpp"
-# include "../mmo/ip.hpp"
-# include "../mmo/mmo.hpp"
+#include "../generic/array.hpp"
-struct Session;
+#include "../net/ip.hpp"
+#include "../mmo/mmo.hpp"
+
+
+namespace tmwa
+{
constexpr int MAX_MAP_SERVERS = 30;
struct mmo_map_server
@@ -41,16 +44,13 @@ struct mmo_map_server
};
const CharPair *search_character(CharName character_name);
-const CharPair *search_character_id(int char_id);
+const CharPair *search_character_id(CharId char_id);
Session *server_for(const CharPair *mcs);
-int mapif_sendall(const uint8_t *buf, unsigned int len);
-int mapif_sendallwos(Session *s, const uint8_t *buf, unsigned int len);
-int mapif_send(Session *s, const uint8_t *buf, unsigned int len);
+auto iter_map_sessions() -> decltype(filter_iterator<Session *>(std::declval<Array<Session *, MAX_MAP_SERVERS> *>()));
void char_log(XString line);
-# define CHAR_LOG(fmt, ...) \
+#define CHAR_LOG(fmt, ...) \
char_log(STRPRINTF(fmt, ## __VA_ARGS__))
-
-#endif // TMWA_CHAR_CHAR_HPP
+} // namespace tmwa