A joining app plays whatever map its host plays #46
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "task/4202-joining-follows-host"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Tracker: #4202
Stacked on #44: merge that first. Until it lands this PR also shows the map picker's commit.
--join <address>no longer needs to be told the map: the app asks the host which map it plays before loading anything, and loads that one.What changes
askandplayspair. The answer carries the client's salt and the map's name, and the server keeps nothing of an ask. An ask carriesMAP_NAME_BYTESunread so its answer is never the larger, which keeps the handshake from being an amplifier. A name that does not print or runs past that length does not decode.ServerandHost.Server.inittakes its map's name, fromserver.sxand fromHost, andHost.starttakes aGameMap.hostsMapinmain.sxasks while the window keeps answering, asjoindoes, over the same conditioned link. The window now says which map it is loading on every launch, not only after the picker.Decisions
--mapon a joiner is refused at launch. The host chooses the map, so the app exits 2 and says why, and the bots tool no longer takes--map.the server at <address> plays <name>, a map this build does not haveand exits 1. The world-hash refusal stays for a host on the same map from another bake.Also fixed
The test scene holds no bodies or dummies, so a bot's walk over it read past an empty list of targets. A world with fewer targets than a game holds players now gets a ring of them about the clearing.
Evidence
tools/gate.sh fast: 112 passed, 0 failed. After it, only test comments changed, andnet_handshakeandbotspassed again.tests/net_host.sx: on each map, a client that has loaded nothing asks a real host over UDP, loads what it names and is welcomed.tests/bots.sx: the tool follows a server on the test scene and a client sees a bot walk; against a server naming an unknown map it prints why and exits 1.--map, and each server printed the join. The test scene was seen drawn. The first map's picture and theLoadingwords on a joining window were not seen, so those are for a person playing to confirm.Known limit
A client of this version asking a server older than protocol 13 gets no answer, because that server does not know the ask, so it closes after 10 s with
has not answeredrather thananother version.Head:
eda45c05b1View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.