[#12783] NetServer fix
自动翻译暂时不可用
本帖暂时展示 GitHub 原始内容。
I have read the contribution guidelines.
I have ensured that any new features or fixes in this PR function correctly in-game, if applicable.
I affirm that this code follows Mindustry's AI policy.
Fix unnecessary snapshot packets during world loading
Problem
Clients can receive unnecessary snapshot packets while loading a world. These packets add extra network traffic and processing overhead, slowing down the loading process.
Fix
Skip snapshot transmission when there are no eligible connected remote clients, and send snapshot packets directly to the connections that should receive them.
The generated mindustry.gen.Call class does not provide methods for sending snapshot packets to an explicitly specified list of connections. Therefore, the corresponding packets must be instantiated manually and sent directly through net.send(...).
This avoids sending unnecessary snapshots during world loading while preserving snapshot delivery to eligible clients.
Testing
Tested on a locally rebuilt server. Confirmed that the change prevents unnecessary snapshot transmissions and improves world loading performance.
由 MDT GitHub 同步机器人自动同步。