Skip to content

Commit

Permalink
fix: listen to RemotePlayerDespawnedEvent
Browse files Browse the repository at this point in the history
  • Loading branch information
Dragonisser committed May 14, 2022
1 parent 3406433 commit 0aa9cc2
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Code/client/Services/Generic/OverlayService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ OverlayService::OverlayService(World& aWorld, TransportService& transport, entt:
m_playerLeftConnection = aDispatcher.sink<NotifyPlayerLeft>().connect<&OverlayService::OnPlayerLeft>(this);
m_playerDialogueConnection = aDispatcher.sink<NotifyPlayerDialogue>().connect<&OverlayService::OnPlayerDialogue>(this);
m_remotePlayerSpawnedConnection = aDispatcher.sink<RemotePlayerSpawnedEvent>().connect<&OverlayService::OnRemotePlayerSpawned>(this);
m_remotePlayerDespawnedConnection = aDispatcher.sink<RemotePlayerDespawnedEvent>().connect<&OverlayService::OnRemotePlayerDespawned>(this);
m_playerLevelConnection = aDispatcher.sink<NotifyPlayerLevel>().connect<&OverlayService::OnPlayerLevel>(this);
m_cellChangedConnection = aDispatcher.sink<NotifyPlayerCellChanged>().connect<&OverlayService::OnPlayerCellChanged>(this);
}
Expand Down Expand Up @@ -327,13 +328,17 @@ void OverlayService::OnRemotePlayerSpawned(const RemotePlayerSpawnedEvent& acEve
auto pArguments = CefListValue::Create();
pArguments->SetInt(0, acEvent.PlayerId);
pArguments->SetInt(1, static_cast<int>(percentage));
spdlog::debug("[3dLoad] {} - {}", acEvent.PlayerId, percentage);

m_pOverlay->ExecuteAsync("setPlayer3dLoaded", pArguments);
}

void OverlayService::OnRemotePlayerDespawned(const RemotePlayerDespawnedEvent& acEvent) noexcept
{
auto pArguments = CefListValue::Create();
pArguments->SetInt(0, acEvent.PlayerId);
spdlog::debug("[3dUnload] {}", acEvent.PlayerId);

m_pOverlay->ExecuteAsync("setPlayer3dUnloaded", pArguments);
}

Expand Down

0 comments on commit 0aa9cc2

Please sign in to comment.