Conversation
|
Observers do not count when sorting the list of servers. So you don't need to change how bzadmin joins, which I believe makes the changes to bzfs.cxx unnecessary as well. For SSPs, changing the player type to ComputerPlayer might make sense, but I'd have to check if there's any side-effects there. But in 2.4, I don't know if anyone joins an SSP as something other than observer. I don't think SSPs are functional enough to play as an actual player, so it's mostly used by bzfscron to run server commands. |
|
A server owner can write a short custom plugin that creates bots via |
|
The recent issue was with normal game clients running autopilot, which this PR doesn't address. One way to solve this when counting player is to check if a player is a bot or if they're running autopilot. There would be a delay until you sent a list server update once the autopilot state was updated. However, I'd also not want an update sent every time the state changed, since someone could toggle the state a bunch. So, maybe some sort of "this player used autopilot in the last X minutes" kind of tracking in bzfs, and just update if that state changes. |
|
We could be stricter. A single change to the Sure, this then cuts out the viable situation of a legit player going autopilot and then coming back for the remainder of the session, but realistically, how often does that happen? Mostly people either idle before coming back to play, or they join the observers and then join back in as the players, potentially restoring their previous score if the plugin is used. |
Currently, bots (most notably
bzadminand plugins utilizingServerSidePlayer) artificially inflate the server's player counts on the master list server. This causes inaccurate server population statistics and forces server administrators to manually configure or run third-party plugins to hide their bots and comply with list server policies.Historically, bots were forced to spoof their connection type as
TankPlayer(human) due to two hardcoded roadblocks in thebzfsengine:bzfsexplicitly rejected anyComputerPlayerthat attempted to join theObserverTeam.bzfsintentionally skipped sending the initial game state (existing players, teams, and flags) toComputerPlayersto save bandwidth for legacy-solodummy bots.Because network bots (like
bzadmin) need to join as observers and require game state to function, developers had no choice but to lie and identify them asTankPlayers(as noted by the ancient// because we like to lie :)comment inServerSidePlayer.cxx). Consequently, they were continually caught by theisHuman()checks, which appended them to the list serverPingPacketand prevented servers from correctly idling/sleeping.This PR untangles these legacy workarounds by allowing bots to natively function as bots, eliminating the need to spoof humans:
src/bzfs/bzfs.cxx:ComputerPlayerson theObserverTeam.!isBot()exclusion block duringMsgEnterprocessing, allowing network bots to receive the initial game state payload. (Also refactored this iteration loop using earlycontinuesto reduce nesting).src/bzadmin/BZAdminClient.cxx:MsgEnteras aComputerPlayer.src/bzfs/ServerSidePlayer.cxx:ComputerPlayer, removing theTankPlayerspoofing hack.Compiled cleanly against Alpine/musl. End-to-end testing confirms that
bzadminsuccessfully connects, correctly authenticates as aComputerPlayerobserver, receives full game state (e.g.,/playerlistworks perfectly), and is entirely ignored bybzfs's list server ping payload.