Merge branch 'Networking' of github.com:teamfisk/TacticalZ into Networking

# Conflicts:
#	src/Engine/Network/Client.cpp
This commit is contained in:
Jocke
2016-01-20 14:33:17 +01:00
+8 -2
View File
@@ -238,8 +238,7 @@ void Client::connect()
void Client::disconnect()
{
Packet packet(MessageType::Connect, m_SendPacketID);
packet.WriteString("+Disconnect");
Packet packet(MessageType::Disconnect, m_SendPacketID);
send(packet);
}
@@ -254,9 +253,16 @@ void Client::ping()
bool Client::OnInputCommand(const Events::InputCommand & e)
{
if (e.Command == "ConnectToServer") { // Connect for now
if (e.Value > 0) {
connect();
}
//LOG_DEBUG("Client::OnInputCommand: Command is %s. Value is %f. PlayerID is %i.", e.Command.c_str(), e.Value, e.PlayerID);
return true;
} else if (e.Command == "DisconnectFromServer") {
if (e.Value > 0) {
disconnect();
}
return true;
} else {
m_InputCommandBuffer.push_back(e);
//LOG_DEBUG("Client::OnInputCommand: Command is %s. Value is %f. PlayerID is %i.", e.Command.c_str(), e.Value, e.PlayerID);