1
0
mirror of https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git synced 2025-07-17 02:51:27 +00:00

Merge pull request #275 from zrax/file-utils

Unify filesystem utilities
This commit is contained in:
2013-01-22 16:27:26 -08:00
148 changed files with 1545 additions and 4225 deletions

View File

@ -1474,8 +1474,7 @@ plUoid plNetClientMgr::GetAgeSDLObjectUoid(const char* ageName) const
if (!loc.IsValid())
{
// check current age des
if (plAgeLoader::GetInstance()->GetCurrAgeDesc().GetAgeName() &&
!strcmp(plAgeLoader::GetInstance()->GetCurrAgeDesc().GetAgeName(), ageName))
if (plAgeLoader::GetInstance()->GetCurrAgeDesc().GetAgeName() == ageName)
loc=plAgeLoader::GetInstance()->GetCurrAgeDesc().CalcPageLocation("BuiltIn");
if (!loc.IsValid())

View File

@ -63,7 +63,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "plNetMessage/plNetMessage.h"
#include "plAvatar/plAvatarMgr.h"
#include "plAvatar/plArmatureMod.h"
#include "plFile/hsFiles.h"
/*****************************************************************************
@ -305,15 +304,14 @@ void plNetLinkingMgr::SetEnabled( bool b )
////////////////////////////////////////////////////////////////////
// static
std::string plNetLinkingMgr::GetProperAgeName( const char * ageName )
plString plNetLinkingMgr::GetProperAgeName( const plString & ageName )
{
plNetClientMgr * nc = plNetClientMgr::GetInstance();
hsFolderIterator it("dat" PATH_SEPARATOR_STR "*.age", true);
while ( it.NextFile() )
std::vector<plFileName> files = plFileSystem::ListDir("dat", "*.age");
for (auto iter = files.begin(); iter != files.end(); ++iter)
{
std::string work = it.GetFileName();
work.erase( work.find( ".age" ) );
if ( stricmp( ageName, work.c_str() )==0 )
plString work = iter->GetFileNameNoExt();
if (ageName.CompareI(work) == 0)
return work;
}
return ageName;

View File

@ -158,7 +158,7 @@ public:
const plNetServerSessionInfo * GetLobbyServerInfo( void ) const { return &fLobbyInfo;}
// helpers
static std::string GetProperAgeName( const char * ageName ); // attempt to fix wrong case age name.
static plString GetProperAgeName( const plString & ageName ); // attempt to fix wrong case age name.
private:
bool fLinkingEnabled;