Browse Source

Merge pull request #294 from Hoikas/trolling

Fix patcher launching and StreamSource case-sensitivity.
Joseph Davies 12 years ago
parent
commit
676a8d649f
  1. 17
      Sources/Plasma/Apps/plClient/winmain.cpp
  2. 3
      Sources/Plasma/PubUtilLib/plFile/plStreamSource.cpp

17
Sources/Plasma/Apps/plClient/winmain.cpp

@ -1232,26 +1232,25 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPSTR lpCmdLine, int nC
memset(&pi, 0, sizeof(pi)); memset(&pi, 0, sizeof(pi));
si.cb = sizeof(si); si.cb = sizeof(si);
plStringStream cmdLine;
const char** addrs; const char** addrs;
if (!eventExists) // if it is missing, assume patcher wasn't launched if (!eventExists) // if it is missing, assume patcher wasn't launched
{ {
cmdLine << "\\" << plString::FromWchar(s_patcherExeName); plStringStream cmdLine;
GetAuthSrvHostnames(&addrs); GetAuthSrvHostnames(&addrs);
if(strlen(addrs[0])) if (strlen(addrs[0]))
cmdLine << plString::Format(" /AuthSrv=%s", addrs[0]); cmdLine << " /AuthSrv=" << addrs[0];
GetFileSrvHostnames(&addrs); GetFileSrvHostnames(&addrs);
if(strlen(addrs[0])) if (strlen(addrs[0]))
cmdLine << plString::Format(" /FileSrv=%s", addrs[0]); cmdLine << " /FileSrv=" << addrs[0];
GetGateKeeperSrvHostnames(&addrs); GetGateKeeperSrvHostnames(&addrs);
if(strlen(addrs[0])) if (strlen(addrs[0]))
cmdLine << plString::Format(" /GateKeeperSrv=%s", addrs[0]); cmdLine << " /GateKeeperSrv=" << addrs[0];
if(!CreateProcessW(NULL, (LPWSTR)cmdLine.GetString().ToUtf16().GetData(), NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi)) if(!CreateProcessW(s_patcherExeName, (LPWSTR)cmdLine.GetString().ToUtf16().GetData(), NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi))
{ {
hsMessageBox("Failed to launch patcher", "Error", hsMessageBoxNormal); hsMessageBox("Failed to launch patcher", "Error", hsMessageBoxNormal);
} }

3
Sources/Plasma/PubUtilLib/plFile/plStreamSource.cpp

@ -107,7 +107,8 @@ std::vector<plFileName> plStreamSource::GetListOfNames(const plFileName& dir, co
std::vector<plFileName> retVal; std::vector<plFileName> retVal;
for (auto curData = fFileData.begin(); curData != fFileData.end(); curData++) for (auto curData = fFileData.begin(); curData != fFileData.end(); curData++)
{ {
if ((curData->second.fDir == sDir) && (curData->second.fExt == ext)) if ((curData->second.fDir.AsString().CompareI(sDir.AsString()) == 0) &&
(curData->second.fExt.CompareI(ext) == 0))
retVal.push_back(curData->second.fFilename); retVal.push_back(curData->second.fFilename);
} }

Loading…
Cancel
Save