mirror of
https://github.com/ddnet/ddnet.git
synced 2024-09-20 01:24:18 +00:00
Merge branch 'master' into sqlmasters
This commit is contained in:
commit
b648b530d5
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -20,6 +20,7 @@ mastersrv*
|
||||||
packetgen*
|
packetgen*
|
||||||
teeworlds*
|
teeworlds*
|
||||||
teeworlds_srv*
|
teeworlds_srv*
|
||||||
|
serverlaunch_*
|
||||||
tileset_border*
|
tileset_border*
|
||||||
twping*
|
twping*
|
||||||
versionsrv*
|
versionsrv*
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
[![DDraceNetwork](http://ddnet.tw/ddnet-small.png)](http://ddnet.tw) [![Build Status](https://circleci.com/gh/ddnet/ddnet/tree/master.png)](https://circleci.com/gh/ddnet/ddnet)
|
[![DDraceNetwork](https://ddnet.tw/ddnet-small.png)](https://ddnet.tw) [![Build Status](https://circleci.com/gh/ddnet/ddnet/tree/master.png)](https://circleci.com/gh/ddnet/ddnet)
|
||||||
================================
|
================================
|
||||||
|
|
||||||
Our own flavor of DDRace, a Teeworlds mod. See the [website](http://ddnet.tw) for more information.
|
Our own flavor of DDRace, a Teeworlds mod. See the [website](https://ddnet.tw) for more information.
|
||||||
|
|
||||||
Development discussions happen on #ddnet on Quakenet ([Webchat](http://webchat.quakenet.org/?channels=ddnet&uio=d4)).
|
Development discussions happen on #ddnet on Quakenet ([Webchat](http://webchat.quakenet.org/?channels=ddnet&uio=d4)).
|
||||||
|
|
||||||
You can get binary releases on the [DDNet website](http://ddnet.tw/downloads/).
|
You can get binary releases on the [DDNet website](https://ddnet.tw/downloads/).
|
||||||
|
|
||||||
Building
|
Building
|
||||||
--------
|
--------
|
||||||
|
@ -14,7 +14,7 @@ To compile DDNet yourself, you can follow the [instructions for compiling Teewor
|
||||||
|
|
||||||
DDNet requires additional libraries, that are bundled for the most common platforms (Windows, Mac, Linux, all x86 and x86_64). Instead you can install these libraries on your system, remove the `config.lua` and `bam` should use the system-wide libraries by default. You can install all required dependencies on Debian and Ubuntu like this:
|
DDNet requires additional libraries, that are bundled for the most common platforms (Windows, Mac, Linux, all x86 and x86_64). Instead you can install these libraries on your system, remove the `config.lua` and `bam` should use the system-wide libraries by default. You can install all required dependencies on Debian and Ubuntu like this:
|
||||||
|
|
||||||
apt-get install libsdl1.2-dev libfreetype6-dev libcurl4-openssl-dev libogg-dev libopus-dev libopusfile-dev
|
apt-get install libsdl2-dev libfreetype6-dev libcurl4-openssl-dev libogg-dev libopus-dev libopusfile-dev
|
||||||
|
|
||||||
If you have the libraries installed, but still want to use the bundled ones instead, you can specify so by running `bam config curl.use_pkgconfig=false opus.use_pkgconfig=false opusfile.use_pkgconfig=false ogg.use_pkgconfig=false`.
|
If you have the libraries installed, but still want to use the bundled ones instead, you can specify so by running `bam config curl.use_pkgconfig=false opus.use_pkgconfig=false opusfile.use_pkgconfig=false ogg.use_pkgconfig=false`.
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#
|
#
|
||||||
# autoexec_server.cfg
|
# autoexec_server.cfg
|
||||||
#
|
#
|
||||||
# See http://ddnet.tw/settingscommands for all available settings.
|
# See https://ddnet.tw/settingscommands/ for all available settings.
|
||||||
# Everything following a # is considered a comment and ignored by the server.
|
# Everything following a # is considered a comment and ignored by the server.
|
||||||
# When an option can be enabled or disabled, it's enabled with 1, disabled with 0.
|
# When an option can be enabled or disabled, it's enabled with 1, disabled with 0.
|
||||||
#
|
#
|
||||||
|
|
|
@ -156,6 +156,8 @@ if use_bundle:
|
||||||
<string>%s</string>
|
<string>%s</string>
|
||||||
<key>CFBundleIdentifier</key>
|
<key>CFBundleIdentifier</key>
|
||||||
<string>org.DDNetClient.app</string>
|
<string>org.DDNetClient.app</string>
|
||||||
|
<key>NSHighResolutionCapable</key>
|
||||||
|
<true/>
|
||||||
</dict>
|
</dict>
|
||||||
</plist>
|
</plist>
|
||||||
""" % (version))
|
""" % (version))
|
||||||
|
|
|
@ -41,6 +41,7 @@ protected:
|
||||||
public:
|
public:
|
||||||
int m_LocalIDs[2];
|
int m_LocalIDs[2];
|
||||||
char m_aNews[NEWS_SIZE];
|
char m_aNews[NEWS_SIZE];
|
||||||
|
int64 m_ReconnectTime;
|
||||||
|
|
||||||
CNetObj_PlayerInput m_DummyInput;
|
CNetObj_PlayerInput m_DummyInput;
|
||||||
|
|
||||||
|
@ -139,6 +140,8 @@ public:
|
||||||
|
|
||||||
virtual void CheckVersionUpdate() = 0;
|
virtual void CheckVersionUpdate() = 0;
|
||||||
|
|
||||||
|
virtual int GetPredictionTime() = 0;
|
||||||
|
|
||||||
// snapshot interface
|
// snapshot interface
|
||||||
|
|
||||||
enum
|
enum
|
||||||
|
|
|
@ -568,7 +568,8 @@ int CGraphicsBackend_SDL_OpenGL::Init(const char *pName, int *Screen, int *pWidt
|
||||||
m_NumScreens = SDL_GetNumVideoDisplays();
|
m_NumScreens = SDL_GetNumVideoDisplays();
|
||||||
if(m_NumScreens > 0)
|
if(m_NumScreens > 0)
|
||||||
{
|
{
|
||||||
clamp(*Screen, 0, m_NumScreens-1);
|
if(*Screen < 0 || *Screen >= m_NumScreens)
|
||||||
|
*Screen = 0;
|
||||||
if(SDL_GetDisplayBounds(*Screen, &ScreenPos) != 0)
|
if(SDL_GetDisplayBounds(*Screen, &ScreenPos) != 0)
|
||||||
{
|
{
|
||||||
dbg_msg("gfx", "unable to retrieve screen information: %s", SDL_GetError());
|
dbg_msg("gfx", "unable to retrieve screen information: %s", SDL_GetError());
|
||||||
|
@ -620,6 +621,11 @@ int CGraphicsBackend_SDL_OpenGL::Init(const char *pName, int *Screen, int *pWidt
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(Flags&IGraphicsBackend::INITFLAG_HIGHDPI)
|
||||||
|
SdlFlags |= SDL_WINDOW_ALLOW_HIGHDPI;
|
||||||
|
else
|
||||||
|
SDL_SetHint(SDL_HINT_VIDEO_HIGHDPI_DISABLED, "1");
|
||||||
|
|
||||||
// set gl attributes
|
// set gl attributes
|
||||||
SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
|
SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
|
||||||
if(FsaaSamples)
|
if(FsaaSamples)
|
||||||
|
@ -633,13 +639,13 @@ int CGraphicsBackend_SDL_OpenGL::Init(const char *pName, int *Screen, int *pWidt
|
||||||
SDL_GL_SetAttribute(SDL_GL_MULTISAMPLESAMPLES, 0);
|
SDL_GL_SetAttribute(SDL_GL_MULTISAMPLESAMPLES, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Might fix problems with Windows HighDPI scaling
|
if(g_Config.m_InpMouseOld)
|
||||||
SDL_SetHint(SDL_HINT_VIDEO_HIGHDPI_DISABLED, "1");
|
SDL_SetHint(SDL_HINT_MOUSE_RELATIVE_MODE_WARP, "1");
|
||||||
|
|
||||||
m_pWindow = SDL_CreateWindow(
|
m_pWindow = SDL_CreateWindow(
|
||||||
pName,
|
pName,
|
||||||
SDL_WINDOWPOS_CENTERED_DISPLAY(g_Config.m_GfxScreen),
|
SDL_WINDOWPOS_UNDEFINED,
|
||||||
SDL_WINDOWPOS_CENTERED_DISPLAY(g_Config.m_GfxScreen),
|
SDL_WINDOWPOS_UNDEFINED,
|
||||||
*pWidth,
|
*pWidth,
|
||||||
*pHeight,
|
*pHeight,
|
||||||
SdlFlags);
|
SdlFlags);
|
||||||
|
@ -651,8 +657,6 @@ int CGraphicsBackend_SDL_OpenGL::Init(const char *pName, int *Screen, int *pWidt
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
SDL_GetWindowSize(m_pWindow, pWidth, pHeight);
|
|
||||||
|
|
||||||
m_GLContext = SDL_GL_CreateContext(m_pWindow);
|
m_GLContext = SDL_GL_CreateContext(m_pWindow);
|
||||||
|
|
||||||
if(m_GLContext == NULL)
|
if(m_GLContext == NULL)
|
||||||
|
@ -661,12 +665,8 @@ int CGraphicsBackend_SDL_OpenGL::Init(const char *pName, int *Screen, int *pWidt
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
SDL_ShowWindow(m_pWindow);
|
SDL_GL_GetDrawableSize(m_pWindow, pWidth, pHeight);
|
||||||
|
|
||||||
SetWindowScreen(g_Config.m_GfxScreen);
|
|
||||||
|
|
||||||
SDL_GL_SetSwapInterval(Flags&IGraphicsBackend::INITFLAG_VSYNC ? 1 : 0);
|
SDL_GL_SetSwapInterval(Flags&IGraphicsBackend::INITFLAG_VSYNC ? 1 : 0);
|
||||||
|
|
||||||
SDL_GL_MakeCurrent(NULL, NULL);
|
SDL_GL_MakeCurrent(NULL, NULL);
|
||||||
|
|
||||||
// start the command processor
|
// start the command processor
|
||||||
|
@ -685,6 +685,9 @@ int CGraphicsBackend_SDL_OpenGL::Init(const char *pName, int *Screen, int *pWidt
|
||||||
RunBuffer(&CmdBuffer);
|
RunBuffer(&CmdBuffer);
|
||||||
WaitForIdle();
|
WaitForIdle();
|
||||||
|
|
||||||
|
SDL_ShowWindow(m_pWindow);
|
||||||
|
SetWindowScreen(g_Config.m_GfxScreen);
|
||||||
|
|
||||||
// return
|
// return
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -345,6 +345,7 @@ CClient::CClient() : m_DemoPlayer(&m_SnapshotDelta)
|
||||||
m_LastDummyConnectTime = 0;
|
m_LastDummyConnectTime = 0;
|
||||||
|
|
||||||
m_DDNetSrvListTokenSet = false;
|
m_DDNetSrvListTokenSet = false;
|
||||||
|
m_ReconnectTime = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----- send functions -----
|
// ----- send functions -----
|
||||||
|
@ -622,7 +623,17 @@ void CClient::SetState(int s)
|
||||||
}
|
}
|
||||||
m_State = s;
|
m_State = s;
|
||||||
if(Old != s)
|
if(Old != s)
|
||||||
|
{
|
||||||
GameClient()->OnStateChange(m_State, Old);
|
GameClient()->OnStateChange(m_State, Old);
|
||||||
|
|
||||||
|
if(s == IClient::STATE_OFFLINE && m_ReconnectTime == 0)
|
||||||
|
{
|
||||||
|
if(g_Config.m_ClReconnectFull > 0 && (str_find_nocase(ErrorString(), "full") || str_find_nocase(ErrorString(), "reserved")))
|
||||||
|
m_ReconnectTime = time_get() + time_freq() * g_Config.m_ClReconnectFull;
|
||||||
|
else if(g_Config.m_ClReconnectTimeout > 0 && str_find_nocase(ErrorString(), "Timeout"))
|
||||||
|
m_ReconnectTime = time_get() + time_freq() * g_Config.m_ClReconnectTimeout;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// called when the map is loaded and we should init for a new round
|
// called when the map is loaded and we should init for a new round
|
||||||
|
@ -922,7 +933,6 @@ void CClient::DebugRender()
|
||||||
static NETSTATS Prev, Current;
|
static NETSTATS Prev, Current;
|
||||||
static int64 LastSnap = 0;
|
static int64 LastSnap = 0;
|
||||||
static float FrameTimeAvg = 0;
|
static float FrameTimeAvg = 0;
|
||||||
int64 Now = time_get();
|
|
||||||
char aBuffer[512];
|
char aBuffer[512];
|
||||||
|
|
||||||
if(!g_Config.m_Debug)
|
if(!g_Config.m_Debug)
|
||||||
|
@ -988,8 +998,7 @@ void CClient::DebugRender()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
str_format(aBuffer, sizeof(aBuffer), "pred: %d ms",
|
str_format(aBuffer, sizeof(aBuffer), "pred: %d ms", GetPredictionTime());
|
||||||
(int)((m_PredictedTime.Get(Now)-m_GameTime[g_Config.m_ClDummy].Get(Now))*1000/(float)time_freq()));
|
|
||||||
Graphics()->QuadsText(2, 70, 16, aBuffer);
|
Graphics()->QuadsText(2, 70, 16, aBuffer);
|
||||||
Graphics()->QuadsEnd();
|
Graphics()->QuadsEnd();
|
||||||
|
|
||||||
|
@ -1224,6 +1233,7 @@ void CClient::ProcessConnlessPacket(CNetChunk *pPacket)
|
||||||
// do decompression of serverlist
|
// do decompression of serverlist
|
||||||
if (uncompress((Bytef*)aBuf, &DstLen, (Bytef*)pComp, CompLength) == Z_OK && (int)DstLen == PlainLength)
|
if (uncompress((Bytef*)aBuf, &DstLen, (Bytef*)pComp, CompLength) == Z_OK && (int)DstLen == PlainLength)
|
||||||
{
|
{
|
||||||
|
aBuf[DstLen] = '\0';
|
||||||
bool ListChanged = true;
|
bool ListChanged = true;
|
||||||
|
|
||||||
IOHANDLE File = m_pStorage->OpenFile("ddnet-servers.json", IOFLAG_READ, IStorage::TYPE_SAVE);
|
IOHANDLE File = m_pStorage->OpenFile("ddnet-servers.json", IOFLAG_READ, IStorage::TYPE_SAVE);
|
||||||
|
@ -2467,6 +2477,12 @@ void CClient::Update()
|
||||||
// update gameclient
|
// update gameclient
|
||||||
if(!m_EditorActive)
|
if(!m_EditorActive)
|
||||||
GameClient()->OnUpdate();
|
GameClient()->OnUpdate();
|
||||||
|
|
||||||
|
if(m_ReconnectTime > 0 && time_get() > m_ReconnectTime)
|
||||||
|
{
|
||||||
|
Connect(m_aServerAddressStr);
|
||||||
|
m_ReconnectTime = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CClient::VersionUpdate()
|
void CClient::VersionUpdate()
|
||||||
|
@ -2743,13 +2759,15 @@ void CClient::Run()
|
||||||
m_EditorActive = false;
|
m_EditorActive = false;
|
||||||
|
|
||||||
Update();
|
Update();
|
||||||
|
int64 Now = time_get();
|
||||||
|
|
||||||
if((g_Config.m_GfxBackgroundRender || m_pGraphics->WindowOpen()) && (!g_Config.m_GfxAsyncRenderOld || m_pGraphics->IsIdle()))
|
if((g_Config.m_GfxBackgroundRender || m_pGraphics->WindowOpen())
|
||||||
|
&& (!g_Config.m_GfxAsyncRenderOld || m_pGraphics->IsIdle())
|
||||||
|
&& (!g_Config.m_GfxRefreshRate || Now >= m_LastRenderTime + time_freq() / g_Config.m_GfxRefreshRate))
|
||||||
{
|
{
|
||||||
m_RenderFrames++;
|
m_RenderFrames++;
|
||||||
|
|
||||||
// update frametime
|
// update frametime
|
||||||
int64 Now = time_get();
|
|
||||||
m_RenderFrameTime = (Now - m_LastRenderTime) / (float)time_freq();
|
m_RenderFrameTime = (Now - m_LastRenderTime) / (float)time_freq();
|
||||||
if(m_RenderFrameTime < m_RenderFrameTimeLow)
|
if(m_RenderFrameTime < m_RenderFrameTimeLow)
|
||||||
m_RenderFrameTimeLow = m_RenderFrameTime;
|
m_RenderFrameTimeLow = m_RenderFrameTime;
|
||||||
|
@ -3531,3 +3549,9 @@ void CClient::RequestDDNetSrvList()
|
||||||
Packet.m_Flags = NETSENDFLAG_CONNLESS;
|
Packet.m_Flags = NETSENDFLAG_CONNLESS;
|
||||||
m_NetClient[g_Config.m_ClDummy].Send(&Packet);
|
m_NetClient[g_Config.m_ClDummy].Send(&Packet);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int CClient::GetPredictionTime()
|
||||||
|
{
|
||||||
|
int64 Now = time_get();
|
||||||
|
return (int)((m_PredictedTime.Get(Now)-m_GameTime[g_Config.m_ClDummy].Get(Now))*1000/(float)time_freq());
|
||||||
|
}
|
||||||
|
|
|
@ -270,6 +270,7 @@ public:
|
||||||
|
|
||||||
// ---
|
// ---
|
||||||
|
|
||||||
|
int GetPredictionTime();
|
||||||
void *SnapGetItem(int SnapID, int Index, CSnapItem *pItem);
|
void *SnapGetItem(int SnapID, int Index, CSnapItem *pItem);
|
||||||
void SnapInvalidateItem(int SnapID, int Index);
|
void SnapInvalidateItem(int SnapID, int Index);
|
||||||
void *SnapFindItem(int SnapID, int Type, int ID);
|
void *SnapFindItem(int SnapID, int Type, int ID);
|
||||||
|
|
|
@ -787,6 +787,7 @@ int CGraphics_Threaded::IssueInit()
|
||||||
if(g_Config.m_GfxFullscreen) Flags |= IGraphicsBackend::INITFLAG_FULLSCREEN;
|
if(g_Config.m_GfxFullscreen) Flags |= IGraphicsBackend::INITFLAG_FULLSCREEN;
|
||||||
if(g_Config.m_GfxVsync) Flags |= IGraphicsBackend::INITFLAG_VSYNC;
|
if(g_Config.m_GfxVsync) Flags |= IGraphicsBackend::INITFLAG_VSYNC;
|
||||||
if(g_Config.m_GfxResizable) Flags |= IGraphicsBackend::INITFLAG_RESIZABLE;
|
if(g_Config.m_GfxResizable) Flags |= IGraphicsBackend::INITFLAG_RESIZABLE;
|
||||||
|
if(g_Config.m_GfxHighdpi) Flags |= IGraphicsBackend::INITFLAG_HIGHDPI;
|
||||||
|
|
||||||
return m_pBackend->Init("DDNet Client", &g_Config.m_GfxScreen, &g_Config.m_GfxScreenWidth, &g_Config.m_GfxScreenHeight, g_Config.m_GfxFsaaSamples, Flags, &m_DesktopScreenWidth, &m_DesktopScreenHeight);
|
return m_pBackend->Init("DDNet Client", &g_Config.m_GfxScreen, &g_Config.m_GfxScreenWidth, &g_Config.m_GfxScreenHeight, g_Config.m_GfxFsaaSamples, Flags, &m_DesktopScreenWidth, &m_DesktopScreenHeight);
|
||||||
}
|
}
|
||||||
|
|
|
@ -318,6 +318,7 @@ public:
|
||||||
INITFLAG_VSYNC = 2,
|
INITFLAG_VSYNC = 2,
|
||||||
INITFLAG_RESIZABLE = 4,
|
INITFLAG_RESIZABLE = 4,
|
||||||
INITFLAG_BORDERLESS = 8,
|
INITFLAG_BORDERLESS = 8,
|
||||||
|
INITFLAG_HIGHDPI = 16,
|
||||||
};
|
};
|
||||||
|
|
||||||
virtual ~IGraphicsBackend() {}
|
virtual ~IGraphicsBackend() {}
|
||||||
|
|
|
@ -249,7 +249,12 @@ int CInput::Update()
|
||||||
case SDL_WINDOWEVENT_FOCUS_LOST:
|
case SDL_WINDOWEVENT_FOCUS_LOST:
|
||||||
m_MouseFocus = false;
|
m_MouseFocus = false;
|
||||||
IgnoreKeys = true;
|
IgnoreKeys = true;
|
||||||
SDL_SetRelativeMouseMode(SDL_FALSE);
|
if(m_InputGrabbed)
|
||||||
|
{
|
||||||
|
MouseModeAbsolute();
|
||||||
|
// Remember that we had relative mouse
|
||||||
|
m_InputGrabbed = true;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
#if defined(CONF_PLATFORM_MACOSX) // Todo: remove this when fixed in SDL
|
#if defined(CONF_PLATFORM_MACOSX) // Todo: remove this when fixed in SDL
|
||||||
case SDL_WINDOWEVENT_MAXIMIZED:
|
case SDL_WINDOWEVENT_MAXIMIZED:
|
||||||
|
|
|
@ -1066,6 +1066,7 @@ bool CServerBrowser::DDNetFiltered(char *pFilter, const char *pName)
|
||||||
void CServerBrowser::DDNetCountryFilterClean()
|
void CServerBrowser::DDNetCountryFilterClean()
|
||||||
{
|
{
|
||||||
char aNewList[128];
|
char aNewList[128];
|
||||||
|
aNewList[0] = '\0';
|
||||||
|
|
||||||
for(int i = 0; i < m_NumDDNetCountries; i++)
|
for(int i = 0; i < m_NumDDNetCountries; i++)
|
||||||
{
|
{
|
||||||
|
@ -1084,6 +1085,7 @@ void CServerBrowser::DDNetCountryFilterClean()
|
||||||
void CServerBrowser::DDNetTypeFilterClean()
|
void CServerBrowser::DDNetTypeFilterClean()
|
||||||
{
|
{
|
||||||
char aNewList[128];
|
char aNewList[128];
|
||||||
|
aNewList[0] = '\0';
|
||||||
|
|
||||||
for(int i = 0; i < m_NumDDNetTypes; i++)
|
for(int i = 0; i < m_NumDDNetTypes; i++)
|
||||||
{
|
{
|
||||||
|
|
|
@ -112,7 +112,7 @@ MACRO_CONFIG_INT(GfxHighDetail, gfx_high_detail, 1, 0, 1, CFGFLAG_SAVE|CFGFLAG_C
|
||||||
MACRO_CONFIG_INT(GfxTextureQuality, gfx_texture_quality, 1, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "")
|
MACRO_CONFIG_INT(GfxTextureQuality, gfx_texture_quality, 1, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "")
|
||||||
#endif
|
#endif
|
||||||
MACRO_CONFIG_INT(GfxFsaaSamples, gfx_fsaa_samples, 0, 0, 16, CFGFLAG_SAVE|CFGFLAG_CLIENT, "FSAA Samples")
|
MACRO_CONFIG_INT(GfxFsaaSamples, gfx_fsaa_samples, 0, 0, 16, CFGFLAG_SAVE|CFGFLAG_CLIENT, "FSAA Samples")
|
||||||
MACRO_CONFIG_INT(GfxRefreshRate, gfx_refresh_rate, 0, 0, 0, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Screen refresh rate")
|
MACRO_CONFIG_INT(GfxRefreshRate, gfx_refresh_rate, 0, 0, 1000, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Screen refresh rate")
|
||||||
MACRO_CONFIG_INT(GfxFinish, gfx_finish, 0, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "")
|
MACRO_CONFIG_INT(GfxFinish, gfx_finish, 0, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "")
|
||||||
MACRO_CONFIG_INT(GfxBackgroundRender, gfx_backgroundrender, 1, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Render graphics when window is in background")
|
MACRO_CONFIG_INT(GfxBackgroundRender, gfx_backgroundrender, 1, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Render graphics when window is in background")
|
||||||
MACRO_CONFIG_INT(GfxTextOverlay, gfx_text_overlay, 10, 1, 100, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Stop rendering textoverlay in editor or with entities: high value = less details = more speed")
|
MACRO_CONFIG_INT(GfxTextOverlay, gfx_text_overlay, 10, 1, 100, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Stop rendering textoverlay in editor or with entities: high value = less details = more speed")
|
||||||
|
@ -127,8 +127,10 @@ MACRO_CONFIG_INT(GfxQuadAsTriangle, gfx_quad_as_triangle, 0, 0, 0, CFGFLAG_SAVE|
|
||||||
#else
|
#else
|
||||||
MACRO_CONFIG_INT(GfxQuadAsTriangle, gfx_quad_as_triangle, 1, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Render quads as triangles (fixes quad coloring on some GPUs)")
|
MACRO_CONFIG_INT(GfxQuadAsTriangle, gfx_quad_as_triangle, 1, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Render quads as triangles (fixes quad coloring on some GPUs)")
|
||||||
#endif
|
#endif
|
||||||
|
MACRO_CONFIG_INT(GfxHighdpi, gfx_highdpi, 0, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Try to use high-dpi screen features")
|
||||||
|
|
||||||
MACRO_CONFIG_INT(InpMousesens, inp_mousesens, 100, 5, 100000, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Mouse sensitivity")
|
MACRO_CONFIG_INT(InpMousesens, inp_mousesens, 100, 5, 100000, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Mouse sensitivity")
|
||||||
|
MACRO_CONFIG_INT(InpMouseOld, inp_mouseold, 0, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Use old mouse mode (warp mouse instead of raw input)")
|
||||||
MACRO_CONFIG_INT(InpIgnoredModifiers, inp_ignored_modifiers, 0, 0, 65536, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Ignored keyboard modifier mask")
|
MACRO_CONFIG_INT(InpIgnoredModifiers, inp_ignored_modifiers, 0, 0, 65536, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Ignored keyboard modifier mask")
|
||||||
|
|
||||||
MACRO_CONFIG_STR(SvName, sv_name, 128, "unnamed server", CFGFLAG_SERVER, "Server name")
|
MACRO_CONFIG_STR(SvName, sv_name, 128, "unnamed server", CFGFLAG_SERVER, "Server name")
|
||||||
|
|
|
@ -5,15 +5,15 @@
|
||||||
|
|
||||||
#include <engine/shared/config.h>
|
#include <engine/shared/config.h>
|
||||||
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
void CFifo::Init(IConsole *pConsole, char *pFifoFile, int Flag)
|
void CFifo::Init(IConsole *pConsole, char *pFifoFile, int Flag)
|
||||||
{
|
{
|
||||||
m_File = NULL;
|
m_File = -1;
|
||||||
|
|
||||||
m_pConsole = pConsole;
|
m_pConsole = pConsole;
|
||||||
if(pFifoFile[0] == '\0')
|
if(pFifoFile[0] == '\0')
|
||||||
|
@ -40,31 +40,37 @@ void CFifo::Init(IConsole *pConsole, char *pFifoFile, int Flag)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int fileFD = open(pFifoFile, O_RDONLY|O_NONBLOCK);
|
m_File = open(pFifoFile, O_RDONLY|O_NONBLOCK);
|
||||||
if(fileFD >= 0)
|
if(m_File < 0)
|
||||||
m_File = fdopen(fileFD, "r");
|
|
||||||
if(m_File == NULL)
|
|
||||||
dbg_msg("fifo", "can't open file '%s'", pFifoFile);
|
dbg_msg("fifo", "can't open file '%s'", pFifoFile);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CFifo::Shutdown()
|
void CFifo::Shutdown()
|
||||||
{
|
{
|
||||||
if(m_File)
|
if(m_File >= 0)
|
||||||
fclose(m_File);
|
close(m_File);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CFifo::Update()
|
void CFifo::Update()
|
||||||
{
|
{
|
||||||
if(m_File == NULL)
|
if(m_File < 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
char aBuf[8192];
|
char aBuf[8192];
|
||||||
|
int Length = read(m_File, aBuf, sizeof(aBuf));
|
||||||
|
if(Length <= 0)
|
||||||
|
return;
|
||||||
|
|
||||||
while(true)
|
char *pCur = aBuf;
|
||||||
|
for(int i = 0; i < Length; ++i)
|
||||||
{
|
{
|
||||||
char *pResult = fgets(aBuf, sizeof(aBuf), m_File);
|
if(aBuf[i] != '\n')
|
||||||
if(pResult == NULL) break;
|
continue;
|
||||||
m_pConsole->ExecuteLineFlag(pResult, m_Flag, -1);
|
aBuf[i] = '\0';
|
||||||
|
m_pConsole->ExecuteLineFlag(pCur, m_Flag, -1);
|
||||||
|
pCur = aBuf+i+1;
|
||||||
}
|
}
|
||||||
|
if(pCur < aBuf+Length) // missed the last line
|
||||||
|
m_pConsole->ExecuteLineFlag(pCur, m_Flag, -1);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -5,13 +5,11 @@
|
||||||
|
|
||||||
#if defined(CONF_FAMILY_UNIX)
|
#if defined(CONF_FAMILY_UNIX)
|
||||||
|
|
||||||
#include <stdio.h> // FILE
|
|
||||||
|
|
||||||
class CFifo
|
class CFifo
|
||||||
{
|
{
|
||||||
IConsole *m_pConsole;
|
IConsole *m_pConsole;
|
||||||
int m_Flag;
|
int m_Flag;
|
||||||
FILE *m_File;
|
int m_File;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void Init(IConsole *pConsole, char *pFifoFile, int Flag);
|
void Init(IConsole *pConsole, char *pFifoFile, int Flag);
|
||||||
|
|
|
@ -220,7 +220,9 @@ public:
|
||||||
int AckSequence() const { return m_Ack; }
|
int AckSequence() const { return m_Ack; }
|
||||||
int SeqSequence() const { return m_Sequence; }
|
int SeqSequence() const { return m_Sequence; }
|
||||||
int SecurityToken() const { return m_SecurityToken; }
|
int SecurityToken() const { return m_SecurityToken; }
|
||||||
void SetTimedOut(const NETADDR *pAddr, int Sequence, int Ack, SECURITY_TOKEN SecurityToken);
|
TStaticRingBuffer<CNetChunkResend, NET_CONN_BUFFERSIZE> *ResendBuffer() { return &m_Buffer; };
|
||||||
|
|
||||||
|
void SetTimedOut(const NETADDR *pAddr, int Sequence, int Ack, SECURITY_TOKEN SecurityToken, TStaticRingBuffer<CNetChunkResend, NET_CONN_BUFFERSIZE> *pResendBuffer);
|
||||||
|
|
||||||
// anti spoof
|
// anti spoof
|
||||||
void DirectInit(NETADDR &Addr, SECURITY_TOKEN SecurityToken);
|
void DirectInit(NETADDR &Addr, SECURITY_TOKEN SecurityToken);
|
||||||
|
|
|
@ -467,7 +467,7 @@ int CNetConnection::Update()
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CNetConnection::SetTimedOut(const NETADDR *pAddr, int Sequence, int Ack, SECURITY_TOKEN SecurityToken)
|
void CNetConnection::SetTimedOut(const NETADDR *pAddr, int Sequence, int Ack, SECURITY_TOKEN SecurityToken, TStaticRingBuffer<CNetChunkResend, NET_CONN_BUFFERSIZE> *pResendBuffer)
|
||||||
{
|
{
|
||||||
int64 Now = time_get();
|
int64 Now = time_get();
|
||||||
|
|
||||||
|
@ -482,5 +482,16 @@ void CNetConnection::SetTimedOut(const NETADDR *pAddr, int Sequence, int Ack, SE
|
||||||
m_LastRecvTime = Now;
|
m_LastRecvTime = Now;
|
||||||
m_LastUpdateTime = Now;
|
m_LastUpdateTime = Now;
|
||||||
m_SecurityToken = SecurityToken;
|
m_SecurityToken = SecurityToken;
|
||||||
|
|
||||||
|
// copy resend buffer
|
||||||
m_Buffer.Init();
|
m_Buffer.Init();
|
||||||
|
while (pResendBuffer->First())
|
||||||
|
{
|
||||||
|
CNetChunkResend *First = pResendBuffer->First();
|
||||||
|
|
||||||
|
CNetChunkResend *pResend = m_Buffer.Allocate(sizeof(CNetChunkResend)+First->m_DataSize);
|
||||||
|
mem_copy(pResend, First, sizeof(CNetChunkResend)+First->m_DataSize);
|
||||||
|
|
||||||
|
pResendBuffer->PopFirst();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -596,7 +596,7 @@ int CNetServer::Recv(CNetChunk *pChunk)
|
||||||
// drop invalid ctrl packets
|
// drop invalid ctrl packets
|
||||||
if (m_RecvUnpacker.m_Data.m_Flags&NET_PACKETFLAG_CONTROL &&
|
if (m_RecvUnpacker.m_Data.m_Flags&NET_PACKETFLAG_CONTROL &&
|
||||||
m_RecvUnpacker.m_Data.m_DataSize == 0)
|
m_RecvUnpacker.m_Data.m_DataSize == 0)
|
||||||
return 0;
|
continue;
|
||||||
|
|
||||||
// normal packet, find matching slot
|
// normal packet, find matching slot
|
||||||
int Slot = GetClientSlot(Addr);
|
int Slot = GetClientSlot(Addr);
|
||||||
|
@ -684,7 +684,7 @@ bool CNetServer::SetTimedOut(int ClientID, int OrigID)
|
||||||
if (m_aSlots[ClientID].m_Connection.State() != NET_CONNSTATE_ERROR)
|
if (m_aSlots[ClientID].m_Connection.State() != NET_CONNSTATE_ERROR)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
m_aSlots[ClientID].m_Connection.SetTimedOut(ClientAddr(OrigID), m_aSlots[OrigID].m_Connection.SeqSequence(), m_aSlots[OrigID].m_Connection.AckSequence(), m_aSlots[OrigID].m_Connection.SecurityToken());
|
m_aSlots[ClientID].m_Connection.SetTimedOut(ClientAddr(OrigID), m_aSlots[OrigID].m_Connection.SeqSequence(), m_aSlots[OrigID].m_Connection.AckSequence(), m_aSlots[OrigID].m_Connection.SecurityToken(), m_aSlots[OrigID].m_Connection.ResendBuffer());
|
||||||
m_aSlots[OrigID].m_Connection.Reset();
|
m_aSlots[OrigID].m_Connection.Reset();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -127,18 +127,14 @@ bool CChat::OnInput(IInput::CEvent Event)
|
||||||
{
|
{
|
||||||
if(Text[i] == '\n')
|
if(Text[i] == '\n')
|
||||||
{
|
{
|
||||||
int max = i - Begin + 1;
|
int max = min(i - Begin + 1, (int)sizeof(Line));
|
||||||
if(max > (int)sizeof(Line))
|
|
||||||
max = sizeof(Line);
|
|
||||||
str_copy(Line, Text + Begin, max);
|
str_copy(Line, Text + Begin, max);
|
||||||
Begin = i+1;
|
Begin = i+1;
|
||||||
SayChat(Line);
|
SayChat(Line);
|
||||||
while(Text[i] == '\n') i++;
|
while(Text[i] == '\n') i++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
int max = i - Begin + 1;
|
int max = min(i - Begin + 1, (int)sizeof(Line));
|
||||||
if(max > (int)sizeof(Line))
|
|
||||||
max = sizeof(Line);
|
|
||||||
str_copy(Line, Text + Begin, max);
|
str_copy(Line, Text + Begin, max);
|
||||||
Begin = i+1;
|
Begin = i+1;
|
||||||
m_Input.Add(Line);
|
m_Input.Add(Line);
|
||||||
|
@ -150,6 +146,35 @@ bool CChat::OnInput(IInput::CEvent Event)
|
||||||
Input()->SetClipboardText(m_Input.GetString());
|
Input()->SetClipboardText(m_Input.GetString());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(Input()->KeyIsPressed(KEY_LCTRL)) // jump to spaces and special ASCII characters
|
||||||
|
{
|
||||||
|
int SearchDirection = 0;
|
||||||
|
if(Input()->KeyPress(KEY_LEFT))
|
||||||
|
SearchDirection = -1;
|
||||||
|
else if(Input()->KeyPress(KEY_RIGHT))
|
||||||
|
SearchDirection = 1;
|
||||||
|
|
||||||
|
if(SearchDirection != 0)
|
||||||
|
{
|
||||||
|
int FoundAt = SearchDirection > 0 ? m_Input.GetLength()-1 : 0;
|
||||||
|
for(int i = m_Input.GetCursorOffset()+SearchDirection; SearchDirection > 0 ? i < m_Input.GetLength()-1 : i > 0; i+=SearchDirection)
|
||||||
|
{
|
||||||
|
int next = i+SearchDirection;
|
||||||
|
if( (m_Input.GetString()[next] == ' ') ||
|
||||||
|
(m_Input.GetString()[next] >= 32 && m_Input.GetString()[next] <= 47) ||
|
||||||
|
(m_Input.GetString()[next] >= 58 && m_Input.GetString()[next] <= 64) ||
|
||||||
|
(m_Input.GetString()[next] >= 91 && m_Input.GetString()[next] <= 96) )
|
||||||
|
{
|
||||||
|
FoundAt = i;
|
||||||
|
if(SearchDirection < 0)
|
||||||
|
FoundAt++;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
m_Input.SetCursorOffset(FoundAt);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if(Event.m_Flags&IInput::FLAG_PRESS && Event.m_Key == KEY_ESCAPE)
|
if(Event.m_Flags&IInput::FLAG_PRESS && Event.m_Key == KEY_ESCAPE)
|
||||||
{
|
{
|
||||||
m_Mode = MODE_NONE;
|
m_Mode = MODE_NONE;
|
||||||
|
@ -641,12 +666,26 @@ void CChat::OnRender()
|
||||||
if(Now > m_aLines[r].m_Time+16*time_freq() && !m_Show)
|
if(Now > m_aLines[r].m_Time+16*time_freq() && !m_Show)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
char aName[64] = "";
|
||||||
|
if(g_Config.m_ClShowIDs && m_aLines[r].m_ClientID != -1 && m_aLines[r].m_aName[0] != '\0')
|
||||||
|
{
|
||||||
|
if (m_aLines[r].m_ClientID >= 10)
|
||||||
|
str_format(aName, sizeof(aName),"%d: ", m_aLines[r].m_ClientID);
|
||||||
|
else
|
||||||
|
str_format(aName, sizeof(aName)," %d: ", m_aLines[r].m_ClientID);
|
||||||
|
str_append(aName, m_aLines[r].m_aName,sizeof(aName));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
str_copy(aName, m_aLines[r].m_aName, sizeof(aName));
|
||||||
|
}
|
||||||
|
|
||||||
// get the y offset (calculate it if we haven't done that yet)
|
// get the y offset (calculate it if we haven't done that yet)
|
||||||
if(m_aLines[r].m_YOffset[OffsetType] < 0.0f)
|
if(m_aLines[r].m_YOffset[OffsetType] < 0.0f)
|
||||||
{
|
{
|
||||||
TextRender()->SetCursor(&Cursor, Begin, 0.0f, FontSize, 0);
|
TextRender()->SetCursor(&Cursor, Begin, 0.0f, FontSize, 0);
|
||||||
Cursor.m_LineWidth = LineWidth;
|
Cursor.m_LineWidth = LineWidth;
|
||||||
TextRender()->TextEx(&Cursor, m_aLines[r].m_aName, -1);
|
TextRender()->TextEx(&Cursor, aName, -1);
|
||||||
TextRender()->TextEx(&Cursor, m_aLines[r].m_aText, -1);
|
TextRender()->TextEx(&Cursor, m_aLines[r].m_aText, -1);
|
||||||
m_aLines[r].m_YOffset[OffsetType] = Cursor.m_Y + Cursor.m_FontSize;
|
m_aLines[r].m_YOffset[OffsetType] = Cursor.m_Y + Cursor.m_FontSize;
|
||||||
}
|
}
|
||||||
|
@ -685,7 +724,7 @@ void CChat::OnRender()
|
||||||
else
|
else
|
||||||
TextRender()->TextColor(0.8f, 0.8f, 0.8f, Blend);
|
TextRender()->TextColor(0.8f, 0.8f, 0.8f, Blend);
|
||||||
|
|
||||||
TextRender()->TextEx(&Cursor, m_aLines[r].m_aName, -1);
|
TextRender()->TextEx(&Cursor, aName, -1);
|
||||||
|
|
||||||
// render line
|
// render line
|
||||||
if (m_aLines[r].m_ClientID == -1)
|
if (m_aLines[r].m_ClientID == -1)
|
||||||
|
|
|
@ -108,17 +108,13 @@ void CGameConsole::CInstance::OnInput(IInput::CEvent Event)
|
||||||
Begin++;
|
Begin++;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
int max = i - Begin + 1;
|
int max = min(i - Begin + 1, (int)sizeof(Line));
|
||||||
if(max > (int)sizeof(Line))
|
|
||||||
max = sizeof(Line);
|
|
||||||
str_copy(Line, Text + Begin, max);
|
str_copy(Line, Text + Begin, max);
|
||||||
Begin = i+1;
|
Begin = i+1;
|
||||||
ExecuteLine(Line);
|
ExecuteLine(Line);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
int max = i - Begin + 1;
|
int max = min(i - Begin + 1, (int)sizeof(Line));
|
||||||
if(max > (int)sizeof(Line))
|
|
||||||
max = sizeof(Line);
|
|
||||||
str_copy(Line, Text + Begin, max);
|
str_copy(Line, Text + Begin, max);
|
||||||
Begin = i+1;
|
Begin = i+1;
|
||||||
m_Input.Add(Line);
|
m_Input.Add(Line);
|
||||||
|
|
|
@ -319,11 +319,10 @@ void CHud::RenderTextInfo()
|
||||||
str_format(Buf, sizeof(Buf), "%d", (int)m_AverageFPS);
|
str_format(Buf, sizeof(Buf), "%d", (int)m_AverageFPS);
|
||||||
TextRender()->Text(0, m_Width-10-TextRender()->TextWidth(0,12,Buf,-1), 5, 12, Buf, -1);
|
TextRender()->Text(0, m_Width-10-TextRender()->TextWidth(0,12,Buf,-1), 5, 12, Buf, -1);
|
||||||
}
|
}
|
||||||
|
if(g_Config.m_ClShowpred)
|
||||||
if(g_Config.m_ClShowping)
|
|
||||||
{
|
{
|
||||||
char aBuf[64];
|
char aBuf[64];
|
||||||
str_format(aBuf, sizeof(aBuf), "%d", clamp(m_pClient->m_Snap.m_pLocalInfo->m_Latency, 0, 1000));
|
str_format(aBuf, sizeof(aBuf), "%d", Client()->GetPredictionTime());
|
||||||
TextRender()->Text(0, m_Width-10-TextRender()->TextWidth(0,12,aBuf,-1), g_Config.m_ClShowfps ? 20 : 5, 12, aBuf, -1);
|
TextRender()->Text(0, m_Width-10-TextRender()->TextWidth(0,12,aBuf,-1), g_Config.m_ClShowfps ? 20 : 5, 12, aBuf, -1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -54,7 +54,7 @@ void CKillMessages::OnRender()
|
||||||
|
|
||||||
Graphics()->MapScreen(0, 0, Width*1.5f, Height*1.5f);
|
Graphics()->MapScreen(0, 0, Width*1.5f, Height*1.5f);
|
||||||
float StartX = Width*1.5f-10.0f;
|
float StartX = Width*1.5f-10.0f;
|
||||||
float y = 30.0f + 100.0f * (g_Config.m_ClShowfps + g_Config.m_ClShowping);
|
float y = 30.0f + 100.0f * (g_Config.m_ClShowfps + g_Config.m_ClShowpred);
|
||||||
|
|
||||||
for(int i = 1; i <= MAX_KILLMSGS; i++)
|
for(int i = 1; i <= MAX_KILLMSGS; i++)
|
||||||
{
|
{
|
||||||
|
|
|
@ -94,7 +94,8 @@ int CMapImages::GetEntities()
|
||||||
|
|
||||||
if(m_EntitiesTextures == -1 || str_comp(m_aEntitiesGameType, Info.m_aGameType))
|
if(m_EntitiesTextures == -1 || str_comp(m_aEntitiesGameType, Info.m_aGameType))
|
||||||
{
|
{
|
||||||
char file[64] = "vanilla";
|
// DDNet default to prevent delay in seeing entities
|
||||||
|
char file[64] = "ddnet";
|
||||||
if(IsDDNet(&Info))
|
if(IsDDNet(&Info))
|
||||||
str_copy(file, "ddnet", sizeof(file));
|
str_copy(file, "ddnet", sizeof(file));
|
||||||
else if(IsDDRace(&Info))
|
else if(IsDDRace(&Info))
|
||||||
|
@ -103,6 +104,8 @@ int CMapImages::GetEntities()
|
||||||
str_copy(file, "race", sizeof(file));
|
str_copy(file, "race", sizeof(file));
|
||||||
else if(IsFNG(&Info))
|
else if(IsFNG(&Info))
|
||||||
str_copy(file, "fng", sizeof(file));
|
str_copy(file, "fng", sizeof(file));
|
||||||
|
else if(IsVanilla(&Info))
|
||||||
|
str_copy(file, "vanilla", sizeof(file));
|
||||||
|
|
||||||
char path[64];
|
char path[64];
|
||||||
str_format(path, sizeof(path), "editor/entities_clear/%s.png", file);
|
str_format(path, sizeof(path), "editor/entities_clear/%s.png", file);
|
||||||
|
|
|
@ -244,9 +244,9 @@ int CMenus::DoEditBox(void *pID, const CUIRect *pRect, char *pStr, unsigned StrS
|
||||||
const char *Text = Input()->GetClipboardText();
|
const char *Text = Input()->GetClipboardText();
|
||||||
if(Text)
|
if(Text)
|
||||||
{
|
{
|
||||||
int CharsLeft = StrSize - str_length(pStr);
|
|
||||||
int Offset = str_length(pStr);
|
int Offset = str_length(pStr);
|
||||||
for(int i = 0; i < str_length(Text) && i <= CharsLeft; i++)
|
int CharsLeft = StrSize - Offset - 1;
|
||||||
|
for(int i = 0; i < str_length(Text) && i < CharsLeft; i++)
|
||||||
{
|
{
|
||||||
if(Text[i] == '\n')
|
if(Text[i] == '\n')
|
||||||
pStr[i + Offset] = ' ';
|
pStr[i + Offset] = ' ';
|
||||||
|
@ -1057,30 +1057,13 @@ int CMenus::Render()
|
||||||
pTitle = Localize("Disconnected");
|
pTitle = Localize("Disconnected");
|
||||||
pExtraText = Client()->ErrorString();
|
pExtraText = Client()->ErrorString();
|
||||||
pButtonText = Localize("Ok");
|
pButtonText = Localize("Ok");
|
||||||
if ((str_find_nocase(Client()->ErrorString(), "full")) || (str_find_nocase(Client()->ErrorString(), "reserved")))
|
if(Client()->m_ReconnectTime > 0)
|
||||||
{
|
{
|
||||||
if (g_Config.m_ClReconnectFull > 0)
|
str_format(aBuf, sizeof(aBuf), Localize("\n\nReconnect in %d sec"), ((Client()->m_ReconnectTime - time_get()) / time_freq() + g_Config.m_ClReconnectFull));
|
||||||
{
|
|
||||||
if (_my_rtime == 0)
|
|
||||||
_my_rtime = time_get();
|
|
||||||
str_format(aBuf, sizeof(aBuf), Localize("\n\nReconnect in %d sec"), ((_my_rtime - time_get()) / time_freq() + g_Config.m_ClReconnectFull));
|
|
||||||
pTitle = Client()->ErrorString();
|
pTitle = Client()->ErrorString();
|
||||||
pExtraText = aBuf;
|
pExtraText = aBuf;
|
||||||
pButtonText = Localize("Abort");
|
pButtonText = Localize("Abort");
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else if (str_find_nocase(Client()->ErrorString(), "Timeout"))
|
|
||||||
{
|
|
||||||
if (g_Config.m_ClReconnectTimeout > 0)
|
|
||||||
{
|
|
||||||
if (_my_rtime == 0)
|
|
||||||
_my_rtime = time_get();
|
|
||||||
str_format(aBuf, sizeof(aBuf), Localize("\n\nReconnect in %d sec"), ((_my_rtime - time_get()) / time_freq() + g_Config.m_ClReconnectTimeout));
|
|
||||||
pTitle = Client()->ErrorString();
|
|
||||||
pExtraText = aBuf;
|
|
||||||
pButtonText = Localize("Abort");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ExtraAlign = 0;
|
ExtraAlign = 0;
|
||||||
}
|
}
|
||||||
else if(m_Popup == POPUP_PURE)
|
else if(m_Popup == POPUP_PURE)
|
||||||
|
@ -1614,29 +1597,16 @@ int CMenus::Render()
|
||||||
|
|
||||||
static int s_Button = 0;
|
static int s_Button = 0;
|
||||||
if(DoButton_Menu(&s_Button, pButtonText, 0, &Part) || m_EscapePressed || m_EnterPressed)
|
if(DoButton_Menu(&s_Button, pButtonText, 0, &Part) || m_EscapePressed || m_EnterPressed)
|
||||||
|
{
|
||||||
|
if(m_Popup == POPUP_DISCONNECTED && Client()->m_ReconnectTime > 0)
|
||||||
|
Client()->m_ReconnectTime = 0;
|
||||||
m_Popup = POPUP_NONE;
|
m_Popup = POPUP_NONE;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if(m_Popup == POPUP_NONE)
|
if(m_Popup == POPUP_NONE)
|
||||||
UI()->SetActiveItem(0);
|
UI()->SetActiveItem(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_Popup == POPUP_DISCONNECTED)
|
|
||||||
{
|
|
||||||
if (str_find_nocase(Client()->ErrorString(), "full") || str_find_nocase(Client()->ErrorString(), "reserved"))
|
|
||||||
{
|
|
||||||
if (g_Config.m_ClReconnectFull > 0 && time_get() > _my_rtime + time_freq() * g_Config.m_ClReconnectFull)
|
|
||||||
Client()->Connect(g_Config.m_UiServerAddress);
|
|
||||||
}
|
|
||||||
else if (str_find_nocase(Client()->ErrorString(), "Timeout"))
|
|
||||||
{
|
|
||||||
if (g_Config.m_ClReconnectTimeout > 0 && time_get() > _my_rtime + time_freq() * g_Config.m_ClReconnectTimeout)
|
|
||||||
Client()->Connect(g_Config.m_UiServerAddress);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (_my_rtime != 0) {
|
|
||||||
_my_rtime = 0;
|
|
||||||
}
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -129,6 +129,7 @@ class CMenus : public CComponent
|
||||||
bool m_NeedRestartGraphics;
|
bool m_NeedRestartGraphics;
|
||||||
bool m_NeedRestartSound;
|
bool m_NeedRestartSound;
|
||||||
bool m_NeedRestartUpdate;
|
bool m_NeedRestartUpdate;
|
||||||
|
bool m_NeedRestartDDNet;
|
||||||
bool m_NeedSendinfo;
|
bool m_NeedSendinfo;
|
||||||
bool m_NeedSendDummyinfo;
|
bool m_NeedSendDummyinfo;
|
||||||
int m_SettingPlayerPage;
|
int m_SettingPlayerPage;
|
||||||
|
@ -185,13 +186,13 @@ class CMenus : public CComponent
|
||||||
{
|
{
|
||||||
return !str_comp(m_aFilename, "..") ? true : !str_comp(Other.m_aFilename, "..") ? false :
|
return !str_comp(m_aFilename, "..") ? true : !str_comp(Other.m_aFilename, "..") ? false :
|
||||||
m_IsDir && !Other.m_IsDir ? true : !m_IsDir && Other.m_IsDir ? false :
|
m_IsDir && !Other.m_IsDir ? true : !m_IsDir && Other.m_IsDir ? false :
|
||||||
str_comp_filenames(m_aFilename, Other.m_aFilename) < 0;
|
str_comp_nocase(m_aFilename, Other.m_aFilename) < 0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return !str_comp(m_aFilename, "..") ? true : !str_comp(Other.m_aFilename, "..") ? false :
|
return !str_comp(m_aFilename, "..") ? true : !str_comp(Other.m_aFilename, "..") ? false :
|
||||||
m_IsDir && !Other.m_IsDir ? true : !m_IsDir && Other.m_IsDir ? false :
|
m_IsDir && !Other.m_IsDir ? true : !m_IsDir && Other.m_IsDir ? false :
|
||||||
str_comp_filenames(m_aFilename, Other.m_aFilename) > 0;
|
str_comp_nocase(m_aFilename, Other.m_aFilename) > 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -320,7 +321,6 @@ public:
|
||||||
};
|
};
|
||||||
|
|
||||||
// DDRace
|
// DDRace
|
||||||
int64 _my_rtime; // reconnect time
|
|
||||||
int DoButton_CheckBox_DontCare(const void *pID, const char *pText, int Checked, const CUIRect *pRect);
|
int DoButton_CheckBox_DontCare(const void *pID, const char *pText, int Checked, const CUIRect *pRect);
|
||||||
sorted_array<CDemoItem> m_lDemos;
|
sorted_array<CDemoItem> m_lDemos;
|
||||||
void DemolistPopulate();
|
void DemolistPopulate();
|
||||||
|
@ -381,7 +381,7 @@ private:
|
||||||
void RenderGhost(CUIRect MainView);
|
void RenderGhost(CUIRect MainView);
|
||||||
|
|
||||||
// found in menus_settings.cpp
|
// found in menus_settings.cpp
|
||||||
void RenderSettingsDDRace(CUIRect MainView);
|
void RenderSettingsDDNet(CUIRect MainView);
|
||||||
void RenderSettingsHUD(CUIRect MainView);
|
void RenderSettingsHUD(CUIRect MainView);
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -683,11 +683,11 @@ void CMenus::RenderServerbrowserFilters(CUIRect View)
|
||||||
int NumTypes = ServerBrowser()->NumDDNetTypes();
|
int NumTypes = ServerBrowser()->NumDDNetTypes();
|
||||||
int PerLine = 3;
|
int PerLine = 3;
|
||||||
|
|
||||||
if(MaxTypes <= 12)
|
ServerFilter.HSplitTop(4.0f, 0, &ServerFilter);
|
||||||
ServerFilter.HSplitTop(8.0f, 0, &ServerFilter);
|
ServerFilter.HSplitBottom(4.0f, &ServerFilter, 0);
|
||||||
|
|
||||||
const float TypesWidth = 40.0f;
|
const float TypesWidth = 40.0f;
|
||||||
const float TypesHeight = MaxTypes > 12 ? 15.0f : 20.0f;
|
const float TypesHeight = ServerFilter.h / ceil(MaxTypes / (float)PerLine);
|
||||||
|
|
||||||
CUIRect TypesRect, Left, Right;
|
CUIRect TypesRect, Left, Right;
|
||||||
|
|
||||||
|
@ -1310,7 +1310,7 @@ void CMenus::RenderServerbrowser(CUIRect MainView)
|
||||||
char aBuf[64];
|
char aBuf[64];
|
||||||
if(str_comp(Client()->LatestVersion(), "0") != 0)
|
if(str_comp(Client()->LatestVersion(), "0") != 0)
|
||||||
{
|
{
|
||||||
str_format(aBuf, sizeof(aBuf), Localize("DDNet %s is out! Download it at ddnet.tw!"), Client()->LatestVersion());
|
str_format(aBuf, sizeof(aBuf), Localize("DDNet %s is out! Download it at DDNet.tw!"), Client()->LatestVersion());
|
||||||
TextRender()->TextColor(1.0f, 0.4f, 0.4f, 1.0f);
|
TextRender()->TextColor(1.0f, 0.4f, 0.4f, 1.0f);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -344,6 +344,10 @@ void CMenus::RenderSettingsPlayer(CUIRect MainView)
|
||||||
void CMenus::RenderSettingsTee(CUIRect MainView)
|
void CMenus::RenderSettingsTee(CUIRect MainView)
|
||||||
{
|
{
|
||||||
CUIRect Button, Label, Button2, Dummy, DummyLabel, SkinList, QuickSearch, QuickSearchClearButton;
|
CUIRect Button, Label, Button2, Dummy, DummyLabel, SkinList, QuickSearch, QuickSearchClearButton;
|
||||||
|
|
||||||
|
bool CheckSettings = false;
|
||||||
|
static int s_ClVanillaSkinsOnly = g_Config.m_ClVanillaSkinsOnly;
|
||||||
|
|
||||||
static bool s_InitSkinlist = true;
|
static bool s_InitSkinlist = true;
|
||||||
MainView.HSplitTop(10.0f, 0, &MainView);
|
MainView.HSplitTop(10.0f, 0, &MainView);
|
||||||
|
|
||||||
|
@ -396,6 +400,14 @@ void CMenus::RenderSettingsTee(CUIRect MainView)
|
||||||
if(DoButton_CheckBox(&g_Config.m_ClVanillaSkinsOnly, Localize("Vanilla Skins only"), g_Config.m_ClVanillaSkinsOnly, &DummyLabel))
|
if(DoButton_CheckBox(&g_Config.m_ClVanillaSkinsOnly, Localize("Vanilla Skins only"), g_Config.m_ClVanillaSkinsOnly, &DummyLabel))
|
||||||
{
|
{
|
||||||
g_Config.m_ClVanillaSkinsOnly ^= 1;
|
g_Config.m_ClVanillaSkinsOnly ^= 1;
|
||||||
|
CheckSettings = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(CheckSettings)
|
||||||
|
{
|
||||||
|
if(s_ClVanillaSkinsOnly == g_Config.m_ClVanillaSkinsOnly)
|
||||||
|
m_NeedRestartSkins = false;
|
||||||
|
else
|
||||||
m_NeedRestartSkins = true;
|
m_NeedRestartSkins = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -792,7 +804,7 @@ void CMenus::RenderSettingsControls(CUIRect MainView)
|
||||||
|
|
||||||
void CMenus::RenderSettingsGraphics(CUIRect MainView)
|
void CMenus::RenderSettingsGraphics(CUIRect MainView)
|
||||||
{
|
{
|
||||||
CUIRect Button;
|
CUIRect Button, Label;
|
||||||
char aBuf[128];
|
char aBuf[128];
|
||||||
bool CheckSettings = false;
|
bool CheckSettings = false;
|
||||||
|
|
||||||
|
@ -806,6 +818,7 @@ void CMenus::RenderSettingsGraphics(CUIRect MainView)
|
||||||
static int s_GfxFsaaSamples = g_Config.m_GfxFsaaSamples;
|
static int s_GfxFsaaSamples = g_Config.m_GfxFsaaSamples;
|
||||||
static int s_GfxTextureQuality = g_Config.m_GfxTextureQuality;
|
static int s_GfxTextureQuality = g_Config.m_GfxTextureQuality;
|
||||||
static int s_GfxTextureCompression = g_Config.m_GfxTextureCompression;
|
static int s_GfxTextureCompression = g_Config.m_GfxTextureCompression;
|
||||||
|
static int s_GfxHighdpi = g_Config.m_GfxHighdpi;
|
||||||
|
|
||||||
CUIRect ModeList;
|
CUIRect ModeList;
|
||||||
MainView.VSplitLeft(300.0f, &MainView, &ModeList);
|
MainView.VSplitLeft(300.0f, &MainView, &ModeList);
|
||||||
|
@ -925,6 +938,13 @@ void CMenus::RenderSettingsGraphics(CUIRect MainView)
|
||||||
if(DoButton_CheckBox(&g_Config.m_GfxHighDetail, Localize("High Detail"), g_Config.m_GfxHighDetail, &Button))
|
if(DoButton_CheckBox(&g_Config.m_GfxHighDetail, Localize("High Detail"), g_Config.m_GfxHighDetail, &Button))
|
||||||
g_Config.m_GfxHighDetail ^= 1;
|
g_Config.m_GfxHighDetail ^= 1;
|
||||||
|
|
||||||
|
MainView.HSplitTop(20.0f, &Button, &MainView);
|
||||||
|
if(DoButton_CheckBox(&g_Config.m_GfxHighdpi, Localize("High-DPI screen support (experimental)"), g_Config.m_GfxHighdpi, &Button))
|
||||||
|
{
|
||||||
|
g_Config.m_GfxHighdpi ^= 1;
|
||||||
|
CheckSettings = true;
|
||||||
|
}
|
||||||
|
|
||||||
// check if the new settings require a restart
|
// check if the new settings require a restart
|
||||||
if(CheckSettings)
|
if(CheckSettings)
|
||||||
{
|
{
|
||||||
|
@ -934,12 +954,20 @@ void CMenus::RenderSettingsGraphics(CUIRect MainView)
|
||||||
s_GfxVsync == g_Config.m_GfxVsync &&
|
s_GfxVsync == g_Config.m_GfxVsync &&
|
||||||
s_GfxFsaaSamples == g_Config.m_GfxFsaaSamples &&
|
s_GfxFsaaSamples == g_Config.m_GfxFsaaSamples &&
|
||||||
s_GfxTextureQuality == g_Config.m_GfxTextureQuality &&
|
s_GfxTextureQuality == g_Config.m_GfxTextureQuality &&
|
||||||
s_GfxTextureCompression == g_Config.m_GfxTextureCompression)
|
s_GfxTextureCompression == g_Config.m_GfxTextureCompression &&
|
||||||
|
s_GfxHighdpi == g_Config.m_GfxHighdpi)
|
||||||
m_NeedRestartGraphics = false;
|
m_NeedRestartGraphics = false;
|
||||||
else
|
else
|
||||||
m_NeedRestartGraphics = true;
|
m_NeedRestartGraphics = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
MainView.HSplitTop(20.0f, &Label, &MainView);
|
||||||
|
Label.VSplitLeft(130.0f, &Label, &Button);
|
||||||
|
str_format(aBuf, sizeof(aBuf), "%s: %i", Localize("Refresh Rate"), g_Config.m_GfxRefreshRate);
|
||||||
|
UI()->DoLabelScaled(&Label, aBuf, 14.0f, -1);
|
||||||
|
Button.HMargin(2.0f, &Button);
|
||||||
|
g_Config.m_GfxRefreshRate = static_cast<int>(DoScrollbarH(&g_Config.m_GfxRefreshRate, &Button, g_Config.m_GfxRefreshRate/1000.0f)*1000.0f+0.1f);
|
||||||
|
|
||||||
CUIRect Text;
|
CUIRect Text;
|
||||||
MainView.HSplitTop(20.0f, 0, &MainView);
|
MainView.HSplitTop(20.0f, 0, &MainView);
|
||||||
MainView.HSplitTop(20.0f, &Text, &MainView);
|
MainView.HSplitTop(20.0f, &Text, &MainView);
|
||||||
|
@ -1274,7 +1302,7 @@ void CMenus::RenderSettings(CUIRect MainView)
|
||||||
else if(s_SettingsPage == 7)
|
else if(s_SettingsPage == 7)
|
||||||
RenderSettingsSound(MainView);
|
RenderSettingsSound(MainView);
|
||||||
else if(s_SettingsPage == 8)
|
else if(s_SettingsPage == 8)
|
||||||
RenderSettingsDDRace(MainView);
|
RenderSettingsDDNet(MainView);
|
||||||
|
|
||||||
if(m_NeedRestartUpdate)
|
if(m_NeedRestartUpdate)
|
||||||
{
|
{
|
||||||
|
@ -1282,7 +1310,7 @@ void CMenus::RenderSettings(CUIRect MainView)
|
||||||
UI()->DoLabelScaled(&RestartWarning, Localize("DDNet Client needs to be restarted to complete update!"), 14.0f, -1);
|
UI()->DoLabelScaled(&RestartWarning, Localize("DDNet Client needs to be restarted to complete update!"), 14.0f, -1);
|
||||||
TextRender()->TextColor(1.0f, 1.0f, 1.0f, 1.0f);
|
TextRender()->TextColor(1.0f, 1.0f, 1.0f, 1.0f);
|
||||||
}
|
}
|
||||||
else if(m_NeedRestartSkins || m_NeedRestartGraphics || m_NeedRestartSound)
|
else if(m_NeedRestartSkins || m_NeedRestartGraphics || m_NeedRestartSound || m_NeedRestartDDNet)
|
||||||
UI()->DoLabelScaled(&RestartWarning, Localize("You must restart the game for all settings to take effect."), 14.0f, -1);
|
UI()->DoLabelScaled(&RestartWarning, Localize("You must restart the game for all settings to take effect."), 14.0f, -1);
|
||||||
}
|
}
|
||||||
void CMenus::RenderSettingsHUD(CUIRect MainView)
|
void CMenus::RenderSettingsHUD(CUIRect MainView)
|
||||||
|
@ -1727,10 +1755,13 @@ void CMenus::RenderSettingsHUD(CUIRect MainView)
|
||||||
g_Config.m_ClReconnectTimeout = 5;*/
|
g_Config.m_ClReconnectTimeout = 5;*/
|
||||||
}
|
}
|
||||||
|
|
||||||
void CMenus::RenderSettingsDDRace(CUIRect MainView)
|
void CMenus::RenderSettingsDDNet(CUIRect MainView)
|
||||||
{
|
{
|
||||||
CUIRect Button, Left, Right, LeftLeft, Demo, Gameplay, Miscellaneous, Label, Background;
|
CUIRect Button, Left, Right, LeftLeft, Demo, Gameplay, Miscellaneous, Label, Background;
|
||||||
|
|
||||||
|
bool CheckSettings = false;
|
||||||
|
static int s_InpMouseOld = g_Config.m_InpMouseOld;
|
||||||
|
|
||||||
MainView.HSplitTop(100.0f, &Demo , &MainView);
|
MainView.HSplitTop(100.0f, &Demo , &MainView);
|
||||||
|
|
||||||
Demo.HSplitTop(30.0f, &Label, &Demo);
|
Demo.HSplitTop(30.0f, &Label, &Demo);
|
||||||
|
@ -1868,6 +1899,19 @@ void CMenus::RenderSettingsDDRace(CUIRect MainView)
|
||||||
}
|
}
|
||||||
|
|
||||||
Left.HSplitTop(20.0f, &Button, &Left);
|
Left.HSplitTop(20.0f, &Button, &Left);
|
||||||
|
if(DoButton_CheckBox(&g_Config.m_InpMouseOld, Localize("Old mouse mode"), g_Config.m_InpMouseOld, &Button))
|
||||||
|
{
|
||||||
|
g_Config.m_InpMouseOld ^= 1;
|
||||||
|
CheckSettings = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(CheckSettings)
|
||||||
|
{
|
||||||
|
if(s_InpMouseOld == g_Config.m_InpMouseOld)
|
||||||
|
m_NeedRestartDDNet = false;
|
||||||
|
else
|
||||||
|
m_NeedRestartDDNet = true;
|
||||||
|
}
|
||||||
|
|
||||||
CUIRect aRects[2];
|
CUIRect aRects[2];
|
||||||
Left.HSplitTop(5.0f, &Button, &Left);
|
Left.HSplitTop(5.0f, &Button, &Left);
|
||||||
|
|
|
@ -365,7 +365,7 @@ public:
|
||||||
|
|
||||||
void FindWeaker(bool IsWeaker[2][MAX_CLIENTS]);
|
void FindWeaker(bool IsWeaker[2][MAX_CLIENTS]);
|
||||||
|
|
||||||
bool AntiPingPlayers() { return g_Config.m_ClAntiPing && g_Config.m_ClAntiPingPlayers && !m_Snap.m_SpecInfo.m_Active && Client()->State() != IClient::STATE_DEMOPLAYBACK; }
|
bool AntiPingPlayers() { return g_Config.m_ClAntiPing && g_Config.m_ClAntiPingPlayers && !m_Snap.m_SpecInfo.m_Active && Client()->State() != IClient::STATE_DEMOPLAYBACK && (m_Tuning[g_Config.m_ClDummy].m_PlayerCollision || m_Tuning[g_Config.m_ClDummy].m_PlayerHooking); }
|
||||||
bool AntiPingGrenade() { return g_Config.m_ClAntiPing && g_Config.m_ClAntiPingGrenade && !m_Snap.m_SpecInfo.m_Active && Client()->State() != IClient::STATE_DEMOPLAYBACK; }
|
bool AntiPingGrenade() { return g_Config.m_ClAntiPing && g_Config.m_ClAntiPingGrenade && !m_Snap.m_SpecInfo.m_Active && Client()->State() != IClient::STATE_DEMOPLAYBACK; }
|
||||||
bool AntiPingWeapons() { return g_Config.m_ClAntiPing && g_Config.m_ClAntiPingWeapons && !m_Snap.m_SpecInfo.m_Active && Client()->State() != IClient::STATE_DEMOPLAYBACK; }
|
bool AntiPingWeapons() { return g_Config.m_ClAntiPing && g_Config.m_ClAntiPingWeapons && !m_Snap.m_SpecInfo.m_Active && Client()->State() != IClient::STATE_DEMOPLAYBACK; }
|
||||||
|
|
||||||
|
|
|
@ -1196,7 +1196,7 @@ void CEditor::DoToolbar(CUIRect ToolBar)
|
||||||
if(DoButton_Ex(&s_SpeedupButton, "Speedup", (pS && pS->m_Speedup)?0:-1, &Button, 0, "Speedup", CUI::CORNER_ALL))
|
if(DoButton_Ex(&s_SpeedupButton, "Speedup", (pS && pS->m_Speedup)?0:-1, &Button, 0, "Speedup", CUI::CORNER_ALL))
|
||||||
{
|
{
|
||||||
static int s_SpeedupPopupID = 0;
|
static int s_SpeedupPopupID = 0;
|
||||||
UiInvokePopupMenu(&s_SpeedupPopupID, 0, UI()->MouseX(), UI()->MouseY(), 120, 53, PopupSpeedup);
|
UiInvokePopupMenu(&s_SpeedupPopupID, 0, UI()->MouseX(), UI()->MouseY(), 120, 48, PopupSpeedup);
|
||||||
}
|
}
|
||||||
// do switch button
|
// do switch button
|
||||||
TB_Bottom.VSplitLeft(5.0f, &Button, &TB_Bottom);
|
TB_Bottom.VSplitLeft(5.0f, &Button, &TB_Bottom);
|
||||||
|
@ -1214,7 +1214,7 @@ void CEditor::DoToolbar(CUIRect ToolBar)
|
||||||
if(DoButton_Ex(&s_TuneButton, "Tune", (pS && pS->m_Tune)?0:-1, &Button, 0, "Tune", CUI::CORNER_ALL))
|
if(DoButton_Ex(&s_TuneButton, "Tune", (pS && pS->m_Tune)?0:-1, &Button, 0, "Tune", CUI::CORNER_ALL))
|
||||||
{
|
{
|
||||||
static int s_TunePopupID = 0;
|
static int s_TunePopupID = 0;
|
||||||
UiInvokePopupMenu(&s_TunePopupID, 0, UI()->MouseX(), UI()->MouseY(), 120, 90, PopupTune);
|
UiInvokePopupMenu(&s_TunePopupID, 0, UI()->MouseX(), UI()->MouseY(), 120, 23, PopupTune);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3012,7 +3012,7 @@ void CEditor::RenderLayers(CUIRect ToolBox, CUIRect ToolBar, CUIRect View)
|
||||||
m_SelectedGroup = g;
|
m_SelectedGroup = g;
|
||||||
static int s_LayerPopupID = 0;
|
static int s_LayerPopupID = 0;
|
||||||
if(Result == 2)
|
if(Result == 2)
|
||||||
UiInvokePopupMenu(&s_LayerPopupID, 0, UI()->MouseX(), UI()->MouseY(), 120, 260, PopupLayer);
|
UiInvokePopupMenu(&s_LayerPopupID, 0, UI()->MouseX(), UI()->MouseY(), 120, 280, PopupLayer);
|
||||||
}
|
}
|
||||||
|
|
||||||
LayerCur += 14.0f;
|
LayerCur += 14.0f;
|
||||||
|
@ -4393,7 +4393,7 @@ void CEditor::RenderEnvelopeEditor(CUIRect View)
|
||||||
ToolBar.VSplitLeft(15.0f, &Button, &ToolBar);
|
ToolBar.VSplitLeft(15.0f, &Button, &ToolBar);
|
||||||
ToolBar.VSplitLeft(12.0f, &Button, &ToolBar);
|
ToolBar.VSplitLeft(12.0f, &Button, &ToolBar);
|
||||||
static int s_SyncButton;
|
static int s_SyncButton;
|
||||||
if(DoButton_Editor(&s_SyncButton, pEnvelope->m_Synchronized?"X":"", 0, &Button, 0, "Enable envelope synchronization between clients"))
|
if(DoButton_Editor(&s_SyncButton, pEnvelope->m_Synchronized?"X":"", 0, &Button, 0, "Synchronize envelope animation to game time (restarts when you touch the start line)"))
|
||||||
pEnvelope->m_Synchronized = !pEnvelope->m_Synchronized;
|
pEnvelope->m_Synchronized = !pEnvelope->m_Synchronized;
|
||||||
|
|
||||||
ToolBar.VSplitLeft(4.0f, &Button, &ToolBar);
|
ToolBar.VSplitLeft(4.0f, &Button, &ToolBar);
|
||||||
|
|
|
@ -61,7 +61,7 @@ public:
|
||||||
m_aName[0] = 0;
|
m_aName[0] = 0;
|
||||||
m_Bottom = 0;
|
m_Bottom = 0;
|
||||||
m_Top = 0;
|
m_Top = 0;
|
||||||
m_Synchronized = true;
|
m_Synchronized = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Resort()
|
void Resort()
|
||||||
|
@ -831,7 +831,7 @@ public:
|
||||||
|
|
||||||
bool operator<(const CFilelistItem &Other) { return !str_comp(m_aFilename, "..") ? true : !str_comp(Other.m_aFilename, "..") ? false :
|
bool operator<(const CFilelistItem &Other) { return !str_comp(m_aFilename, "..") ? true : !str_comp(Other.m_aFilename, "..") ? false :
|
||||||
m_IsDir && !Other.m_IsDir ? true : !m_IsDir && Other.m_IsDir ? false :
|
m_IsDir && !Other.m_IsDir ? true : !m_IsDir && Other.m_IsDir ? false :
|
||||||
str_comp_filenames(m_aFilename, Other.m_aFilename) < 0; }
|
str_comp_nocase(m_aFilename, Other.m_aFilename) < 0; }
|
||||||
};
|
};
|
||||||
sorted_array<CFilelistItem> m_FileList;
|
sorted_array<CFilelistItem> m_FileList;
|
||||||
int m_FilesStartAt;
|
int m_FilesStartAt;
|
||||||
|
|
|
@ -877,50 +877,6 @@ int CEditorMap::Load(class IStorage *pStorage, const char *pFileName, int Storag
|
||||||
if(pTilemapItem->m_Version >= 3)
|
if(pTilemapItem->m_Version >= 3)
|
||||||
IntsToStr(pTilemapItem->m_aName, sizeof(pTiles->m_aName)/sizeof(int), pTiles->m_aName);
|
IntsToStr(pTilemapItem->m_aName, sizeof(pTiles->m_aName)/sizeof(int), pTiles->m_aName);
|
||||||
|
|
||||||
if (Size >= pTiles->m_Width*pTiles->m_Height*sizeof(CTile))
|
|
||||||
{
|
|
||||||
mem_copy(pTiles->m_pTiles, pData, pTiles->m_Width*pTiles->m_Height*sizeof(CTile));
|
|
||||||
|
|
||||||
if(pTiles->m_Game && pTilemapItem->m_Version == MakeVersion(1, *pTilemapItem))
|
|
||||||
{
|
|
||||||
for(int i = 0; i < pTiles->m_Width*pTiles->m_Height; i++)
|
|
||||||
{
|
|
||||||
if(pTiles->m_pTiles[i].m_Index)
|
|
||||||
pTiles->m_pTiles[i].m_Index += ENTITY_OFFSET;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Convert race stoppers to ddrace stoppers
|
|
||||||
/*if(pTiles->m_Game)
|
|
||||||
{
|
|
||||||
for(int i = 0; i < pTiles->m_Width*pTiles->m_Height; i++)
|
|
||||||
{
|
|
||||||
if(pTiles->m_pTiles[i].m_Index == 29)
|
|
||||||
{
|
|
||||||
pTiles->m_pTiles[i].m_Index = 60;
|
|
||||||
pTiles->m_pTiles[i].m_Flags = TILEFLAG_HFLIP|TILEFLAG_VFLIP|TILEFLAG_ROTATE;
|
|
||||||
}
|
|
||||||
else if(pTiles->m_pTiles[i].m_Index == 30)
|
|
||||||
{
|
|
||||||
pTiles->m_pTiles[i].m_Index = 60;
|
|
||||||
pTiles->m_pTiles[i].m_Flags = TILEFLAG_ROTATE;
|
|
||||||
}
|
|
||||||
else if(pTiles->m_pTiles[i].m_Index == 31)
|
|
||||||
{
|
|
||||||
pTiles->m_pTiles[i].m_Index = 60;
|
|
||||||
pTiles->m_pTiles[i].m_Flags = TILEFLAG_HFLIP|TILEFLAG_VFLIP;
|
|
||||||
}
|
|
||||||
else if(pTiles->m_pTiles[i].m_Index == 32)
|
|
||||||
{
|
|
||||||
pTiles->m_pTiles[i].m_Index = 60;
|
|
||||||
pTiles->m_pTiles[i].m_Flags = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}*/
|
|
||||||
}
|
|
||||||
|
|
||||||
DataFile.UnloadData(pTilemapItem->m_Data);
|
|
||||||
|
|
||||||
if(pTiles->m_Tele)
|
if(pTiles->m_Tele)
|
||||||
{
|
{
|
||||||
void *pTeleData = DataFile.GetData(pTilemapItem->m_Tele);
|
void *pTeleData = DataFile.GetData(pTilemapItem->m_Tele);
|
||||||
|
@ -1083,6 +1039,77 @@ int CEditorMap::Load(class IStorage *pStorage, const char *pFileName, int Storag
|
||||||
}
|
}
|
||||||
DataFile.UnloadData(pTilemapItem->m_Tune);
|
DataFile.UnloadData(pTilemapItem->m_Tune);
|
||||||
}
|
}
|
||||||
|
else // regular tile layer or game layer
|
||||||
|
{
|
||||||
|
if (Size >= pTiles->m_Width*pTiles->m_Height*sizeof(CTile))
|
||||||
|
{
|
||||||
|
mem_copy(pTiles->m_pTiles, pData, pTiles->m_Width*pTiles->m_Height*sizeof(CTile));
|
||||||
|
|
||||||
|
if(pTiles->m_Game && pTilemapItem->m_Version == MakeVersion(1, *pTilemapItem))
|
||||||
|
{
|
||||||
|
for(int i = 0; i < pTiles->m_Width*pTiles->m_Height; i++)
|
||||||
|
{
|
||||||
|
if(pTiles->m_pTiles[i].m_Index)
|
||||||
|
pTiles->m_pTiles[i].m_Index += ENTITY_OFFSET;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
DataFile.UnloadData(pTilemapItem->m_Data);
|
||||||
|
|
||||||
|
// Remove unused tiles on game and front layers
|
||||||
|
/*if(pTiles->m_Game)
|
||||||
|
{
|
||||||
|
for(int i = 0; i < pTiles->m_Width*pTiles->m_Height; i++)
|
||||||
|
{
|
||||||
|
if(!IsValidGameTile(pTiles->m_pTiles[i].m_Index))
|
||||||
|
{
|
||||||
|
pTiles->m_pTiles[i].m_Index = 0;
|
||||||
|
pTiles->m_pTiles[i].m_Flags = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(pTiles->m_Front)
|
||||||
|
{
|
||||||
|
for(int i = 0; i < pTiles->m_Width*pTiles->m_Height; i++)
|
||||||
|
{
|
||||||
|
if(!IsValidFrontTile(pTiles->m_pTiles[i].m_Index))
|
||||||
|
{
|
||||||
|
pTiles->m_pTiles[i].m_Index = 0;
|
||||||
|
pTiles->m_pTiles[i].m_Flags = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}*/
|
||||||
|
|
||||||
|
// Convert race stoppers to ddrace stoppers
|
||||||
|
/*if(pTiles->m_Game)
|
||||||
|
{
|
||||||
|
for(int i = 0; i < pTiles->m_Width*pTiles->m_Height; i++)
|
||||||
|
{
|
||||||
|
if(pTiles->m_pTiles[i].m_Index == 29)
|
||||||
|
{
|
||||||
|
pTiles->m_pTiles[i].m_Index = 60;
|
||||||
|
pTiles->m_pTiles[i].m_Flags = TILEFLAG_HFLIP|TILEFLAG_VFLIP|TILEFLAG_ROTATE;
|
||||||
|
}
|
||||||
|
else if(pTiles->m_pTiles[i].m_Index == 30)
|
||||||
|
{
|
||||||
|
pTiles->m_pTiles[i].m_Index = 60;
|
||||||
|
pTiles->m_pTiles[i].m_Flags = TILEFLAG_ROTATE;
|
||||||
|
}
|
||||||
|
else if(pTiles->m_pTiles[i].m_Index == 31)
|
||||||
|
{
|
||||||
|
pTiles->m_pTiles[i].m_Index = 60;
|
||||||
|
pTiles->m_pTiles[i].m_Flags = TILEFLAG_HFLIP|TILEFLAG_VFLIP;
|
||||||
|
}
|
||||||
|
else if(pTiles->m_pTiles[i].m_Index == 32)
|
||||||
|
{
|
||||||
|
pTiles->m_pTiles[i].m_Index = 60;
|
||||||
|
pTiles->m_pTiles[i].m_Flags = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}*/
|
||||||
|
|
||||||
}
|
}
|
||||||
else if(pLayerItem->m_Type == LAYERTYPE_QUADS)
|
else if(pLayerItem->m_Type == LAYERTYPE_QUADS)
|
||||||
{
|
{
|
||||||
|
|
|
@ -602,25 +602,25 @@ int CLayerTiles::RenderProperties(CUIRect *pToolBox)
|
||||||
switch(Result)
|
switch(Result)
|
||||||
{
|
{
|
||||||
case 4:
|
case 4:
|
||||||
Result = TILE_FREEZE;
|
Result = TILE_THROUGH_CUT;
|
||||||
break;
|
break;
|
||||||
case 5:
|
case 5:
|
||||||
Result = TILE_UNFREEZE;
|
Result = TILE_FREEZE;
|
||||||
break;
|
break;
|
||||||
case 6:
|
case 6:
|
||||||
Result = TILE_DFREEZE;
|
Result = TILE_UNFREEZE;
|
||||||
break;
|
break;
|
||||||
case 7:
|
case 7:
|
||||||
Result = TILE_DUNFREEZE;
|
Result = TILE_DFREEZE;
|
||||||
break;
|
break;
|
||||||
case 8:
|
case 8:
|
||||||
Result = TILE_TELECHECKIN;
|
Result = TILE_DUNFREEZE;
|
||||||
break;
|
break;
|
||||||
case 9:
|
case 9:
|
||||||
Result = TILE_TELECHECKINEVIL;
|
Result = TILE_TELECHECKIN;
|
||||||
break;
|
break;
|
||||||
case 10:
|
case 10:
|
||||||
Result = TILE_THROUGH_CUT;
|
Result = TILE_TELECHECKINEVIL;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1307,7 +1307,7 @@ static int s_GametileOpSelected = -1;
|
||||||
|
|
||||||
int CEditor::PopupSelectGametileOp(CEditor *pEditor, CUIRect View)
|
int CEditor::PopupSelectGametileOp(CEditor *pEditor, CUIRect View)
|
||||||
{
|
{
|
||||||
static const char *s_pButtonNames[] = { "Clear", "Collision", "Death", "Unhookable", "Freeze", "Unfreeze", "Deep Freeze", "Deep Unfreeze", "Check-Tele From", "Evil Check-Tele From", "Hookthrough" };
|
static const char *s_pButtonNames[] = { "Air", "Hookable", "Death", "Unhookable", "Hookthrough", "Freeze", "Unfreeze", "Deep Freeze", "Deep Unfreeze", "Blue Check-Tele", "Red Check-Tele" };
|
||||||
static unsigned s_NumButtons = sizeof(s_pButtonNames) / sizeof(char*);
|
static unsigned s_NumButtons = sizeof(s_pButtonNames) / sizeof(char*);
|
||||||
CUIRect Button;
|
CUIRect Button;
|
||||||
|
|
||||||
|
@ -1470,14 +1470,14 @@ int CEditor::PopupSwitch(CEditor *pEditor, CUIRect View)
|
||||||
|
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
PROP_SwitchNumber=0,
|
PROP_SwitchDelay=0,
|
||||||
PROP_SwitchDelay,
|
PROP_SwitchNumber,
|
||||||
NUM_PROPS,
|
NUM_PROPS,
|
||||||
};
|
};
|
||||||
|
|
||||||
CProperty aProps[] = {
|
CProperty aProps[] = {
|
||||||
{"Number", pEditor->m_SwitchNum, PROPTYPE_INT_STEP, 0, 255},
|
|
||||||
{"Delay", pEditor->m_SwitchDelay, PROPTYPE_INT_STEP, 0, 255},
|
{"Delay", pEditor->m_SwitchDelay, PROPTYPE_INT_STEP, 0, 255},
|
||||||
|
{"Number", pEditor->m_SwitchNum, PROPTYPE_INT_STEP, 0, 255},
|
||||||
{0},
|
{0},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -18,9 +18,9 @@ void CGameContext::ConCredits(IConsole::IResult *pResult, void *pUserData)
|
||||||
CGameContext *pSelf = (CGameContext *) pUserData;
|
CGameContext *pSelf = (CGameContext *) pUserData;
|
||||||
|
|
||||||
pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "credit",
|
pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "credit",
|
||||||
"DDRaceNetwork is maintained by deen.");
|
"DDNet is run by the DDNet staff (DDNet.tw/staff)");
|
||||||
pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "credit",
|
pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "credit",
|
||||||
"Many ideas from the great community,");
|
"Great maps and many ideas from the great community");
|
||||||
pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "credit",
|
pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "credit",
|
||||||
"Help and code by eeeee, HMH, east, CookieMichal, Learath2,");
|
"Help and code by eeeee, HMH, east, CookieMichal, Learath2,");
|
||||||
pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "credit",
|
pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "credit",
|
||||||
|
@ -33,8 +33,6 @@ void CGameContext::ConCredits(IConsole::IResult *pResult, void *pUserData)
|
||||||
"Based on DDRace by the DDRace developers,");
|
"Based on DDRace by the DDRace developers,");
|
||||||
pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "credit",
|
pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "credit",
|
||||||
"which is a mod of Teeworlds by the Teeworlds developers.");
|
"which is a mod of Teeworlds by the Teeworlds developers.");
|
||||||
pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "credit",
|
|
||||||
"Check the changes on ddnet.tw");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CGameContext::ConInfo(IConsole::IResult *pResult, void *pUserData)
|
void CGameContext::ConInfo(IConsole::IResult *pResult, void *pUserData)
|
||||||
|
@ -47,11 +45,11 @@ void CGameContext::ConInfo(IConsole::IResult *pResult, void *pUserData)
|
||||||
"Git revision hash: " GIT_SHORTREV_HASH);
|
"Git revision hash: " GIT_SHORTREV_HASH);
|
||||||
#endif
|
#endif
|
||||||
pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "info",
|
pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "info",
|
||||||
"Official site: ddnet.tw");
|
"Official site: DDNet.tw");
|
||||||
pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "info",
|
pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "info",
|
||||||
"For more Info /cmdlist");
|
"For more info: /cmdlist");
|
||||||
pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "info",
|
pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "info",
|
||||||
"Or visit ddnet.tw");
|
"Or visit DDNet.tw");
|
||||||
}
|
}
|
||||||
|
|
||||||
void CGameContext::ConHelp(IConsole::IResult *pResult, void *pUserData)
|
void CGameContext::ConHelp(IConsole::IResult *pResult, void *pUserData)
|
||||||
|
@ -396,7 +394,7 @@ void CGameContext::ConTeamTop5(IConsole::IResult *pResult, void *pUserData)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pResult->NumArguments() > 0 && pResult->GetInteger(0) >= 0)
|
if (pResult->NumArguments() > 0 && pResult->GetInteger(0) > 0)
|
||||||
pSelf->Score()->ShowTeamTop5(pResult, pResult->m_ClientID, pUserData,
|
pSelf->Score()->ShowTeamTop5(pResult, pResult->m_ClientID, pUserData,
|
||||||
pResult->GetInteger(0));
|
pResult->GetInteger(0));
|
||||||
else
|
else
|
||||||
|
@ -427,7 +425,7 @@ void CGameContext::ConTop5(IConsole::IResult *pResult, void *pUserData)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pResult->NumArguments() > 0 && pResult->GetInteger(0) >= 0)
|
if (pResult->NumArguments() > 0 && pResult->GetInteger(0) > 0)
|
||||||
pSelf->Score()->ShowTop5(pResult, pResult->m_ClientID, pUserData,
|
pSelf->Score()->ShowTop5(pResult, pResult->m_ClientID, pUserData,
|
||||||
pResult->GetInteger(0));
|
pResult->GetInteger(0));
|
||||||
else
|
else
|
||||||
|
|
|
@ -919,7 +919,7 @@ void CGameContext::OnClientEnter(int ClientID)
|
||||||
SendChat(-1, CGameContext::CHAT_ALL, aBuf);
|
SendChat(-1, CGameContext::CHAT_ALL, aBuf);
|
||||||
|
|
||||||
SendChatTarget(ClientID, "DDraceNetwork Mod. Version: " GAME_VERSION);
|
SendChatTarget(ClientID, "DDraceNetwork Mod. Version: " GAME_VERSION);
|
||||||
SendChatTarget(ClientID, "please visit https://ddnet.tw or say /info for more info");
|
SendChatTarget(ClientID, "please visit DDNet.tw or say /info for more info");
|
||||||
|
|
||||||
if(g_Config.m_SvWelcome[0]!=0)
|
if(g_Config.m_SvWelcome[0]!=0)
|
||||||
SendChatTarget(ClientID,g_Config.m_SvWelcome);
|
SendChatTarget(ClientID,g_Config.m_SvWelcome);
|
||||||
|
@ -930,7 +930,7 @@ void CGameContext::OnClientEnter(int ClientID)
|
||||||
if (g_Config.m_SvShowOthersDefault)
|
if (g_Config.m_SvShowOthersDefault)
|
||||||
{
|
{
|
||||||
if (g_Config.m_SvShowOthers)
|
if (g_Config.m_SvShowOthers)
|
||||||
SendChatTarget(ClientID, "You can see other players. To disable this use the DDNet client and type /showothers .");
|
SendChatTarget(ClientID, "You can see other players. To disable this use DDNet client and type /showothers .");
|
||||||
|
|
||||||
m_apPlayers[ClientID]->m_ShowOthers = true;
|
m_apPlayers[ClientID]->m_ShowOthers = true;
|
||||||
}
|
}
|
||||||
|
@ -1166,7 +1166,7 @@ void CGameContext::OnMessage(int MsgID, CUnpacker *pUnpacker, int ClientID)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(g_Config.m_SvJoinVoteDelay && Now < pPlayer->m_FirstVoteTick)
|
if(Now < pPlayer->m_FirstVoteTick)
|
||||||
{
|
{
|
||||||
char aBuf[64];
|
char aBuf[64];
|
||||||
str_format(aBuf, sizeof(aBuf), "You must wait %d seconds before making your first vote", ((pPlayer->m_FirstVoteTick - Now) / TickSpeed) + 1);
|
str_format(aBuf, sizeof(aBuf), "You must wait %d seconds before making your first vote", ((pPlayer->m_FirstVoteTick - Now) / TickSpeed) + 1);
|
||||||
|
|
|
@ -422,7 +422,7 @@ void IGameController::ChangeMap(const char *pToMap)
|
||||||
{
|
{
|
||||||
/*str_copy(m_aMapWish, pToMap, sizeof(m_aMapWish));
|
/*str_copy(m_aMapWish, pToMap, sizeof(m_aMapWish));
|
||||||
EndRound();*/
|
EndRound();*/
|
||||||
str_copy(g_Config.m_SvMap, pToMap, sizeof(m_aMapWish));
|
str_copy(g_Config.m_SvMap, pToMap, sizeof(g_Config.m_SvMap));
|
||||||
}
|
}
|
||||||
|
|
||||||
/*void IGameController::CycleMap()
|
/*void IGameController::CycleMap()
|
||||||
|
|
|
@ -134,14 +134,10 @@ void CPlayer::Reset()
|
||||||
//
|
//
|
||||||
// Otherwise, block voting for 60 seconds after joining.
|
// Otherwise, block voting for 60 seconds after joining.
|
||||||
if(Now > GameServer()->m_NonEmptySince + 10 * TickSpeed)
|
if(Now > GameServer()->m_NonEmptySince + 10 * TickSpeed)
|
||||||
{
|
m_FirstVoteTick = Now + g_Config.m_SvJoinVoteDelay * TickSpeed;
|
||||||
m_FirstVoteTick = Now + 60 * TickSpeed;
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
|
||||||
m_FirstVoteTick = Now;
|
m_FirstVoteTick = Now;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
void CPlayer::Tick()
|
void CPlayer::Tick()
|
||||||
{
|
{
|
||||||
|
@ -263,8 +259,6 @@ void CPlayer::PostTick()
|
||||||
m_aActLatency[i] = GameServer()->m_apPlayers[i]->m_Latency.m_Min;
|
m_aActLatency[i] = GameServer()->m_apPlayers[i]->m_Latency.m_Min;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
m_aActLatency[m_ClientID] = GameServer()->m_apPlayers[m_ClientID]->m_Latency.m_Min;
|
|
||||||
|
|
||||||
// update view pos for spectators
|
// update view pos for spectators
|
||||||
if((m_Team == TEAM_SPECTATORS || m_Paused) && m_SpectatorID != SPEC_FREEVIEW && GameServer()->m_apPlayers[m_SpectatorID] && GameServer()->m_apPlayers[m_SpectatorID]->GetCharacter())
|
if((m_Team == TEAM_SPECTATORS || m_Paused) && m_SpectatorID != SPEC_FREEVIEW && GameServer()->m_apPlayers[m_SpectatorID] && GameServer()->m_apPlayers[m_SpectatorID]->GetCharacter())
|
||||||
|
|
|
@ -293,6 +293,12 @@ bool CSqlScore::MapVoteThread(CSqlServer* pSqlServer, const CSqlData *pGameData,
|
||||||
str_format(aBuf, sizeof(aBuf), "No map like \"%s\" found. Try adding a '%%' at the start if you don't know the first character. Example: /map %%castle for \"Out of Castle\"", pData->m_RequestedMap.Str());
|
str_format(aBuf, sizeof(aBuf), "No map like \"%s\" found. Try adding a '%%' at the start if you don't know the first character. Example: /map %%castle for \"Out of Castle\"", pData->m_RequestedMap.Str());
|
||||||
pData->GameServer()->SendChatTarget(pData->m_ClientID, aBuf);
|
pData->GameServer()->SendChatTarget(pData->m_ClientID, aBuf);
|
||||||
}
|
}
|
||||||
|
else if(Now < pPlayer->m_FirstVoteTick)
|
||||||
|
{
|
||||||
|
char aBuf[64];
|
||||||
|
str_format(aBuf, sizeof(aBuf), "You must wait %d seconds before making your first vote", ((pPlayer->m_FirstVoteTick - Now) / pData->Server()->TickSpeed()) + 1);
|
||||||
|
pData->GameServer()->SendChatTarget(pData->m_ClientID, aBuf);
|
||||||
|
}
|
||||||
else if(pPlayer->m_LastVoteCall && Timeleft > 0)
|
else if(pPlayer->m_LastVoteCall && Timeleft > 0)
|
||||||
{
|
{
|
||||||
char aChatmsg[512] = {0};
|
char aChatmsg[512] = {0};
|
||||||
|
@ -1086,16 +1092,16 @@ bool CSqlScore::ShowTimesThread(CSqlServer* pSqlServer, const CSqlData *pGameDat
|
||||||
if(pData->m_Search) // last 5 times of a player
|
if(pData->m_Search) // last 5 times of a player
|
||||||
{
|
{
|
||||||
if(pStamp == 0) // stamp is 00:00:00 cause it's an old entry from old times where there where no stamps yet
|
if(pStamp == 0) // stamp is 00:00:00 cause it's an old entry from old times where there where no stamps yet
|
||||||
str_format(aBuf, sizeof(aBuf), "%d min %.2f sec, don't know how long ago", (int)(pTime/60), pTime-((int)pTime/60*60));
|
str_format(aBuf, sizeof(aBuf), "%02d:%05.02f, don't know how long ago", (int)(pTime/60), pTime-((int)pTime/60*60));
|
||||||
else
|
else
|
||||||
str_format(aBuf, sizeof(aBuf), "%s ago, %d min %.2f sec", pAgoString,(int)(pTime/60), pTime-((int)pTime/60*60));
|
str_format(aBuf, sizeof(aBuf), "%s ago, %02d:%05.02f", pAgoString, (int)(pTime/60), pTime-((int)pTime/60*60));
|
||||||
}
|
}
|
||||||
else // last 5 times of the server
|
else // last 5 times of the server
|
||||||
{
|
{
|
||||||
if(pStamp == 0) // stamp is 00:00:00 cause it's an old entry from old times where there where no stamps yet
|
if(pStamp == 0) // stamp is 00:00:00 cause it's an old entry from old times where there where no stamps yet
|
||||||
str_format(aBuf, sizeof(aBuf), "%s, %02d:%05.02f s, don't know when", pSqlServer->GetResults()->getString("Name").c_str(), (int)(pTime/60), pTime-((int)pTime/60*60));
|
str_format(aBuf, sizeof(aBuf), "%s, %02d:%05.02f, don't know when", pSqlServer->GetResults()->getString("Name").c_str(), (int)(pTime/60), pTime-((int)pTime/60*60));
|
||||||
else
|
else
|
||||||
str_format(aBuf, sizeof(aBuf), "%s, %s ago, %02d:%05.02f s", pSqlServer->GetResults()->getString("Name").c_str(), pAgoString, (int)(pTime/60), pTime-((int)pTime/60*60));
|
str_format(aBuf, sizeof(aBuf), "%s, %s ago, %02d:%05.02f", pSqlServer->GetResults()->getString("Name").c_str(), pAgoString, (int)(pTime/60), pTime-((int)pTime/60*60));
|
||||||
}
|
}
|
||||||
pData->GameServer()->SendChatTarget(pData->m_ClientID, aBuf);
|
pData->GameServer()->SendChatTarget(pData->m_ClientID, aBuf);
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,7 +36,7 @@ MACRO_CONFIG_INT(ClShowKillMessages, cl_showkillmessages, 1, 0, 1, CFGFLAG_CLIEN
|
||||||
MACRO_CONFIG_INT(ClShowVotesAfterVoting, cl_show_votes_after_voting, 0, 0, 1, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Show votes window after voting")
|
MACRO_CONFIG_INT(ClShowVotesAfterVoting, cl_show_votes_after_voting, 0, 0, 1, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Show votes window after voting")
|
||||||
MACRO_CONFIG_INT(ClShowLocalTimeAlways, cl_show_local_time_always, 0, 0, 1, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Always show local time")
|
MACRO_CONFIG_INT(ClShowLocalTimeAlways, cl_show_local_time_always, 0, 0, 1, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Always show local time")
|
||||||
MACRO_CONFIG_INT(ClShowfps, cl_showfps, 0, 0, 1, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Show ingame FPS counter")
|
MACRO_CONFIG_INT(ClShowfps, cl_showfps, 0, 0, 1, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Show ingame FPS counter")
|
||||||
MACRO_CONFIG_INT(ClShowping, cl_showping, 0, 0, 1, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Show ingame ping counter")
|
MACRO_CONFIG_INT(ClShowpred, cl_showpred, 0, 0, 1, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Show ingame prediction time in milliseconds")
|
||||||
MACRO_CONFIG_INT(ClEyeWheel, cl_eye_wheel, 1, 0, 1, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Show eye wheel along together with emotes")
|
MACRO_CONFIG_INT(ClEyeWheel, cl_eye_wheel, 1, 0, 1, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Show eye wheel along together with emotes")
|
||||||
MACRO_CONFIG_INT(ClEyeDuration, cl_eye_duration, 999999, 1, 999999, CFGFLAG_CLIENT|CFGFLAG_SAVE, "How long the eyes emotes last")
|
MACRO_CONFIG_INT(ClEyeDuration, cl_eye_duration, 999999, 1, 999999, CFGFLAG_CLIENT|CFGFLAG_SAVE, "How long the eyes emotes last")
|
||||||
|
|
||||||
|
@ -149,7 +149,7 @@ MACRO_CONFIG_INT(SvVoteSpectateRejoindelay, sv_vote_spectate_rejoindelay, 3, 0,
|
||||||
MACRO_CONFIG_INT(SvVoteKick, sv_vote_kick, 1, 0, 1, CFGFLAG_SERVER, "Allow voting to kick players")
|
MACRO_CONFIG_INT(SvVoteKick, sv_vote_kick, 1, 0, 1, CFGFLAG_SERVER, "Allow voting to kick players")
|
||||||
MACRO_CONFIG_INT(SvVoteKickMin, sv_vote_kick_min, 0, 0, MAX_CLIENTS, CFGFLAG_SERVER, "Minimum number of players required to start a kick vote")
|
MACRO_CONFIG_INT(SvVoteKickMin, sv_vote_kick_min, 0, 0, MAX_CLIENTS, CFGFLAG_SERVER, "Minimum number of players required to start a kick vote")
|
||||||
MACRO_CONFIG_INT(SvVoteKickBantime, sv_vote_kick_bantime, 5, 0, 1440, CFGFLAG_SERVER, "The time in seconds to ban a player if kicked by vote. 0 makes it just use kick")
|
MACRO_CONFIG_INT(SvVoteKickBantime, sv_vote_kick_bantime, 5, 0, 1440, CFGFLAG_SERVER, "The time in seconds to ban a player if kicked by vote. 0 makes it just use kick")
|
||||||
MACRO_CONFIG_INT(SvJoinVoteDelay, sv_join_vote_delay, 1, 0, 1, CFGFLAG_SERVER, "Add a delay before recently joined players can vote")
|
MACRO_CONFIG_INT(SvJoinVoteDelay, sv_join_vote_delay, 60, 0, 1000, CFGFLAG_SERVER, "Add a delay before recently joined players can vote (in seconds)")
|
||||||
MACRO_CONFIG_INT(SvOldTeleportWeapons, sv_old_teleport_weapons, 0, 0, 1, CFGFLAG_SERVER|CFGFLAG_GAME, "Teleporting of all weapons (deprecated, use special entities instead)");
|
MACRO_CONFIG_INT(SvOldTeleportWeapons, sv_old_teleport_weapons, 0, 0, 1, CFGFLAG_SERVER|CFGFLAG_GAME, "Teleporting of all weapons (deprecated, use special entities instead)");
|
||||||
MACRO_CONFIG_INT(SvOldTeleportHook, sv_old_teleport_hook, 0, 0, 1, CFGFLAG_SERVER|CFGFLAG_GAME, "Hook through teleporter (deprecated, use special entities instead)");
|
MACRO_CONFIG_INT(SvOldTeleportHook, sv_old_teleport_hook, 0, 0, 1, CFGFLAG_SERVER|CFGFLAG_GAME, "Hook through teleporter (deprecated, use special entities instead)");
|
||||||
MACRO_CONFIG_INT(SvTeleportHoldHook, sv_teleport_hold_hook, 0, 0, 1, CFGFLAG_SERVER|CFGFLAG_GAME, "Hold hook when teleported");
|
MACRO_CONFIG_INT(SvTeleportHoldHook, sv_teleport_hold_hook, 0, 0, 1, CFGFLAG_SERVER|CFGFLAG_GAME, "Hold hook when teleported");
|
||||||
|
|
|
@ -3,8 +3,8 @@
|
||||||
#ifndef GAME_VERSION_H
|
#ifndef GAME_VERSION_H
|
||||||
#define GAME_VERSION_H
|
#define GAME_VERSION_H
|
||||||
#include "generated/nethash.cpp"
|
#include "generated/nethash.cpp"
|
||||||
#define GAME_VERSION "0.6.3, 10.0.1"
|
#define GAME_VERSION "0.6.3, 10.0.3"
|
||||||
#define GAME_NETVERSION "0.6 626fce9a778df4d4"
|
#define GAME_NETVERSION "0.6 626fce9a778df4d4"
|
||||||
static const char GAME_RELEASE_VERSION[8] = "10.0.1";
|
static const char GAME_RELEASE_VERSION[8] = "10.0.3";
|
||||||
#define CLIENT_VERSIONNR 1000
|
#define CLIENT_VERSIONNR 1000
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue