mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
Removed sv_broadcAst
this commit is funny cause it was made from my iPhone and it only took 8 minutes
This commit is contained in:
parent
bee10fda8f
commit
c1962bff25
|
@ -96,7 +96,6 @@ MACRO_CONFIG_INT(DbgResizable, dbg_resizable, 0, 0, 0, CFGFLAG_CLIENT, "Enables
|
|||
// DDRace
|
||||
|
||||
MACRO_CONFIG_STR(SvWelcome, sv_welcome, 64, "", CFGFLAG_SERVER, "Message that will be displayed to players who join the server", IConsole::CONSOLELEVEL_ADMIN)
|
||||
MACRO_CONFIG_STR(SvBroadcast, sv_broadcast, 64, "DDRace.info Trunk 0.5", CFGFLAG_SERVER, "The broadcasting message", IConsole::CONSOLELEVEL_ADMIN)
|
||||
MACRO_CONFIG_INT(SvReservedSlots, sv_reserved_slots, 0, 0, 16, CFGFLAG_SERVER, "The number of slots that are reserved for special players", IConsole::CONSOLELEVEL_ADMIN)
|
||||
MACRO_CONFIG_STR(SvReservedSlotsPass, sv_reserved_slots_pass, 32, "", CFGFLAG_SERVER, "The password that is required to use a reserved slot", IConsole::CONSOLELEVEL_ADMIN)
|
||||
MACRO_CONFIG_STR(SvRconPasswordAdmin, sv_admin_pass, 32, "", CFGFLAG_SERVER, "Remote console administrator password", IConsole::CONSOLELEVEL_ADMIN)
|
||||
|
|
|
@ -358,7 +358,6 @@ void CConsole::ExecuteLineStroked(int Stroke, const char *pStr, int ClientID, in
|
|||
{
|
||||
m_Cheated = true;
|
||||
Result.Print(OUTPUT_LEVEL_STANDARD, "Cheated", "You have cheated, no records will be saved until server shutdown");
|
||||
str_format(g_Config.m_SvBroadcast, sizeof(g_Config.m_SvBroadcast), "Cheated: No records will be saved");
|
||||
}
|
||||
if (Result.HasVictim())
|
||||
{
|
||||
|
|
|
@ -1082,54 +1082,16 @@ void CCharacter::HandleBroadcast()
|
|||
char aBroadcast[128];
|
||||
m_Time = (float)(Server()->Tick() - m_StartTime) / ((float)Server()->TickSpeed());
|
||||
CPlayerData *pData = GameServer()->Score()->PlayerData(m_pPlayer->GetCID());
|
||||
|
||||
if(Server()->Tick() - m_RefreshTime >= Server()->TickSpeed())
|
||||
// Todo:DDRace:GreYFoX: optimize these if statements, editing from iphone is not easy
|
||||
if(m_DDRaceState == DDRACE_STARTED && Server()->Tick() - m_RefreshTime >= Server()->TickSpeed())
|
||||
{
|
||||
if (m_DDRaceState == DDRACE_STARTED)
|
||||
if(m_CpActive != -1 && m_CpTick > Server()->Tick() && !m_pPlayer->m_IsUsingDDRaceClient)
|
||||
{
|
||||
if(m_CpActive != -1 && m_CpTick > Server()->Tick() && !m_pPlayer->m_IsUsingDDRaceClient)
|
||||
if(pData->m_BestTime && pData->m_aBestCpTime[m_CpActive] != 0)
|
||||
{
|
||||
if(pData->m_BestTime && pData->m_aBestCpTime[m_CpActive] != 0)
|
||||
{
|
||||
float Diff = m_CpCurrent[m_CpActive] - pData->m_aBestCpTime[m_CpActive];
|
||||
str_format(aBroadcast, sizeof(aBroadcast), "Checkpoint | Diff : %+5.2f", Diff);
|
||||
GameServer()->SendBroadcast(aBroadcast, m_pPlayer->GetCID());
|
||||
m_LastBroadcast = Server()->Tick();
|
||||
}
|
||||
}
|
||||
else if( g_Config.m_SvBroadcast[0] != 0 && m_BroadCast)
|
||||
{
|
||||
str_format(aBroadcast, sizeof(aBroadcast), "%s", g_Config.m_SvBroadcast);
|
||||
|
||||
if(Server()->Tick() >= (m_LastBroadcast + Server()->TickSpeed()))
|
||||
{
|
||||
GameServer()->SendBroadcast(aBroadcast, m_pPlayer->GetCID());
|
||||
m_LastBroadcast = Server()->Tick();
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
char aTmp[128];
|
||||
if(!m_pPlayer->m_IsUsingDDRaceClient)
|
||||
{
|
||||
if( g_Config.m_SvBroadcast[0] != 0 && (Server()->Tick() > (m_LastBroadcast + (Server()->TickSpeed() * 9))))
|
||||
{
|
||||
char aYourBest[64],aServerBest[64];
|
||||
str_format(aYourBest, sizeof(aYourBest), "Your Best:'%s%d:%s%d'", ((pData->m_BestTime / 60) < 10)?"0":"", (int)(pData->m_BestTime / 60), (((int)pData->m_BestTime % 60) < 10)?"0":"", (int)pData->m_BestTime % 60);
|
||||
|
||||
CPlayerData *pData = GameServer()->Score()->PlayerData(m_pPlayer->GetCID());
|
||||
|
||||
str_format(aServerBest, sizeof(aServerBest), "Server Best:'%s%d:%s%d'", ((GameServer()->m_pController->m_CurrentRecord / 60) < 10)?"0":"", (int)(GameServer()->m_pController->m_CurrentRecord / 60), (((int)GameServer()->m_pController->m_CurrentRecord % 60) < 10)?"0":"", (int)GameServer()->m_pController->m_CurrentRecord % 60);
|
||||
str_format(aTmp, sizeof(aTmp), "%s %s", (GameServer()->m_pController->m_CurrentRecord)?aServerBest:"", (pData->m_BestTime)?aYourBest:"");
|
||||
GameServer()->SendBroadcast(aTmp, m_pPlayer->GetCID());
|
||||
m_LastBroadcast = Server()->Tick();
|
||||
}
|
||||
}
|
||||
else if( g_Config.m_SvBroadcast[0] != 0 && (Server()->Tick() > (m_LastBroadcast + (Server()->TickSpeed() * 9))))
|
||||
{
|
||||
str_format(aTmp, sizeof(aTmp), "%s", g_Config.m_SvBroadcast);
|
||||
GameServer()->SendBroadcast(aTmp, m_pPlayer->GetCID());
|
||||
float Diff = m_CpCurrent[m_CpActive] - pData->m_aBestCpTime[m_CpActive];
|
||||
str_format(aBroadcast, sizeof(aBroadcast), "Checkpoint | Diff : %+5.2f", Diff);
|
||||
GameServer()->SendBroadcast(aBroadcast, m_pPlayer->GetCID());
|
||||
m_LastBroadcast = Server()->Tick();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue