From 6e9ae670537fa0d89a610d8a809ea28c6edbcaa6 Mon Sep 17 00:00:00 2001 From: necropotame Date: Fri, 28 Oct 2016 09:51:35 +0200 Subject: [PATCH] Fix circles in menu for DDNet clients --- src/engine/server/mapconverter.cpp | 9 +++++---- src/engine/server/server.cpp | 4 ++++ 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/engine/server/mapconverter.cpp b/src/engine/server/mapconverter.cpp index d37b4b0a1..fe7a9e9bd 100644 --- a/src/engine/server/mapconverter.cpp +++ b/src/engine/server/mapconverter.cpp @@ -131,8 +131,6 @@ void CMapConverter::CreateCircle(array* 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; @@ -147,14 +145,17 @@ void CMapConverter::CreateCircle(array* 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); diff --git a/src/engine/server/server.cpp b/src/engine/server/server.cpp index e3b0d47a1..4c6690466 100644 --- a/src/engine/server/server.cpp +++ b/src/engine/server/server.cpp @@ -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);