Changeset View
Changeset View
Standalone View
Standalone View
source/network/NetServer.cpp
/* Copyright (C) 2022 Wildfire Games. | /* Copyright (C) 2023 Wildfire Games. | ||||
* This file is part of 0 A.D. | * This file is part of 0 A.D. | ||||
* | * | ||||
* 0 A.D. is free software: you can redistribute it and/or modify | * 0 A.D. is free software: you can redistribute it and/or modify | ||||
* it under the terms of the GNU General Public License as published by | * it under the terms of the GNU General Public License as published by | ||||
* the Free Software Foundation, either version 2 of the License, or | * the Free Software Foundation, either version 2 of the License, or | ||||
* (at your option) any later version. | * (at your option) any later version. | ||||
* | * | ||||
* 0 A.D. is distributed in the hope that it will be useful, | * 0 A.D. is distributed in the hope that it will be useful, | ||||
▲ Show 20 Lines • Show All 208 Lines • ▼ Show 20 Lines | bool CNetServerWorker::SetupConnection(const u16 port) | ||||
ENSURE(!m_Host); | ENSURE(!m_Host); | ||||
// Bind to default host | // Bind to default host | ||||
ENetAddress addr; | ENetAddress addr; | ||||
addr.host = ENET_HOST_ANY; | addr.host = ENET_HOST_ANY; | ||||
addr.port = port; | addr.port = port; | ||||
// Create ENet server | // Create ENet server | ||||
m_Host = enet_host_create(&addr, MAX_CLIENTS, CHANNEL_COUNT, 0, 0); | m_Host = ps_enet_host_create_with_mtu(&addr, MAX_CLIENTS, CHANNEL_COUNT, 0, 0, PS_ENET_HOST_DEFAULT_MTU); | ||||
if (!m_Host) | if (!m_Host) | ||||
{ | { | ||||
LOGERROR("Net server: enet_host_create failed"); | LOGERROR("Net server: enet_host_create failed"); | ||||
return false; | return false; | ||||
} | } | ||||
m_Stats = new CNetStatsTable(); | m_Stats = new CNetStatsTable(); | ||||
if (CProfileViewer::IsInitialised()) | if (CProfileViewer::IsInitialised()) | ||||
▲ Show 20 Lines • Show All 1,514 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator