mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
Refactoring
This commit is contained in:
parent
d102267139
commit
505a5b4172
|
@ -294,7 +294,7 @@ Messages = [
|
|||
NetStringStrict("m_Value"),
|
||||
]),
|
||||
|
||||
NetMessage("Cl_IsRace", []),
|
||||
NetMessage("Cl_IsDDRace", []),
|
||||
|
||||
NetMessage("Cl_TeamsState", [
|
||||
NetIntAny("m_Tee0"),
|
||||
|
|
|
@ -10,15 +10,15 @@
|
|||
|
||||
const float ZoomStep = 0.75f;
|
||||
void CCamera::ConZoomPlus(IConsole::IResult *pResult, void *pUserData, int ClientID) {
|
||||
//if(g_Config.m_ClRaceCheats == 1 || ((CCamera *)pUserData)->m_pClient->m_IsRace)
|
||||
//if(g_Config.m_ClDDRaceCheats == 1 || ((CCamera *)pUserData)->m_pClient->m_IsDDRace)
|
||||
((CCamera *)pUserData)->m_Zoom *= 1/ZoomStep;
|
||||
}
|
||||
void CCamera::ConZoomMinus(IConsole::IResult *pResult, void *pUserData, int ClientID) {
|
||||
//if(g_Config.m_ClRaceCheats == 1 || ((CCamera *)pUserData)->m_pClient->m_IsRace)
|
||||
//if(g_Config.m_ClDDRaceCheats == 1 || ((CCamera *)pUserData)->m_pClient->m_IsDDRace)
|
||||
((CCamera *)pUserData)->m_Zoom *= ZoomStep;
|
||||
}
|
||||
void CCamera::ConZoomReset(IConsole::IResult *pResult, void *pUserData, int ClientID) {
|
||||
//if(g_Config.m_ClRaceCheats == 1 || ((CCamera *)pUserData)->m_pClient->m_IsRace)
|
||||
//if(g_Config.m_ClDDRaceCheats == 1 || ((CCamera *)pUserData)->m_pClient->m_IsDDRace)
|
||||
((CCamera *)pUserData)->m_Zoom = 1.0f;
|
||||
}
|
||||
|
||||
|
|
|
@ -305,7 +305,7 @@ void CGameClient::OnInit()
|
|||
|
||||
m_ServerMode = SERVERMODE_PURE;
|
||||
|
||||
m_RaceMsgSent = false;
|
||||
m_DDRaceMsgSent = false;
|
||||
}
|
||||
|
||||
void CGameClient::DispatchInput()
|
||||
|
@ -396,7 +396,7 @@ void CGameClient::OnReset()
|
|||
Layers()->Dest();
|
||||
Collision()->Dest();
|
||||
|
||||
m_RaceMsgSent = false;
|
||||
m_DDRaceMsgSent = false;
|
||||
}
|
||||
|
||||
|
||||
|
@ -845,11 +845,11 @@ void CGameClient::OnNewSnapshot()
|
|||
m_ServerMode = SERVERMODE_PUREMOD;
|
||||
}
|
||||
|
||||
if(!m_RaceMsgSent && m_Snap.m_pLocalInfo)
|
||||
if(!m_DDRaceMsgSent && m_Snap.m_pLocalInfo)
|
||||
{
|
||||
CNetMsg_Cl_IsRace Msg;
|
||||
CNetMsg_Cl_IsDDRace Msg;
|
||||
Client()->SendPackMsg(&Msg, MSGFLAG_VITAL);
|
||||
m_RaceMsgSent = true;
|
||||
m_DDRaceMsgSent = true;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -55,7 +55,7 @@ class CGameClient : public IGameClient
|
|||
|
||||
int64 m_LastSendInfo;
|
||||
|
||||
bool m_RaceMsgSent;
|
||||
bool m_DDRaceMsgSent;
|
||||
|
||||
static void ConTeam(IConsole::IResult *pResult, void *pUserData, int ClientID);
|
||||
static void ConKill(IConsole::IResult *pResult, void *pUserData, int ClientID);
|
||||
|
|
|
@ -290,7 +290,7 @@ void CCharacterCore::Tick(bool UseInput)
|
|||
if(p/*&&*/)
|
||||
{
|
||||
//CCharacter* pl = GameServer()->m_apPlayers[m_HookedPlayer]->GetCharacter();
|
||||
//if (pl->m_RaceState != RACE_PAUSE)
|
||||
//if (pl->m_DDRaceState != DDRACE_PAUSE)
|
||||
m_HookPos = p->m_Pos;
|
||||
}
|
||||
else
|
||||
|
|
|
@ -69,7 +69,7 @@ bool CCharacter::Spawn(CPlayer *pPlayer, vec2 Pos)
|
|||
m_Pos = Pos;
|
||||
m_OlderPos = Pos;
|
||||
m_OldPos = Pos;
|
||||
m_RaceState = RACE_NONE;
|
||||
m_DDRaceState = DDRACE_NONE;
|
||||
m_PrevPos = Pos;
|
||||
m_Core.Reset();
|
||||
m_BroadTime = true;
|
||||
|
@ -620,7 +620,7 @@ void CCharacter::OnFinish()
|
|||
|
||||
}
|
||||
|
||||
m_RaceState = RACE_NONE;
|
||||
m_DDRaceState = DDRACE_NONE;
|
||||
// set player score
|
||||
if(!GameServer()->Score()->PlayerData(m_pPlayer->GetCID())->m_CurrentTime || GameServer()->Score()->PlayerData(m_pPlayer->GetCID())->m_CurrentTime > time)
|
||||
{
|
||||
|
@ -705,7 +705,7 @@ void CCharacter::Tick()
|
|||
|
||||
if(Server()->Tick() - m_RefreshTime >= Server()->TickSpeed())
|
||||
{
|
||||
if (m_RaceState == RACE_STARTED) {
|
||||
if (m_DDRaceState == DDRACE_STARTED) {
|
||||
int IntTime = (int)m_Time;
|
||||
if(m_BroadTime)
|
||||
str_format(aBuftime, sizeof(aBuftime), "%s%d:%s%d", ((IntTime/60) > 9)?"":"0", IntTime/60, ((IntTime%60) > 9)?"":"0", IntTime%60);
|
||||
|
@ -808,19 +808,19 @@ void CCharacter::HandleTiles(int Index)
|
|||
//dbg_msg("","N%d L%d R%d B%d T%d",m_TileFIndex,m_TileFIndexL,m_TileFIndexR,m_TileFIndexB,m_TileFIndexT);
|
||||
|
||||
int cp = GameServer()->Collision()->IsCheckpoint(MapIndex);
|
||||
if(cp != -1 && m_RaceState == RACE_STARTED && cp > m_CpActive)
|
||||
if(cp != -1 && m_DDRaceState == DDRACE_STARTED && cp > m_CpActive)
|
||||
{
|
||||
m_CpActive = cp;
|
||||
m_CpCurrent[cp] = m_Time;
|
||||
m_CpTick = Server()->Tick() + Server()->TickSpeed()*2;
|
||||
}
|
||||
if(((m_TileIndex == TILE_BEGIN) || (m_TileFIndex == TILE_BEGIN)) && (m_RaceState == RACE_NONE || (m_RaceState == RACE_STARTED && !Team())))
|
||||
if(((m_TileIndex == TILE_BEGIN) || (m_TileFIndex == TILE_BEGIN)) && (m_DDRaceState == DDRACE_NONE || (m_DDRaceState == DDRACE_STARTED && !Team())))
|
||||
{
|
||||
Controller->m_Teams.OnCharacterStart(m_pPlayer->GetCID());
|
||||
m_CpActive = -2;
|
||||
}
|
||||
|
||||
if(((m_TileIndex == TILE_END) || (m_TileFIndex == TILE_END)) && m_RaceState == RACE_STARTED)
|
||||
if(((m_TileIndex == TILE_END) || (m_TileFIndex == TILE_END)) && m_DDRaceState == DDRACE_STARTED)
|
||||
{
|
||||
Controller->m_Teams.OnCharacterFinish(m_pPlayer->GetCID());
|
||||
}
|
||||
|
@ -1281,7 +1281,7 @@ void CCharacter::Snap(int SnappingClient)
|
|||
CCharacter* SnapChar = GameServer()->GetPlayerChar(SnappingClient);
|
||||
if(SnapChar && !SnapChar->m_Super &&
|
||||
GameServer()->m_apPlayers[SnappingClient]->GetTeam() != -1 &&
|
||||
!CanCollide(SnappingClient) && !GameServer()->m_apPlayers[SnappingClient]->m_IsUsingRaceClient) return;
|
||||
!CanCollide(SnappingClient) && !GameServer()->m_apPlayers[SnappingClient]->m_IsUsingDDRaceClient) return;
|
||||
if(GetPlayer()->m_Invisible &&
|
||||
GetPlayer()->GetCID() != SnappingClient &&
|
||||
GameServer()->m_apPlayers[SnappingClient]->m_Authed < GetPlayer()->m_Authed
|
||||
|
|
|
@ -17,9 +17,9 @@ enum
|
|||
|
||||
enum
|
||||
{
|
||||
RACE_NONE = 0,
|
||||
RACE_STARTED,
|
||||
RACE_CHEAT // no time and won't start again unless ordered by a mod or death
|
||||
DDRACE_NONE = 0,
|
||||
DDRACE_STARTED,
|
||||
DDRACE_CHEAT // no time and won't start again unless ordered by a mod or death
|
||||
};
|
||||
|
||||
class CCharacter : public CEntity
|
||||
|
@ -96,7 +96,7 @@ public:
|
|||
// player controlling this character
|
||||
class CPlayer *m_pPlayer;
|
||||
|
||||
int m_RaceState;
|
||||
int m_DDRaceState;
|
||||
|
||||
void OnFinish();
|
||||
int Team();
|
||||
|
|
|
@ -80,7 +80,7 @@ void CPlasma::Snap(int SnappingClient)
|
|||
return;
|
||||
CCharacter* SnapChar = GameServer()->GetPlayerChar(SnappingClient);
|
||||
if(!SnapChar) return;
|
||||
if((SnapChar->Team() != m_ResponsibleTeam) && !SnapChar->GetPlayer()->m_IsUsingRaceClient) return;
|
||||
if((SnapChar->Team() != m_ResponsibleTeam) && !SnapChar->GetPlayer()->m_IsUsingDDRaceClient) return;
|
||||
CNetObj_Laser *pObj = static_cast<CNetObj_Laser *>(Server()->SnapNewItem(NETOBJTYPE_LASER, m_Id, sizeof(CNetObj_Laser)));
|
||||
pObj->m_X = (int)m_Pos.x;
|
||||
pObj->m_Y = (int)m_Pos.y;
|
||||
|
|
|
@ -958,9 +958,9 @@ void CGameContext::OnMessage(int MsgId, CUnpacker *pUnpacker, int ClientId)
|
|||
SendBroadcast(aBuf, ClientId);
|
||||
}
|
||||
}
|
||||
else if (MsgId == NETMSGTYPE_CL_ISRACE)
|
||||
else if (MsgId == NETMSGTYPE_CL_ISDDRACE)
|
||||
{
|
||||
pPlayer->m_IsUsingRaceClient = true;
|
||||
pPlayer->m_IsUsingDDRaceClient = true;
|
||||
char aBuf[128];
|
||||
str_format(aBuf, sizeof(aBuf), "%d use DDRace Client", pPlayer->GetCID());
|
||||
dbg_msg("DDRace", aBuf);
|
||||
|
@ -1261,7 +1261,7 @@ void CGameContext::ConGoLeft(IConsole::IResult *pResult, void *pUserData, int Cl
|
|||
{
|
||||
chr->m_Core.m_Pos.x -= 32;
|
||||
if(!g_Config.m_SvCheatTime)
|
||||
chr->m_RaceState = RACE_CHEAT;
|
||||
chr->m_DDRaceState = DDRACE_CHEAT;
|
||||
}
|
||||
}
|
||||
else if(pSelf->m_apPlayers[Victim] && compare_players(pSelf->m_apPlayers[ClientId],pSelf->m_apPlayers[Victim]))
|
||||
|
@ -1271,7 +1271,7 @@ void CGameContext::ConGoLeft(IConsole::IResult *pResult, void *pUserData, int Cl
|
|||
{
|
||||
chr->m_Core.m_Pos.x -= 32;
|
||||
if(!g_Config.m_SvCheatTime)
|
||||
chr->m_RaceState = RACE_CHEAT;
|
||||
chr->m_DDRaceState = DDRACE_CHEAT;
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -1297,7 +1297,7 @@ void CGameContext::ConGoRight(IConsole::IResult *pResult, void *pUserData, int C
|
|||
{
|
||||
chr->m_Core.m_Pos.x += 32;
|
||||
if(!g_Config.m_SvCheatTime)
|
||||
chr->m_RaceState = RACE_CHEAT;
|
||||
chr->m_DDRaceState = DDRACE_CHEAT;
|
||||
}
|
||||
}
|
||||
else if(pSelf->m_apPlayers[Victim] && compare_players(pSelf->m_apPlayers[ClientId],pSelf->m_apPlayers[Victim]))
|
||||
|
@ -1307,7 +1307,7 @@ void CGameContext::ConGoRight(IConsole::IResult *pResult, void *pUserData, int C
|
|||
{
|
||||
chr->m_Core.m_Pos.x += 32;
|
||||
if(!g_Config.m_SvCheatTime)
|
||||
chr->m_RaceState = RACE_CHEAT;
|
||||
chr->m_DDRaceState = DDRACE_CHEAT;
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -1333,7 +1333,7 @@ void CGameContext::ConGoDown(IConsole::IResult *pResult, void *pUserData, int Cl
|
|||
{
|
||||
chr->m_Core.m_Pos.y += 32;
|
||||
if(!g_Config.m_SvCheatTime)
|
||||
chr->m_RaceState = RACE_CHEAT;
|
||||
chr->m_DDRaceState = DDRACE_CHEAT;
|
||||
}
|
||||
}
|
||||
else if(pSelf->m_apPlayers[Victim] && compare_players(pSelf->m_apPlayers[ClientId],pSelf->m_apPlayers[Victim]))
|
||||
|
@ -1343,7 +1343,7 @@ void CGameContext::ConGoDown(IConsole::IResult *pResult, void *pUserData, int Cl
|
|||
{
|
||||
chr->m_Core.m_Pos.y += 32;
|
||||
if(!g_Config.m_SvCheatTime)
|
||||
chr->m_RaceState = RACE_CHEAT;
|
||||
chr->m_DDRaceState = DDRACE_CHEAT;
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -1369,7 +1369,7 @@ void CGameContext::ConGoUp(IConsole::IResult *pResult, void *pUserData, int Clie
|
|||
{
|
||||
chr->m_Core.m_Pos.y -= 32;
|
||||
if(!g_Config.m_SvCheatTime)
|
||||
chr->m_RaceState = RACE_CHEAT;
|
||||
chr->m_DDRaceState = DDRACE_CHEAT;
|
||||
}
|
||||
}
|
||||
else if(pSelf->m_apPlayers[Victim] && compare_players(pSelf->m_apPlayers[ClientId],pSelf->m_apPlayers[Victim]))
|
||||
|
@ -1379,7 +1379,7 @@ void CGameContext::ConGoUp(IConsole::IResult *pResult, void *pUserData, int Clie
|
|||
{
|
||||
chr->m_Core.m_Pos.y -= 32;
|
||||
if(!g_Config.m_SvCheatTime)
|
||||
chr->m_RaceState = RACE_CHEAT;
|
||||
chr->m_DDRaceState = DDRACE_CHEAT;
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -1486,7 +1486,7 @@ void CGameContext::ConNinjaMe(IConsole::IResult *pResult, void *pUserData, int C
|
|||
{
|
||||
chr->GiveNinja();
|
||||
if(!g_Config.m_SvCheatTime)
|
||||
chr->m_RaceState = RACE_CHEAT;
|
||||
chr->m_DDRaceState = DDRACE_CHEAT;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1502,7 +1502,7 @@ void CGameContext::ConNinja(IConsole::IResult *pResult, void *pUserData, int Cli
|
|||
{
|
||||
chr->GiveNinja();
|
||||
if(!g_Config.m_SvCheatTime)
|
||||
chr->m_RaceState = RACE_CHEAT;
|
||||
chr->m_DDRaceState = DDRACE_CHEAT;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1530,7 +1530,7 @@ void CGameContext::ConHammer(IConsole::IResult *pResult, void *pUserData, int Cl
|
|||
{
|
||||
chr->m_HammerType = type;
|
||||
if(!g_Config.m_SvCheatTime)
|
||||
chr->m_RaceState = RACE_CHEAT;
|
||||
chr->m_DDRaceState = DDRACE_CHEAT;
|
||||
str_format(buf, sizeof(buf), "Hammer of '%s' ClientId=%d setted to %d", pServ->ClientName(ClientId), Victim, type);
|
||||
pSelf->Console()->PrintResponse(IConsole::OUTPUT_LEVEL_STANDARD, "info", buf);
|
||||
}
|
||||
|
@ -1555,7 +1555,7 @@ void CGameContext::ConHammerMe(IConsole::IResult *pResult, void *pUserData, int
|
|||
{
|
||||
chr->m_HammerType = type;
|
||||
if(!g_Config.m_SvCheatTime)
|
||||
chr->m_RaceState = RACE_CHEAT;
|
||||
chr->m_DDRaceState = DDRACE_CHEAT;
|
||||
str_format(buf, sizeof(buf), "Hammer setted to %d",type);
|
||||
pSelf->Console()->PrintResponse(IConsole::OUTPUT_LEVEL_STANDARD, "info", buf);
|
||||
}
|
||||
|
@ -1578,7 +1578,7 @@ void CGameContext::ConSuper(IConsole::IResult *pResult, void *pUserData, int Cli
|
|||
dbg_msg("Teamb4super","%d",chr->m_TeamBeforeSuper = chr->Team());
|
||||
chr->Teams()->SetCharacterTeam(Victim, TEAM_SUPER);
|
||||
if(!g_Config.m_SvCheatTime)
|
||||
chr->m_RaceState = RACE_CHEAT;
|
||||
chr->m_DDRaceState = DDRACE_CHEAT;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1614,7 +1614,7 @@ void CGameContext::ConSuperMe(IConsole::IResult *pResult, void *pUserData, int C
|
|||
dbg_msg("Teamb4super","%d",chr->m_TeamBeforeSuper = chr->Team());
|
||||
chr->Teams()->SetCharacterTeam(ClientId, TEAM_SUPER);
|
||||
if(!g_Config.m_SvCheatTime)
|
||||
chr->m_RaceState = RACE_CHEAT;
|
||||
chr->m_DDRaceState = DDRACE_CHEAT;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1646,7 +1646,7 @@ void CGameContext::ConShotgun(IConsole::IResult *pResult, void *pUserData, int C
|
|||
{
|
||||
chr->GiveWeapon(WEAPON_SHOTGUN,-1);
|
||||
if(!g_Config.m_SvCheatTime)
|
||||
chr->m_RaceState = RACE_CHEAT;
|
||||
chr->m_DDRaceState = DDRACE_CHEAT;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1660,7 +1660,7 @@ void CGameContext::ConShotgunMe(IConsole::IResult *pResult, void *pUserData, int
|
|||
{
|
||||
chr->GiveWeapon(WEAPON_SHOTGUN,-1);
|
||||
if(!g_Config.m_SvCheatTime)
|
||||
chr->m_RaceState = RACE_CHEAT;
|
||||
chr->m_DDRaceState = DDRACE_CHEAT;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1676,7 +1676,7 @@ void CGameContext::ConGrenade(IConsole::IResult *pResult, void *pUserData, int C
|
|||
{
|
||||
chr->GiveWeapon(WEAPON_GRENADE,-1);
|
||||
if(!g_Config.m_SvCheatTime)
|
||||
chr->m_RaceState = RACE_CHEAT;
|
||||
chr->m_DDRaceState = DDRACE_CHEAT;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1690,7 +1690,7 @@ void CGameContext::ConGrenadeMe(IConsole::IResult *pResult, void *pUserData, int
|
|||
{
|
||||
chr->GiveWeapon(WEAPON_GRENADE,-1);
|
||||
if(!g_Config.m_SvCheatTime)
|
||||
chr->m_RaceState = RACE_CHEAT;
|
||||
chr->m_DDRaceState = DDRACE_CHEAT;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1706,7 +1706,7 @@ void CGameContext::ConLaser(IConsole::IResult *pResult, void *pUserData, int Cli
|
|||
{
|
||||
chr->GiveWeapon(WEAPON_RIFLE,-1);
|
||||
if(!g_Config.m_SvCheatTime)
|
||||
chr->m_RaceState = RACE_CHEAT;
|
||||
chr->m_DDRaceState = DDRACE_CHEAT;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1720,7 +1720,7 @@ void CGameContext::ConLaserMe(IConsole::IResult *pResult, void *pUserData, int C
|
|||
{
|
||||
chr->GiveWeapon(WEAPON_RIFLE,-1);
|
||||
if(!g_Config.m_SvCheatTime)
|
||||
chr->m_RaceState = RACE_CHEAT;
|
||||
chr->m_DDRaceState = DDRACE_CHEAT;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1736,7 +1736,7 @@ void CGameContext::ConWeapons(IConsole::IResult *pResult, void *pUserData, int C
|
|||
{
|
||||
chr->GiveAllWeapons();
|
||||
if(!g_Config.m_SvCheatTime)
|
||||
chr->m_RaceState = RACE_CHEAT;
|
||||
chr->m_DDRaceState = DDRACE_CHEAT;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1750,7 +1750,7 @@ void CGameContext::ConWeaponsMe(IConsole::IResult *pResult, void *pUserData, int
|
|||
{
|
||||
chr->GiveAllWeapons();
|
||||
if(!g_Config.m_SvCheatTime)
|
||||
chr->m_RaceState = RACE_CHEAT;
|
||||
chr->m_DDRaceState = DDRACE_CHEAT;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1771,7 +1771,7 @@ void CGameContext::ConTeleport(IConsole::IResult *pResult, void *pUserData, int
|
|||
{
|
||||
chr->m_Core.m_Pos = pSelf->m_apPlayers[cid2]->m_ViewPos;
|
||||
if(!g_Config.m_SvCheatTime)
|
||||
chr->m_RaceState = RACE_CHEAT;
|
||||
chr->m_DDRaceState = DDRACE_CHEAT;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1791,7 +1791,7 @@ void CGameContext::ConTimerStop(IConsole::IResult *pResult, void *pUserData, int
|
|||
return;
|
||||
if(pSelf->m_apPlayers[Victim] && compare_players(pSelf->m_apPlayers[ClientId],pSelf->m_apPlayers[Victim]))
|
||||
{
|
||||
chr->m_RaceState=RACE_CHEAT;
|
||||
chr->m_DDRaceState=DDRACE_CHEAT;
|
||||
str_format(buf, sizeof(buf), "'%s' ClientId=%d Hasn't time now (Timer Stopped)", pServ->ClientName(ClientId), Victim);
|
||||
pSelf->Console()->PrintResponse(IConsole::OUTPUT_LEVEL_STANDARD, "info", buf);
|
||||
}
|
||||
|
@ -1816,7 +1816,7 @@ void CGameContext::ConTimerStart(IConsole::IResult *pResult, void *pUserData, in
|
|||
return;
|
||||
if(pSelf->m_apPlayers[Victim] && compare_players(pSelf->m_apPlayers[ClientId],pSelf->m_apPlayers[Victim]))
|
||||
{
|
||||
chr->m_RaceState = RACE_STARTED;
|
||||
chr->m_DDRaceState = DDRACE_STARTED;
|
||||
str_format(buf, sizeof(buf), "'%s' ClientId=%d Has time now (Timer Started)", pServ->ClientName(ClientId), Victim);
|
||||
pSelf->Console()->PrintResponse(IConsole::OUTPUT_LEVEL_STANDARD, "info", buf);
|
||||
}
|
||||
|
@ -1846,7 +1846,7 @@ void CGameContext::ConTimerZero(IConsole::IResult *pResult, void *pUserData, int
|
|||
{
|
||||
chr->m_StartTime = pSelf->Server()->Tick();
|
||||
chr->m_RefreshTime = pSelf->Server()->Tick();
|
||||
chr->m_RaceState=RACE_CHEAT;
|
||||
chr->m_DDRaceState=DDRACE_CHEAT;
|
||||
str_format(buf, sizeof(buf), "'%s' ClientId=%d time has been reset & stopped.", pServ->ClientName(ClientId), Victim);
|
||||
pSelf->Console()->PrintResponse(IConsole::OUTPUT_LEVEL_STANDARD, "info", buf);
|
||||
}
|
||||
|
@ -1875,7 +1875,7 @@ void CGameContext::ConTimerReStart(IConsole::IResult *pResult, void *pUserData,
|
|||
{
|
||||
chr->m_StartTime = pSelf->Server()->Tick();
|
||||
chr->m_RefreshTime = pSelf->Server()->Tick();
|
||||
chr->m_RaceState=RACE_STARTED;
|
||||
chr->m_DDRaceState=DDRACE_STARTED;
|
||||
str_format(buf, sizeof(buf), "'%s' ClientId=%d time has been reset & stopped.", pServ->ClientName(ClientId), Victim);
|
||||
pSelf->Console()->PrintResponse(IConsole::OUTPUT_LEVEL_STANDARD, "info", buf);
|
||||
}
|
||||
|
|
|
@ -211,7 +211,7 @@ public:
|
|||
struct PlayerInfo {
|
||||
CCharacterCore m_Core;
|
||||
int m_StartTime;
|
||||
int m_RaceState;
|
||||
int m_DDRaceState;
|
||||
//int m_RefreshTime;
|
||||
int m_FreezeTime;
|
||||
bool m_Doored;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/*Based on rajh's, Redix's & Sushi Tee's, Race mod stuff and tweaked byt btd and GreYFoX@GTi with STL to fit our DDRace needs*/
|
||||
/*Based on rajh's, Redix's & Sushi Tee's, DDRace mod stuff and tweaked byt btd and GreYFoX@GTi with STL to fit our DDRace needs*/
|
||||
#include <engine/server.h>
|
||||
#include <game/mapitems.h>
|
||||
#include <game/server/entities/character.h>
|
||||
|
|
|
@ -30,7 +30,7 @@ CPlayer::CPlayer(CGameContext *pGameServer, int CID, int Team)
|
|||
GameServer()->Score()->PlayerData(CID)->Reset();
|
||||
|
||||
m_Invisible = false;
|
||||
m_IsUsingRaceClient = false;
|
||||
m_IsUsingDDRaceClient = false;
|
||||
}
|
||||
|
||||
CPlayer::~CPlayer()
|
||||
|
@ -248,7 +248,7 @@ void CPlayer::LoadCharacter()
|
|||
Character->m_StartTime = Server()->Tick() - (m_PauseInfo.m_PauseTime - m_PauseInfo.m_StartTime);
|
||||
else
|
||||
Character->m_StartTime = m_PauseInfo.m_StartTime;
|
||||
Character->m_RaceState = m_PauseInfo.m_RaceState;
|
||||
Character->m_DDRaceState = m_PauseInfo.m_DDRaceState;
|
||||
Character->m_RefreshTime = Server()->Tick();
|
||||
for(int i = 0; i < NUM_WEAPONS; ++i)
|
||||
{
|
||||
|
@ -281,7 +281,7 @@ void CPlayer::SaveCharacter()
|
|||
{
|
||||
m_PauseInfo.m_Core = Character->m_Core;
|
||||
m_PauseInfo.m_StartTime = Character->m_StartTime;
|
||||
m_PauseInfo.m_RaceState = Character->m_RaceState;
|
||||
m_PauseInfo.m_DDRaceState = Character->m_DDRaceState;
|
||||
for(int i = 0; i < WEAPON_NINJA; ++i)
|
||||
{
|
||||
m_PauseInfo.m_aHasWeapon[i] = Character->m_aWeapons[i].m_Got;
|
||||
|
|
|
@ -36,7 +36,7 @@ public:
|
|||
struct PauseInfo {
|
||||
CCharacterCore m_Core;
|
||||
int m_StartTime;
|
||||
int m_RaceState;
|
||||
int m_DDRaceState;
|
||||
//int m_RefreshTime;
|
||||
int m_FreezeTime;
|
||||
bool m_Doored;
|
||||
|
@ -87,13 +87,13 @@ public:
|
|||
// TODO: clean this up
|
||||
int m_Authed;
|
||||
|
||||
bool m_IsUsingRaceClient;
|
||||
bool m_IsUsingDDRaceClient;
|
||||
|
||||
bool m_ColorSet; // Set if player changed color at least once
|
||||
|
||||
int m_Starttime;
|
||||
int m_Refreshtime;
|
||||
int m_RaceState;
|
||||
int m_DDRaceState;
|
||||
int m_Besttick;
|
||||
int m_Lasttick;
|
||||
float m_BestLap;
|
||||
|
|
|
@ -17,7 +17,7 @@ void CGameTeams::OnCharacterStart(int id) {
|
|||
int Tick = Server()->Tick();
|
||||
if(m_Core.Team(id) == TEAM_FLOCK || m_Core.Team(id) == TEAM_SUPER) {
|
||||
CCharacter* Char = Character(id);
|
||||
Char->m_RaceState = RACE_STARTED;
|
||||
Char->m_DDRaceState = DDRACE_STARTED;
|
||||
Char->m_StartTime = Tick;
|
||||
Char->m_RefreshTime = Tick;
|
||||
} else {
|
||||
|
@ -28,7 +28,7 @@ void CGameTeams::OnCharacterStart(int id) {
|
|||
if(m_Core.Team(id) == m_Core.Team(i)) {
|
||||
CCharacter* Char = Character(i);
|
||||
|
||||
Char->m_RaceState = RACE_STARTED;
|
||||
Char->m_DDRaceState = DDRACE_STARTED;
|
||||
Char->m_StartTime = Tick;
|
||||
Char->m_RefreshTime = Tick;
|
||||
}
|
||||
|
@ -76,7 +76,7 @@ bool CGameTeams::SetCharacterTeam(int id, int Team) {
|
|||
//You cannot be in TEAM_SUPER if you not super
|
||||
if(Team == TEAM_SUPER && !Character(id)->m_Super) return false;
|
||||
//if you begin race
|
||||
if(Character(id)->m_RaceState != RACE_NONE) {
|
||||
if(Character(id)->m_DDRaceState != DDRACE_NONE) {
|
||||
//you will be killed if you try to join FLOCK
|
||||
if(Team == TEAM_FLOCK && m_Core.Team(id) != TEAM_FLOCK) {
|
||||
Character(id)->GetPlayer()->KillCharacter(WEAPON_GAME);
|
||||
|
@ -90,7 +90,7 @@ bool CGameTeams::SetCharacterTeam(int id, int Team) {
|
|||
char aBuf[512];
|
||||
str_format(aBuf, sizeof(aBuf), "Id = %d Team = %d", id, Team);
|
||||
dbg_msg("Teams", aBuf);
|
||||
if(Character(id) && Character(id)->GetPlayer()->m_IsUsingRaceClient) {
|
||||
if(Character(id) && Character(id)->GetPlayer()->m_IsUsingDDRaceClient) {
|
||||
SendTeamsState(id);
|
||||
}
|
||||
//GameServer()->CreatePlayerSpawn(Character(id)->m_Core.m_Pos, TeamMask());
|
||||
|
|
|
@ -20,7 +20,7 @@ MACRO_CONFIG_INT(ClMouseDeadzone, cl_mouse_deadzone, 300, 0, 0, CFGFLAG_CLIENT|C
|
|||
MACRO_CONFIG_INT(ClMouseFollowfactor, cl_mouse_followfactor, 60, 0, 200, CFGFLAG_CLIENT|CFGFLAG_SAVE, "", -1)
|
||||
MACRO_CONFIG_INT(ClMouseMaxDistance, cl_mouse_max_distance, 800, 0, 0, CFGFLAG_CLIENT|CFGFLAG_SAVE, "", -1)
|
||||
|
||||
MACRO_CONFIG_INT(ClRaceCheats, cl_race_cheats, 0, 0, 1, CFGFLAG_CLIENT|CFGFLAG_SAVE, "",0)
|
||||
MACRO_CONFIG_INT(ClDDRaceCheats, cl_race_cheats, 0, 0, 1, CFGFLAG_CLIENT|CFGFLAG_SAVE, "",0)
|
||||
|
||||
MACRO_CONFIG_INT(EdShowkeys, ed_showkeys, 0, 0, 1, CFGFLAG_CLIENT|CFGFLAG_SAVE, "", -1)
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#ifndef GAME_VERSION_H
|
||||
#define GAME_VERSION_H
|
||||
|
||||
#define DDRACE_VERSION "DDRace Alpha 1.0, 0.5 trunk"
|
||||
#define GAME_VERSION "DDRace Alpha 1.0, 0.5 trunk"
|
||||
#define DDRACE_VERSION "DDRace 1.0a, 0.5 trunk"
|
||||
#define GAME_VERSION "DDRace 1.0a, 0.5 trunk"
|
||||
#define GAME_NETVERSION "0.5 b67d1f1a1eea234e"
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue