mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
Merge branch 'master' of http://github.com/heinrich5991/DDRace
This commit is contained in:
commit
5e841fcfae
|
@ -1083,6 +1083,11 @@ void CClient::ProcessPacket(CNetChunk *pPacket)
|
|||
// don't add invalid info to the server browser list
|
||||
if(Info.m_NumPlayers < 0 || Info.m_NumPlayers > MAX_CLIENTS || Info.m_MaxPlayers < 0 || Info.m_MaxPlayers > MAX_CLIENTS)
|
||||
return;
|
||||
|
||||
if((Info.m_Flags | SERVER_FLAGS_VERSION) != SERVER_FLAG_VERSION || !str_find_nocase(Info.m_aGameType, "ddrace"))
|
||||
Info.m_Flags &= SERVER_FLAGS_DEFAULT;
|
||||
else
|
||||
Info.m_Flags &= SERVER_FLAGS_ALL;
|
||||
|
||||
str_format(Info.m_aAddress, sizeof(Info.m_aAddress), "%d.%d.%d.%d:%d",
|
||||
pPacket->m_Address.ip[0], pPacket->m_Address.ip[1], pPacket->m_Address.ip[2],
|
||||
|
|
|
@ -82,6 +82,9 @@ public:
|
|||
virtual void OnClientPredictedInput(int ClientID, void *pInput) = 0;
|
||||
|
||||
virtual void OnSetAuthed(int ClientId,int Level) = 0;
|
||||
|
||||
virtual bool PlayerCollision() = 0;
|
||||
virtual bool PlayerHooking() = 0;
|
||||
|
||||
virtual const char *Version() = 0;
|
||||
virtual const char *NetVersion() = 0;
|
||||
|
|
|
@ -967,10 +967,41 @@ void CServer::SendServerInfo(NETADDR *pAddr, int Token)
|
|||
|
||||
// flags
|
||||
int i = 0;
|
||||
|
||||
i |= SERVER_FLAG_VERSION;
|
||||
if(g_Config.m_Password[0]) // password set
|
||||
i |= SERVER_FLAG_PASSWORD;
|
||||
if(g_Config.m_SvTeam)
|
||||
i |= SERVER_FLAG_TEAMS;
|
||||
if(g_Config.m_SvTeamStrict)
|
||||
i |= SERVER_FLAG_STRICTTEAMS;
|
||||
if(g_Config.m_SvCheats)
|
||||
i |= SERVER_FLAG_CHEATS;
|
||||
if(g_Config.m_SvPauseable)
|
||||
i |= SERVER_FLAG_PAUSE;
|
||||
if(g_Config.m_SvEndlessSuperHook)
|
||||
i |= SERVER_FLAG_ENDLESSSUPERHOOKING;
|
||||
if(g_Config.m_SvTimer)
|
||||
i |= SERVER_FLAG_TIMERCOMMANDS;
|
||||
if(g_Config.m_SvCheatTime)
|
||||
i |= SERVER_FLAG_TIMECHEAT;
|
||||
if(g_Config.m_SvPauseTime)
|
||||
i |= SERVER_FLAG_PAUSETIME;
|
||||
if(GameServer()->PlayerCollision())
|
||||
i |= SERVER_FLAG_PLAYERCOLLISION;
|
||||
if(GameServer()->PlayerHooking())
|
||||
i |= SERVER_FLAG_PLAYERHOOKING;
|
||||
if(g_Config.m_SvEndlessDrag)
|
||||
i |= SERVER_FLAG_ENDLESSHOOKING;
|
||||
if(g_Config.m_SvHit)
|
||||
i |= SERVER_FLAG_HIT;
|
||||
if(g_Config.m_SvMapTest)
|
||||
i |= SERVER_FLAG_MAPTEST;
|
||||
if(g_Config.m_SvServerTest)
|
||||
i |= SERVER_FLAG_SERVERTEST;
|
||||
|
||||
str_format(aBuf, sizeof(aBuf), "%d", i);
|
||||
p.AddString(aBuf, 2);
|
||||
p.AddString(aBuf, 11);
|
||||
|
||||
// progression
|
||||
str_format(aBuf, sizeof(aBuf), "%d", m_BrowseinfoProgression);
|
||||
|
|
|
@ -102,6 +102,14 @@ MACRO_CONFIG_STR(SvRconPasswordHelper, sv_helper_pass, 32, "", CFGFLAG_SERVER, "
|
|||
MACRO_CONFIG_INT(SvHit, sv_hit, 1, 0, 1, CFGFLAG_SERVER, "Whether players can hammer/grenade/laser eachother or not", 4)
|
||||
MACRO_CONFIG_INT(SvEndlessDrag, sv_endless_drag, 0, 0, 1, CFGFLAG_SERVER, "Turns endless hooking on/off", 4)
|
||||
|
||||
MACRO_CONFIG_INT(SvMapTest, sv_map_test, 0, 0, 1, CFGFLAG_SERVER, "Whether this server is just for map testing", 3)
|
||||
|
||||
#ifndef CONF_DEBUG
|
||||
MACRO_CONFIG_INT(SvServerTest, sv_server_test, 0, 0, 0, CFGFLAG_SERVER, "Whether this server is for testing the mod (only available for debug compilation)", 4)
|
||||
#else
|
||||
MACRO_CONFIG_INT(SvServerTest, sv_server_test, 1, 0, 1, CFGFLAG_SERVER, "Whether this server is for testing the mod (only available for debug compilation)", 4)
|
||||
#endif
|
||||
|
||||
MACRO_CONFIG_INT(SvCheats, sv_cheats, 0, 0, 1, CFGFLAG_SERVER, "Turns cheats on/off", 4)
|
||||
MACRO_CONFIG_INT(SvCheatTime, sv_cheattime, 0, 0, 1, CFGFLAG_SERVER, "Whether the time of players will be stopped on cheating or not", 4)
|
||||
MACRO_CONFIG_INT(SvEndlessSuperHook, sv_endless_super_hook, 0, 0, 1, CFGFLAG_SERVER, "Endless hook for super players on/off", 4)
|
||||
|
|
|
@ -71,7 +71,37 @@ enum
|
|||
enum
|
||||
{
|
||||
SERVER_TICK_SPEED=50,
|
||||
SERVER_FLAG_PASSWORD = 0x1,
|
||||
|
||||
SERVER_FLAG_PASSWORD = 0x1, // A
|
||||
SERVER_FLAG_TEAMS = 0x100, // B
|
||||
SERVER_FLAG_STRICTTEAMS = 0x200, // C
|
||||
SERVER_FLAG_CHEATS = 0x1000, // D
|
||||
SERVER_FLAG_PAUSE = 0x2000, // E
|
||||
SERVER_FLAG_ENDLESSSUPERHOOKING = 0x4000, // F
|
||||
SERVER_FLAG_TIMERCOMMANDS = 0x10000, // G
|
||||
SERVER_FLAG_TIMECHEAT = 0x20000, // H
|
||||
SERVER_FLAG_PAUSETIME = 0x40000, // I
|
||||
SERVER_FLAG_PLAYERCOLLISION = 0x100000, // K
|
||||
SERVER_FLAG_PLAYERHOOKING = 0x200000, // L
|
||||
SERVER_FLAG_ENDLESSHOOKING = 0x400000, // M
|
||||
SERVER_FLAG_HIT = 0x800000, // N
|
||||
SERVER_FLAG_MAPTEST = 0x1000000, // O
|
||||
SERVER_FLAG_SERVERTEST = 0x2000000, // P
|
||||
|
||||
SERVER_FLAG_VERSION = 0x10000000,
|
||||
|
||||
SERVER_FLAGS_DEFAULT = 0x1,
|
||||
SERVER_FLAGS_TEAMS = 0x30,
|
||||
SERVER_FLAGS_CHEATS = 0x700,
|
||||
SERVER_FLAGS_TIME = 0x7000,
|
||||
SERVER_FLAGS_GAMEPLAY = 0xF0000,
|
||||
SERVER_FLAGS_TESTING = 0x300000,
|
||||
SERVER_FLAGS_VERSION = 0xF000000,
|
||||
|
||||
SERVER_FLAGS_ALL = 0xF3F7731,
|
||||
|
||||
// version | testing | gameplay | time | cheats | teams | unused | default
|
||||
// 0001 | 00PO | NMLK | 0IHG | 0FED | 00CB | 0000 | 000A - 0 means unused, letter means used
|
||||
|
||||
MAX_CLIENTS=16,
|
||||
|
||||
|
|
|
@ -674,6 +674,20 @@ bool ComparePlayers(CPlayer *pl1, CPlayer *pl2)
|
|||
return false;
|
||||
}
|
||||
|
||||
bool CGameContext::PlayerCollision()
|
||||
{
|
||||
float Temp;
|
||||
m_Tuning.Get("player_collision", &Temp);
|
||||
return Temp != 0.0;
|
||||
}
|
||||
|
||||
bool CGameContext::PlayerHooking()
|
||||
{
|
||||
float Temp;
|
||||
m_Tuning.Get("player_hooking", &Temp);
|
||||
return Temp != 0.0;
|
||||
}
|
||||
|
||||
void CGameContext::OnSetAuthed(int client_id, int Level)
|
||||
{
|
||||
if(m_apPlayers[client_id])
|
||||
|
|
|
@ -276,6 +276,9 @@ public:
|
|||
|
||||
virtual void OnSetAuthed(int ClientId,int Level);
|
||||
|
||||
virtual bool PlayerCollision();
|
||||
virtual bool PlayerHooking();
|
||||
|
||||
virtual const char *Version();
|
||||
virtual const char *NetVersion();
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue