Skip to content

Commit

Permalink
Fix circles in menu for DDNet clients
Browse files Browse the repository at this point in the history
  • Loading branch information
necropotame committed Oct 28, 2016
1 parent e4133ae commit 6e9ae67
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/engine/server/mapconverter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,6 @@ void CMapConverter::CreateCircle(array<CQuad>* pQuads, vec2 CenterPos, float Siz
InitQuad(&Quad);
Quad.m_aPoints[0].x = f2fx(CenterPos.x);
Quad.m_aPoints[0].y = f2fx(CenterPos.y);
Quad.m_aPoints[3].x = f2fx(CenterPos.x);
Quad.m_aPoints[3].y = f2fx(CenterPos.y);
Quad.m_aColors[0].r = Quad.m_aColors[1].r = Quad.m_aColors[2].r = Quad.m_aColors[3].r = Color.r*255.0f;
Quad.m_aColors[0].g = Quad.m_aColors[1].g = Quad.m_aColors[2].g = Quad.m_aColors[3].g = Color.g*255.0f;
Quad.m_aColors[0].b = Quad.m_aColors[1].b = Quad.m_aColors[2].b = Quad.m_aColors[3].b = Color.b*255.0f;
Expand All @@ -147,14 +145,17 @@ void CMapConverter::CreateCircle(array<CQuad>* pQuads, vec2 CenterPos, float Siz
vec2 LastPos = CenterPos+RadiusVect;
for(int i=0; i<32; i++)
{
vec2 PosMid = CenterPos+rotate(RadiusVect, AngleIter - AngleStep/2.0f);
vec2 Pos = CenterPos+rotate(RadiusVect, AngleIter);

Quad.m_aPoints[1].x = f2fx(LastPos.x);
Quad.m_aPoints[1].y = f2fx(LastPos.y);
Quad.m_aPoints[2].x = f2fx(Pos.x);
Quad.m_aPoints[2].y = f2fx(Pos.y);
Quad.m_aPoints[4].x = f2fx((Pos.x+LastPos.x)/2.0f);
Quad.m_aPoints[4].y = f2fx((Pos.y+LastPos.y)/2.0f);
Quad.m_aPoints[3].x = f2fx(PosMid.x);
Quad.m_aPoints[3].y = f2fx(PosMid.y);
Quad.m_aPoints[4].x = f2fx((PosMid.x+CenterPos.x)/2.0f);
Quad.m_aPoints[4].y = f2fx((PosMid.y+CenterPos.y)/2.0f);

pQuads->add(Quad);

Expand Down
4 changes: 4 additions & 0 deletions src/engine/server/server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1303,6 +1303,10 @@ void CServer::ProcessClientPacket(CNetChunk *pPacket)
{
SendRconLine(ClientID, "No rcon password set on server. Set sv_rcon_password and/or sv_rcon_mod_password to enable the remote console.");
}
else if(!m_NetServer.HasSecurityToken(ClientID))
{
SendRconLine(ClientID, "You must use a client that support anti-spoof protection (DDNet-like)");
}
else if(g_Config.m_SvRconPassword[0] && str_comp(pPw, g_Config.m_SvRconPassword) == 0)
{
CMsgPacker Msg(NETMSG_RCON_AUTH_STATUS);
Expand Down

0 comments on commit 6e9ae67

Please sign in to comment.