mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-03-19 09:21:47 +00:00
Define SERVER_URL_PROTOCOL const for easy reconfiguration
This commit is contained in:
parent
feb18208cb
commit
f32ab5918e
3 changed files with 7 additions and 3 deletions
|
@ -895,7 +895,7 @@ static void IdentifyVersion(void)
|
|||
{
|
||||
size_t i;
|
||||
|
||||
CONS_Printf("srb2:// connect links load game files from the SRB2 application's stored directory. Switching to ");
|
||||
CONS_Printf("%s connect links load game files from the SRB2 application's stored directory. Switching to ", SERVER_URL_PROTOCOL);
|
||||
strlcpy(srb2path, myargv[0], sizeof(srb2path));
|
||||
|
||||
// Get just the directory, minus the EXE name
|
||||
|
|
|
@ -150,6 +150,9 @@ extern char logfilename[1024];
|
|||
// Otherwise we can't force updates!
|
||||
#endif
|
||||
|
||||
/* A custom URL protocol for server links. */
|
||||
#define SERVER_URL_PROTOCOL "srb2://"
|
||||
|
||||
// Does this version require an added patch file?
|
||||
// Comment or uncomment this as necessary.
|
||||
#define USE_PATCH_DTA
|
||||
|
|
|
@ -41,12 +41,13 @@ static INT32 found;
|
|||
const char *M_GetUrlProtocolArg(void)
|
||||
{
|
||||
INT32 i;
|
||||
const size_t len = strlen(SERVER_URL_PROTOCOL);
|
||||
|
||||
for (i = 1; i < myargc; i++)
|
||||
{
|
||||
if (!strnicmp(myargv[i], "srb2://", 7))
|
||||
if (strlen(myargv[i]) > len && !strnicmp(myargv[i], SERVER_URL_PROTOCOL, len))
|
||||
{
|
||||
return &myargv[i][7];
|
||||
return &myargv[i][len];
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue