-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes issue with quickload patches on AC
- Fixes quickload patches not working on AC.
- Loading branch information
1 parent
019fc31
commit 24cedac
Showing
7 changed files
with
69 additions
and
2 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#include "CParseCommandLine.h" | ||
|
||
std::map <std::string, std::string> CParseCommandLine::CmdLine; | ||
|
||
std::map <std::string, std::string> CParseCommandLine::parseCmdLine(std::string CommandLine) | ||
{ | ||
for (unsigned int i = 0; i < CommandLine.length(); ++i) | ||
{ | ||
if (CommandLine.at(i) == '-' || CommandLine.at(i) == '/') | ||
{ | ||
// Get past the -h or -p or -whatever | ||
// there's also a space after the -h or -p. | ||
// so i + 1 = 'h' | ||
// and i + 2 = ' ' | ||
// so we want to find the next space AFTER i + 2. | ||
std::size_t stringPos = CommandLine.find(' ', i + 3); | ||
|
||
// If no space was found, assume we're at the end of the string. | ||
if (stringPos == std::string::npos) | ||
{ | ||
stringPos = CommandLine.length(); | ||
} | ||
|
||
// Make sure parameter isn't empty. | ||
// If it's empty, the next parameter will be collided with | ||
if (CommandLine.at(i + 3) != '-') | ||
{ | ||
int characters = stringPos - (i + 3); | ||
switch (CommandLine.at(i + 1)) | ||
{ | ||
|
||
case 'h': CmdLine["Host"] = CommandLine.substr(i + 3, characters); | ||
case 'p': CmdLine["Port"] = CommandLine.substr(i + 3, characters); | ||
case 'z': CmdLine["Password"] = CommandLine.substr(i + 3, characters); | ||
case 'n': CmdLine["Name"] = CommandLine.substr(i + 3, characters); | ||
} | ||
} | ||
} | ||
} | ||
return CmdLine; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#include <vector> | ||
#include <map> | ||
#include <string> | ||
|
||
class CParseCommandLine { | ||
|
||
public: | ||
|
||
// PURPOSE: Parse the command line and get the ip, port, and password | ||
// REQUIRES: The command line. | ||
static std::map <std::string, std::string> parseCmdLine(std::string CommandLine); | ||
private: | ||
static std::map<std::string, std::string> CmdLine; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters