256 changes: 226 additions & 30 deletions src/game/editor/layer_tiles.cpp

Large diffs are not rendered by default.

20 changes: 20 additions & 0 deletions src/game/editor/popups.cpp
Expand Up @@ -838,6 +838,8 @@ int CEditor::PopupPoint(CEditor *pEditor, CUIRect View)
PROP_POS_X=0,
PROP_POS_Y,
PROP_COLOR,
PROP_TEX_U,
PROP_TEX_V,
NUM_PROPS,
};

Expand All @@ -849,11 +851,15 @@ int CEditor::PopupPoint(CEditor *pEditor, CUIRect View)

int x = pCurrentQuad->m_aPoints[pEditor->m_SelectedQuadPoint].x/1000;
int y = pCurrentQuad->m_aPoints[pEditor->m_SelectedQuadPoint].y/1000;
int tu = pCurrentQuad->m_aTexcoords[pEditor->m_SelectedQuadPoint].x/1000 * 1024;
int tv = pCurrentQuad->m_aTexcoords[pEditor->m_SelectedQuadPoint].y/1000 * 1024;

CProperty aProps[] = {
{"Pos X", x, PROPTYPE_INT_SCROLL, -1000000, 1000000},
{"Pos Y", y, PROPTYPE_INT_SCROLL, -1000000, 1000000},
{"Color", Color, PROPTYPE_COLOR, -1, pEditor->m_Map.m_lEnvelopes.size()},
{"Tex U", tu, PROPTYPE_INT_SCROLL, -1000000, 1000000},
{"Tex V", tv, PROPTYPE_INT_SCROLL, -1000000, 1000000},
{0},
};

Expand All @@ -865,6 +871,8 @@ int CEditor::PopupPoint(CEditor *pEditor, CUIRect View)

float OffsetX = NewVal*1000-x*1000;
float OffsetY = NewVal*1000-y*1000;
float OffsetU = NewVal*1000/1024-tu*1000/1024;
float OffsetV = NewVal*1000/1024-tv*1000/1024;

for(int i = 0; i < lQuads.size(); ++i)
{
Expand Down Expand Up @@ -893,6 +901,18 @@ int CEditor::PopupPoint(CEditor *pEditor, CUIRect View)
}
}
}
if(Prop == PROP_TEX_U)
{
for(int v = 0; v < 4; v++)
if(pEditor->m_SelectedPoints&(1<<v))
lQuads[i]->m_aTexcoords[v].x += OffsetU;
}
if(Prop == PROP_TEX_V)
{
for(int v = 0; v < 4; v++)
if(pEditor->m_SelectedPoints&(1<<v))
lQuads[i]->m_aTexcoords[v].y += OffsetV;
}
}

return 0;
Expand Down
20 changes: 20 additions & 0 deletions src/game/mapitems.cpp
Expand Up @@ -81,6 +81,11 @@ bool IsValidSwitchTile(int Index)
);
}

bool IsValidTuneTile(int Index)
{
return Index == TILE_TUNE1;
}

bool IsValidEntity(int Index)
{
Index -= ENTITY_OFFSET;
Expand All @@ -91,3 +96,18 @@ bool IsValidEntity(int Index)
|| Index == ENTITY_DOOR
);
}

bool IsRotatableTile(int Index)
{
return (
Index == TILE_STOP
|| Index == TILE_STOPS
|| Index == TILE_CP
|| Index == TILE_CP_F
|| Index == TILE_THROUGH_DIR
|| Index == TILE_ENTITIES_OFF_1
|| Index == TILE_ENTITIES_OFF_2
|| Index - ENTITY_OFFSET == ENTITY_CRAZY_SHOTGUN_EX
|| Index - ENTITY_OFFSET == ENTITY_CRAZY_SHOTGUN
);
}
2 changes: 2 additions & 0 deletions src/game/mapitems.h
Expand Up @@ -471,6 +471,8 @@ bool IsValidFrontTile(int Index);
bool IsValidTeleTile(int Index);
bool IsValidSpeedupTile(int Index);
bool IsValidSwitchTile(int Index);
bool IsValidTuneTile(int Index);
bool IsValidEntity(int Index);
bool IsRotatableTile(int Index);

#endif
12 changes: 6 additions & 6 deletions src/game/server/ddracechat.cpp
Expand Up @@ -413,9 +413,9 @@ void CGameContext::ConTop5(IConsole::IResult *pResult, void *pUserData)
#endif
}

#if defined(CONF_SQL)
void CGameContext::ConTimes(IConsole::IResult *pResult, void *pUserData)
{
#if defined(CONF_SQL)
if(!CheckClientID(pResult->m_ClientID)) return;
CGameContext *pSelf = (CGameContext *)pUserData;

Expand Down Expand Up @@ -458,8 +458,8 @@ void CGameContext::ConTimes(IConsole::IResult *pResult, void *pUserData)
if(pSelf->m_apPlayers[pResult->m_ClientID] && g_Config.m_SvUseSQL)
pSelf->m_apPlayers[pResult->m_ClientID]->m_LastSQLQuery = pSelf->Server()->Tick();
}
}
#endif
}

void CGameContext::ConDND(IConsole::IResult *pResult, void *pUserData)
{
Expand Down Expand Up @@ -1395,9 +1395,9 @@ void CGameContext::ConProtectedKill(IConsole::IResult *pResult, void *pUserData)
}
}

#if defined(CONF_SQL)
void CGameContext::ConPoints(IConsole::IResult *pResult, void *pUserData)
{
#if defined(CONF_SQL)
CGameContext *pSelf = (CGameContext *) pUserData;
if (!CheckClientID(pResult->m_ClientID))
return;
Expand Down Expand Up @@ -1425,12 +1425,12 @@ void CGameContext::ConPoints(IConsole::IResult *pResult, void *pUserData)

if(pSelf->m_apPlayers[pResult->m_ClientID] && g_Config.m_SvUseSQL)
pSelf->m_apPlayers[pResult->m_ClientID]->m_LastSQLQuery = pSelf->Server()->Tick();
}
#endif
}

#if defined(CONF_SQL)
void CGameContext::ConTopPoints(IConsole::IResult *pResult, void *pUserData)
{
#if defined(CONF_SQL)
CGameContext *pSelf = (CGameContext *) pUserData;
if (!CheckClientID(pResult->m_ClientID))
return;
Expand All @@ -1454,5 +1454,5 @@ void CGameContext::ConTopPoints(IConsole::IResult *pResult, void *pUserData)

if(pSelf->m_apPlayers[pResult->m_ClientID] && g_Config.m_SvUseSQL)
pSelf->m_apPlayers[pResult->m_ClientID]->m_LastSQLQuery = pSelf->Server()->Tick();
}
#endif
}
20 changes: 10 additions & 10 deletions src/game/server/ddracechat.h
Expand Up @@ -6,7 +6,8 @@
#define CHAT_COMMAND(name, params, flags, callback, userdata, help)
#endif

CHAT_COMMAND("credits", "", CFGFLAG_CHAT|CFGFLAG_SERVER, ConCredits, this, "Shows the credits of the DDRace mod")
CHAT_COMMAND("credits", "", CFGFLAG_CHAT|CFGFLAG_SERVER, ConCredits, this, "Shows the credits of the DDNet mod")
CHAT_COMMAND("rules", "", CFGFLAG_CHAT|CFGFLAG_SERVER, ConRules, this, "Shows the server rules")
CHAT_COMMAND("emote", "?s[emote name] i[duration in seconds]", CFGFLAG_CHAT|CFGFLAG_SERVER, ConEyeEmote, this, "Sets your tee's eye emote")
CHAT_COMMAND("eyeemote", "?s['on'|'off'|'toggle']", 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[configname]", CFGFLAG_CHAT|CFGFLAG_SERVER, ConSettings, this, "Shows gameplay information for this server")
Expand All @@ -30,13 +31,17 @@ CHAT_COMMAND("map", "?r[map]", CFGFLAG_CHAT|CFGFLAG_SERVER|CFGFLAG_NONTEEHISTORI
CHAT_COMMAND("rankteam", "?r[player name]", CFGFLAG_CHAT|CFGFLAG_SERVER, ConTeamRank, this, "Shows the team rank of player with name r (your team rank by default)")
CHAT_COMMAND("teamrank", "?r[player name]", CFGFLAG_CHAT|CFGFLAG_SERVER, ConTeamRank, this, "Shows the team rank of player with name r (your team rank by default)")
CHAT_COMMAND("rank", "?r[player name]", CFGFLAG_CHAT|CFGFLAG_SERVER, ConRank, this, "Shows the rank of player with name r (your rank by default)")
CHAT_COMMAND("rules", "", CFGFLAG_CHAT|CFGFLAG_SERVER, ConRules, this, "Shows the server rules")
CHAT_COMMAND("team", "?i[id]", CFGFLAG_CHAT|CFGFLAG_SERVER, ConJoinTeam, this, "Lets you join team i (shows your team if left blank)")
CHAT_COMMAND("lock", "?i['0'|'1']", CFGFLAG_CHAT|CFGFLAG_SERVER, ConLockTeam, this, "Lock team so no-one else can join it")
CHAT_COMMAND("invite", "r[player name]", CFGFLAG_CHAT|CFGFLAG_SERVER, ConInviteTeam, this, "Invite a person to a locked team")
CHAT_COMMAND("top5team", "?i[rank to start with]", CFGFLAG_CHAT|CFGFLAG_SERVER, ConTeamTop5, this, "Shows five team ranks of the ladder beginning with rank i (1 by default)")
CHAT_COMMAND("teamtop5", "?i[rank to start with]", CFGFLAG_CHAT|CFGFLAG_SERVER, ConTeamTop5, this, "Shows five team ranks of the ladder beginning with rank i (1 by default)")
CHAT_COMMAND("top5", "?i[rank to start with]", CFGFLAG_CHAT|CFGFLAG_SERVER, ConTop5, this, "Shows five ranks of the ladder beginning with rank i (1 by default)")
CHAT_COMMAND("times", "?s[player name] ?i[number of times to skip]", 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)")
CHAT_COMMAND("points", "?r[player name]", CFGFLAG_CHAT|CFGFLAG_SERVER, ConPoints, this, "Shows the global points of a player beginning with name r (your rank by default)")
CHAT_COMMAND("top5points", "?i[number]", CFGFLAG_CHAT|CFGFLAG_SERVER, ConTopPoints, this, "Shows five points of the global point ladder beginning with rank i (1 by default)")

CHAT_COMMAND("team", "?i[id]", CFGFLAG_CHAT|CFGFLAG_SERVER, ConJoinTeam, this, "Lets you join team i (shows your team if left blank)")
CHAT_COMMAND("lock", "?i['0'|'1']", CFGFLAG_CHAT|CFGFLAG_SERVER, ConLockTeam, this, "Lock team so no-one else can join it")
CHAT_COMMAND("invite", "r[player name]", CFGFLAG_CHAT|CFGFLAG_SERVER, ConInviteTeam, this, "Invite a person to a locked team")

CHAT_COMMAND("showothers", "?i['0'|'1']", CFGFLAG_CHAT|CFGFLAG_SERVER, ConShowOthers, this, "Whether to show players from other teams or not (off by default), optional i = 0 for off else for on")
CHAT_COMMAND("showall", "?i['0'|'1']", CFGFLAG_CHAT|CFGFLAG_SERVER, ConShowAll, this, "Whether to show players at any distance (off by default), optional i = 0 for off else for on")
CHAT_COMMAND("specteam", "?i['0'|'1']", CFGFLAG_CHAT|CFGFLAG_SERVER, ConSpecTeam, this, "Whether to show players from other teams when spectating (on by default), optional i = 0 for off else for on")
Expand All @@ -50,9 +55,4 @@ CHAT_COMMAND("rescue", "", CFGFLAG_CHAT|CFGFLAG_SERVER, ConRescue, this, "Telepo

CHAT_COMMAND("kill", "", CFGFLAG_CHAT|CFGFLAG_SERVER, ConProtectedKill, this, "Kill yourself")

#if defined(CONF_SQL)
CHAT_COMMAND("times", "?s[player name] ?i[number of times to skip]", 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)")
CHAT_COMMAND("points", "?r[player name]", CFGFLAG_CHAT|CFGFLAG_SERVER, ConPoints, this, "Shows the global points of a player beginning with name r (your rank by default)")
CHAT_COMMAND("top5points", "?i[number]", CFGFLAG_CHAT|CFGFLAG_SERVER, ConTopPoints, this, "Shows five points of the global point ladder beginning with rank i (1 by default)")
#endif
#undef CHAT_COMMAND
102 changes: 88 additions & 14 deletions src/game/server/ddracecommands.cpp
Expand Up @@ -343,10 +343,10 @@ void CGameContext::ConForcePause(IConsole::IResult *pResult, void *pUserData)
pPlayer->ForcePause(Seconds);
}

void CGameContext::VoteMute(const NETADDR *pAddr, int Secs, const char *pDisplayName, int AuthedID)
bool CGameContext::VoteMute(const NETADDR *pAddr, int Secs, const char *pDisplayName, int AuthedID)
{
char aBuf[128];
bool Found = 0;
bool Found = false;

// find a matching vote mute for this ip, update expiration time if found
for(int i = 0; i < m_NumVoteMutes; i++)
Expand All @@ -355,7 +355,7 @@ void CGameContext::VoteMute(const NETADDR *pAddr, int Secs, const char *pDisplay
{
m_aVoteMutes[i].m_Expire = Server()->Tick()
+ Secs * Server()->TickSpeed();
Found = 1;
Found = true;
break;
}
}
Expand All @@ -368,7 +368,7 @@ void CGameContext::VoteMute(const NETADDR *pAddr, int Secs, const char *pDisplay
m_aVoteMutes[m_NumVoteMutes].m_Expire = Server()->Tick()
+ Secs * Server()->TickSpeed();
m_NumVoteMutes++;
Found = 1;
Found = true;
}
}
if(Found)
Expand All @@ -382,6 +382,28 @@ void CGameContext::VoteMute(const NETADDR *pAddr, int Secs, const char *pDisplay
}
else // no free slot found
Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "votemute", "vote mute array is full");
return Found;
}

bool CGameContext::VoteUnmute(const NETADDR *pAddr, const char *pDisplayName, int AuthedID)
{
for(int i = 0; i < m_NumVoteMutes; i++)
{
if(net_addr_comp_noport(&m_aVoteMutes[i].m_Addr, pAddr) == 0)
{
m_NumVoteMutes--;
m_aVoteMutes[i] = m_aVoteMutes[m_NumVoteMutes];
if(pDisplayName)
{
char aBuf[128];
str_format(aBuf, sizeof aBuf, "'%s' unbanned '%s' from voting.",
Server()->ClientName(AuthedID), pDisplayName);
Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "voteunmute", aBuf);
}
return true;
}
}
return false;
}

void CGameContext::Mute(const NETADDR *pAddr, int Secs, const char *pDisplayName)
Expand Down Expand Up @@ -438,8 +460,66 @@ void CGameContext::ConVoteMute(IConsole::IResult *pResult, void *pUserData)
NETADDR Addr;
pSelf->Server()->GetClientAddr(Victim, &Addr);

pSelf->VoteMute(&Addr, clamp(pResult->GetInteger(1), 1, 86400),
pSelf->Server()->ClientName(Victim), pResult->m_ClientID);
int Seconds = clamp(pResult->GetInteger(1), 1, 86400);
bool Found = pSelf->VoteMute(&Addr, Seconds, pSelf->Server()->ClientName(Victim), pResult->m_ClientID);

if(Found)
{
char aBuf[128];
str_format(aBuf, sizeof aBuf, "'%s' banned '%s' for %d seconds from voting.",
pSelf->Server()->ClientName(pResult->m_ClientID), pSelf->Server()->ClientName(Victim), Seconds);
pSelf->SendChat(-1, 0, aBuf);
}
}

void CGameContext::ConVoteUnmute(IConsole::IResult *pResult, void *pUserData)
{
CGameContext *pSelf = (CGameContext *)pUserData;
int Victim = pResult->GetVictim();

if(Victim < 0 || Victim > MAX_CLIENTS || !pSelf->m_apPlayers[Victim])
{
pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "voteunmute", "Client ID not found");
return;
}

NETADDR Addr;
pSelf->Server()->GetClientAddr(Victim, &Addr);

bool Found = pSelf->VoteUnmute(&Addr, pSelf->Server()->ClientName(Victim), pResult->m_ClientID);
if(Found)
{
char aBuf[128];
str_format(aBuf, sizeof aBuf, "'%s' unbanned '%s' from voting.",
pSelf->Server()->ClientName(pResult->m_ClientID), pSelf->Server()->ClientName(Victim));
pSelf->SendChat(-1, 0, aBuf);
}
}

void CGameContext::ConVoteMutes(IConsole::IResult *pResult, void *pUserData)
{
CGameContext *pSelf = (CGameContext *) pUserData;

if (pSelf->m_NumVoteMutes <= 0)
{
// Just to make sure.
pSelf->m_NumVoteMutes = 0;
pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "votemutes",
"There are no active vote mutes.");
return;
}

char aIpBuf[64];
char aBuf[128];
pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "votemutes",
"Active vote mutes:");
for (int i = 0; i < pSelf->m_NumVoteMutes; i++)
{
net_addr_str(&pSelf->m_aVoteMutes[i].m_Addr, aIpBuf, sizeof(aIpBuf), false);
str_format(aBuf, sizeof aBuf, "%d: \"%s\", %d seconds left", i,
aIpBuf, (pSelf->m_aVoteMutes[i].m_Expire - pSelf->Server()->Tick()) / pSelf->Server()->TickSpeed());
pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "votemutes", aBuf);
}
}

void CGameContext::ConMute(IConsole::IResult *pResult, void *pUserData)
Expand Down Expand Up @@ -523,14 +603,8 @@ void CGameContext::ConMutes(IConsole::IResult *pResult, void *pUserData)
for (int i = 0; i < pSelf->m_NumMutes; i++)
{
net_addr_str(&pSelf->m_aMutes[i].m_Addr, aIpBuf, sizeof(aIpBuf), false);
str_format(
aBuf,
sizeof aBuf,
"%d: \"%s\", %d seconds left",
i,
aIpBuf,
(pSelf->m_aMutes[i].m_Expire - pSelf->Server()->Tick())
/ pSelf->Server()->TickSpeed());
str_format(aBuf, sizeof aBuf, "%d: \"%s\", %d seconds left", i, aIpBuf,
(pSelf->m_aMutes[i].m_Expire - pSelf->Server()->Tick()) / pSelf->Server()->TickSpeed());
pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "mutes", aBuf);
}
}
Expand Down
32 changes: 20 additions & 12 deletions src/game/server/entities/character.cpp
Expand Up @@ -1442,7 +1442,6 @@ void CCharacter::HandleTiles(int Index)
// start
if(((m_TileIndex == TILE_BEGIN) || (m_TileFIndex == TILE_BEGIN) || FTile1 == TILE_BEGIN || FTile2 == TILE_BEGIN || FTile3 == TILE_BEGIN || FTile4 == TILE_BEGIN || Tile1 == TILE_BEGIN || Tile2 == TILE_BEGIN || Tile3 == TILE_BEGIN || Tile4 == TILE_BEGIN) && (m_DDRaceState == DDRACE_NONE || m_DDRaceState == DDRACE_FINISHED || (m_DDRaceState == DDRACE_STARTED && !Team() && g_Config.m_SvTeam != 3)))
{
bool CanBegin = true;
if(g_Config.m_SvResetPickups)
{
for (int i = WEAPON_SHOTGUN; i < NUM_WEAPONS; ++i)
Expand All @@ -1460,13 +1459,11 @@ void CCharacter::HandleTiles(int Index)
m_LastStartWarning = Server()->Tick();
}
Die(GetPlayer()->GetCID(), WEAPON_WORLD);
CanBegin = false;
}
if(CanBegin)
{
Teams()->OnCharacterStart(m_pPlayer->GetCID());
m_CpActive = -2;
return;
}

Teams()->OnCharacterStart(m_pPlayer->GetCID());
m_CpActive = -2;
}

// finish
Expand Down Expand Up @@ -2118,15 +2115,25 @@ void CCharacter::DDRacePostCoreTick()

int CurrentIndex = GameServer()->Collision()->GetMapIndex(m_Pos);
HandleSkippableTiles(CurrentIndex);
if(!m_Alive)
return;

// handle Anti-Skip tiles
std::list < int > Indices = GameServer()->Collision()->GetMapIndices(m_PrevPos, m_Pos);
if(!Indices.empty())
{
for(std::list < int >::iterator i = Indices.begin(); i != Indices.end(); i++)
{
HandleTiles(*i);
if(!m_Alive)
return;
}
}
else
{
HandleTiles(CurrentIndex);
if(!m_Alive)
return;
}

// teleport gun
Expand Down Expand Up @@ -2254,11 +2261,6 @@ void CCharacter::DDRaceInit()
m_LastBroadcast = 0;
m_TeamBeforeSuper = 0;
m_Core.m_Id = GetPlayer()->GetCID();
if(g_Config.m_SvTeam == 2)
{
GameServer()->SendChatTarget(GetPlayer()->GetCID(),"Please join a team before you start");
m_LastStartWarning = Server()->Tick();
}
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;
Expand All @@ -2285,6 +2287,12 @@ void CCharacter::DDRaceInit()
}
}
}

if(g_Config.m_SvTeam == 2 && Team == TEAM_FLOCK)
{
GameServer()->SendChatTarget(GetPlayer()->GetCID(),"Please join a team before you start");
m_LastStartWarning = Server()->Tick();
}
}

void CCharacter::Rescue()
Expand Down
66 changes: 19 additions & 47 deletions src/game/server/gamecontext.cpp
Expand Up @@ -792,26 +792,6 @@ void CGameContext::OnTick()
else if(ActVote < 0)
VetoStop = true;
}

// Check if an active moderator has voted.
if (m_apPlayers[i] && m_apPlayers[i]->m_Vote != 0 && m_apPlayers[i]->m_Moderating)
{
if (m_apPlayers[i]->m_Vote == 1)
{
Server()->SetRconCID(IServer::RCON_CID_VOTE);
Console()->ExecuteLine(m_aVoteCommand);
Server()->SetRconCID(IServer::RCON_CID_SERV);
EndVote();
SendChat(-1, CGameContext::CHAT_ALL, "Vote passed enforced by authorized player");
return;
}
else if (m_apPlayers[i]->m_Vote == -1)
{
EndVote();
SendChat(-1, CGameContext::CHAT_ALL, "Vote failed enforced by authorized player");
return;
}
}
}

if(g_Config.m_SvVoteMaxTotal && Total > g_Config.m_SvVoteMaxTotal &&
Expand All @@ -832,34 +812,18 @@ void CGameContext::OnTick()
if(time_get() > m_VoteCloseTime && !g_Config.m_SvVoteMajority)
m_VoteEnforce = (m_VoteWillPass && !Veto) ? VOTE_ENFORCE_YES : VOTE_ENFORCE_NO;

if(m_VoteEnforce == VOTE_ENFORCE_YES)
// / Ensure minimum time for vote to end when moderating.
if(m_VoteEnforce == VOTE_ENFORCE_YES && !(PlayerModerating() &&
(m_VoteKick || m_VoteSpec) && time_get() < m_VoteCloseTime))
{
if(PlayerModerating() && (m_VoteKick || m_VoteSpec))
{
// Ensure minimum time for vote to end when moderating.
if(time_get() > m_VoteCloseTime)
{
Server()->SetRconCID(IServer::RCON_CID_VOTE);
Console()->ExecuteLine(m_aVoteCommand);
Server()->SetRconCID(IServer::RCON_CID_SERV);
EndVote();
SendChat(-1, CGameContext::CHAT_ALL, "Vote passed");

if(m_apPlayers[m_VoteCreator] && !m_VoteKick && !m_VoteSpec)
m_apPlayers[m_VoteCreator]->m_LastVoteCall = 0;
}
}
else
{
Server()->SetRconCID(IServer::RCON_CID_VOTE);
Console()->ExecuteLine(m_aVoteCommand);
Server()->SetRconCID(IServer::RCON_CID_SERV);
EndVote();
SendChat(-1, CGameContext::CHAT_ALL, "Vote passed");

if(m_apPlayers[m_VoteCreator] && !m_VoteKick && !m_VoteSpec)
m_apPlayers[m_VoteCreator]->m_LastVoteCall = 0;
}
Server()->SetRconCID(IServer::RCON_CID_VOTE);
Console()->ExecuteLine(m_aVoteCommand);
Server()->SetRconCID(IServer::RCON_CID_SERV);
EndVote();
SendChat(-1, CGameContext::CHAT_ALL, "Vote passed");

if(m_apPlayers[m_VoteCreator] && !m_VoteKick && !m_VoteSpec)
m_apPlayers[m_VoteCreator]->m_LastVoteCall = 0;
}
else if(m_VoteEnforce == VOTE_ENFORCE_YES_ADMIN)
{
Expand Down Expand Up @@ -902,6 +866,14 @@ void CGameContext::OnTick()
m_aMutes[i] = m_aMutes[m_NumMutes];
}
}
for(int i = 0; i < m_NumVoteMutes; i++)
{
if(m_aVoteMutes[i].m_Expire <= Server()->Tick())
{
m_NumVoteMutes--;
m_aVoteMutes[i] = m_aVoteMutes[m_NumVoteMutes];
}
}

if(Server()->Tick() % (g_Config.m_SvAnnouncementInterval * Server()->TickSpeed() * 60) == 0)
{
Expand Down
7 changes: 4 additions & 3 deletions src/game/server/gamecontext.h
Expand Up @@ -316,11 +316,9 @@ class CGameContext : public IGameServer
static void ConForcePause(IConsole::IResult *pResult, void *pUserData);
static void ConTeamTop5(IConsole::IResult *pResult, void *pUserData);
static void ConTop5(IConsole::IResult *pResult, void *pUserData);
#if defined(CONF_SQL)
static void ConTimes(IConsole::IResult *pResult, void *pUserData);
static void ConPoints(IConsole::IResult *pResult, void *pUserData);
static void ConTopPoints(IConsole::IResult *pResult, void *pUserData);
#endif

static void ConUTF8(IConsole::IResult *pResult, void *pUserData);
static void ConDND(IConsole::IResult *pResult, void *pUserData);
Expand Down Expand Up @@ -353,6 +351,8 @@ class CGameContext : public IGameServer
static void ConProtectedKill(IConsole::IResult *pResult, void *pUserData);

static void ConVoteMute(IConsole::IResult *pResult, void *pUserData);
static void ConVoteUnmute(IConsole::IResult *pResult, void *pUserData);
static void ConVoteMutes(IConsole::IResult *pResult, void *pUserData);
static void ConMute(IConsole::IResult *pResult, void *pUserData);
static void ConMuteID(IConsole::IResult *pResult, void *pUserData);
static void ConMuteIP(IConsole::IResult *pResult, void *pUserData);
Expand Down Expand Up @@ -387,7 +387,8 @@ class CGameContext : public IGameServer
CVoteMute m_aVoteMutes[MAX_VOTE_BANS];
int m_NumVoteMutes;
void Mute(const NETADDR *pAddr, int Secs, const char *pDisplayName);
void VoteMute(const NETADDR *pAddr, int Secs, const char *pDisplayName, int AuthedID);
bool VoteMute(const NETADDR *pAddr, int Secs, const char *pDisplayName, int AuthedID);
bool VoteUnmute(const NETADDR *pAddr, const char *pDisplayName, int AuthedID);
void Whisper(int ClientID, char *pStr);
void WhisperID(int ClientID, int VictimID, char *pMessage);
void Converse(int ClientID, char *pStr);
Expand Down
3 changes: 1 addition & 2 deletions src/game/server/score/file_score.cpp
Expand Up @@ -95,8 +95,7 @@ void CFileScore::SaveScoreThread(void *pUser)

void CFileScore::Save()
{
void *pSaveThread = thread_init(SaveScoreThread, this);
thread_detach(pSaveThread);
thread_init_and_detach(SaveScoreThread, this, "FileScore save");
}

void CFileScore::Init()
Expand Down
67 changes: 24 additions & 43 deletions src/game/server/score/sql_score.cpp
Expand Up @@ -57,8 +57,7 @@ m_pServer(pGameServer->Server())

CSqlConnector::ResetReachable();

void* InitThread = thread_init(ExecSqlFunc, new CSqlExecData(Init, new CSqlData()));
thread_detach(InitThread);
thread_init_and_detach(ExecSqlFunc, new CSqlExecData(Init, new CSqlData()), "SqlScore constructor");
}


Expand Down Expand Up @@ -166,8 +165,7 @@ void CSqlScore::CheckBirthday(int ClientID)
CSqlPlayerData *Tmp = new CSqlPlayerData();
Tmp->m_ClientID = ClientID;
Tmp->m_Name = Server()->ClientName(ClientID);
void *CheckThread = thread_init(ExecSqlFunc, new CSqlExecData(CheckBirthdayThread, Tmp));
thread_detach(CheckThread);
thread_init_and_detach(ExecSqlFunc, new CSqlExecData(CheckBirthdayThread, Tmp), "birthday check");
}

bool CSqlScore::CheckBirthdayThread(CSqlServer* pSqlServer, const CSqlData *pGameData, bool HandleFailure)
Expand Down Expand Up @@ -218,8 +216,7 @@ void CSqlScore::LoadScore(int ClientID)
Tmp->m_ClientID = ClientID;
Tmp->m_Name = Server()->ClientName(ClientID);

void *LoadThread = thread_init(ExecSqlFunc, new CSqlExecData(LoadScoreThread, Tmp));
thread_detach(LoadThread);
thread_init_and_detach(ExecSqlFunc, new CSqlExecData(LoadScoreThread, Tmp), "load score");
}

// update stuff
Expand Down Expand Up @@ -284,8 +281,7 @@ void CSqlScore::MapVote(int ClientID, const char* MapName)
sqlstr::ClearString(Tmp->m_aFuzzyMap, sizeof(Tmp->m_aFuzzyMap));
sqlstr::FuzzyString(Tmp->m_aFuzzyMap, sizeof(Tmp->m_aFuzzyMap));

void *VoteThread = thread_init(ExecSqlFunc, new CSqlExecData(MapVoteThread, Tmp));
thread_detach(VoteThread);
thread_init_and_detach(ExecSqlFunc, new CSqlExecData(MapVoteThread, Tmp), "map vote");
}

bool CSqlScore::MapVoteThread(CSqlServer* pSqlServer, const CSqlData *pGameData, bool HandleFailure)
Expand Down Expand Up @@ -381,8 +377,7 @@ void CSqlScore::MapInfo(int ClientID, const char* MapName)
sqlstr::ClearString(Tmp->m_aFuzzyMap, sizeof(Tmp->m_aFuzzyMap));
sqlstr::FuzzyString(Tmp->m_aFuzzyMap, sizeof(Tmp->m_aFuzzyMap));

void *InfoThread = thread_init(ExecSqlFunc, new CSqlExecData(MapInfoThread, Tmp));
thread_detach(InfoThread);
thread_init_and_detach(ExecSqlFunc, new CSqlExecData(MapInfoThread, Tmp), "map info");
}

bool CSqlScore::MapInfoThread(CSqlServer* pSqlServer, const CSqlData *pGameData, bool HandleFailure)
Expand Down Expand Up @@ -484,8 +479,7 @@ void CSqlScore::SaveScore(int ClientID, float Time, float CpTime[NUM_CHECKPOINTS
for(int i = 0; i < NUM_CHECKPOINTS; i++)
Tmp->m_aCpCurrent[i] = CpTime[i];

void *SaveThread = thread_init(ExecSqlFunc, new CSqlExecData(SaveScoreThread, Tmp, false));
thread_detach(SaveThread);
thread_init_and_detach(ExecSqlFunc, new CSqlExecData(SaveScoreThread, Tmp, false), "save score");
}

bool CSqlScore::SaveScoreThread(CSqlServer* pSqlServer, const CSqlData *pGameData, bool HandleFailure)
Expand Down Expand Up @@ -590,8 +584,7 @@ void CSqlScore::SaveTeamScore(int* aClientIDs, unsigned int Size, float Time)
Tmp->m_Size = Size;
Tmp->m_Time = Time;

void *SaveTeamThread = thread_init(ExecSqlFunc, new CSqlExecData(SaveTeamScoreThread, Tmp, false));
thread_detach(SaveTeamThread);
thread_init_and_detach(ExecSqlFunc, new CSqlExecData(SaveTeamScoreThread, Tmp, false), "save team score");
}

bool CSqlScore::SaveTeamScoreThread(CSqlServer* pSqlServer, const CSqlData *pGameData, bool HandleFailure)
Expand Down Expand Up @@ -743,8 +736,7 @@ void CSqlScore::ShowRank(int ClientID, const char* pName, bool Search)
Tmp->m_Search = Search;
str_copy(Tmp->m_aRequestingPlayer, Server()->ClientName(ClientID), sizeof(Tmp->m_aRequestingPlayer));

void *RankThread = thread_init(ExecSqlFunc, new CSqlExecData(ShowRankThread, Tmp));
thread_detach(RankThread);
thread_init_and_detach(ExecSqlFunc, new CSqlExecData(ShowRankThread, Tmp), "show rank");
}

bool CSqlScore::ShowRankThread(CSqlServer* pSqlServer, const CSqlData *pGameData, bool HandleFailure)
Expand Down Expand Up @@ -813,8 +805,7 @@ void CSqlScore::ShowTeamRank(int ClientID, const char* pName, bool Search)
Tmp->m_Search = Search;
str_copy(Tmp->m_aRequestingPlayer, Server()->ClientName(ClientID), sizeof(Tmp->m_aRequestingPlayer));

void *TeamRankThread = thread_init(ExecSqlFunc, new CSqlExecData(ShowTeamRankThread, Tmp));
thread_detach(TeamRankThread);
thread_init_and_detach(ExecSqlFunc, new CSqlExecData(ShowTeamRankThread, Tmp), "show team rank");
}

bool CSqlScore::ShowTeamRankThread(CSqlServer* pSqlServer, const CSqlData *pGameData, bool HandleFailure)
Expand Down Expand Up @@ -899,8 +890,7 @@ void CSqlScore::ShowTop5(IConsole::IResult *pResult, int ClientID, void *pUserDa
Tmp->m_Num = Debut;
Tmp->m_ClientID = ClientID;

void *Top5Thread = thread_init(ExecSqlFunc, new CSqlExecData(ShowTop5Thread, Tmp));
thread_detach(Top5Thread);
thread_init_and_detach(ExecSqlFunc, new CSqlExecData(ShowTop5Thread, Tmp), "show top5");
}

bool CSqlScore::ShowTop5Thread(CSqlServer* pSqlServer, const CSqlData *pGameData, bool HandleFailure)
Expand Down Expand Up @@ -960,8 +950,7 @@ void CSqlScore::ShowTeamTop5(IConsole::IResult *pResult, int ClientID, void *pUs
Tmp->m_Num = Debut;
Tmp->m_ClientID = ClientID;

void *TeamTop5Thread = thread_init(ExecSqlFunc, new CSqlExecData(ShowTeamTop5Thread, Tmp));
thread_detach(TeamTop5Thread);
thread_init_and_detach(ExecSqlFunc, new CSqlExecData(ShowTeamTop5Thread, Tmp), "show team top5");
}

bool CSqlScore::ShowTeamTop5Thread(CSqlServer* pSqlServer, const CSqlData *pGameData, bool HandleFailure)
Expand Down Expand Up @@ -1069,8 +1058,7 @@ void CSqlScore::ShowTimes(int ClientID, int Debut)
Tmp->m_ClientID = ClientID;
Tmp->m_Search = false;

void *TimesThread = thread_init(ExecSqlFunc, new CSqlExecData(ShowTimesThread, Tmp));
thread_detach(TimesThread);
thread_init_and_detach(ExecSqlFunc, new CSqlExecData(ShowTimesThread, Tmp), "show times");
}

void CSqlScore::ShowTimes(int ClientID, const char* pName, int Debut)
Expand All @@ -1081,8 +1069,7 @@ void CSqlScore::ShowTimes(int ClientID, const char* pName, int Debut)
Tmp->m_Name = pName;
Tmp->m_Search = true;

void *TimesThread = thread_init(ExecSqlFunc, new CSqlExecData(ShowTimesThread, Tmp));
thread_detach(TimesThread);
thread_init_and_detach(ExecSqlFunc, new CSqlExecData(ShowTimesThread, Tmp), "show name's times");
}

bool CSqlScore::ShowTimesThread(CSqlServer* pSqlServer, const CSqlData *pGameData, bool HandleFailure)
Expand Down Expand Up @@ -1170,8 +1157,7 @@ void CSqlScore::ShowPoints(int ClientID, const char* pName, bool Search)
Tmp->m_Search = Search;
str_copy(Tmp->m_aRequestingPlayer, Server()->ClientName(ClientID), sizeof(Tmp->m_aRequestingPlayer));

void *PointsThread = thread_init(ExecSqlFunc, new CSqlExecData(ShowPointsThread, Tmp));
thread_detach(PointsThread);
thread_init_and_detach(ExecSqlFunc, new CSqlExecData(ShowPointsThread, Tmp), "show points");
}

bool CSqlScore::ShowPointsThread(CSqlServer* pSqlServer, const CSqlData *pGameData, bool HandleFailure)
Expand Down Expand Up @@ -1227,8 +1213,7 @@ void CSqlScore::ShowTopPoints(IConsole::IResult *pResult, int ClientID, void *pU
Tmp->m_Num = Debut;
Tmp->m_ClientID = ClientID;

void *TopPointsThread = thread_init(ExecSqlFunc, new CSqlExecData(ShowTopPointsThread, Tmp));
thread_detach(TopPointsThread);
thread_init_and_detach(ExecSqlFunc, new CSqlExecData(ShowTopPointsThread, Tmp), "show top points");
}

bool CSqlScore::ShowTopPointsThread(CSqlServer* pSqlServer, const CSqlData *pGameData, bool HandleFailure)
Expand Down Expand Up @@ -1285,8 +1270,7 @@ void CSqlScore::RandomMap(int ClientID, int stars)
Tmp->m_ClientID = ClientID;
Tmp->m_Name = GameServer()->Server()->ClientName(ClientID);

void *RandomThread = thread_init(ExecSqlFunc, new CSqlExecData(RandomMapThread, Tmp));
thread_detach(RandomThread);
thread_init_and_detach(ExecSqlFunc, new CSqlExecData(RandomMapThread, Tmp), "random map");
}

bool CSqlScore::RandomMapThread(CSqlServer* pSqlServer, const CSqlData *pGameData, bool HandleFailure)
Expand All @@ -1300,9 +1284,9 @@ bool CSqlScore::RandomMapThread(CSqlServer* pSqlServer, const CSqlData *pGameDat
{
char aBuf[512];
if(pData->m_Num)
str_format(aBuf, sizeof(aBuf), "select * from %s_maps where Server = \"%s\" and Stars = \"%d\" order by RAND() limit 1;", pSqlServer->GetPrefix(), g_Config.m_SvServerType, pData->m_Num);
str_format(aBuf, sizeof(aBuf), "select * from %s_maps where Server = \"%s\" and Map != \"%s\" and Stars = \"%d\" order by RAND() limit 1;", pSqlServer->GetPrefix(), g_Config.m_SvServerType, g_Config.m_SvMap, pData->m_Num);
else
str_format(aBuf, sizeof(aBuf), "select * from %s_maps where Server = \"%s\" order by RAND() limit 1;", pSqlServer->GetPrefix(), g_Config.m_SvServerType);
str_format(aBuf, sizeof(aBuf), "select * from %s_maps where Server = \"%s\" and Map != \"%s\" order by RAND() limit 1;", pSqlServer->GetPrefix(), g_Config.m_SvServerType, g_Config.m_SvMap);
pSqlServer->executeSqlQuery(aBuf);

if(pSqlServer->GetResults()->rowsCount() != 1)
Expand Down Expand Up @@ -1343,8 +1327,7 @@ void CSqlScore::RandomUnfinishedMap(int ClientID, int stars)
Tmp->m_ClientID = ClientID;
Tmp->m_Name = GameServer()->Server()->ClientName(ClientID);

void *RandomUnfinishedThread = thread_init(ExecSqlFunc, new CSqlExecData(RandomUnfinishedMapThread, Tmp));
thread_detach(RandomUnfinishedThread);
thread_init_and_detach(ExecSqlFunc, new CSqlExecData(RandomUnfinishedMapThread, Tmp), "random unfinished map");
}

bool CSqlScore::RandomUnfinishedMapThread(CSqlServer* pSqlServer, const CSqlData *pGameData, bool HandleFailure)
Expand All @@ -1358,14 +1341,14 @@ bool CSqlScore::RandomUnfinishedMapThread(CSqlServer* pSqlServer, const CSqlData
{
char aBuf[512];
if(pData->m_Num)
str_format(aBuf, sizeof(aBuf), "select * from %s_maps where Server = \"%s\" and Stars = \"%d\" and not exists (select * from %s_race where Name = \"%s\" and %s_race.Map = %s_maps.Map) order by RAND() limit 1;", pSqlServer->GetPrefix(), g_Config.m_SvServerType, pData->m_Num, pSqlServer->GetPrefix(), pData->m_Name.ClrStr(), pSqlServer->GetPrefix(), pSqlServer->GetPrefix());
str_format(aBuf, sizeof(aBuf), "select * from %s_maps where Server = \"%s\" and Map != \"%s\" and Stars = \"%d\" and not exists (select * from %s_race where Name = \"%s\" and %s_race.Map = %s_maps.Map) order by RAND() limit 1;", pSqlServer->GetPrefix(), g_Config.m_SvServerType, g_Config.m_SvMap, pData->m_Num, pSqlServer->GetPrefix(), pData->m_Name.ClrStr(), pSqlServer->GetPrefix(), pSqlServer->GetPrefix());
else
str_format(aBuf, sizeof(aBuf), "select * from %s_maps where Server = \"%s\" and not exists (select * from %s_race where Name = \"%s\" and %s_race.Map = %s_maps.Map) order by RAND() limit 1;", pSqlServer->GetPrefix(), g_Config.m_SvServerType, pSqlServer->GetPrefix(), pData->m_Name.ClrStr(), pSqlServer->GetPrefix(), pSqlServer->GetPrefix());
str_format(aBuf, sizeof(aBuf), "select * from %s_maps where Server = \"%s\" and Map != \"%s\" and not exists (select * from %s_race where Name = \"%s\" and %s_race.Map = %s_maps.Map) order by RAND() limit 1;", pSqlServer->GetPrefix(), g_Config.m_SvServerType, g_Config.m_SvMap, pSqlServer->GetPrefix(), pData->m_Name.ClrStr(), pSqlServer->GetPrefix(), pSqlServer->GetPrefix());
pSqlServer->executeSqlQuery(aBuf);

if(pSqlServer->GetResults()->rowsCount() != 1)
{
pData->GameServer()->SendChatTarget(pData->m_ClientID, "You have no unfinished maps on this server!");
pData->GameServer()->SendChatTarget(pData->m_ClientID, "You have no more unfinished maps on this server!");
pData->GameServer()->m_LastMapVote = 0;
}
else
Expand Down Expand Up @@ -1414,8 +1397,7 @@ void CSqlScore::SaveTeam(int Team, const char* Code, int ClientID, const char* S
Tmp->m_Code = Code;
str_copy(Tmp->m_Server, Server, sizeof(Tmp->m_Server));

void *SaveThread = thread_init(ExecSqlFunc, new CSqlExecData(SaveTeamThread, Tmp, false));
thread_detach(SaveThread);
thread_init_and_detach(ExecSqlFunc, new CSqlExecData(SaveTeamThread, Tmp, false), "save team");
}

bool CSqlScore::SaveTeamThread(CSqlServer* pSqlServer, const CSqlData *pGameData, bool HandleFailure)
Expand Down Expand Up @@ -1548,8 +1530,7 @@ void CSqlScore::LoadTeam(const char* Code, int ClientID)
Tmp->m_Code = Code;
Tmp->m_ClientID = ClientID;

void *LoadThread = thread_init(ExecSqlFunc, new CSqlExecData(LoadTeamThread, Tmp));
thread_detach(LoadThread);
thread_init_and_detach(ExecSqlFunc, new CSqlExecData(LoadTeamThread, Tmp), "load team");
}

bool CSqlScore::LoadTeamThread(CSqlServer* pSqlServer, const CSqlData *pGameData, bool HandleFailure)
Expand Down
1 change: 1 addition & 0 deletions src/game/variables.h
Expand Up @@ -19,6 +19,7 @@ MACRO_CONFIG_INT(ClNameplatesClan, cl_nameplates_clan, 0, 0, 1, CFGFLAG_CLIENT|C
MACRO_CONFIG_INT(ClNameplatesClanSize, cl_nameplates_clan_size, 30, 0, 100, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Size of the clan plates from 0 to 100%")
MACRO_CONFIG_INT(ClNameplatesOwn, cl_nameplates_own, 0, 0, 1, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Show own name plate (useful for demo recording)")
MACRO_CONFIG_INT(ClTextEntities, cl_text_entities, 1, 0, 1, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Render textual entity data")
MACRO_CONFIG_INT(ClAuthedPlayerColor, cl_authed_player_color, 5898183, 0, 0xFFFFFF, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Color of name of authenticated player in scoreboard")
#if defined(__ANDROID__)
MACRO_CONFIG_INT(ClAutoswitchWeapons, cl_autoswitch_weapons, 1, 0, 1, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Auto switch weapon on pickup")
MACRO_CONFIG_INT(ClAutoswitchWeaponsOutOfAmmo, cl_autoswitch_weapons_out_of_ammo, 1, 0, 1, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Auto switch weapon when out of ammo")
Expand Down
6 changes: 3 additions & 3 deletions src/game/version.h
Expand Up @@ -2,9 +2,9 @@
/* If you are missing that file, acquire a complete release at teeworlds.com. */
#ifndef GAME_VERSION_H
#define GAME_VERSION_H
#define GAME_VERSION "0.6.4, 11.9"
#define GAME_VERSION "0.6.4, 12.0.1"
#define GAME_NETVERSION "0.6 626fce9a778df4d4"
#define GAME_RELEASE_VERSION "11.9"
#define CLIENT_VERSIONNR 11090
#define GAME_RELEASE_VERSION "12.0.1"
#define CLIENT_VERSIONNR 12001
extern const char *GIT_SHORTREV_HASH;
#endif
11 changes: 11 additions & 0 deletions src/test/str.cpp
Expand Up @@ -166,3 +166,14 @@ TEST(Str, InList)
EXPECT_FALSE(str_in_list("", ",", ""));
EXPECT_FALSE(str_in_list("", ",", "xyz"));
}

TEST(Str, StrFormat)
{
char aBuf[4];
EXPECT_EQ(str_format(aBuf, 4, "%d:", 9), 2);
EXPECT_STREQ(aBuf, "9:");
EXPECT_EQ(str_format(aBuf, 4, "%d: ", 9), 3);
EXPECT_STREQ(aBuf, "9: ");
EXPECT_EQ(str_format(aBuf, 4, "%d: ", 99), 3);
EXPECT_STREQ(aBuf, "99:");
}
8 changes: 4 additions & 4 deletions src/test/thread.cpp
Expand Up @@ -9,7 +9,7 @@ static void Nothing(void *pUser)

TEST(Thread, Detach)
{
void *pThread = thread_init(Nothing, 0);
void *pThread = thread_init(Nothing, 0, "detach");
thread_detach(pThread);
}

Expand All @@ -21,7 +21,7 @@ static void SetToOne(void *pUser)
TEST(Thread, Wait)
{
int Integer = 0;
void *pThread = thread_init(SetToOne, &Integer);
void *pThread = thread_init(SetToOne, &Integer, "wait");
thread_wait(pThread);
EXPECT_EQ(Integer, 1);
}
Expand Down Expand Up @@ -60,7 +60,7 @@ TEST(Thread, SemaphoreMultiThreaded)
SEMAPHORE Semaphore;
sphore_init(&Semaphore);
sphore_signal(&Semaphore);
void *pThread = thread_init(SemaphoreThread, &Semaphore);
void *pThread = thread_init(SemaphoreThread, &Semaphore, "semaphore");
thread_wait(pThread);
sphore_destroy(&Semaphore);
}
Expand All @@ -76,7 +76,7 @@ TEST(Thread, Lock)
{
LOCK Lock = lock_create();
lock_wait(Lock);
void *pThread = thread_init(LockThread, &Lock);
void *pThread = thread_init(LockThread, &Lock, "lock");
lock_unlock(Lock);
thread_wait(pThread);
}