aboutsummaryrefslogtreecommitdiff
path: root/src/parsec/include/net_serv.h
diff options
context:
space:
mode:
authorFelix Morgner <felix.morgner@gmail.com>2026-08-24 11:16:07 +0200
committerFelix Morgner <felix.morgner@gmail.com>2026-08-24 11:16:07 +0200
commitc068f22329d5cc722622a2183bbb22eef2093df7 (patch)
tree12d56c1aede67988a55e241364606bfbb4dba933 /src/parsec/include/net_serv.h
downloadopenparsec-main.tar.xz
openparsec-main.zip
initial importHEADmain
Diffstat (limited to 'src/parsec/include/net_serv.h')
-rw-r--r--src/parsec/include/net_serv.h77
1 files changed, 77 insertions, 0 deletions
diff --git a/src/parsec/include/net_serv.h b/src/parsec/include/net_serv.h
new file mode 100644
index 0000000..f2c260d
--- /dev/null
+++ b/src/parsec/include/net_serv.h
@@ -0,0 +1,77 @@
+/*
+ * PARSEC HEADER: net_serv.h
+ */
+
+#ifndef _NET_SERV_H_
+#define _NET_SERV_H_
+
+
+//NOTE:
+// these functions are only needed by the GMSV protocol
+// they are implemented by NET_SERV.C.
+
+
+// server access functions
+
+int NET_ResolveServerNode();
+int NET_ServerConnect();
+int NET_ServerDisconnect();
+void NET_ServerDisconnectReset();
+int NET_ServerJump();
+void NET_ServerMessages();
+int NET_ServerUpdateName();
+int NET_ServerParseMessage( char* msg );
+void NET_ServerProcessPingPacket( NetPacket_GMSV* gamepacket );
+int NET_ServerList_Get( char* masterhostname, int serverid = -1 );
+int NET_ServerList_AddServer( RE_IPv4ServerInfo* pServerInfo );
+int NET_ServerList_UpdateServer( RE_IPv4ServerInfo* pServerInfo );
+int NET_ServerList_AddLinkInfo( RE_ServerLinkInfo* pServerLinkInfo );
+int NET_ServerList_AddMapObject( RE_MapObject* pMapObject );
+int NET_ServerList_SetPONG( int serverid, refframe_t sendframe, int curplayers, int maxplayers );
+int NET_ServerList_SetINFO( int serverid, refframe_t framediff, int curplayers, int maxplayers, int srv_version_minor, int srv_version_major, char* srv_name );
+int NET_ServerPing( node_t* node, int anon, int fullinfo = FALSE );
+
+// defaults for "SERVRLIST" command -------------------------------------------
+//
+#define DEFAULT_SERVERLIST_MIN_PING 0
+#define DEFAULT_SERVERLIST_MAX_PING 9999
+#define DEFAULT_SERVERLIST_MIN_PLAYERS 0
+#define DEFAULT_SERVERLIST_MAX_PLAYERS MAX_NET_ALLOC_SLOTS
+#define DEFAULT_SERVERLIST_LOCALE 1
+
+// all info about a "SERVERLIST" command --------------------------------------
+//
+struct serverlist_info_s {
+
+ int m_ListRequested;
+ int m_nMinPing;
+ int m_nMaxPing;
+ int m_nMinPlayers;
+ int m_nMaxPlayers;
+ int m_nLocale;
+
+ word m_RequestedServerIDs[ MAX_NUM_LINKS ];
+ int m_nNumRequestedServerIDs;
+
+ serverlist_info_s()
+ {
+ Reset();
+ }
+
+ void Reset()
+ {
+ m_ListRequested = FALSE;
+ m_nMinPing = DEFAULT_SERVERLIST_MIN_PING;
+ m_nMaxPing = DEFAULT_SERVERLIST_MAX_PING;
+ m_nMinPlayers = DEFAULT_SERVERLIST_MIN_PLAYERS;
+ m_nMaxPlayers = DEFAULT_SERVERLIST_MAX_PLAYERS;
+ m_nLocale = DEFAULT_SERVERLIST_LOCALE;
+ m_nNumRequestedServerIDs = 0;
+ }
+};
+
+extern serverlist_info_s serverlist_info;
+
+#endif // _NET_SERV_H_
+
+