Skip to content

Commit d1eeefd

Browse files
committed
feat(mods): add new mod binaries and update networking test script
- Introduced new binary files for idtech3 OpenGL, RTX, and Vulkan renderers. - Added dedicated server and client executable for idtech3. - Updated the networking test script to reflect changes in server startup command and improved waiting time for server readiness. - Implemented content validation checks to enhance mod loading and asset management.
1 parent 15de422 commit d1eeefd

11 files changed

Lines changed: 74 additions & 16 deletions

mods/idtech3.ded.x86_64

1.6 MB
Binary file not shown.

mods/idtech3.server.x86_64

1.6 MB
Binary file not shown.

mods/idtech3.x86_64

2.32 MB
Binary file not shown.

mods/idtech3_opengl_x86_64.so

471 KB
Binary file not shown.

mods/idtech3_rtx_x86_64.so

1.58 MB
Binary file not shown.

mods/idtech3_vulkan_x86_64.so

2.15 MB
Binary file not shown.

scripts/test_networking.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@ fi
3030
echo "Testing Networking Features..."
3131
echo
3232

33-
# Test 1: Start dedicated server
33+
# Test 1: Start dedicated server (using client in dedicated mode)
3434
echo "Test 1: Starting Dedicated Server"
35-
echo "Command: ./idtech3.server.x86_64 +set sv_pure 0 +set sv_maxclients 8 +map q3dm9"
36-
"$SERVER" +set sv_pure 0 +set sv_maxclients 8 +map q3dm9 &
35+
echo "Command: ./idtech3.x86_64 +set dedicated 1 +set sv_pure 0 +set sv_maxclients 8 +map q3dm9"
36+
"$ENGINE" +set dedicated 1 +set sv_pure 0 +set sv_maxclients 8 +map q3dm9 &
3737
SERVER_PID=$!
38-
sleep 3
38+
sleep 5
3939

4040
# Check if server is running
4141
if kill -0 $SERVER_PID 2>/dev/null; then

