Server now does Capture point logic too.
This commit is contained in:
@@ -136,7 +136,7 @@ void Server::parseMessageType(Packet& packet)
|
||||
parseOnPlayerDamage(packet);
|
||||
break;
|
||||
case MessageType::PlayerTransform:
|
||||
// parsePlayerTransform(packet);
|
||||
parsePlayerTransform(packet);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -549,7 +549,8 @@ void Server::parsePlayerTransform(Packet& packet)
|
||||
bool Server::shouldSendToClient(EntityWrapper childEntity)
|
||||
{
|
||||
return childEntity.HasComponent("Player") || childEntity.FirstParentWithComponent("Player").Valid()
|
||||
|| childEntity.HasComponent("CapturePointHUD");
|
||||
|| childEntity.HasComponent("CapturePointHUD") || childEntity.FirstParentWithComponent("CapturePointHUD").Valid();
|
||||
|
||||
}
|
||||
|
||||
PlayerID Server::GetPlayerIDFromEndpoint()
|
||||
|
||||
@@ -6,20 +6,20 @@ CapturePointSystem::CapturePointSystem(SystemParams params)
|
||||
, PureSystem("CapturePoint")
|
||||
{
|
||||
//subscribe/listenTo playerdamage,healthpickup events (using the eventBroker)
|
||||
if (IsClient) {
|
||||
//if (IsClient) {
|
||||
EVENT_SUBSCRIBE_MEMBER(m_ETriggerTouch, &CapturePointSystem::OnTriggerTouch);
|
||||
EVENT_SUBSCRIBE_MEMBER(m_ETriggerLeave, &CapturePointSystem::OnTriggerLeave);
|
||||
EVENT_SUBSCRIBE_MEMBER(m_ECaptured, &CapturePointSystem::OnCaptured);
|
||||
}
|
||||
//}
|
||||
}
|
||||
|
||||
//here all capturepoints will update their component
|
||||
//NOTE: needs to run each frame, since we're possibly modifying the captureTimer for the capturePoints by dt
|
||||
void CapturePointSystem::UpdateComponent(EntityWrapper& capturePointEntity, ComponentWrapper& cCapturePoint, double dt)
|
||||
{
|
||||
if (!IsClient) {
|
||||
return;
|
||||
}
|
||||
//if (!IsClient) {
|
||||
// return;
|
||||
//}
|
||||
|
||||
if (m_WinnerWasFound) {
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user