mirror of
https://github.com/ddnet/ddnet.git
synced 2024-09-19 17:14:18 +00:00
Compare commits
25 commits
6e2f8148f5
...
55b01b90a2
Author | SHA1 | Date | |
---|---|---|---|
55b01b90a2 | |||
d2348b2e06 | |||
45808841ac | |||
78d702d3b7 | |||
cbc21fab4a | |||
ChillerDragon | 3781f95190 | ||
ChillerDragon | 32e8bb1f05 | ||
a2e0ab2dbe | |||
255694c061 | |||
b475c67039 | |||
a266cd2f70 | |||
2c77e79061 | |||
ChillerDragon | 46c5344d71 | ||
96ad30eb21 | |||
b03245f7dd | |||
ChillerDragon | 7192bbf397 | ||
ChillerDragon | 984845b2a9 | ||
60624d5599 | |||
9d7b476c33 | |||
9cd2f561e3 | |||
ceb66d6ba8 | |||
7cf1ff4ca0 | |||
e16c2d39a7 | |||
68b7fbe163 | |||
942ce372f7 |
|
@ -996,6 +996,7 @@ endif()
|
||||||
########################################################################
|
########################################################################
|
||||||
|
|
||||||
set(EXPECTED_DATA
|
set(EXPECTED_DATA
|
||||||
|
announcement.txt
|
||||||
arrow.png
|
arrow.png
|
||||||
assets/entities/comfort/ddnet.png
|
assets/entities/comfort/ddnet.png
|
||||||
assets/entities/license.txt
|
assets/entities/license.txt
|
||||||
|
|
0
data/announcement.txt
Normal file
0
data/announcement.txt
Normal file
|
@ -80,10 +80,10 @@ sv_rescue_delay 5
|
||||||
# Message on chat displayed when joining
|
# Message on chat displayed when joining
|
||||||
sv_welcome "Welcome to my server!"
|
sv_welcome "Welcome to my server!"
|
||||||
|
|
||||||
# File which will have the announcements (each one in new line)
|
# File which contains the announcements (One on each line)
|
||||||
sv_announcement_filename "announcement.txt"
|
sv_announcement_filename "announcement.txt"
|
||||||
|
|
||||||
# Number of minutes before next announcement will be displayed (from the announcement file)
|
# Number of minutes before the next announcement will be displayed (from the announcement file)
|
||||||
sv_announcement_interval 120
|
sv_announcement_interval 120
|
||||||
|
|
||||||
# Whether announcements will be displayed in their order or chosen randomly
|
# Whether announcements will be displayed in their order or chosen randomly
|
||||||
|
|
|
@ -80,6 +80,7 @@ void CInput::Init()
|
||||||
|
|
||||||
m_pGraphics = Kernel()->RequestInterface<IEngineGraphics>();
|
m_pGraphics = Kernel()->RequestInterface<IEngineGraphics>();
|
||||||
m_pConsole = Kernel()->RequestInterface<IConsole>();
|
m_pConsole = Kernel()->RequestInterface<IConsole>();
|
||||||
|
m_pConfigManager = Kernel()->RequestInterface<IConfigManager>();
|
||||||
|
|
||||||
MouseModeRelative();
|
MouseModeRelative();
|
||||||
|
|
||||||
|
@ -824,6 +825,9 @@ int CInput::Update()
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case SDL_WINDOWEVENT_MINIMIZED:
|
case SDL_WINDOWEVENT_MINIMIZED:
|
||||||
|
#if defined(CONF_PLATFORM_ANDROID) // Save the config when minimized on Android.
|
||||||
|
m_pConfigManager->Save();
|
||||||
|
#endif
|
||||||
Graphics()->WindowDestroyNtf(Event.window.windowID);
|
Graphics()->WindowDestroyNtf(Event.window.windowID);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
class IEngineGraphics;
|
class IEngineGraphics;
|
||||||
|
class IConfigManager;
|
||||||
|
|
||||||
class CInput : public IEngineInput
|
class CInput : public IEngineInput
|
||||||
{
|
{
|
||||||
|
@ -59,6 +60,7 @@ public:
|
||||||
private:
|
private:
|
||||||
IEngineGraphics *m_pGraphics;
|
IEngineGraphics *m_pGraphics;
|
||||||
IConsole *m_pConsole;
|
IConsole *m_pConsole;
|
||||||
|
IConfigManager *m_pConfigManager;
|
||||||
|
|
||||||
IEngineGraphics *Graphics() const { return m_pGraphics; }
|
IEngineGraphics *Graphics() const { return m_pGraphics; }
|
||||||
IConsole *Console() const { return m_pConsole; }
|
IConsole *Console() const { return m_pConsole; }
|
||||||
|
|
|
@ -273,7 +273,8 @@ public:
|
||||||
virtual bool DnsblWhite(int ClientId) = 0;
|
virtual bool DnsblWhite(int ClientId) = 0;
|
||||||
virtual bool DnsblPending(int ClientId) = 0;
|
virtual bool DnsblPending(int ClientId) = 0;
|
||||||
virtual bool DnsblBlack(int ClientId) = 0;
|
virtual bool DnsblBlack(int ClientId) = 0;
|
||||||
virtual const char *GetAnnouncementLine(const char *pFileName) = 0;
|
virtual const char *GetAnnouncementLine() = 0;
|
||||||
|
virtual void ReadAnnouncementsFile(const char *pFileName) = 0;
|
||||||
virtual bool ClientPrevIngame(int ClientId) = 0;
|
virtual bool ClientPrevIngame(int ClientId) = 0;
|
||||||
virtual const char *GetNetErrorString(int ClientId) = 0;
|
virtual const char *GetNetErrorString(int ClientId) = 0;
|
||||||
virtual void ResetNetErrorString(int ClientId) = 0;
|
virtual void ResetNetErrorString(int ClientId) = 0;
|
||||||
|
|
|
@ -537,8 +537,7 @@ int CServer::Init()
|
||||||
|
|
||||||
m_CurrentGameTick = MIN_TICK;
|
m_CurrentGameTick = MIN_TICK;
|
||||||
|
|
||||||
m_AnnouncementLastLine = 0;
|
m_AnnouncementLastLine = -1;
|
||||||
m_aAnnouncementFile[0] = '\0';
|
|
||||||
mem_zero(m_aPrevStates, sizeof(m_aPrevStates));
|
mem_zero(m_aPrevStates, sizeof(m_aPrevStates));
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -2783,6 +2782,8 @@ int CServer::Run()
|
||||||
Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "server", aBuf);
|
Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "server", aBuf);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ReadAnnouncementsFile(g_Config.m_SvAnnouncementFileName);
|
||||||
|
|
||||||
// process pending commands
|
// process pending commands
|
||||||
m_pConsole->StoreCommands(false);
|
m_pConsole->StoreCommands(false);
|
||||||
m_pRegister->OnConfigChange();
|
m_pRegister->OnConfigChange();
|
||||||
|
@ -3809,6 +3810,17 @@ void CServer::ConchainStdoutOutputLevel(IConsole::IResult *pResult, void *pUserD
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CServer::ConchainAnnouncementFileName(IConsole::IResult *pResult, void *pUserData, IConsole::FCommandCallback pfnCallback, void *pCallbackUserData)
|
||||||
|
{
|
||||||
|
CServer *pSelf = (CServer *)pUserData;
|
||||||
|
bool Changed = pResult->NumArguments() && str_comp(pResult->GetString(0), g_Config.m_SvAnnouncementFileName);
|
||||||
|
pfnCallback(pResult, pCallbackUserData);
|
||||||
|
if(Changed)
|
||||||
|
{
|
||||||
|
pSelf->ReadAnnouncementsFile(g_Config.m_SvAnnouncementFileName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#if defined(CONF_FAMILY_UNIX)
|
#if defined(CONF_FAMILY_UNIX)
|
||||||
void CServer::ConchainConnLoggingServerChange(IConsole::IResult *pResult, void *pUserData, IConsole::FCommandCallback pfnCallback, void *pCallbackUserData)
|
void CServer::ConchainConnLoggingServerChange(IConsole::IResult *pResult, void *pUserData, IConsole::FCommandCallback pfnCallback, void *pCallbackUserData)
|
||||||
{
|
{
|
||||||
|
@ -3887,6 +3899,8 @@ void CServer::RegisterCommands()
|
||||||
Console()->Chain("loglevel", ConchainLoglevel, this);
|
Console()->Chain("loglevel", ConchainLoglevel, this);
|
||||||
Console()->Chain("stdout_output_level", ConchainStdoutOutputLevel, this);
|
Console()->Chain("stdout_output_level", ConchainStdoutOutputLevel, this);
|
||||||
|
|
||||||
|
Console()->Chain("sv_announcement_filename", ConchainAnnouncementFileName, this);
|
||||||
|
|
||||||
#if defined(CONF_FAMILY_UNIX)
|
#if defined(CONF_FAMILY_UNIX)
|
||||||
Console()->Chain("sv_conn_logging_server", ConchainConnLoggingServerChange, this);
|
Console()->Chain("sv_conn_logging_server", ConchainConnLoggingServerChange, this);
|
||||||
#endif
|
#endif
|
||||||
|
@ -3930,27 +3944,30 @@ void CServer::GetClientAddr(int ClientId, NETADDR *pAddr) const
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *CServer::GetAnnouncementLine(const char *pFileName)
|
void CServer::ReadAnnouncementsFile(const char *pFileName)
|
||||||
{
|
{
|
||||||
if(str_comp(pFileName, m_aAnnouncementFile) != 0)
|
m_vAnnouncements.clear();
|
||||||
{
|
|
||||||
str_copy(m_aAnnouncementFile, pFileName);
|
|
||||||
m_vAnnouncements.clear();
|
|
||||||
|
|
||||||
CLineReader LineReader;
|
if(pFileName[0] == '\0')
|
||||||
if(!LineReader.OpenFile(m_pStorage->OpenFile(pFileName, IOFLAG_READ, IStorage::TYPE_ALL)))
|
return;
|
||||||
|
|
||||||
|
CLineReader LineReader;
|
||||||
|
if(!LineReader.OpenFile(m_pStorage->OpenFile(pFileName, IOFLAG_READ, IStorage::TYPE_ALL)))
|
||||||
|
{
|
||||||
|
dbg_msg("announcements", "failed to open '%s'", pFileName);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
while(const char *pLine = LineReader.Get())
|
||||||
|
{
|
||||||
|
if(str_length(pLine) && pLine[0] != '#')
|
||||||
{
|
{
|
||||||
return 0;
|
m_vAnnouncements.emplace_back(pLine);
|
||||||
}
|
|
||||||
while(const char *pLine = LineReader.Get())
|
|
||||||
{
|
|
||||||
if(str_length(pLine) && pLine[0] != '#')
|
|
||||||
{
|
|
||||||
m_vAnnouncements.emplace_back(pLine);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const char *CServer::GetAnnouncementLine()
|
||||||
|
{
|
||||||
if(m_vAnnouncements.empty())
|
if(m_vAnnouncements.empty())
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -3959,7 +3976,7 @@ const char *CServer::GetAnnouncementLine(const char *pFileName)
|
||||||
{
|
{
|
||||||
m_AnnouncementLastLine = 0;
|
m_AnnouncementLastLine = 0;
|
||||||
}
|
}
|
||||||
else if(!Config()->m_SvAnnouncementRandom)
|
else if(!g_Config.m_SvAnnouncementRandom)
|
||||||
{
|
{
|
||||||
if(++m_AnnouncementLastLine >= m_vAnnouncements.size())
|
if(++m_AnnouncementLastLine >= m_vAnnouncements.size())
|
||||||
m_AnnouncementLastLine %= m_vAnnouncements.size();
|
m_AnnouncementLastLine %= m_vAnnouncements.size();
|
||||||
|
|
|
@ -259,7 +259,6 @@ public:
|
||||||
|
|
||||||
size_t m_AnnouncementLastLine;
|
size_t m_AnnouncementLastLine;
|
||||||
std::vector<std::string> m_vAnnouncements;
|
std::vector<std::string> m_vAnnouncements;
|
||||||
char m_aAnnouncementFile[IO_MAX_PATH_LENGTH];
|
|
||||||
|
|
||||||
std::shared_ptr<ILogger> m_pFileLogger = nullptr;
|
std::shared_ptr<ILogger> m_pFileLogger = nullptr;
|
||||||
std::shared_ptr<ILogger> m_pStdoutLogger = nullptr;
|
std::shared_ptr<ILogger> m_pStdoutLogger = nullptr;
|
||||||
|
@ -427,6 +426,7 @@ public:
|
||||||
static void ConchainSixupUpdate(IConsole::IResult *pResult, void *pUserData, IConsole::FCommandCallback pfnCallback, void *pCallbackUserData);
|
static void ConchainSixupUpdate(IConsole::IResult *pResult, void *pUserData, IConsole::FCommandCallback pfnCallback, void *pCallbackUserData);
|
||||||
static void ConchainLoglevel(IConsole::IResult *pResult, void *pUserData, IConsole::FCommandCallback pfnCallback, void *pCallbackUserData);
|
static void ConchainLoglevel(IConsole::IResult *pResult, void *pUserData, IConsole::FCommandCallback pfnCallback, void *pCallbackUserData);
|
||||||
static void ConchainStdoutOutputLevel(IConsole::IResult *pResult, void *pUserData, IConsole::FCommandCallback pfnCallback, void *pCallbackUserData);
|
static void ConchainStdoutOutputLevel(IConsole::IResult *pResult, void *pUserData, IConsole::FCommandCallback pfnCallback, void *pCallbackUserData);
|
||||||
|
static void ConchainAnnouncementFileName(IConsole::IResult *pResult, void *pUserData, IConsole::FCommandCallback pfnCallback, void *pCallbackUserData);
|
||||||
|
|
||||||
#if defined(CONF_FAMILY_UNIX)
|
#if defined(CONF_FAMILY_UNIX)
|
||||||
static void ConchainConnLoggingServerChange(IConsole::IResult *pResult, void *pUserData, IConsole::FCommandCallback pfnCallback, void *pCallbackUserData);
|
static void ConchainConnLoggingServerChange(IConsole::IResult *pResult, void *pUserData, IConsole::FCommandCallback pfnCallback, void *pCallbackUserData);
|
||||||
|
@ -443,7 +443,8 @@ public:
|
||||||
|
|
||||||
void GetClientAddr(int ClientId, NETADDR *pAddr) const override;
|
void GetClientAddr(int ClientId, NETADDR *pAddr) const override;
|
||||||
int m_aPrevStates[MAX_CLIENTS];
|
int m_aPrevStates[MAX_CLIENTS];
|
||||||
const char *GetAnnouncementLine(const char *pFileName) override;
|
const char *GetAnnouncementLine() override;
|
||||||
|
void ReadAnnouncementsFile(const char *pFileName) override;
|
||||||
|
|
||||||
int *GetIdMap(int ClientId) override;
|
int *GetIdMap(int ClientId) override;
|
||||||
|
|
||||||
|
|
|
@ -228,7 +228,7 @@ MACRO_CONFIG_INT(SvWarmup, sv_warmup, 0, 0, 0, CFGFLAG_SERVER, "Number of second
|
||||||
MACRO_CONFIG_STR(SvMotd, sv_motd, 900, "", CFGFLAG_SERVER, "Message of the day to display for the clients")
|
MACRO_CONFIG_STR(SvMotd, sv_motd, 900, "", CFGFLAG_SERVER, "Message of the day to display for the clients")
|
||||||
MACRO_CONFIG_STR(SvGametype, sv_gametype, 32, "ddnet", CFGFLAG_SERVER, "Game type (ddnet, mod)")
|
MACRO_CONFIG_STR(SvGametype, sv_gametype, 32, "ddnet", CFGFLAG_SERVER, "Game type (ddnet, mod)")
|
||||||
MACRO_CONFIG_INT(SvTournamentMode, sv_tournament_mode, 0, 0, 1, CFGFLAG_SERVER, "Tournament mode. When enabled, players joins the server as spectator")
|
MACRO_CONFIG_INT(SvTournamentMode, sv_tournament_mode, 0, 0, 1, CFGFLAG_SERVER, "Tournament mode. When enabled, players joins the server as spectator")
|
||||||
MACRO_CONFIG_INT(SvSpamprotection, sv_spamprotection, 1, 0, 1, CFGFLAG_SERVER, "Spam protection")
|
MACRO_CONFIG_INT(SvSpamprotection, sv_spamprotection, 1, 0, 1, CFGFLAG_SERVER, "Spam protection for: team change, chat, skin change, emotes and votes")
|
||||||
|
|
||||||
MACRO_CONFIG_INT(SvSpectatorSlots, sv_spectator_slots, 0, 0, MAX_CLIENTS, CFGFLAG_SERVER, "Number of slots to reserve for spectators")
|
MACRO_CONFIG_INT(SvSpectatorSlots, sv_spectator_slots, 0, 0, MAX_CLIENTS, CFGFLAG_SERVER, "Number of slots to reserve for spectators")
|
||||||
MACRO_CONFIG_INT(SvInactiveKickTime, sv_inactivekick_time, 0, 0, 1000, CFGFLAG_SERVER, "How many minutes to wait before taking care of inactive players")
|
MACRO_CONFIG_INT(SvInactiveKickTime, sv_inactivekick_time, 0, 0, 1000, CFGFLAG_SERVER, "How many minutes to wait before taking care of inactive players")
|
||||||
|
@ -548,8 +548,8 @@ MACRO_CONFIG_INT(SvMinTeamSize, sv_min_team_size, 2, 1, MAX_CLIENTS, CFGFLAG_SER
|
||||||
MACRO_CONFIG_INT(SvMaxTeamSize, sv_max_team_size, MAX_CLIENTS, 1, MAX_CLIENTS, CFGFLAG_SERVER | CFGFLAG_GAME, "Maximum team size")
|
MACRO_CONFIG_INT(SvMaxTeamSize, sv_max_team_size, MAX_CLIENTS, 1, MAX_CLIENTS, CFGFLAG_SERVER | CFGFLAG_GAME, "Maximum team size")
|
||||||
MACRO_CONFIG_INT(SvMapVote, sv_map_vote, 1, 0, 1, CFGFLAG_SERVER, "Whether to allow /map")
|
MACRO_CONFIG_INT(SvMapVote, sv_map_vote, 1, 0, 1, CFGFLAG_SERVER, "Whether to allow /map")
|
||||||
|
|
||||||
MACRO_CONFIG_STR(SvAnnouncementFileName, sv_announcement_filename, 24, "announcement.txt", CFGFLAG_SERVER, "file which will have the announcement, each one at a line")
|
MACRO_CONFIG_STR(SvAnnouncementFileName, sv_announcement_filename, IO_MAX_PATH_LENGTH, "announcement.txt", CFGFLAG_SERVER, "File which contains the announcements, one on each line")
|
||||||
MACRO_CONFIG_INT(SvAnnouncementInterval, sv_announcement_interval, 300, 1, 9999, CFGFLAG_SERVER, "time(minutes) in which the announcement will be displayed from the announcement file")
|
MACRO_CONFIG_INT(SvAnnouncementInterval, sv_announcement_interval, 120, 1, 9999, CFGFLAG_SERVER, "The time (minutes) for how often an announcement will be displayed from the announcement file")
|
||||||
MACRO_CONFIG_INT(SvAnnouncementRandom, sv_announcement_random, 1, 0, 1, CFGFLAG_SERVER, "Whether announcements are sequential or random")
|
MACRO_CONFIG_INT(SvAnnouncementRandom, sv_announcement_random, 1, 0, 1, CFGFLAG_SERVER, "Whether announcements are sequential or random")
|
||||||
|
|
||||||
MACRO_CONFIG_INT(SvOldLaser, sv_old_laser, 0, 0, 1, CFGFLAG_SERVER | CFGFLAG_GAME, "Whether lasers can hit you if you shot them and that they pull you towards the bounce origin (0 for all new maps) or lasers can't hit you if you shot them, and they pull others towards the shooter")
|
MACRO_CONFIG_INT(SvOldLaser, sv_old_laser, 0, 0, 1, CFGFLAG_SERVER | CFGFLAG_GAME, "Whether lasers can hit you if you shot them and that they pull you towards the bounce origin (0 for all new maps) or lasers can't hit you if you shot them, and they pull others towards the shooter")
|
||||||
|
|
|
@ -577,9 +577,9 @@ void CMenus::RenderServerbrowserStatusBox(CUIRect StatusBox, bool WasListboxItem
|
||||||
|
|
||||||
// buttons
|
// buttons
|
||||||
{
|
{
|
||||||
CUIRect ButtonRefresh, ButtonConnect;
|
CUIRect ButtonRefresh, ButtonConnect, Button;
|
||||||
ConnectButtons.VSplitMid(&ButtonRefresh, &ButtonConnect, 5.0f);
|
ConnectButtons.VSplitMid(&ButtonRefresh, &ButtonConnect, 5.0f);
|
||||||
|
|
||||||
// refresh button
|
// refresh button
|
||||||
{
|
{
|
||||||
char aLabelBuf[32] = {0};
|
char aLabelBuf[32] = {0};
|
||||||
|
|
|
@ -152,7 +152,9 @@ void CMenus::RenderSettingsGeneral(CUIRect MainView)
|
||||||
|
|
||||||
Left.HSplitTop(10.0f, nullptr, &Left);
|
Left.HSplitTop(10.0f, nullptr, &Left);
|
||||||
Left.HSplitTop(20.0f, &Button, &Left);
|
Left.HSplitTop(20.0f, &Button, &Left);
|
||||||
Ui()->DoScrollbarOption(&g_Config.m_ClRefreshRate, &g_Config.m_ClRefreshRate, &Button, Localize("Refresh Rate"), 10, 10000, &CUi::ms_LogarithmicScrollbarScale, CUi::SCROLLBAR_OPTION_INFINITE, " Hz");
|
str_copy(aBuf, " ");
|
||||||
|
str_append(aBuf, Localize("Hz", "Hertz"));
|
||||||
|
Ui()->DoScrollbarOption(&g_Config.m_ClRefreshRate, &g_Config.m_ClRefreshRate, &Button, Localize("Refresh Rate"), 10, 10000, &CUi::ms_LogarithmicScrollbarScale, CUi::SCROLLBAR_OPTION_INFINITE, aBuf);
|
||||||
Left.HSplitTop(5.0f, nullptr, &Left);
|
Left.HSplitTop(5.0f, nullptr, &Left);
|
||||||
Left.HSplitTop(20.0f, &Button, &Left);
|
Left.HSplitTop(20.0f, &Button, &Left);
|
||||||
static int s_LowerRefreshRate;
|
static int s_LowerRefreshRate;
|
||||||
|
@ -1628,7 +1630,9 @@ void CMenus::RenderSettingsGraphics(CUIRect MainView)
|
||||||
}
|
}
|
||||||
|
|
||||||
MainView.HSplitTop(20.0f, &Button, &MainView);
|
MainView.HSplitTop(20.0f, &Button, &MainView);
|
||||||
Ui()->DoScrollbarOption(&g_Config.m_GfxRefreshRate, &g_Config.m_GfxRefreshRate, &Button, Localize("Refresh Rate"), 10, 1000, &CUi::ms_LinearScrollbarScale, CUi::SCROLLBAR_OPTION_INFINITE | CUi::SCROLLBAR_OPTION_NOCLAMPVALUE, " Hz");
|
str_copy(aBuf, " ");
|
||||||
|
str_append(aBuf, Localize("Hz", "Hertz"));
|
||||||
|
Ui()->DoScrollbarOption(&g_Config.m_GfxRefreshRate, &g_Config.m_GfxRefreshRate, &Button, Localize("Refresh Rate"), 10, 1000, &CUi::ms_LinearScrollbarScale, CUi::SCROLLBAR_OPTION_INFINITE | CUi::SCROLLBAR_OPTION_NOCLAMPVALUE, aBuf);
|
||||||
|
|
||||||
MainView.HSplitTop(2.0f, nullptr, &MainView);
|
MainView.HSplitTop(2.0f, nullptr, &MainView);
|
||||||
static CButtonContainer s_UiColorResetId;
|
static CButtonContainer s_UiColorResetId;
|
||||||
|
|
|
@ -1565,7 +1565,7 @@ void CGameClient::OnNewSnapshot()
|
||||||
pClient->m_SkinInfo.m_ColorFeet = ColorRGBA(1, 1, 1);
|
pClient->m_SkinInfo.m_ColorFeet = ColorRGBA(1, 1, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
pClient->UpdateRenderInfo(IsTeamPlay(), g_Config.m_ClDummy);
|
pClient->UpdateRenderInfo(IsTeamPlay());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(Item.m_Type == NETOBJTYPE_PLAYERINFO)
|
else if(Item.m_Type == NETOBJTYPE_PLAYERINFO)
|
||||||
|
@ -2388,7 +2388,7 @@ void CGameClient::CClientStats::Reset()
|
||||||
m_FlagCaptures = 0;
|
m_FlagCaptures = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CGameClient::CClientData::UpdateRenderInfo(bool IsTeamPlay, int Conn)
|
void CGameClient::CClientData::UpdateRenderInfo(bool IsTeamPlay)
|
||||||
{
|
{
|
||||||
m_RenderInfo = m_SkinInfo;
|
m_RenderInfo = m_SkinInfo;
|
||||||
|
|
||||||
|
@ -2403,6 +2403,7 @@ void CGameClient::CClientData::UpdateRenderInfo(bool IsTeamPlay, int Conn)
|
||||||
m_RenderInfo.m_ColorFeet = color_cast<ColorRGBA>(ColorHSLA(aTeamColors[m_Team]));
|
m_RenderInfo.m_ColorFeet = color_cast<ColorRGBA>(ColorHSLA(aTeamColors[m_Team]));
|
||||||
|
|
||||||
// 0.7
|
// 0.7
|
||||||
|
for(auto &Sixup : m_RenderInfo.m_aSixup)
|
||||||
{
|
{
|
||||||
const ColorRGBA aTeamColorsSixup[2] = {
|
const ColorRGBA aTeamColorsSixup[2] = {
|
||||||
ColorRGBA(0.753f, 0.318f, 0.318f, 1.0f),
|
ColorRGBA(0.753f, 0.318f, 0.318f, 1.0f),
|
||||||
|
@ -2410,19 +2411,20 @@ void CGameClient::CClientData::UpdateRenderInfo(bool IsTeamPlay, int Conn)
|
||||||
const ColorRGBA aMarkingColorsSixup[2] = {
|
const ColorRGBA aMarkingColorsSixup[2] = {
|
||||||
ColorRGBA(0.824f, 0.345f, 0.345f, 1.0f),
|
ColorRGBA(0.824f, 0.345f, 0.345f, 1.0f),
|
||||||
ColorRGBA(0.345f, 0.514f, 0.824f, 1.0f)};
|
ColorRGBA(0.345f, 0.514f, 0.824f, 1.0f)};
|
||||||
float MarkingAlpha = m_RenderInfo.m_aSixup[Conn].m_aColors[protocol7::SKINPART_MARKING].a;
|
float MarkingAlpha = Sixup.m_aColors[protocol7::SKINPART_MARKING].a;
|
||||||
for(auto &Color : m_RenderInfo.m_aSixup[Conn].m_aColors)
|
for(auto &Color : Sixup.m_aColors)
|
||||||
Color = aTeamColorsSixup[m_Team];
|
Color = aTeamColorsSixup[m_Team];
|
||||||
if(MarkingAlpha > 0.1f)
|
if(MarkingAlpha > 0.1f)
|
||||||
m_RenderInfo.m_aSixup[Conn].m_aColors[protocol7::SKINPART_MARKING] = aMarkingColorsSixup[m_Team];
|
Sixup.m_aColors[protocol7::SKINPART_MARKING] = aMarkingColorsSixup[m_Team];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_RenderInfo.m_ColorBody = color_cast<ColorRGBA>(ColorHSLA(12829350));
|
m_RenderInfo.m_ColorBody = color_cast<ColorRGBA>(ColorHSLA(12829350));
|
||||||
m_RenderInfo.m_ColorFeet = color_cast<ColorRGBA>(ColorHSLA(12829350));
|
m_RenderInfo.m_ColorFeet = color_cast<ColorRGBA>(ColorHSLA(12829350));
|
||||||
for(auto &Color : m_RenderInfo.m_aSixup[Conn].m_aColors)
|
for(auto &Sixup : m_RenderInfo.m_aSixup)
|
||||||
Color = color_cast<ColorRGBA>(ColorHSLA(12829350));
|
for(auto &Color : Sixup.m_aColors)
|
||||||
|
Color = color_cast<ColorRGBA>(ColorHSLA(12829350));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3757,8 +3759,7 @@ void CGameClient::RefreshSkins()
|
||||||
Client.m_SkinInfo.m_OriginalRenderSkin.Reset();
|
Client.m_SkinInfo.m_OriginalRenderSkin.Reset();
|
||||||
Client.m_SkinInfo.m_ColorableRenderSkin.Reset();
|
Client.m_SkinInfo.m_ColorableRenderSkin.Reset();
|
||||||
}
|
}
|
||||||
for(int Dummy = 0; Dummy < NUM_DUMMIES; Dummy++)
|
Client.UpdateRenderInfo(IsTeamPlay());
|
||||||
Client.UpdateRenderInfo(IsTeamPlay(), Dummy);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for(auto &pComponent : m_vpAll)
|
for(auto &pComponent : m_vpAll)
|
||||||
|
|
|
@ -438,7 +438,7 @@ public:
|
||||||
bool m_SpecCharPresent;
|
bool m_SpecCharPresent;
|
||||||
vec2 m_SpecChar;
|
vec2 m_SpecChar;
|
||||||
|
|
||||||
void UpdateRenderInfo(bool IsTeamPlay, int Conn);
|
void UpdateRenderInfo(bool IsTeamPlay);
|
||||||
void Reset();
|
void Reset();
|
||||||
|
|
||||||
class CSixup
|
class CSixup
|
||||||
|
|
|
@ -196,7 +196,7 @@ void *CGameClient::TranslateGameMsg(int *pMsgId, CUnpacker *pUnpacker, int Conn)
|
||||||
{
|
{
|
||||||
m_aClients[pMsg7->m_ClientId].m_Team = pMsg7->m_Team;
|
m_aClients[pMsg7->m_ClientId].m_Team = pMsg7->m_Team;
|
||||||
m_pClient->m_TranslationContext.m_aClients[pMsg7->m_ClientId].m_Team = pMsg7->m_Team;
|
m_pClient->m_TranslationContext.m_aClients[pMsg7->m_ClientId].m_Team = pMsg7->m_Team;
|
||||||
m_aClients[pMsg7->m_ClientId].UpdateRenderInfo(IsTeamPlay(), Conn);
|
m_aClients[pMsg7->m_ClientId].UpdateRenderInfo(IsTeamPlay());
|
||||||
|
|
||||||
// if(pMsg7->m_ClientId == m_LocalClientId)
|
// if(pMsg7->m_ClientId == m_LocalClientId)
|
||||||
// {
|
// {
|
||||||
|
@ -620,10 +620,12 @@ void *CGameClient::TranslateGameMsg(int *pMsgId, CUnpacker *pUnpacker, int Conn)
|
||||||
switch(GameMsgId)
|
switch(GameMsgId)
|
||||||
{
|
{
|
||||||
case protocol7::GAMEMSG_CTF_DROP:
|
case protocol7::GAMEMSG_CTF_DROP:
|
||||||
m_Sounds.Enqueue(CSounds::CHN_GLOBAL, SOUND_CTF_DROP);
|
if(Conn == g_Config.m_ClDummy)
|
||||||
|
m_Sounds.Enqueue(CSounds::CHN_GLOBAL, SOUND_CTF_DROP);
|
||||||
break;
|
break;
|
||||||
case protocol7::GAMEMSG_CTF_RETURN:
|
case protocol7::GAMEMSG_CTF_RETURN:
|
||||||
m_Sounds.Enqueue(CSounds::CHN_GLOBAL, SOUND_CTF_RETURN);
|
if(Conn == g_Config.m_ClDummy)
|
||||||
|
m_Sounds.Enqueue(CSounds::CHN_GLOBAL, SOUND_CTF_RETURN);
|
||||||
break;
|
break;
|
||||||
case protocol7::GAMEMSG_TEAM_ALL:
|
case protocol7::GAMEMSG_TEAM_ALL:
|
||||||
{
|
{
|
||||||
|
@ -650,7 +652,8 @@ void *CGameClient::TranslateGameMsg(int *pMsgId, CUnpacker *pUnpacker, int Conn)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case protocol7::GAMEMSG_CTF_GRAB:
|
case protocol7::GAMEMSG_CTF_GRAB:
|
||||||
m_Sounds.Enqueue(CSounds::CHN_GLOBAL, SOUND_CTF_GRAB_EN);
|
if(Conn == g_Config.m_ClDummy)
|
||||||
|
m_Sounds.Enqueue(CSounds::CHN_GLOBAL, SOUND_CTF_GRAB_EN);
|
||||||
break;
|
break;
|
||||||
case protocol7::GAMEMSG_GAME_PAUSED:
|
case protocol7::GAMEMSG_GAME_PAUSED:
|
||||||
{
|
{
|
||||||
|
@ -660,7 +663,8 @@ void *CGameClient::TranslateGameMsg(int *pMsgId, CUnpacker *pUnpacker, int Conn)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case protocol7::GAMEMSG_CTF_CAPTURE:
|
case protocol7::GAMEMSG_CTF_CAPTURE:
|
||||||
m_Sounds.Enqueue(CSounds::CHN_GLOBAL, SOUND_CTF_CAPTURE);
|
if(Conn == g_Config.m_ClDummy)
|
||||||
|
m_Sounds.Enqueue(CSounds::CHN_GLOBAL, SOUND_CTF_CAPTURE);
|
||||||
int ClientId = clamp(aParaI[1], 0, MAX_CLIENTS - 1);
|
int ClientId = clamp(aParaI[1], 0, MAX_CLIENTS - 1);
|
||||||
m_aStats[ClientId].m_FlagCaptures++;
|
m_aStats[ClientId].m_FlagCaptures++;
|
||||||
|
|
||||||
|
|
|
@ -328,8 +328,10 @@ public:
|
||||||
bool CanFillGameTiles() const;
|
bool CanFillGameTiles() const;
|
||||||
void AddGroup();
|
void AddGroup();
|
||||||
void AddTileLayer();
|
void AddTileLayer();
|
||||||
|
void AddFrontLayer();
|
||||||
void LayerSelectImage();
|
void LayerSelectImage();
|
||||||
bool IsNonGameTileLayerSelected() const;
|
bool IsNonGameTileLayerSelected() const;
|
||||||
|
void MapDetails();
|
||||||
#define REGISTER_QUICK_ACTION(name, text, callback, disabled, active, button_color, description) CQuickAction m_QuickAction##name;
|
#define REGISTER_QUICK_ACTION(name, text, callback, disabled, active, button_color, description) CQuickAction m_QuickAction##name;
|
||||||
#include <game/editor/quick_actions.h>
|
#include <game/editor/quick_actions.h>
|
||||||
#undef REGISTER_QUICK_ACTION
|
#undef REGISTER_QUICK_ACTION
|
||||||
|
|
|
@ -32,7 +32,6 @@ CUi::EPopupMenuFunctionResult CEditor::PopupMenuFile(void *pContext, CUIRect Vie
|
||||||
static int s_OpenButton = 0;
|
static int s_OpenButton = 0;
|
||||||
static int s_OpenCurrentMapButton = 0;
|
static int s_OpenCurrentMapButton = 0;
|
||||||
static int s_AppendButton = 0;
|
static int s_AppendButton = 0;
|
||||||
static int s_MapInfoButton = 0;
|
|
||||||
static int s_ExitButton = 0;
|
static int s_ExitButton = 0;
|
||||||
|
|
||||||
CUIRect Slot;
|
CUIRect Slot;
|
||||||
|
@ -115,15 +114,9 @@ CUi::EPopupMenuFunctionResult CEditor::PopupMenuFile(void *pContext, CUIRect Vie
|
||||||
|
|
||||||
View.HSplitTop(10.0f, nullptr, &View);
|
View.HSplitTop(10.0f, nullptr, &View);
|
||||||
View.HSplitTop(12.0f, &Slot, &View);
|
View.HSplitTop(12.0f, &Slot, &View);
|
||||||
if(pEditor->DoButton_MenuItem(&s_MapInfoButton, "Map details", 0, &Slot, 0, "Adjust the map details of the current map"))
|
if(pEditor->DoButton_MenuItem(&pEditor->m_QuickActionMapDetails, pEditor->m_QuickActionMapDetails.Label(), 0, &Slot, 0, pEditor->m_QuickActionMapDetails.Description()))
|
||||||
{
|
{
|
||||||
const CUIRect *pScreen = pEditor->Ui()->Screen();
|
pEditor->m_QuickActionMapDetails.Call();
|
||||||
pEditor->m_Map.m_MapInfoTmp.Copy(pEditor->m_Map.m_MapInfo);
|
|
||||||
static SPopupMenuId s_PopupMapInfoId;
|
|
||||||
constexpr float PopupWidth = 400.0f;
|
|
||||||
constexpr float PopupHeight = 170.0f;
|
|
||||||
pEditor->Ui()->DoPopupMenu(&s_PopupMapInfoId, pScreen->w / 2.0f - PopupWidth / 2.0f, pScreen->h / 2.0f - PopupHeight / 2.0f, PopupWidth, PopupHeight, pEditor, PopupMapInfo);
|
|
||||||
pEditor->Ui()->SetActiveItem(nullptr);
|
|
||||||
return CUi::POPUP_CLOSE_CURRENT;
|
return CUi::POPUP_CLOSE_CURRENT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -543,16 +536,9 @@ CUi::EPopupMenuFunctionResult CEditor::PopupGroup(void *pContext, CUIRect View,
|
||||||
// new front layer
|
// new front layer
|
||||||
View.HSplitBottom(5.0f, &View, nullptr);
|
View.HSplitBottom(5.0f, &View, nullptr);
|
||||||
View.HSplitBottom(12.0f, &View, &Button);
|
View.HSplitBottom(12.0f, &View, &Button);
|
||||||
static int s_NewFrontLayerButton = 0;
|
if(pEditor->DoButton_Editor(&pEditor->m_QuickActionAddFrontLayer, pEditor->m_QuickActionAddFrontLayer.Label(), 0, &Button, 0, pEditor->m_QuickActionAddFrontLayer.Description()))
|
||||||
if(pEditor->DoButton_Editor(&s_NewFrontLayerButton, "Add front layer", 0, &Button, 0, "Creates a new item layer"))
|
|
||||||
{
|
{
|
||||||
std::shared_ptr<CLayer> pFrontLayer = std::make_shared<CLayerFront>(pEditor, pEditor->m_Map.m_pGameLayer->m_Width, pEditor->m_Map.m_pGameLayer->m_Height);
|
pEditor->m_QuickActionAddFrontLayer.Call();
|
||||||
pEditor->m_Map.MakeFrontLayer(pFrontLayer);
|
|
||||||
pEditor->m_Map.m_vpGroups[pEditor->m_SelectedGroup]->AddLayer(pFrontLayer);
|
|
||||||
int LayerIndex = pEditor->m_Map.m_vpGroups[pEditor->m_SelectedGroup]->m_vpLayers.size() - 1;
|
|
||||||
pEditor->SelectLayer(LayerIndex);
|
|
||||||
pEditor->m_pBrush->Clear();
|
|
||||||
pEditor->m_EditorHistory.RecordAction(std::make_shared<CEditorActionAddLayer>(pEditor, pEditor->m_SelectedGroup, LayerIndex));
|
|
||||||
return CUi::POPUP_CLOSE_CURRENT;
|
return CUi::POPUP_CLOSE_CURRENT;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,6 +37,17 @@ void CEditor::AddTileLayer()
|
||||||
m_EditorHistory.RecordAction(std::make_shared<CEditorActionAddLayer>(this, m_SelectedGroup, LayerIndex));
|
m_EditorHistory.RecordAction(std::make_shared<CEditorActionAddLayer>(this, m_SelectedGroup, LayerIndex));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CEditor::AddFrontLayer()
|
||||||
|
{
|
||||||
|
std::shared_ptr<CLayer> pFrontLayer = std::make_shared<CLayerFront>(this, m_Map.m_pGameLayer->m_Width, m_Map.m_pGameLayer->m_Height);
|
||||||
|
m_Map.MakeFrontLayer(pFrontLayer);
|
||||||
|
m_Map.m_vpGroups[m_SelectedGroup]->AddLayer(pFrontLayer);
|
||||||
|
int LayerIndex = m_Map.m_vpGroups[m_SelectedGroup]->m_vpLayers.size() - 1;
|
||||||
|
SelectLayer(LayerIndex);
|
||||||
|
m_pBrush->Clear();
|
||||||
|
m_EditorHistory.RecordAction(std::make_shared<CEditorActionAddLayer>(this, m_SelectedGroup, LayerIndex));
|
||||||
|
}
|
||||||
|
|
||||||
bool CEditor::IsNonGameTileLayerSelected() const
|
bool CEditor::IsNonGameTileLayerSelected() const
|
||||||
{
|
{
|
||||||
std::shared_ptr<CLayer> pLayer = GetSelectedLayer(0);
|
std::shared_ptr<CLayer> pLayer = GetSelectedLayer(0);
|
||||||
|
@ -69,3 +80,21 @@ void CEditor::LayerSelectImage()
|
||||||
Ui()->DoPopupMenu(&s_LayerPopupContext, Ui()->MouseX(), Ui()->MouseY(), 120, 270, &s_LayerPopupContext, PopupLayer);
|
Ui()->DoPopupMenu(&s_LayerPopupContext, Ui()->MouseX(), Ui()->MouseY(), 120, 270, &s_LayerPopupContext, PopupLayer);
|
||||||
PopupSelectImageInvoke(pTiles->m_Image, Ui()->MouseX(), Ui()->MouseY());
|
PopupSelectImageInvoke(pTiles->m_Image, Ui()->MouseX(), Ui()->MouseY());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CEditor::MapDetails()
|
||||||
|
{
|
||||||
|
const CUIRect *pScreen = Ui()->Screen();
|
||||||
|
m_Map.m_MapInfoTmp.Copy(m_Map.m_MapInfo);
|
||||||
|
static SPopupMenuId s_PopupMapInfoId;
|
||||||
|
constexpr float PopupWidth = 400.0f;
|
||||||
|
constexpr float PopupHeight = 170.0f;
|
||||||
|
Ui()->DoPopupMenu(
|
||||||
|
&s_PopupMapInfoId,
|
||||||
|
pScreen->w / 2.0f - PopupWidth / 2.0f,
|
||||||
|
pScreen->h / 2.0f - PopupHeight / 2.0f,
|
||||||
|
PopupWidth,
|
||||||
|
PopupHeight,
|
||||||
|
this,
|
||||||
|
PopupMapInfo);
|
||||||
|
Ui()->SetActiveItem(nullptr);
|
||||||
|
}
|
||||||
|
|
|
@ -169,6 +169,14 @@ REGISTER_QUICK_ACTION(
|
||||||
"Toggles proof borders. These borders represent the area that a player can see with default zoom.")
|
"Toggles proof borders. These borders represent the area that a player can see with default zoom.")
|
||||||
REGISTER_QUICK_ACTION(
|
REGISTER_QUICK_ACTION(
|
||||||
AddTileLayer, "Add tile layer", [&]() { AddTileLayer(); }, ALWAYS_FALSE, ALWAYS_FALSE, DEFAULT_BTN, "Creates a new tile layer.")
|
AddTileLayer, "Add tile layer", [&]() { AddTileLayer(); }, ALWAYS_FALSE, ALWAYS_FALSE, DEFAULT_BTN, "Creates a new tile layer.")
|
||||||
|
REGISTER_QUICK_ACTION(
|
||||||
|
AddFrontLayer,
|
||||||
|
"Add front layer",
|
||||||
|
[&]() { AddFrontLayer(); },
|
||||||
|
[&]() -> bool { return !GetSelectedGroup()->m_GameGroup || m_Map.m_pFrontLayer; },
|
||||||
|
ALWAYS_FALSE,
|
||||||
|
DEFAULT_BTN,
|
||||||
|
"Creates a new item layer.")
|
||||||
REGISTER_QUICK_ACTION(
|
REGISTER_QUICK_ACTION(
|
||||||
SaveAs,
|
SaveAs,
|
||||||
"Save As",
|
"Save As",
|
||||||
|
@ -276,6 +284,14 @@ REGISTER_QUICK_ACTION(
|
||||||
[&]() -> bool { return m_ColorPipetteActive; },
|
[&]() -> bool { return m_ColorPipetteActive; },
|
||||||
DEFAULT_BTN,
|
DEFAULT_BTN,
|
||||||
"[Ctrl+Shift+C] Color pipette. Pick a color from the screen by clicking on it.")
|
"[Ctrl+Shift+C] Color pipette. Pick a color from the screen by clicking on it.")
|
||||||
|
REGISTER_QUICK_ACTION(
|
||||||
|
MapDetails,
|
||||||
|
"Map details",
|
||||||
|
[&]() { MapDetails(); },
|
||||||
|
ALWAYS_FALSE,
|
||||||
|
ALWAYS_FALSE,
|
||||||
|
DEFAULT_BTN,
|
||||||
|
"Adjust the map details of the current map.")
|
||||||
|
|
||||||
#undef ALWAYS_FALSE
|
#undef ALWAYS_FALSE
|
||||||
#undef DEFAULT_BTN
|
#undef DEFAULT_BTN
|
||||||
|
|
|
@ -893,6 +893,12 @@ void CGameContext::ConReloadCensorlist(IConsole::IResult *pResult, void *pUserDa
|
||||||
pSelf->ReadCensorList();
|
pSelf->ReadCensorList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CGameContext::ConReloadAnnouncement(IConsole::IResult *pResult, void *pUserData)
|
||||||
|
{
|
||||||
|
CGameContext *pSelf = (CGameContext *)pUserData;
|
||||||
|
pSelf->Server()->ReadAnnouncementsFile(g_Config.m_SvAnnouncementFileName);
|
||||||
|
}
|
||||||
|
|
||||||
void CGameContext::ConDumpAntibot(IConsole::IResult *pResult, void *pUserData)
|
void CGameContext::ConDumpAntibot(IConsole::IResult *pResult, void *pUserData)
|
||||||
{
|
{
|
||||||
CGameContext *pSelf = (CGameContext *)pUserData;
|
CGameContext *pSelf = (CGameContext *)pUserData;
|
||||||
|
|
|
@ -1253,7 +1253,7 @@ void CGameContext::OnTick()
|
||||||
|
|
||||||
if(Server()->Tick() % (g_Config.m_SvAnnouncementInterval * Server()->TickSpeed() * 60) == 0)
|
if(Server()->Tick() % (g_Config.m_SvAnnouncementInterval * Server()->TickSpeed() * 60) == 0)
|
||||||
{
|
{
|
||||||
const char *pLine = Server()->GetAnnouncementLine(g_Config.m_SvAnnouncementFileName);
|
const char *pLine = Server()->GetAnnouncementLine();
|
||||||
if(pLine)
|
if(pLine)
|
||||||
SendChat(-1, TEAM_ALL, pLine);
|
SendChat(-1, TEAM_ALL, pLine);
|
||||||
}
|
}
|
||||||
|
@ -3643,6 +3643,7 @@ void CGameContext::OnConsoleInit()
|
||||||
Console()->Register("set_team_all", "i[team-id]", CFGFLAG_SERVER, ConSetTeamAll, this, "Set team of all players to team");
|
Console()->Register("set_team_all", "i[team-id]", CFGFLAG_SERVER, ConSetTeamAll, this, "Set team of all players to team");
|
||||||
Console()->Register("hot_reload", "", CFGFLAG_SERVER | CMDFLAG_TEST, ConHotReload, this, "Reload the map while preserving the state of tees and teams");
|
Console()->Register("hot_reload", "", CFGFLAG_SERVER | CMDFLAG_TEST, ConHotReload, this, "Reload the map while preserving the state of tees and teams");
|
||||||
Console()->Register("reload_censorlist", "", CFGFLAG_SERVER, ConReloadCensorlist, this, "Reload the censorlist");
|
Console()->Register("reload_censorlist", "", CFGFLAG_SERVER, ConReloadCensorlist, this, "Reload the censorlist");
|
||||||
|
Console()->Register("reload_announcement", "", CFGFLAG_SERVER, ConReloadAnnouncement, this, "Reload the announcements");
|
||||||
|
|
||||||
Console()->Register("add_vote", "s[name] r[command]", CFGFLAG_SERVER, ConAddVote, this, "Add a voting option");
|
Console()->Register("add_vote", "s[name] r[command]", CFGFLAG_SERVER, ConAddVote, this, "Add a voting option");
|
||||||
Console()->Register("remove_vote", "r[name]", CFGFLAG_SERVER, ConRemoveVote, this, "remove a voting option");
|
Console()->Register("remove_vote", "r[name]", CFGFLAG_SERVER, ConRemoveVote, this, "remove a voting option");
|
||||||
|
|
|
@ -516,6 +516,7 @@ private:
|
||||||
static void ConUnFreezeHammer(IConsole::IResult *pResult, void *pUserData);
|
static void ConUnFreezeHammer(IConsole::IResult *pResult, void *pUserData);
|
||||||
|
|
||||||
static void ConReloadCensorlist(IConsole::IResult *pResult, void *pUserData);
|
static void ConReloadCensorlist(IConsole::IResult *pResult, void *pUserData);
|
||||||
|
static void ConReloadAnnouncement(IConsole::IResult *pResult, void *pUserData);
|
||||||
|
|
||||||
CCharacter *GetPracticeCharacter(IConsole::IResult *pResult);
|
CCharacter *GetPracticeCharacter(IConsole::IResult *pResult);
|
||||||
|
|
||||||
|
|
|
@ -1028,7 +1028,7 @@ bool CScoreWorker::ShowTop(IDbConnection *pSqlServer, const ISqlData *pGameData,
|
||||||
|
|
||||||
if(!g_Config.m_SvRegionalRankings)
|
if(!g_Config.m_SvRegionalRankings)
|
||||||
{
|
{
|
||||||
str_copy(pResult->m_Data.m_aaMessages[Line], "----------------------------------------", sizeof(pResult->m_Data.m_aaMessages[Line]));
|
str_copy(pResult->m_Data.m_aaMessages[Line], "-----------------------------------------", sizeof(pResult->m_Data.m_aaMessages[Line]));
|
||||||
return !End;
|
return !End;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1146,7 +1146,7 @@ bool CScoreWorker::ShowTeamTop5(IDbConnection *pSqlServer, const ISqlData *pGame
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
str_copy(paMessages[Line], "-------------------------------", sizeof(paMessages[Line]));
|
str_copy(paMessages[Line], "---------------------------------", sizeof(paMessages[Line]));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1230,7 +1230,7 @@ bool CScoreWorker::ShowPlayerTeamTop5(IDbConnection *pSqlServer, const ISqlData
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
str_copy(paMessages[Line], "-------------------------------", sizeof(paMessages[Line]));
|
str_copy(paMessages[Line], "---------------------------------", sizeof(paMessages[Line]));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -1352,7 +1352,7 @@ bool CScoreWorker::ShowTimes(IDbConnection *pSqlServer, const ISqlData *pGameDat
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
str_copy(paMessages[Line], "----------------------------------------------------", sizeof(paMessages[Line]));
|
str_copy(paMessages[Line], "-------------------------------------------", sizeof(paMessages[Line]));
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -160,7 +160,7 @@ TEST_P(SingleScore, Top)
|
||||||
ExpectLines(m_pPlayerResult,
|
ExpectLines(m_pPlayerResult,
|
||||||
{"------------ Global Top ------------",
|
{"------------ Global Top ------------",
|
||||||
"1. nameless tee Time: 01:40.00",
|
"1. nameless tee Time: 01:40.00",
|
||||||
"----------------------------------------"});
|
"-----------------------------------------"});
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_P(SingleScore, RankRegional)
|
TEST_P(SingleScore, RankRegional)
|
||||||
|
@ -197,7 +197,7 @@ TEST_P(SingleScore, TopServer)
|
||||||
ExpectLines(m_pPlayerResult,
|
ExpectLines(m_pPlayerResult,
|
||||||
{"------------ Global Top ------------",
|
{"------------ Global Top ------------",
|
||||||
"1. nameless tee Time: 01:40.00",
|
"1. nameless tee Time: 01:40.00",
|
||||||
"----------------------------------------"});
|
"-----------------------------------------"});
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_P(SingleScore, RankServerRegional)
|
TEST_P(SingleScore, RankServerRegional)
|
||||||
|
@ -264,7 +264,7 @@ TEST_P(SingleScore, TimesExists)
|
||||||
|
|
||||||
str_copy(aBuf, m_pPlayerResult->m_Data.m_aaMessages[1] + str_length(m_pPlayerResult->m_Data.m_aaMessages[1]) - 10, 11);
|
str_copy(aBuf, m_pPlayerResult->m_Data.m_aaMessages[1] + str_length(m_pPlayerResult->m_Data.m_aaMessages[1]) - 10, 11);
|
||||||
EXPECT_STREQ(aBuf, ", 01:40.00");
|
EXPECT_STREQ(aBuf, ", 01:40.00");
|
||||||
EXPECT_STREQ(m_pPlayerResult->m_Data.m_aaMessages[2], "----------------------------------------------------");
|
EXPECT_STREQ(m_pPlayerResult->m_Data.m_aaMessages[2], "-------------------------------------------");
|
||||||
for(int i = 3; i < CScorePlayerResult::MAX_MESSAGES; i++)
|
for(int i = 3; i < CScorePlayerResult::MAX_MESSAGES; i++)
|
||||||
{
|
{
|
||||||
EXPECT_STREQ(m_pPlayerResult->m_Data.m_aaMessages[i], "");
|
EXPECT_STREQ(m_pPlayerResult->m_Data.m_aaMessages[i], "");
|
||||||
|
@ -321,7 +321,7 @@ TEST_P(TeamScore, All)
|
||||||
ExpectLines(m_pPlayerResult,
|
ExpectLines(m_pPlayerResult,
|
||||||
{"------- Team Top 5 -------",
|
{"------- Team Top 5 -------",
|
||||||
"1. brainless tee & nameless tee Team Time: 01:40.00",
|
"1. brainless tee & nameless tee Team Time: 01:40.00",
|
||||||
"-------------------------------"});
|
"---------------------------------"});
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_P(TeamScore, PlayerExists)
|
TEST_P(TeamScore, PlayerExists)
|
||||||
|
@ -331,7 +331,7 @@ TEST_P(TeamScore, PlayerExists)
|
||||||
ExpectLines(m_pPlayerResult,
|
ExpectLines(m_pPlayerResult,
|
||||||
{"------- Team Top 5 -------",
|
{"------- Team Top 5 -------",
|
||||||
"1. brainless tee & nameless tee Team Time: 01:40.00",
|
"1. brainless tee & nameless tee Team Time: 01:40.00",
|
||||||
"-------------------------------"});
|
"---------------------------------"});
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_P(TeamScore, PlayerDoesntExist)
|
TEST_P(TeamScore, PlayerDoesntExist)
|
||||||
|
@ -349,7 +349,7 @@ TEST_P(TeamScore, RankUpdates)
|
||||||
ExpectLines(m_pPlayerResult,
|
ExpectLines(m_pPlayerResult,
|
||||||
{"------- Team Top 5 -------",
|
{"------- Team Top 5 -------",
|
||||||
"1. brainless tee & nameless tee Team Time: 01:38.00",
|
"1. brainless tee & nameless tee Team Time: 01:38.00",
|
||||||
"-------------------------------"});
|
"---------------------------------"});
|
||||||
}
|
}
|
||||||
|
|
||||||
struct MapInfo : public Score
|
struct MapInfo : public Score
|
||||||
|
|
Loading…
Reference in a new issue