Hopeless attempts to fix network bugs
This commit is contained in:
@@ -23,7 +23,7 @@ StartNetwork=false
|
||||
IsServer=false
|
||||
Name=Bob
|
||||
Address=127.0.0.1
|
||||
Port=13
|
||||
Port=27666
|
||||
MaxConnections=8
|
||||
SnapshotInterval=0.05
|
||||
SendInputIntervalMs=33
|
||||
|
||||
@@ -187,7 +187,7 @@ void Server::addChildrenToPacket(Packet & packet, EntityID entityID)
|
||||
{
|
||||
// HACK: Only sync players for now, since the map turned out to be TOO LARGE to send in one snapshot and Simon's computer shits itself
|
||||
EntityWrapper entity(m_World, entityID);
|
||||
if (entityID != EntityID_Invalid && !shouldSendToClient(entity)) {
|
||||
if (!entity.Valid() || !shouldSendToClient(entity)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -6,15 +6,21 @@ CapturePointSystem::CapturePointSystem(SystemParams params)
|
||||
, PureSystem("CapturePoint")
|
||||
{
|
||||
//subscribe/listenTo playerdamage,healthpickup events (using the eventBroker)
|
||||
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 (m_WinnerWasFound) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -114,6 +114,7 @@ void PlayerMovementSystem::updateMovementControllers(double dt)
|
||||
if (isOnGround) {
|
||||
controller->SetDoubleJumping(false);
|
||||
} else {
|
||||
if (IsClient) {
|
||||
//put a hexagon at the players feet
|
||||
auto hexagonEffect = ResourceManager::Load<EntityFile>("Schema/Entities/DoubleJumpHexagon.xml");
|
||||
EntityFileParser parser(hexagonEffect);
|
||||
@@ -124,6 +125,7 @@ void PlayerMovementSystem::updateMovementControllers(double dt)
|
||||
Events::DoubleJump e;
|
||||
m_EventBroker->Publish(e);
|
||||
}
|
||||
}
|
||||
velocity.y = 4.f;
|
||||
}
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ SoundSystem::SoundSystem(SystemParams params)
|
||||
{
|
||||
ConfigFile* config = ResourceManager::Load<ConfigFile>("Config.ini");
|
||||
m_Announcer = ResourceManager::Load<ConfigFile>("Config.ini")->Get<std::string>("Sound.Announcer", "female");
|
||||
if (IsClient) {
|
||||
EVENT_SUBSCRIBE_MEMBER(m_EPlayerSpawned, &SoundSystem::OnPlayerSpawned);
|
||||
EVENT_SUBSCRIBE_MEMBER(m_InputCommand, &SoundSystem::OnInputCommand);
|
||||
EVENT_SUBSCRIBE_MEMBER(m_EDoubleJump, &SoundSystem::OnDoubleJump);
|
||||
@@ -14,12 +15,17 @@ SoundSystem::SoundSystem(SystemParams params)
|
||||
EVENT_SUBSCRIBE_MEMBER(m_ECaptured, &SoundSystem::OnCaptured);
|
||||
EVENT_SUBSCRIBE_MEMBER(m_ETriggerTouch, &SoundSystem::OnTriggerTouch);
|
||||
}
|
||||
}
|
||||
|
||||
void SoundSystem::UpdateComponent(EntityWrapper& entity, ComponentWrapper& cComponent, double dt)
|
||||
{ }
|
||||
|
||||
void SoundSystem::Update(double dt)
|
||||
{
|
||||
if (!IsClient) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Temp for play test.
|
||||
if (m_DrumsIsPlaying) {
|
||||
m_DrumsIsPlaying = !drumTimer(dt);
|
||||
|
||||
Reference in New Issue
Block a user