Fixed merge conflicts. Scoreboard updates team when a team is picked. Fixed some code standard violations and misspellings.
This commit is contained in:
@@ -94,17 +94,17 @@ void Server::Update(double dt)
|
||||
previousSnapshotMessage = 0;
|
||||
}
|
||||
// Send pings each
|
||||
previousePingMessage += dt;
|
||||
if (pingInterval < previousePingMessage) {
|
||||
previousPingMessage += dt;
|
||||
if (pingInterval < previousPingMessage) {
|
||||
sendPing();
|
||||
previousePingMessage = 0;
|
||||
previousPingMessage = 0;
|
||||
}
|
||||
|
||||
// Time out logic
|
||||
timOutTimer += dt;
|
||||
if (checkTimeOutInterval < timOutTimer) {
|
||||
timeOutTimer += dt;
|
||||
if (checkTimeOutInterval < timeOutTimer) {
|
||||
checkForTimeOuts();
|
||||
timOutTimer = 0;
|
||||
timeOutTimer = 0;
|
||||
}
|
||||
m_EventBroker->Process<Server>();
|
||||
if (isReadingData) {
|
||||
@@ -117,7 +117,7 @@ void Server::Update(double dt)
|
||||
// Take the first CapturePointGameMode component found.
|
||||
ComponentWrapper& modeComponent = *pool->begin();
|
||||
// Decrease timer.
|
||||
double& timer = (double&)modeComponent["ResetCountdown"];
|
||||
Field<double> timer = modeComponent["ResetCountdown"];
|
||||
timer -= dt;
|
||||
if (timer < 0) {
|
||||
resetMap();
|
||||
|
||||
@@ -10,9 +10,9 @@ CapturePointSystem::CapturePointSystem(SystemParams params)
|
||||
EVENT_SUBSCRIBE_MEMBER(m_ETriggerTouch, &CapturePointSystem::OnTriggerTouch);
|
||||
EVENT_SUBSCRIBE_MEMBER(m_ETriggerLeave, &CapturePointSystem::OnTriggerLeave);
|
||||
EVENT_SUBSCRIBE_MEMBER(m_ECaptured, &CapturePointSystem::OnCaptured);
|
||||
EVENT_SUBSCRIBE_MEMBER(m_EReset, &CapturePointSystem::OnReset);
|
||||
Init();
|
||||
}
|
||||
EVENT_SUBSCRIBE_MEMBER(m_EReset, &CapturePointSystem::OnReset);
|
||||
Init();
|
||||
}
|
||||
|
||||
void CapturePointSystem::Init()
|
||||
|
||||
@@ -10,6 +10,7 @@ ScoreScreenSystem::ScoreScreenSystem(SystemParams params)
|
||||
EVENT_SUBSCRIBE_MEMBER(m_EPlayerConnected, &ScoreScreenSystem::OnPlayerConnected);
|
||||
EVENT_SUBSCRIBE_MEMBER(m_EPlayerDisconnected, &ScoreScreenSystem::OnPlayerDisconnected);
|
||||
EVENT_SUBSCRIBE_MEMBER(m_EReset, &ScoreScreenSystem::OnReset);
|
||||
EVENT_SUBSCRIBE_MEMBER(m_EInputCommand, &ScoreScreenSystem::OnInputCommand);
|
||||
}
|
||||
|
||||
void ScoreScreenSystem::UpdateComponent(EntityWrapper& entity, ComponentWrapper& scoreScreen, double dt)
|
||||
@@ -168,3 +169,14 @@ bool ScoreScreenSystem::OnReset(const Events::Reset & e)
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ScoreScreenSystem::OnInputCommand(const Events::InputCommand & e)
|
||||
{
|
||||
if (e.Command != "PickTeam" || e.PlayerID == -1 || e.Value == 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
m_PlayerIdentities.at(e.PlayerID).Team = e.Value;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user