--- deliantra/server/include/network.h 2007/01/06 14:42:30 1.7
+++ deliantra/server/include/network.h 2007/07/28 12:02:58 1.15
@@ -1,26 +1,25 @@
/*
- CrossFire, A Multiplayer game for X-windows
-
- Copyright (C) 2005, 2006, 2007 Marc Lehmann & Crossfire+ Development Team
- Copyright (C) 2002 Mark Wedel & Crossfire Development Team
- Copyright (C) 1992 Frank Tore Johansen
-
- 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 2 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, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
- The authors can be reached via e-mail at crossfire@schmorp.de
-*/
+ * This file is part of Crossfire TRT, the Roguelike Realtime MORPG.
+ *
+ * Copyright (©) 2005,2006,2007 Marc Alexander Lehmann / Robin Redeker / the Crossfire TRT team
+ * Copyright (©) 2002,2007 Mark Wedel & Crossfire Development Team
+ * Copyright (©) 1992,2007 Frank Tore Johansen
+ *
+ * Crossfire TRT 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 .
+ *
+ * The authors can be reached via e-mail to
+ */
/* This file defines various flags that both the new client and
* newserver uses. These should never be changed, only expanded.
@@ -177,13 +176,17 @@
#define NDI_TAN 12 /* Khaki */
#define NDI_MAX_COLOR 12 /* Last value in */
-#define NDI_COLOR_MASK 0xff /* Gives lots of room for expansion - we are */
+#define NDI_COLOR_MASK 0x1f /* Gives lots of room for expansion - we are */
/* using an int anyways, so we have the space */
/* to still do all the flags */
-
-#define NDI_UNIQUE 0x100 /* Print this out immediately, don't buffer */
-#define NDI_ALL 0x200 /* Inform all players of this message */
+#define NDI_REPLY 0x20 // is a direct reply to a user command
+#define NDI_NOCREATE 0x40 // do not create a tba if one doesn't exist
+#define NDI_CLIENT_MASK 0x7f // what the client is allowed to see
+
+#define NDI_UNIQUE 0x1000 /* Print this out immediately, don't buffer */
+#define NDI_ALL 0x2000 /* Inform all players of this message */
+#define NDI_DEF 0x4000 // ignore colour for channel protocol
/* Flags for the item command */
enum {a_none, a_readied, a_wielded, a_worn, a_active, a_applied};
@@ -260,6 +263,14 @@
data16 (const shstr &sh) : len (sh.length ()), ptr ((void *)&sh) { }
};
+struct ber32
+{
+ enum { size = 5 }; // maximum length of an encoded ber32
+ uint32 val;
+
+ ber32 (uint32 val) : val (val) { }
+};
+
/* Contains the base information we use to make up a packet we want to send. */
struct packet
{
@@ -301,12 +312,15 @@
packet &operator <<(sint64 v) { return *this << (uint64)v; }
// checked
+ packet &operator <<(const ber32 v);
+
packet &operator <<(const data &v);
packet &operator <<(const data8 &v);
packet &operator <<(const data16 &v);
packet &operator <<(const char *v);
packet &operator <<(const shstr &sh) { return *this << data (&sh, sh.length ()); }
+ packet &operator <<(const std::string &s) { return *this << data (s.data (), s.size ()); }
void vprintf (const char *format, va_list ap);
@@ -324,15 +338,5 @@
inline sint16 net_sint16 (uint8 *data) { return sint16 (net_uint16 (data)); }
inline sint16 net_sint32 (uint8 *data) { return sint32 (net_uint32 (data)); }
-struct CS_Stats
-{
- int ibytes; /* ibytes, obytes are bytes in, out */
- int obytes;
- short max_conn; /* Maximum connections received */
- time_t time_start; /* When we started logging this */
-};
-
-extern CS_Stats cst_tot, cst_lst;
-
#endif