mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
Make client launchable from browser
By needs from https://github.com/teeworlds/teeworlds/pull/1478/files
This commit is contained in:
parent
ff36974bed
commit
c4d437bc0f
|
@ -3542,6 +3542,11 @@ static CClient *CreateClient()
|
|||
return new(pClient) CClient;
|
||||
}
|
||||
|
||||
void CClient::HandleConnectLink(const char *pArg)
|
||||
{
|
||||
str_copy(m_aCmdConnect, pArg + sizeof(CONNECTLINK) - 1, sizeof(m_aCmdConnect));
|
||||
}
|
||||
|
||||
/*
|
||||
Server Time
|
||||
Client Mirror Time
|
||||
|
@ -3688,7 +3693,9 @@ int main(int argc, const char **argv) // ignore_convention
|
|||
g_Config.m_ClConfigVersion = 1;
|
||||
|
||||
// parse the command line arguments
|
||||
if(argc > 1) // ignore_convention
|
||||
if(argc == 2 && str_startswith(argv[1], CONNECTLINK))
|
||||
pClient->HandleConnectLink(argv[1]);
|
||||
else if(argc > 1) // ignore_convention
|
||||
pConsole->ParseArguments(argc-1, &argv[1]); // ignore_convention
|
||||
|
||||
pClient->Engine()->InitLogfile();
|
||||
|
|
|
@ -8,6 +8,8 @@
|
|||
#include <base/hash.h>
|
||||
#include <engine/shared/http.h>
|
||||
|
||||
#define CONNECTLINK "ddnet:"
|
||||
|
||||
class CGraph
|
||||
{
|
||||
public:
|
||||
|
@ -382,6 +384,8 @@ public:
|
|||
|
||||
void ServerBrowserUpdate();
|
||||
|
||||
void HandleConnectLink(const char *pLink);
|
||||
|
||||
// gfx
|
||||
void SwitchWindowScreen(int Index);
|
||||
void ToggleFullscreen();
|
||||
|
|
Loading…
Reference in a new issue