mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-16 19:43:06 +01:00
fix cmake compile errors
fix cmake compile errors
This commit is contained in:
@@ -22,16 +22,15 @@
|
||||
|
||||
#include <math.h>
|
||||
#include <set>
|
||||
#include "network.h"
|
||||
extern "C" {
|
||||
#include "../addresses.h"
|
||||
#include "../common.h"
|
||||
#include "../game.h"
|
||||
#include "../localisation/date.h"
|
||||
#include "../localisation/localisation.h"
|
||||
#include "../management/news_item.h"
|
||||
#include "../scenario.h"
|
||||
}
|
||||
#include "network.h"
|
||||
|
||||
#pragma comment(lib, "Ws2_32.lib")
|
||||
|
||||
@@ -51,21 +50,17 @@ struct GameCommand
|
||||
}
|
||||
};
|
||||
|
||||
static network_packet* _packetQueue = NULL;
|
||||
static int _wsaInitialised = 0;
|
||||
static WSADATA _wsaData;
|
||||
static SOCKET _listeningSocket = INVALID_SOCKET;
|
||||
static SOCKET _serverSocket = INVALID_SOCKET;
|
||||
static SOCKET _clientSocket = INVALID_SOCKET;
|
||||
static network_packet _inboundPacket;
|
||||
static std::vector<uint8> _chunkBuffer;
|
||||
static NetworkConnection _serverConnection;
|
||||
static std::list<std::unique_ptr<NetworkConnection>> _clientConnectionList;
|
||||
static std::multiset<GameCommand> _gameCommandQueue;
|
||||
|
||||
static void network_process_packet(NetworkPacket& packet);
|
||||
static int network_send_packet(network_packet *packet);
|
||||
static void network_send_queued_packets();
|
||||
|
||||
NetworkPacket::NetworkPacket()
|
||||
{
|
||||
@@ -76,12 +71,12 @@ NetworkPacket::NetworkPacket()
|
||||
|
||||
std::unique_ptr<NetworkPacket> NetworkPacket::AllocatePacket()
|
||||
{
|
||||
return std::move(std::make_unique<NetworkPacket>());
|
||||
return std::move(std::unique_ptr<NetworkPacket>(new NetworkPacket)); // change to make_unique in c++14
|
||||
}
|
||||
|
||||
std::unique_ptr<NetworkPacket> NetworkPacket::DuplicatePacket(NetworkPacket& packet)
|
||||
{
|
||||
return std::move(std::make_unique<NetworkPacket>(packet));
|
||||
return std::move(std::unique_ptr<NetworkPacket>(new NetworkPacket(packet))); // change to make_unique in c++14
|
||||
}
|
||||
|
||||
uint8* NetworkPacket::GetData()
|
||||
@@ -300,7 +295,7 @@ void network_end_server()
|
||||
void network_add_client(SOCKET socket)
|
||||
{
|
||||
printf("New client connection\n");
|
||||
auto networkconnection = std::make_unique<NetworkConnection>();
|
||||
auto networkconnection = std::unique_ptr<NetworkConnection>(new NetworkConnection); // change to make_unique in c++14
|
||||
networkconnection->socket = socket;
|
||||
_clientConnectionList.push_back(std::move(networkconnection));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user