1
0
forked from metin2/server

Eliminated hardcoded allowed map limit, added and increased the limit in length.h

This commit is contained in:
2023-12-09 19:16:41 +02:00
parent da120f69e0
commit 99935d6cff
6 changed files with 12 additions and 5 deletions

View File

@ -172,6 +172,12 @@ void map_allow_add(int index)
exit(1);
}
if (s_set_map_allows.size() >= MAP_ALLOW_MAX_LEN)
{
fprintf(stdout, "Fatal error: maximum allowed maps reached!\n");
exit(1);
}
fprintf(stdout, "MAP ALLOW %d\n", index);
s_set_map_allows.insert(index);
}

View File

@ -180,7 +180,7 @@ void CLIENT_DESC::SetPhase(int iPhase)
p.wListenPort = mother_port;
p.wP2PPort = p2p_port;
p.bAuthServer = false;
map_allow_copy(p.alMaps, 32);
map_allow_copy(p.alMaps, MAP_ALLOW_MAX_LEN);
const DESC_MANAGER::DESC_SET & c_set = DESC_MANAGER::instance().GetClientSet();
DESC_MANAGER::DESC_SET::const_iterator it;

View File

@ -1312,7 +1312,7 @@ void CInputDB::MapLocations(const char * c_pData)
while (bCount--)
{
for (int i = 0; i < 32; ++i)
for (int i = 0; i < MAP_ALLOW_MAX_LEN; ++i)
{
if (0 == pLoc->alMaps[i])
break;