Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 5ea0f04b20 |
@@ -10,30 +10,31 @@
|
|||||||
#include <boost/asio.hpp>
|
#include <boost/asio.hpp>
|
||||||
#include <boost/shared_array.hpp>
|
#include <boost/shared_array.hpp>
|
||||||
|
|
||||||
|
#include "Core/World.h"
|
||||||
|
#include "Core/EntityFile.h"
|
||||||
|
#include "Core/EventBroker.h"
|
||||||
|
#include "Core/ConfigFile.h"
|
||||||
|
#include "Core/EPlayerDeath.h"
|
||||||
|
#include "Core/EPlayerDamage.h"
|
||||||
|
#include "Core/EPlayerSpawned.h"
|
||||||
|
#include "Core/EAmmoPickup.h"
|
||||||
|
#include "Game/Events/EDoubleJump.h"
|
||||||
|
#include "Game/Events/EDashAbility.h"
|
||||||
|
#include "Game/Events/EReset.h"
|
||||||
|
#include "Input/EInputCommand.h"
|
||||||
|
#include "imgui/imgui.h"
|
||||||
#include "Network/Network.h"
|
#include "Network/Network.h"
|
||||||
#include "Network/MessageType.h"
|
#include "Network/MessageType.h"
|
||||||
#include "Network/PlayerDefinition.h"
|
#include "Network/PlayerDefinition.h"
|
||||||
#include "Network/UDPClient.h"
|
#include "Network/UDPClient.h"
|
||||||
#include "Network/TCPClient.h"
|
#include "Network/TCPClient.h"
|
||||||
#include "Network/SnapshotDefinitions.h"
|
#include "Network/SnapshotDefinitions.h"
|
||||||
#include "Core/World.h"
|
|
||||||
#include "Core/EntityFile.h"
|
|
||||||
#include "Core/EventBroker.h"
|
|
||||||
#include "Core/ConfigFile.h"
|
|
||||||
#include "Core/EPlayerDeath.h"
|
|
||||||
#include "Input/EInputCommand.h"
|
|
||||||
#include "Core/EPlayerDamage.h"
|
|
||||||
#include "../Game/Events/EDoubleJump.h"
|
|
||||||
#include "Network/EInterpolate.h"
|
|
||||||
#include "Network/SnapshotFilter.h"
|
|
||||||
#include "Core/EPlayerSpawned.h"
|
|
||||||
#include "Core/EAmmoPickup.h"
|
|
||||||
#include "Network/ESearchForServers.h"
|
|
||||||
#include "../Game/Events/EDashAbility.h"
|
|
||||||
#include "Network/EDisplayServerlist.h"
|
#include "Network/EDisplayServerlist.h"
|
||||||
#include "Network/EConnectRequest.h"
|
#include "Network/EConnectRequest.h"
|
||||||
#include "Network/EPlayerDisconnected.h"
|
#include "Network/EPlayerDisconnected.h"
|
||||||
#include "Game/Events/EReset.h"
|
#include "Network/ESearchForServers.h"
|
||||||
|
#include "Network/EInterpolate.h"
|
||||||
|
#include "Network/SnapshotFilter.h"
|
||||||
|
|
||||||
class Client : public Network
|
class Client : public Network
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -108,7 +108,15 @@ void Client::Update(double dt)
|
|||||||
|
|
||||||
hasServerTimedOut();
|
hasServerTimedOut();
|
||||||
}
|
}
|
||||||
//Network::Update();
|
|
||||||
|
if (ImGui::BeginPopupModal("Disconnected", nullptr, ImGuiWindowFlags_AlwaysAutoResize)) {
|
||||||
|
ImGui::Text("You have been disconnected from server.\n\n");
|
||||||
|
ImGui::SetCursorPosX(ImGui::GetContentRegionAvailWidth() - 120);
|
||||||
|
if (ImGui::Button("OK", ImVec2(120, 0))) {
|
||||||
|
ImGui::CloseCurrentPopup();
|
||||||
|
}
|
||||||
|
ImGui::EndPopup();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Client::parseMessageType(Packet& packet)
|
void Client::parseMessageType(Packet& packet)
|
||||||
@@ -196,7 +204,7 @@ void Client::parseTCPConnect(Packet& packet)
|
|||||||
packet.WritePrimitive(m_PlayerID);
|
packet.WritePrimitive(m_PlayerID);
|
||||||
m_Unreliable.Send(packet);
|
m_Unreliable.Send(packet);
|
||||||
|
|
||||||
// LOG_INFO("Sent UDP Connect Server");
|
// LOG_INFO("Sent UDP Connect Server");
|
||||||
}
|
}
|
||||||
|
|
||||||
void Client::parsePlayerConnected(Packet & packet)
|
void Client::parsePlayerConnected(Packet & packet)
|
||||||
@@ -676,6 +684,7 @@ void Client::hasServerTimedOut()
|
|||||||
if (timeSincePing > m_TimeoutMs) {
|
if (timeSincePing > m_TimeoutMs) {
|
||||||
// Clear everything and go to menu.
|
// Clear everything and go to menu.
|
||||||
LOG_INFO("Server has timed out, returning to menu, Beep Boop.");
|
LOG_INFO("Server has timed out, returning to menu, Beep Boop.");
|
||||||
|
ImGui::OpenPopup("Disconnected");
|
||||||
disconnect();
|
disconnect();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user