Compare commits

...
4 Commits
Author SHA1 Message Date
L 29061bea50 Fixed send_heartbeat sending to the wrong address 2023-02-05 02:08:47 +01:00
L 5fecffc451 Fixed wrong client ping value in gamespy players callback 2023-02-05 01:58:52 +01:00
L 4fc3054c0d Renamed LAYOUT.txt to LAYOUT.md (Markdown) 2023-02-05 01:54:57 +01:00
L a08b6b9c3e Updated LAYOUT.txt 2023-02-05 01:50:46 +01:00
5 changed files with 35 additions and 29 deletions

No files matched your search

+23
View File
@@ -0,0 +1,23 @@
# File layout
| Path | Description |
| ---------------------|-------------------------------------------------------------------
| build/ | Output files |
| code/ | OpenMoHAA source code |
| code/cgame | Client game code |
| code/client | Client (network stuff, snapshots, etc) |
| code/game | Server game code (game logic stuff, etc) |
| code/gamespy | Gamespy SDK |
| code/mohui | MoHAA User Interface |
| code/null | Null redirector (used by the OpenMoHAA Dedicated Server) |
| code/parser | Flex/Bison parser |
| code/qcommon | Global shared stuff such as maths |
| code/renderer | OpenMoHAA renderer |
| code/sdl(12) | SDL code |
| code/script | Script engine |
| code/server | Server code (networkn snapshots, handling clients etc) |
| code/skeletor | Skeleton model engine |
| code/sys | Main application system |
| code/tiki | Complete TIKI engine |
| code/uilib | UI library (Ubertools stuff) |
| misc/ | Project stuff, definition files and various resources stuff. |
-20
View File
@@ -1,20 +0,0 @@
File layout
======================
build/ --> Output files
code/ --> OpenMoHAA source code
code/cgame --> Client game code
code/cgame_hook --> Client game patch for MoHAA (hooks the default cgamex86.dll)
code/client --> Client (network stuff, snapshots, etc)
code/game --> Server game code (game logic stuff, etc)
code/globalcpp --> C++ Global stuff such as the Script Engine & Parser
code/mohui --> MoHAA User Interface
code/null --> Null redirector (used by the OpenMoHAA Dedicated Server)
code/qcommon --> Global shared stuff such as maths
code/renderer --> OpenMoHAA renderer
code/renderer_gl3 --> Newest renderer (not working and buggy)
code/sdl(12) --> SDL code
code/server --> Server code (networkn snapshots, handling clients etc)
code/sys --> Main application system
code/testutils --> Test utility for scripts and various stuff
misc/ --> Project stuff, definition files and various resources stuff.
+4 -3
View File
@@ -18,6 +18,8 @@ static const char SECRET_GS_KEY[] = { 'M', '5', 'F', 'd', 'w', 'c' };
static const unsigned int GCD_GAME_ID = 0;
#endif
static const unsigned int GAMESPY_DEFAULT_PORT = 12300;
void qr_send_statechanged(qr_t qrec);
void qr_shutdown(qr_t qrec);
void qr_process_queries(qr_t qrec);
@@ -132,7 +134,7 @@ static void players_callback(char* outbuf, int maxlen, void* userdata)
i,
ps->stats[STAT_DEATHS],
i,
svs.clients[i].rate
svs.clients[i].ping
);
infolen = strlen(infostring);
@@ -203,7 +205,7 @@ qboolean SV_InitGamespy()
strcpy(secret_key, SECRET_GS_KEY);
net_ip = Cvar_Get("net_ip", "localhost", CVAR_LATCH);
net_gamespy_port = Cvar_Get("net_gamespy_port", "12300", CVAR_LATCH);
net_gamespy_port = Cvar_Get("net_gamespy_port", va("%i", GAMESPY_DEFAULT_PORT), CVAR_LATCH);
if (qr_init(
NULL,
@@ -237,4 +239,3 @@ qboolean SV_InitGamespy()
return qtrue;
}
+5 -5
View File
@@ -384,15 +384,15 @@ static void send_heartbeat(qr_t qrec, int statechanged)
sprintf(buf, "\\heartbeat\\%d\\gamename\\%s", qrec->qport, qrec->gamename);
if (statechanged)
sprintf(&buf[strlen(buf)], "\\statechanged\\%d", statechanged);
sprintf(buf + strlen(buf), "\\statechanged\\%d", statechanged);
sendto((SOCKET)qrec->hbsock, buf, (int)strlen(buf), 0, (const struct sockaddr*)&qrec->unk1, 16);
sendto((SOCKET)qrec->hbsock, buf, (int)strlen(buf), 0, (const struct sockaddr*)&qrec->master_saddr, 16);
qrec->lastheartbeat = current_time();
}
static int do_connect(void* sock, char* addr, int port)
static int do_connect(void* sock, char* addr, int port, struct sockaddr_in* master_saddr)
{
get_sockaddrin(addr, port, &hbaddr, NULL);
get_sockaddrin(addr, port, master_saddr, NULL);
return 0;
}
@@ -518,5 +518,5 @@ int qr_init(
if (!qrec)
qrec = &current_rec;
return do_connect((void*)hbsock, "master.x-null.net", 27900);
return do_connect((void*)hbsock, "master.x-null.net", 27900, &(*qrec)->master_saddr);
}
+3 -1
View File
@@ -1,3 +1,5 @@
#include <common/gsPlatformSocket.h>
typedef void (*qr_querycallback_t) (char* outbuf, int maxlen, void* userdata);
typedef void (*qr_custom_handler_t) (const char* query, struct sockaddr* sender);
@@ -27,7 +29,7 @@ typedef struct qr_implementation_s {
int packetnumber;
int qport;
char no_query;
int unk1;
struct sockaddr_in master_saddr;
int unk2;
int unk3;
int unk4;