Added multiplayer page.

Fixed numerous bugs with the alpha.
This commit is contained in:
Justin Marshall
2026-05-20 12:44:52 -07:00
parent 6170f0d4fc
commit b6ea2fb5fa
7 changed files with 1077 additions and 38 deletions
+59 -27
View File
@@ -257,6 +257,7 @@ public:
public:
static void MakeNameCanonical(const char* name, char* result, int maxLength);
idDeclLocal* FindTypeWithoutParsing(declType_t type, const char* name, bool makeDefault = true);
int GetDeclFilePriority(const idDeclFile* declFile) const;
idDeclType* GetDeclType(int type) const { return declTypes[type]; }
const idDeclFile* GetImplicitDeclFile(void) const { return &implicitDecls; }
@@ -716,15 +717,24 @@ int idDeclFile::LoadAndParse() {
declType_t identifiedType = DECL_MAX_TYPES;
if ( token.Icmp( "clampTable" ) == 0 || token.Icmp( "snapTable" ) == 0 || token.Icmp( "soundtable" ) == 0 ) {
identifiedType = DECL_TABLE;
}
// get the decl type from the type name
numTypes = declManagerLocal.GetNumDeclTypes();
for (i = 0; i < numTypes; i++) {
idDeclType* typeInfo = declManagerLocal.GetDeclType(i);
if (typeInfo && typeInfo->typeName.Icmp(token) == 0) {
identifiedType = (declType_t)typeInfo->type;
break;
if ( identifiedType == DECL_MAX_TYPES ) {
for (i = 0; i < numTypes; i++) {
idDeclType* typeInfo = declManagerLocal.GetDeclType(i);
if (typeInfo && typeInfo->typeName.Icmp(token) == 0) {
identifiedType = (declType_t)typeInfo->type;
break;
}
}
}
else {
i = 0;
}
if (i >= numTypes) {
@@ -813,11 +823,29 @@ int idDeclFile::LoadAndParse() {
newDecl = declManagerLocal.FindTypeWithoutParsing(identifiedType, name, false);
if (newDecl) {
// update the existing copy
if (newDecl->sourceFile != this || newDecl->redefinedInReload) {
if (newDecl->sourceFile == this && newDecl->redefinedInReload) {
src.Warning("%s '%s' previously defined at %s:%i", declManagerLocal.GetDeclNameFromType(identifiedType),
name.c_str(), newDecl->sourceFile->fileName.c_str(), newDecl->sourceLine);
continue;
}
if (newDecl->sourceFile != this) {
if (declManagerLocal.GetDeclFilePriority(this) < declManagerLocal.GetDeclFilePriority(newDecl->sourceFile)) {
src.Warning("%s '%s' previously defined at %s:%i", declManagerLocal.GetDeclNameFromType(identifiedType),
name.c_str(), newDecl->sourceFile->fileName.c_str(), newDecl->sourceLine);
continue;
}
idDeclLocal** prev = &newDecl->sourceFile->decls;
while (*prev) {
if (*prev == newDecl) {
*prev = newDecl->nextInFile;
break;
}
prev = &(*prev)->nextInFile;
}
newDecl->nextInFile = this->decls;
this->decls = newDecl;
}
if (newDecl->declState != DS_UNPARSED) {
reparse = true;
}
@@ -1364,30 +1392,15 @@ void idDeclManagerLocal::RegisterDeclType(const char* typeName, declType_t type,
RegisterDeclSubFolder
===================
*/
// jmarshall
void idDeclManagerLocal::RegisterDeclSubFolder(const char* folder, const char* extension, idList<idStr>& fileList) {
// Find all
{
idFileList* list = fileSystem->ListFiles(folder, extension, true);
idFileList* list = fileSystem->ListFilesTree(folder, extension, false);
for (int d = 0; d < list->GetNumFiles(); d++)
{
fileList.Append(va("%s/%s", folder, list->GetFile(d)));
}
fileSystem->FreeFileList(list);
for (int i = 0; i < list->GetNumFiles(); i++) {
fileList.Append(list->GetFile(i));
}
idFileList* dirList = fileSystem->ListFiles(folder, "/", true);
for (int i = 0; i < dirList->GetNumFiles(); i++)
{
idStr dir = va("%s/%s", folder, dirList->GetFile(i));
RegisterDeclSubFolder(dir, extension, fileList);
}
fileSystem->FreeFileList(dirList);
fileSystem->FreeFileList(list);
}
// jmarshall end
/*
===================
@@ -1425,7 +1438,7 @@ void idDeclManagerLocal::RegisterDeclFolder(const char* folder, const char* exte
// jmarshall end
// load and parse decl files
for (i = 0; i < fileList.Num(); i++) {
for (i = fileList.Num() - 1; i >= 0; i--) {
// jmarshall
//fileName = declFolder->folder + "/" + fileList[ i ];
fileName = fileList[i];
@@ -1448,6 +1461,25 @@ void idDeclManagerLocal::RegisterDeclFolder(const char* folder, const char* exte
}
}
/*
===================
idDeclManagerLocal::GetDeclFilePriority
===================
*/
int idDeclManagerLocal::GetDeclFilePriority(const idDeclFile* declFile) const {
if (declFile == &implicitDecls) {
return -1;
}
for (int i = 0; i < loadedFiles.Num(); i++) {
if (loadedFiles[i] == declFile) {
return i;
}
}
return -1;
}
/*
===================
idDeclManagerLocal::GetChecksum
@@ -3124,4 +3156,4 @@ const rvDeclEffect* idDeclManagerLocal::EffectByIndex(int index, bool forceParse
return (const rvDeclEffect*)DeclByIndex(DECL_EFFECT, index, forceParse);
}
#endif
#endif