src/client/cl_main.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4823,8 +4823,11 @@ void CL_Init( void ) {
48234823
// Check if we need to display asset instructions
48244824
extern qboolean com_fullyInitialized;
48254825
if (!com_fullyInitialized) {
4826-
// Display fallback asset status on first init
4827-
FallbackAssets_DisplayAssetInstructions();
4826+
// Only show asset instructions if content validation failed
4827+
extern qboolean FS_ContentValidationPassed(void);
4828+
if (!FS_ContentValidationPassed()) {
4829+
FallbackAssets_DisplayAssetInstructions();
4830+
}
48284831
}
48294832

48304833
Com_Printf( "----- Client Initialization Complete -----\n" );

src/common/files_validation.c

Lines changed: 59 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,20 @@ Provides user-friendly error messages and ensures content integrity.
1919

2020
// Validation result structure is defined in qcommon.h
2121

22+
// Global validation status
23+
static qboolean contentValidationPassed = qfalse;
24+
25+
/*
26+
=================
27+
FS_ContentValidationPassed
28+
29+
Returns whether content validation passed during startup.
30+
=================
31+
*/
32+
qboolean FS_ContentValidationPassed(void) {
33+
return contentValidationPassed;
34+
}
35+
2236
// Function prototypes
2337
qboolean Mod_ApplySandboxRestrictions( const char *modName );
2438
void Mod_RemoveSandboxRestrictions( const char *modName );
@@ -82,6 +96,11 @@ Returns qtrue if all required content is present.
8296
*/
8397
qboolean FS_ValidateGameContent( fs_validation_result_t *result ) {
8498
char errorMsg[MAX_OSPATH];
99+
const char *fs_game = Cvar_VariableString("fs_game");
100+
101+
// If we're playing a mod, be more lenient - don't require base game assets
102+
qboolean isMod = (fs_game && fs_game[0] && Q_stricmp(fs_game, "base") != 0 && Q_stricmp(fs_game, "baseq3") != 0);
103+
85104
const char *requiredPaks[] = {
86105
"pak0.pk3",
87106
NULL
@@ -114,16 +133,20 @@ qboolean FS_ValidateGameContent( fs_validation_result_t *result ) {
114133
result->corrupted_files = 0;
115134

116135
// Check for required pak files
136+
// For mods, be more lenient - don't require pak0.pk3 if mod has its own assets
117137
for ( i = 0; requiredPaks[i] != NULL; i++ ) {
118138
char pakPath[MAX_OSPATH];
119139
fileHandle_t f;
120140

121141
// Try to find the pak file
122142
int fileLen = FS_FOpenFileRead( requiredPaks[i], &f, qfalse );
123143
if ( fileLen < 0 || f == FS_INVALID_HANDLE ) {
124-
result->missing_files++;
125-
result->valid = qfalse;
126-
allValid = qfalse;
144+
// For mods, missing pak0.pk3 is not necessarily fatal
145+
if (!isMod) {
146+
result->missing_files++;
147+
result->valid = qfalse;
148+
allValid = qfalse;
149+
}
127150
continue;
128151
}
129152
FS_FCloseFile( f );
@@ -150,7 +173,33 @@ qboolean FS_ValidateGameContent( fs_validation_result_t *result ) {
150173
}
151174
}
152175

153-
// If we have pak files but no critical assets, something is wrong
176+
// For mods, be more lenient - if we have any content at all, consider it valid
177+
if (isMod) {
178+
// Check if mod has any content at all
179+
char modPak[MAX_OSPATH];
180+
fileHandle_t modF;
181+
182+
Com_sprintf(modPak, sizeof(modPak), "%s/pak0.pk3", fs_game);
183+
int modFileLen = FS_FOpenFileRead(modPak, &modF, qfalse);
184+
if (modFileLen >= 0 && modF != FS_INVALID_HANDLE) {
185+
FS_FCloseFile(modF);
186+
// Mod has its own pak file, consider it valid
187+
result->valid = qtrue;
188+
return qtrue;
189+
}
190+
191+
// Check for any .bsp files in maps directory (indicates mod has maps)
192+
fileHandle_t mapF;
193+
int mapLen = FS_FOpenFileRead("maps/q3dm9.bsp", &mapF, qfalse);
194+
if (mapLen >= 0 && mapF != FS_INVALID_HANDLE) {
195+
FS_FCloseFile(mapF);
196+
// Mod has maps, consider it valid
197+
result->valid = qtrue;
198+
return qtrue;
199+
}
200+
}
201+
202+
// For base game, require critical assets
154203
if ( hasBasicContent && availableAssets == 0 ) {
155204
Com_Printf( S_COLOR_YELLOW "WARNING: Pak files found but no critical assets detected. Content may be incomplete.\n" );
156205
result->valid = qfalse;
@@ -405,18 +454,20 @@ Called from FS_Startup or launcher.
405454
qboolean FS_ValidateContentOnStartup( void ) {
406455
fs_validation_result_t result;
407456
qboolean valid;
408-
457+
409458
Com_Printf( "Validating game content...\n" );
410-
459+
411460
valid = FS_ValidateGameContent( &result );
412-
461+
462+
contentValidationPassed = valid;
463+
413464
if ( !valid ) {
414465
FS_ReportMissingContent( &result );
415466
// Don't fail startup - allow engine to run with missing content
416467
// (user might be setting up or testing)
417468
return qfalse;
418469
}
419-
470+
420471
Com_Printf( S_COLOR_GREEN "Content validation: OK\n" );
421472
return qtrue;
422473
}

src/common/fs_validation.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ void FS_ReportMissingContent( fs_validation_result_t *result );
2727
// Run startup-time content validation (paks, base content, mods)
2828
qboolean FS_ValidateContentOnStartup( void );
2929

30+
// Check if content validation passed during startup
31+
qboolean FS_ContentValidationPassed( void );
32+
3033
// Validate a specific mod before loading (returns true if loadable)
3134
qboolean Mod_ValidateBeforeLoad( const char *modName );
3235

0 commit comments

Comments
 (0)