mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
Added the following settings to Close #123.
sv_time_in_broadcast, 1, 0, 1, CFGFLAG_SERVER, "Whether to display time in broadcast every interval or not by default, later the choice can be changed by players via chat commands" sv_time_in_broadcast_interval, 1, 0, 60, CFGFLAG_SERVER, "How often to update the broadcast time" sv_time_in_gametimer, 0, 0, 1, CFGFLAG_SERVER, "Whether to display time in the round/game timer or not by default, later the choice can be changed by players via chat commands" Added the following Chat commands to give the player the choice over their settings: "saytime", "", CFGFLAG_CHAT|CFGFLAG_SERVER, ConSayTime, this, "Privately messages you your current time in this current running race" "saytimeall", "", CFGFLAG_CHAT|CFGFLAG_SERVER, ConSayTimeAll, this, "Publicly messages everyone your current time in this current running race" "time", "", CFGFLAG_CHAT|CFGFLAG_SERVER, ConTime, this, "Privately shows you your current time in this current running race in the broadcast message" "broadcasttime", "?s", CFGFLAG_CHAT|CFGFLAG_SERVER, ConSetBroadcastTime, this, "Personal Setting of showing time in the broadcast, broadcasttime s, where s = on for on, off for off, toggle for toggle and nothing to show current status" "servergametime", "?s", CFGFLAG_CHAT|CFGFLAG_SERVER, ConSetServerGameTime, this, "Personal Setting of showing time in the round/game timer, servergametime s, where s = on for on off for off, toggle for toggle and nothing to show current status" Fixed Chat Command "eyeemote" and made it a set + toggle instead of just toggle for better bin techneques Moved some vars from CCharacter to CPlayer to keep their status evern after death but not after disconnect. So now players have the choice to see which timer they wanna see if any. Note: These changes are all untested Stay away from this update on your main server until they are tested, i don't even know if they will compile propperly
This commit is contained in:
parent
ff6b9609f3
commit
799f4de2b3
|
@ -196,6 +196,9 @@ MACRO_CONFIG_INT(SvVotePauseTime, sv_vote_pause_time, 10, 0, 360, CFGFLAG_SERVER
|
|||
MACRO_CONFIG_INT(SvTuneReset, sv_tune_reset, 0, 0, 1, CFGFLAG_SERVER, "Whether tuning is reset after each map change or not")
|
||||
MACRO_CONFIG_INT(SvDDRaceTuneReset, sv_ddrace_tune_reset, 1, 0, 1, CFGFLAG_SERVER, "Whether DDRace tuning(sv_hit, Sv_Endless_Drag & Sv_Old_Laser) is reset after each map change or not")
|
||||
MACRO_CONFIG_INT(SvNamelessScore, sv_nameless_score, 0, 0, 1, CFGFLAG_SERVER, "Whether nameless tee has a score or not")
|
||||
MACRO_CONFIG_INT(SvTimeInBroadcast, sv_time_in_broadcast, 1, 0, 1, CFGFLAG_SERVER, "Whether to display time in broadcast every interval or not by default, later the choice can be changed by players via chat commands")
|
||||
MACRO_CONFIG_INT(SvTimeInBroadcastInterval, sv_time_in_broadcast_interval, 1, 0, 60, CFGFLAG_SERVER, "How often to update the broadcast time")
|
||||
MACRO_CONFIG_INT(SvTimeInGameTimer, sv_time_in_gametimer, 0, 0, 1, CFGFLAG_SERVER, "Whether to display time in the round/game timer or not by default, later the choice can be changed by players via chat commands")
|
||||
|
||||
|
||||
// these might need some fine tuning
|
||||
|
|
|
@ -607,7 +607,7 @@ void CGameContext::ConMe(IConsole::IResult *pResult, void *pUserData)
|
|||
"/me is disabled on this server, admin can enable it by using sv_slash_me");
|
||||
}
|
||||
|
||||
void CGameContext::ConToggleEyeEmote(IConsole::IResult *pResult,
|
||||
void CGameContext::ConSetEyeEmote(IConsole::IResult *pResult,
|
||||
void *pUserData)
|
||||
{
|
||||
CGameContext *pSelf = (CGameContext *) pUserData;
|
||||
|
@ -617,15 +617,25 @@ void CGameContext::ConToggleEyeEmote(IConsole::IResult *pResult,
|
|||
CPlayer *pPlayer = pSelf->m_apPlayers[pResult->m_ClientID];
|
||||
if (!pPlayer)
|
||||
return;
|
||||
CCharacter* pChr = pPlayer->GetCharacter();
|
||||
if (!pChr)
|
||||
if(pResult->NumArguments() == 0) {
|
||||
pSelf->Console()->Print(
|
||||
IConsole::OUTPUT_LEVEL_STANDARD,
|
||||
"emote",
|
||||
(pPlayer->m_EyeEmote) ?
|
||||
"You can now use the preset eye emotes." :
|
||||
"You don't have any eye emotes, remember to bind some. (until you die)");
|
||||
return;
|
||||
|
||||
pChr->m_EyeEmote = !pChr->m_EyeEmote;
|
||||
}
|
||||
else if(str_comp_nocase(pResult->GetString(0), "on"))
|
||||
pPlayer->m_EyeEmote = true;
|
||||
else if(str_comp_nocase(pResult->GetString(0), "off"))
|
||||
pPlayer->m_EyeEmote = false;
|
||||
else if(str_comp_nocase(pResult->GetString(0), "toggle"))
|
||||
pPlayer->m_EyeEmote = !pPlayer->m_EyeEmote;
|
||||
pSelf->Console()->Print(
|
||||
IConsole::OUTPUT_LEVEL_STANDARD,
|
||||
"emote",
|
||||
(pChr->m_EyeEmote) ?
|
||||
(pPlayer->m_EyeEmote) ?
|
||||
"You can now use the preset eye emotes." :
|
||||
"You don't have any eye emotes, remember to bind some. (until you die)");
|
||||
}
|
||||
|
@ -646,9 +656,6 @@ void CGameContext::ConEyeEmote(IConsole::IResult *pResult, void *pUserData)
|
|||
CPlayer *pPlayer = pSelf->m_apPlayers[pResult->m_ClientID];
|
||||
if (!pPlayer)
|
||||
return;
|
||||
CCharacter* pChr = pPlayer->GetCharacter();
|
||||
if (!pChr)
|
||||
return;
|
||||
|
||||
if (pResult->NumArguments() == 0)
|
||||
{
|
||||
|
@ -663,25 +670,23 @@ void CGameContext::ConEyeEmote(IConsole::IResult *pResult, void *pUserData)
|
|||
}
|
||||
else
|
||||
{
|
||||
if (pChr)
|
||||
{
|
||||
if(pPlayer->m_LastEyeEmote + g_Config.m_SvEyeEmoteChangeDelay * pSelf->Server()->TickSpeed() >= pSelf->Server()->Tick())
|
||||
return;
|
||||
|
||||
if (!str_comp(pResult->GetString(0), "angry"))
|
||||
pChr->m_DefEmote = EMOTE_ANGRY;
|
||||
pPlayer->m_DefEmote = EMOTE_ANGRY;
|
||||
else if (!str_comp(pResult->GetString(0), "blink"))
|
||||
pChr->m_DefEmote = EMOTE_BLINK;
|
||||
pPlayer->m_DefEmote = EMOTE_BLINK;
|
||||
else if (!str_comp(pResult->GetString(0), "close"))
|
||||
pChr->m_DefEmote = EMOTE_BLINK;
|
||||
pPlayer->m_DefEmote = EMOTE_BLINK;
|
||||
else if (!str_comp(pResult->GetString(0), "happy"))
|
||||
pChr->m_DefEmote = EMOTE_HAPPY;
|
||||
pPlayer->m_DefEmote = EMOTE_HAPPY;
|
||||
else if (!str_comp(pResult->GetString(0), "pain"))
|
||||
pChr->m_DefEmote = EMOTE_PAIN;
|
||||
pPlayer->m_DefEmote = EMOTE_PAIN;
|
||||
else if (!str_comp(pResult->GetString(0), "surprise"))
|
||||
pChr->m_DefEmote = EMOTE_SURPRISE;
|
||||
pPlayer->m_DefEmote = EMOTE_SURPRISE;
|
||||
else if (!str_comp(pResult->GetString(0), "normal"))
|
||||
pChr->m_DefEmote = EMOTE_NORMAL;
|
||||
pPlayer->m_DefEmote = EMOTE_NORMAL;
|
||||
else
|
||||
pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD,
|
||||
"emote", "Unknown emote... Say /emote");
|
||||
|
@ -690,10 +695,9 @@ void CGameContext::ConEyeEmote(IConsole::IResult *pResult, void *pUserData)
|
|||
if (pResult->NumArguments() > 1)
|
||||
Duration = pResult->GetInteger(1);
|
||||
|
||||
pChr->m_DefEmoteReset = pSelf->Server()->Tick()
|
||||
pPlayer->m_DefEmoteReset = pSelf->Server()->Tick()
|
||||
+ Duration * pSelf->Server()->TickSpeed();
|
||||
pPlayer->m_LastEyeEmote = pSelf->Server()->Tick();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -736,3 +740,137 @@ bool CheckClientID(int ClientID)
|
|||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void CGameContext::ConSayTime(IConsole::IResult *pResult, void *pUserData)
|
||||
{
|
||||
CGameContext *pSelf = (CGameContext *) pUserData;
|
||||
if (!CheckClientID(pResult->m_ClientID))
|
||||
return;
|
||||
|
||||
CPlayer *pPlayer = pSelf->m_apPlayers[pResult->m_ClientID];
|
||||
if (!pPlayer)
|
||||
return;
|
||||
CCharacter* pChr = pPlayer->GetCharacter();
|
||||
if (!pChr)
|
||||
return;
|
||||
|
||||
char aBuftime[64];
|
||||
int IntTime = (int) ((float) (pSelf->Server()->Tick() - pChr->m_StartTime)
|
||||
/ ((float) pSelf->Server()->TickSpeed()));
|
||||
str_format(aBuftime, sizeof(aBuftime), "Your Time is %s%d:%s%d",
|
||||
((IntTime / 60) > 9) ? "" : "0", IntTime / 60,
|
||||
((IntTime % 60) > 9) ? "" : "0", IntTime % 60);
|
||||
pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "time", aBuftime);
|
||||
}
|
||||
|
||||
void CGameContext::ConSayTimeAll(IConsole::IResult *pResult, void *pUserData)
|
||||
{
|
||||
CGameContext *pSelf = (CGameContext *) pUserData;
|
||||
if (!CheckClientID(pResult->m_ClientID))
|
||||
return;
|
||||
|
||||
CPlayer *pPlayer = pSelf->m_apPlayers[pResult->m_ClientID];
|
||||
if (!pPlayer)
|
||||
return;
|
||||
CCharacter* pChr = pPlayer->GetCharacter();
|
||||
if (!pChr)
|
||||
return;
|
||||
|
||||
char aBuftime[64];
|
||||
int IntTime = (int) ((float) (pSelf->Server()->Tick() - pChr->m_StartTime)
|
||||
/ ((float) pSelf->Server()->TickSpeed()));
|
||||
str_format(aBuftime, sizeof(aBuftime),
|
||||
"%s\'s current race time is %s%d:%s%d",
|
||||
pSelf->Server()->ClientName(pResult->m_ClientID),
|
||||
((IntTime / 60) > 9) ? "" : "0", IntTime / 60,
|
||||
((IntTime % 60) > 9) ? "" : "0", IntTime % 60);
|
||||
pSelf->SendChat(-1, CGameContext::CHAT_ALL, aBuftime, pResult->m_ClientID);
|
||||
}
|
||||
|
||||
void CGameContext::ConTime(IConsole::IResult *pResult, void *pUserData)
|
||||
{
|
||||
CGameContext *pSelf = (CGameContext *) pUserData;
|
||||
if (!CheckClientID(pResult->m_ClientID))
|
||||
return;
|
||||
|
||||
CPlayer *pPlayer = pSelf->m_apPlayers[pResult->m_ClientID];
|
||||
if (!pPlayer)
|
||||
return;
|
||||
CCharacter* pChr = pPlayer->GetCharacter();
|
||||
if (!pChr)
|
||||
return;
|
||||
|
||||
char aBuftime[64];
|
||||
int IntTime = (int) ((float) (pSelf->Server()->Tick() - pChr->m_StartTime)
|
||||
/ ((float) pSelf->Server()->TickSpeed()));
|
||||
str_format(aBuftime, sizeof(aBuftime), "Your Time is %s%d:%s%d",
|
||||
((IntTime / 60) > 9) ? "" : "0", IntTime / 60,
|
||||
((IntTime % 60) > 9) ? "" : "0", IntTime % 60);
|
||||
pSelf->SendBroadcast(aBuftime, pResult->m_ClientID);
|
||||
}
|
||||
|
||||
void CGameContext::ConSetBroadcastTime(IConsole::IResult *pResult, void *pUserData)
|
||||
{
|
||||
CGameContext *pSelf = (CGameContext *) pUserData;
|
||||
if (!CheckClientID(pResult->m_ClientID))
|
||||
return;
|
||||
|
||||
CPlayer *pPlayer = pSelf->m_apPlayers[pResult->m_ClientID];
|
||||
if (!pPlayer)
|
||||
return;
|
||||
if(pResult->NumArguments() == 0) {
|
||||
pSelf->Console()->Print(
|
||||
IConsole::OUTPUT_LEVEL_STANDARD,
|
||||
"emote",
|
||||
(pPlayer->m_BroadcastTime) ?
|
||||
"Time is displayed in broadcast now." :
|
||||
"Time will not be displayed in broadcast now");
|
||||
return;
|
||||
}
|
||||
else if(str_comp_nocase(pResult->GetString(0), "on"))
|
||||
pPlayer->m_BroadcastTime = true;
|
||||
else if(str_comp_nocase(pResult->GetString(0), "off"))
|
||||
pPlayer->m_BroadcastTime = false;
|
||||
else if(str_comp_nocase(pResult->GetString(0), "toggle"))
|
||||
pPlayer->m_BroadcastTime = !pPlayer->m_BroadcastTime;
|
||||
|
||||
pSelf->Console()->Print(
|
||||
IConsole::OUTPUT_LEVEL_STANDARD,
|
||||
"emote",
|
||||
(pPlayer->m_BroadcastTime) ?
|
||||
"Time is displayed in broadcast now." :
|
||||
"Time will not be displayed in broadcast now");
|
||||
}
|
||||
|
||||
void CGameContext::ConSetServerGameTime(IConsole::IResult *pResult, void *pUserData)
|
||||
{
|
||||
CGameContext *pSelf = (CGameContext *) pUserData;
|
||||
if (!CheckClientID(pResult->m_ClientID))
|
||||
return;
|
||||
|
||||
CPlayer *pPlayer = pSelf->m_apPlayers[pResult->m_ClientID];
|
||||
if (!pPlayer)
|
||||
return;
|
||||
if(pResult->NumArguments() == 0) {
|
||||
pSelf->Console()->Print(
|
||||
IConsole::OUTPUT_LEVEL_STANDARD,
|
||||
"emote",
|
||||
(pPlayer->m_GameTimerTime) ?
|
||||
"Time is displayed in broadcast now." :
|
||||
"Time will not be displayed in broadcast now");
|
||||
return;
|
||||
}
|
||||
else if(str_comp_nocase(pResult->GetString(0), "on"))
|
||||
pPlayer->m_GameTimerTime = true;
|
||||
else if(str_comp_nocase(pResult->GetString(0), "off"))
|
||||
pPlayer->m_GameTimerTime = false;
|
||||
else if(str_comp_nocase(pResult->GetString(0), "toggle"))
|
||||
pPlayer->m_GameTimerTime = !pPlayer->m_GameTimerTime;
|
||||
|
||||
pSelf->Console()->Print(
|
||||
IConsole::OUTPUT_LEVEL_STANDARD,
|
||||
"emote",
|
||||
(pPlayer->m_GameTimerTime) ?
|
||||
"Time is displayed in game/round timer now." :
|
||||
"Time will not be displayed in game/round timer now");
|
||||
}
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
CHAT_COMMAND("credits", "", CFGFLAG_CHAT|CFGFLAG_SERVER, ConCredits, this, "Shows the credits of the DDRace mod")
|
||||
CHAT_COMMAND("emote", "?si", CFGFLAG_CHAT|CFGFLAG_SERVER, ConEyeEmote, this, "Sets your tee's eye emote")
|
||||
CHAT_COMMAND("eyeemote", "", CFGFLAG_CHAT|CFGFLAG_SERVER, ConEyeEmote, this, "Toggles use of standard eye-emotes on/off")
|
||||
CHAT_COMMAND("eyeemote", "?s", CFGFLAG_CHAT|CFGFLAG_SERVER, ConSetEyeEmote, this, "Toggles use of standard eye-emotes on/off, eyeemote s, where s = on for on, off for off, toggle for toggle and nothing to show current status")
|
||||
CHAT_COMMAND("settings", "?s", CFGFLAG_CHAT|CFGFLAG_SERVER, ConSettings, this, "Shows gameplay information for this server")
|
||||
CHAT_COMMAND("help", "?r", CFGFLAG_CHAT|CFGFLAG_SERVER, ConHelp, this, "Shows help to command r, general help if left blank")
|
||||
CHAT_COMMAND("info", "", CFGFLAG_CHAT|CFGFLAG_SERVER, ConInfo, this, "Shows info about this server")
|
||||
|
@ -19,6 +19,11 @@ CHAT_COMMAND("rules", "", CFGFLAG_CHAT|CFGFLAG_SERVER, ConRules, this, "Shows th
|
|||
CHAT_COMMAND("team", "?i", CFGFLAG_CHAT|CFGFLAG_SERVER, ConJoinTeam, this, "Lets you join team i (shows your team if left blank)")
|
||||
CHAT_COMMAND("top5", "?i", CFGFLAG_CHAT|CFGFLAG_SERVER, ConTop5, this, "Shows five ranks of the ladder beginning with rank i (1 by default)")
|
||||
CHAT_COMMAND("showothers", "?i", CFGFLAG_CHAT|CFGFLAG_SERVER, ConShowOthers, this, "Whether to showplayers from other teams or not (off by default), optional i = 0 for off else for on")
|
||||
CHAT_COMMAND("saytime", "", CFGFLAG_CHAT|CFGFLAG_SERVER, ConSayTime, this, "Privately messages you your current time in this current running race")
|
||||
CHAT_COMMAND("saytimeall", "", CFGFLAG_CHAT|CFGFLAG_SERVER, ConSayTimeAll, this, "Publicly messages everyone your current time in this current running race")
|
||||
CHAT_COMMAND("time", "", CFGFLAG_CHAT|CFGFLAG_SERVER, ConTime, this, "Privately shows you your current time in this current running race in the broadcast message")
|
||||
CHAT_COMMAND("broadcasttime", "?s", CFGFLAG_CHAT|CFGFLAG_SERVER, ConSetBroadcastTime, this, "Personal Setting of showing time in the broadcast, broadcasttime s, where s = on for on, off for off, toggle for toggle and nothing to show current status")
|
||||
CHAT_COMMAND("servergametime", "?s", CFGFLAG_CHAT|CFGFLAG_SERVER, ConSetServerGameTime, this, "Personal Setting of showing time in the round/game timer, servergametime s, where s = on for on off for off, toggle for toggle and nothing to show current status")
|
||||
|
||||
#if defined(CONF_SQL)
|
||||
CHAT_COMMAND("times", "?s?i", CFGFLAG_CHAT|CFGFLAG_SERVER, ConTimes, this, "/times ?s?i shows last 5 times of the server or of a player beginning with name s starting with time i (i = 1 by default)")
|
||||
|
|
|
@ -920,7 +920,7 @@ void CCharacter::Snap(int SnappingClient)
|
|||
// set emote
|
||||
if (m_EmoteStop < Server()->Tick())
|
||||
{
|
||||
m_EmoteType = m_DefEmote;
|
||||
m_EmoteType = m_pPlayer->m_DefEmote;
|
||||
m_EmoteStop = -1;
|
||||
}
|
||||
|
||||
|
@ -992,19 +992,26 @@ CGameTeams* CCharacter::Teams()
|
|||
|
||||
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((m_DDRaceState == DDRACE_STARTED && Server()->Tick() - m_RefreshTime >= Server()->TickSpeed()) &&
|
||||
m_CpActive != -1 && m_CpTick > Server()->Tick() && !m_pPlayer->m_IsUsingDDRaceClient &&
|
||||
pData->m_BestTime && pData->m_aBestCpTime[m_CpActive] != 0)
|
||||
{
|
||||
char aBroadcast[128];
|
||||
m_Time = (float)(Server()->Tick() - m_StartTime) / ((float)Server()->TickSpeed());
|
||||
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 (m_pPlayer->m_BroadcastTime && m_LastBroadcast + Server()->TickSpeed() * g_Config.m_SvTimeInBroadcastInterval <= Server()->Tick())
|
||||
{
|
||||
char aBuftime[64];
|
||||
int IntTime = (int)((float)(Server()->Tick() - m_StartTime) / ((float)Server()->TickSpeed()));
|
||||
str_format(aBuftime, sizeof(aBuftime), "%s%d:%s%d", ((IntTime/60) > 9)?"":"0", IntTime/60, ((IntTime%60) > 9)?"":"0", IntTime%60);
|
||||
GameServer()->SendBroadcast(aBuftime, m_pPlayer->GetCID());
|
||||
m_LastBroadcast = Server()->Tick();
|
||||
}
|
||||
m_RefreshTime = Server()->Tick();
|
||||
}
|
||||
|
||||
|
@ -1476,10 +1483,10 @@ void CCharacter::DDRaceTick()
|
|||
|
||||
void CCharacter::DDRacePostCoreTick()
|
||||
{
|
||||
if (m_DefEmoteReset >= 0 && m_DefEmoteReset <= Server()->Tick())
|
||||
if (m_pPlayer->m_DefEmoteReset >= 0 && m_pPlayer->m_DefEmoteReset <= Server()->Tick())
|
||||
{
|
||||
m_DefEmoteReset = -1;
|
||||
m_EmoteType = m_DefEmote = EMOTE_NORMAL;
|
||||
m_pPlayer->m_DefEmoteReset = -1;
|
||||
m_EmoteType = m_pPlayer->m_DefEmote = EMOTE_NORMAL;
|
||||
m_EmoteStop = -1;
|
||||
}
|
||||
|
||||
|
@ -1570,7 +1577,6 @@ void CCharacter::DDRaceInit()
|
|||
{
|
||||
m_DDRaceState = DDRACE_NONE;
|
||||
m_PrevPos = m_Pos;
|
||||
m_EyeEmote = true;
|
||||
m_LastBroadcast = 0;
|
||||
m_TeamBeforeSuper = 0;
|
||||
m_Core.m_Id = GetPlayer()->GetCID();
|
||||
|
@ -1580,8 +1586,6 @@ void CCharacter::DDRaceInit()
|
|||
GameServer()->SendChatTarget(GetPlayer()->GetCID(),"Please join a team before you start");
|
||||
m_LastStartWarning = Server()->Tick();
|
||||
}
|
||||
m_DefEmote = EMOTE_NORMAL;
|
||||
m_DefEmoteReset = -1;
|
||||
m_TeleCheckpoint = 0;
|
||||
m_EndlessHook = g_Config.m_SvEndlessDrag;
|
||||
m_Hit = g_Config.m_SvHit ? HIT_ALL : DISABLE_HIT_GRENADE|DISABLE_HIT_HAMMER|DISABLE_HIT_RIFLE|DISABLE_HIT_SHOTGUN;
|
||||
|
|
|
@ -168,8 +168,6 @@ public:
|
|||
};
|
||||
int m_Hit;
|
||||
int m_PainSoundTimer;
|
||||
int m_DefEmote;
|
||||
int m_DefEmoteReset;
|
||||
int m_LastMove;
|
||||
int m_StartTime;
|
||||
int m_RefreshTime;
|
||||
|
@ -209,7 +207,6 @@ public:
|
|||
int m_TileSIndexB;
|
||||
int m_TileSFlagsB;
|
||||
vec2 m_Intersection;
|
||||
bool m_EyeEmote;
|
||||
int64 m_LastStartWarning;
|
||||
// Setters/Getters because i don't want to modify vanilla vars access modifiers
|
||||
int GetLastWeapon() { return m_LastWeapon; };
|
||||
|
|
|
@ -1233,7 +1233,7 @@ void CGameContext::OnMessage(int MsgID, CUnpacker *pUnpacker, int ClientID)
|
|||
|
||||
SendEmoticon(ClientID, pMsg->m_Emoticon);
|
||||
CCharacter* pChr = pPlayer->GetCharacter();
|
||||
if(pChr && g_Config.m_SvEmotionalTees && pChr->m_EyeEmote)
|
||||
if(pChr && g_Config.m_SvEmotionalTees && pPlayer->m_EyeEmote)
|
||||
{
|
||||
switch(pMsg->m_Emoticon)
|
||||
{
|
||||
|
|
|
@ -226,10 +226,18 @@ private:
|
|||
static void ConBroadTime(IConsole::IResult *pResult, void *pUserData);
|
||||
static void ConJoinTeam(IConsole::IResult *pResult, void *pUserData);
|
||||
static void ConMe(IConsole::IResult *pResult, void *pUserData);
|
||||
static void ConToggleEyeEmote(IConsole::IResult *pResult, void *pUserData);
|
||||
static void ConSetEyeEmote(IConsole::IResult *pResult, void *pUserData);
|
||||
static void ConToggleBroadcast(IConsole::IResult *pResult, void *pUserData);
|
||||
static void ConEyeEmote(IConsole::IResult *pResult, void *pUserData);
|
||||
static void ConShowOthers(IConsole::IResult *pResult, void *pUserData);
|
||||
static void ConSayTime(IConsole::IResult *pResult, void *pUserData);
|
||||
static void ConSayTimeAll(IConsole::IResult *pResult, void *pUserData);
|
||||
static void ConTime(IConsole::IResult *pResult, void *pUserData);
|
||||
static void ConSetBroadcastTime(IConsole::IResult *pResult, void *pUserData);
|
||||
static void ConSetServerGameTime(IConsole::IResult *pResult, void *pUserData);
|
||||
|
||||
|
||||
|
||||
|
||||
static void ConMute(IConsole::IResult *pResult, void *pUserData);
|
||||
static void ConMuteID(IConsole::IResult *pResult, void *pUserData);
|
||||
|
|
|
@ -744,15 +744,15 @@ void IGameController::Snap(int SnappingClient)
|
|||
|
||||
//pGameInfoObj->m_ScoreLimit = g_Config.m_SvScorelimit;
|
||||
//pGameInfoObj->m_TimeLimit = g_Config.m_SvTimelimit;
|
||||
CCharacter *pChar;
|
||||
CPlayer *pPlayer;
|
||||
if(SnappingClient >= 0)
|
||||
if((pPlayer = GameServer()->m_apPlayers[SnappingClient]))
|
||||
if((pChar = pPlayer->GetCharacter()))
|
||||
pGameInfoObj->m_RoundStartTick = (pChar->m_DDRaceState == DDRACE_STARTED)?pChar->m_StartTime:Server()->Tick();
|
||||
|
||||
pGameInfoObj->m_RoundNum = /*(str_length(g_Config.m_SvMaprotation) && g_Config.m_SvRoundsPerMap) ? g_Config.m_SvRoundsPerMap :*/ 0;
|
||||
pGameInfoObj->m_RoundCurrent = m_RoundCount+1;
|
||||
|
||||
CCharacter *pChr;
|
||||
CPlayer *pPlayer = GameServer()->m_apPlayers[SnappingClient];
|
||||
if(pPlayer && pPlayer->m_GameTimerTime && SnappingClient >= 0)
|
||||
if((pChr = pPlayer->GetCharacter()))
|
||||
pGameInfoObj->m_RoundStartTick = (pChr->m_DDRaceState == DDRACE_STARTED)?pChr->m_StartTime:m_RoundStartTick;
|
||||
}
|
||||
|
||||
int IGameController::GetAutoTeam(int NotThisID)
|
||||
|
|
|
@ -38,6 +38,12 @@ CPlayer::CPlayer(CGameContext *pGameServer, int ClientID, int Team)
|
|||
m_Sent2ndAfkWarning = 0;
|
||||
m_ChatScore = 0;
|
||||
m_PauseInfo.m_Respawn = false;
|
||||
m_EyeEmote = true;
|
||||
m_BroadcastTime = g_Config.m_SvTimeInBroadcast;
|
||||
m_BroadcastTime = g_Config.m_SvTimeInGameTimer;
|
||||
m_GameTimerTime = true;
|
||||
m_DefEmote = EMOTE_NORMAL;
|
||||
m_DefEmoteReset = -1;
|
||||
|
||||
GameServer()->Score()->PlayerData(ClientID)->Reset();
|
||||
|
||||
|
|
|
@ -158,6 +158,11 @@ public:
|
|||
int m_Sent1stAfkWarning; // afk timer's 1st warning after 50% of sv_max_afk_time
|
||||
int m_Sent2ndAfkWarning; // afk timer's 2nd warning after 90% of sv_max_afk_time
|
||||
char m_pAfkMsg[160];
|
||||
bool m_EyeEmote;
|
||||
bool m_BroadcastTime;
|
||||
bool m_GameTimerTime;
|
||||
int m_DefEmote;
|
||||
int m_DefEmoteReset;
|
||||
#if defined(CONF_SQL)
|
||||
int64 m_LastSQLQuery;
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue