Skip to content

Commit 6205ac4

Browse files
committed
Deduplicate SResInfo by moving to Shared
1 parent da8e500 commit 6205ac4

File tree

3 files changed

+25
-21
lines changed

3 files changed

+25
-21
lines changed

Client/mods/deathmatch/logic/CLocalServer.cpp

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,23 +10,14 @@
1010
*****************************************************************************/
1111

1212
#include "StdInc.h"
13+
#include <SResInfo.h>
1314

1415
using std::list;
1516

1617
extern CCoreInterface* g_pCore;
1718
extern CLocalizationInterface* g_pLocalization;
1819
extern CClientGame* g_pClientGame;
1920

20-
// SResInfo - Item in list of potential resources - Used in GetResourceNameList()
21-
struct SResInfo
22-
{
23-
SString strAbsPath;
24-
SString strName;
25-
bool bIsDir;
26-
bool bPathIssue;
27-
SString strAbsPathDup;
28-
};
29-
3021
CLocalServer::CLocalServer(const char* szConfig)
3122
{
3223
m_strConfig = szConfig;

Server/mods/deathmatch/logic/CResourceManager.cpp

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,20 +22,11 @@
2222
#include "CMainConfig.h"
2323
#include "CDatabaseManager.h"
2424
#include "CRegistry.h"
25+
#include <SResInfo.h>
2526

2627
#define BLOCKED_DB_FILE_NAME "fileblock.db"
2728
#define BLOCKED_DB_TABLE_NAME "`block_reasons`"
2829

29-
// SResInfo - Item in list of potential resources - Used in Refresh()
30-
struct SResInfo
31-
{
32-
SString strAbsPath;
33-
SString strName;
34-
bool bIsDir;
35-
bool bPathIssue;
36-
SString strAbsPathDup;
37-
};
38-
3930
CResourceManager::CResourceManager()
4031
{
4132
m_bResourceListChanged = false;
@@ -188,7 +179,7 @@ bool CResourceManager::Refresh(bool bRefreshAll, const SString strJustThisResour
188179
{
189180
if (g_pServerInterface->IsRequestingExit())
190181
return false;
191-
182+
192183
// Resource exists but has changed, reload it
193184
Load(!info.bIsDir, info.strAbsPath, info.strName);
194185
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#pragma once
2+
3+
// SResInfo - Item in list of potential resources - Used in Refresh()
4+
struct SResInfo
5+
{
6+
SString strAbsPath;
7+
SString strName;
8+
bool bIsDir;
9+
bool bPathIssue;
10+
SString strAbsPathDup;
11+
};
12+
13+
// IMPROVED REFACTOR FOR LATER:
14+
15+
// struct SResourceInformation
16+
// {
17+
// std::string absolutePathDuplicate; // Handle this elsewhere
18+
// std::string absolutePath;
19+
// std::string name;
20+
// bool isDirectory;
21+
// bool pathIssue;
22+
// };

0 commit comments

Comments
 (0)