Define SERVER_URL_PROTOCOL const for easy reconfiguration
This commit is contained in:
parent
feb18208cb
commit
f32ab5918e
|
@ -895,7 +895,7 @@ static void IdentifyVersion(void)
|
||||||
{
|
{
|
||||||
size_t i;
|
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));
|
strlcpy(srb2path, myargv[0], sizeof(srb2path));
|
||||||
|
|
||||||
// Get just the directory, minus the EXE name
|
// Get just the directory, minus the EXE name
|
||||||
|
|
|
@ -150,6 +150,9 @@ extern char logfilename[1024];
|
||||||
// Otherwise we can't force updates!
|
// Otherwise we can't force updates!
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* A custom URL protocol for server links. */
|
||||||
|
#define SERVER_URL_PROTOCOL "srb2://"
|
||||||
|
|
||||||
// Does this version require an added patch file?
|
// Does this version require an added patch file?
|
||||||
// Comment or uncomment this as necessary.
|
// Comment or uncomment this as necessary.
|
||||||
#define USE_PATCH_DTA
|
#define USE_PATCH_DTA
|
||||||
|
|
|
@ -41,12 +41,13 @@ static INT32 found;
|
||||||
const char *M_GetUrlProtocolArg(void)
|
const char *M_GetUrlProtocolArg(void)
|
||||||
{
|
{
|
||||||
INT32 i;
|
INT32 i;
|
||||||
|
const size_t len = strlen(SERVER_URL_PROTOCOL);
|
||||||
|
|
||||||
for (i = 1; i < myargc; i++)
|
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 New Issue