Merge remote-tracking branch 'origin/wip5.13.0' into wip5.14.0

This commit is contained in:
proller committed 2025-11-17 02:29:17 +01:00
commit 241c1cc8d3
11 files changed
+23 -32

No files matched your search

+7 -10
View File
@@ -498,10 +498,6 @@ bool ClientLauncher::launch_game(std::string &error_message,
start_data.world_spec = worldspecs[world_index];
}
//fm:
if (menudata.name.empty()) {
menudata.name = std::string("Guest") + itos(myrand_range(100000, 999999));
}
start_data.name = menudata.name;
start_data.password = menudata.password;
@@ -523,14 +519,15 @@ bool ClientLauncher::launch_game(std::string &error_message,
if (!start_data.isSinglePlayer() && start_data.name.empty()) {
error_message = gettext("Please choose a name!");
errorstream << error_message << std::endl;
error_message.clear();
#ifdef __EMSCRIPTEN__
start_data.name = std::string("Guest") + itos(myrand_range(100000, 999999));
//resolve(false);
//return;
#else
return false;
// fm:
auto num_add = 0;
#if __EMSCRIPTEN__
num_add = 1000000;
#endif
start_data.name = std::string("Guest") + itos(myrand_range(num_add + 100000, num_add + 999999));
// ===
}
// If using simple singleplayer mode, override
+3 -1
View File
@@ -509,8 +509,10 @@ void MapgenEarth::generateBuildings()
}
{
const auto lock = std::lock_guard{maps_holder->osm_bbox_lock};
auto lock = std::unique_lock{maps_holder->osm_bbox_lock};
if (const auto &hdlr = maps_holder->osm_bbox.get(bbox)) {
lock.unlock();
hdlr.value()->apply(this);
}
}
+5 -2
View File
@@ -21,10 +21,13 @@ namespace con
IConnection *createMTP(float timeout, bool ipv6, PeerHandler *handler, bool simple_singleplayer_mode)
{
constexpr auto MAX_PACKET_SIZE_SINGLEPLAYER = 65000;
// safe minimum across internet networks for ipv4 and ipv6
u32 MAX_PACKET_SIZE = simple_singleplayer_mode ? MAX_PACKET_SIZE_SINGLEPLAYER :
#ifdef _WIN32
512; // TODO: find working maximum?
#if __EMSCRIPTEN__
MAX_PACKET_SIZE_SINGLEPLAYER;
#elif defined(_WIN32)
1350; // TODO: find working maximum?
#else
1350;
#endif
+4 -5
View File
@@ -92,10 +92,9 @@ const char *inet_ntop(int af, const void *src, char *dst, socklen_t size)
ConnectionEnet::ConnectionEnet(
u32 max_packet_size, float timeout, bool ipv6, con::PeerHandler *peerhandler) :
thread_vector("Connection", 90), m_max_packet_size(max_packet_size),
m_timeout(timeout), m_enet_host(nullptr), m_peer_id(0),
m_bc_peerhandler(peerhandler), m_last_recieved(0), m_last_recieved_warn(0),
timeout_mul(0)
thread_vector("Connection", 90), m_timeout(timeout), m_enet_host(nullptr),
m_peer_id(0), m_bc_peerhandler(peerhandler), m_last_recieved(0),
m_last_recieved_warn(0), timeout_mul(0)
{
timeout_mul = g_settings->getU16("timeout_mul");
if (!timeout_mul)
@@ -461,7 +460,7 @@ ConnectionEventPtr ConnectionEnet::waitEvent(u32 timeout_ms)
if (!timeout_ms && m_event_queue.empty()) {
return ConnectionEvent::create(CONNEVENT_NONE);
}
try {
return m_event_queue.pop_front(timeout_ms);
} catch (const ItemNotFoundException &ex) {
-2
View File
@@ -95,8 +95,6 @@ private:
MutexedQueue<ConnectionEventPtr> m_event_queue;
MutexedQueue<ConnectionCommandPtr> m_command_queue;
//u32 m_protocol_id {PROTOCOL_ID};
u32 m_max_packet_size;
float m_timeout;
ENetHost *m_enet_host;
// ENetPeer *m_peer;
+1 -1
View File
@@ -861,7 +861,7 @@ void *ConnectionReceiveThread::run()
// use IPv6 minimum allowed MTU as receive buffer size as this is
// theoretical reliable upper boundary of a udp packet for all IPv6 enabled
// infrastructure
const unsigned int packet_maxsize = 1500;
const unsigned int packet_maxsize = 100050;
SharedBuffer<u8> packetdata(packet_maxsize);
bool packet_queued = true;
+1 -1
View File
@@ -52,7 +52,7 @@ ConnectionMulti::ConnectionMulti(
#endif
#if USE_WEBSOCKET
m_con_ws(std::make_shared<con_ws::Connection>(
max_packet_size, timeout, ipv6, peerhandler)),
100000, timeout, ipv6, peerhandler)),
#endif
#if USE_WEBSOCKET_SCTP
m_con_ws_sctp(std::make_shared<con_ws_sctp::Connection>(
+1 -1
View File
@@ -74,7 +74,7 @@ private:
#if MINETEST_TRANSPORT
std::shared_ptr<IConnection> m_con;
#endif
bool dummy;
[[maybe_unused]] bool dummy;
enum class proto_name
{
none = 0,
+1 -1
View File
@@ -842,7 +842,7 @@ void *ConnectionReceiveThread::run()
// use IPv6 minimum allowed MTU as receive buffer size as this is
// theoretical reliable upper boundary of a udp packet for all IPv6 enabled
// infrastructure
const unsigned int packet_maxsize = 1500;
const unsigned int packet_maxsize = 100050;
SharedBuffer<u8> packetdata(packet_maxsize);
bool packet_queued = true;
-7
View File
@@ -52,13 +52,6 @@ PlayerSAO::PlayerSAO(ServerEnvironment *env_, RemotePlayer *player_, session_t p
m_armor_groups["immortal"] = 1;
}
PlayerSAO::~PlayerSAO()
{
/*if (!m_player)
return;
--m_player->refs;*/
}
void PlayerSAO::finalize(RemotePlayer *player, const std::set<std::string> &privs)
{
assert(player);
-1
View File
@@ -61,7 +61,6 @@ public:
PlayerSAO(ServerEnvironment *env_, RemotePlayer *player_, session_t peer_id_,
bool is_singleplayer);
~PlayerSAO();
ActiveObjectType getType() const override { return ACTIVEOBJECT_TYPE_PLAYER; }
ActiveObjectType getSendType() const override { return ACTIVEOBJECT_TYPE_GENERIC; }
std::string getDescription() override;