mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-19 22:48:18 +00:00
Reduced length of new year event to 2 days.
This commit is contained in:
parent
1c8c20c93e
commit
c55cae6492
|
@ -693,16 +693,10 @@ void CGameContext::OnClientEnter(int ClientID)
|
|||
dd = atoi(d);
|
||||
mm = atoi(m);
|
||||
yy = atoi(y);
|
||||
if((mm == 12 && dd >= 20))
|
||||
if((mm == 12 || mm == 1) && (dd == 31 || dd == 1))
|
||||
{
|
||||
char aBuf[128];
|
||||
str_format(aBuf, sizeof(aBuf), "Happy %d from GreYFoX", yy+1);
|
||||
SendBroadcast(aBuf, ClientID);
|
||||
}
|
||||
else if(mm == 1 && dd <= 20)
|
||||
{
|
||||
char aBuf[128];
|
||||
str_format(aBuf, sizeof(aBuf), "Happy %d from GreYFoX", yy);
|
||||
str_format(aBuf, sizeof(aBuf), "Happy %d from GreYFoX", mm==12?yy+1:yy);
|
||||
SendBroadcast(aBuf, ClientID);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -40,25 +40,24 @@ CPlayer::CPlayer(CGameContext *pGameServer, int ClientID, int Team)
|
|||
m_ChatScore = 0;
|
||||
m_EyeEmote = true;
|
||||
m_TimerType = g_Config.m_SvDefaultTimerType;
|
||||
m_DefEmote = EMOTE_NORMAL;
|
||||
|
||||
//New Year
|
||||
time_t rawtime;
|
||||
struct tm* timeinfo;
|
||||
char d[16], m[16], y[16];
|
||||
int dd, mm, yy;
|
||||
time ( &rawtime );
|
||||
timeinfo = localtime ( &rawtime );
|
||||
strftime (d,sizeof(y),"%d",timeinfo);
|
||||
strftime (m,sizeof(m),"%m",timeinfo);
|
||||
strftime (y,sizeof(y),"%Y",timeinfo);
|
||||
dd = atoi(d);
|
||||
mm = atoi(m);
|
||||
yy = atoi(y);
|
||||
|
||||
m_DefEmote = EMOTE_NORMAL;
|
||||
if (g_Config.m_SvEvents)
|
||||
{
|
||||
m_DefEmote = ((mm == 12 && dd >= 20) || (mm == 1 && dd <= 20)) ? EMOTE_HAPPY : EMOTE_NORMAL;
|
||||
{
|
||||
time_t rawtime;
|
||||
struct tm* timeinfo;
|
||||
char d[16], m[16], y[16];
|
||||
int dd, mm, yy;
|
||||
time ( &rawtime );
|
||||
timeinfo = localtime ( &rawtime );
|
||||
strftime (d,sizeof(y),"%d",timeinfo);
|
||||
strftime (m,sizeof(m),"%m",timeinfo);
|
||||
strftime (y,sizeof(y),"%Y",timeinfo);
|
||||
dd = atoi(d);
|
||||
mm = atoi(m);
|
||||
yy = atoi(y);
|
||||
m_DefEmote = ((mm == 12 && dd == 31) || (mm == 1 && dd == 1)) ? EMOTE_HAPPY : EMOTE_NORMAL;
|
||||
}
|
||||
m_DefEmoteReset = -1;
|
||||
|
||||
|
|
Loading…
Reference in a new issue