-
Notifications
You must be signed in to change notification settings - Fork 42
Notes on the NeoHabitat to Habitat protocol bridge
This was written by Randy Farmer on the NeoHabitat Slack during the time we were discussing issues we were having with the NeoHabitat pushserver. See Issues https://github.com/frandallfarmer/neohabitat/issues/401 and https://github.com/frandallfarmer/neohabitat/issues/408 for more details.
The Bridge holds a connection (game session) open to a client (C64-via-Qlink OR JSON test/bot) while making a short-term JSON connection to ELKO/Neohabitat.
The Elko/Game server breaks the short-term connection whenever the user moves between regions.
When the Pushserver/Habiproxy is in place it sits between the bridge and the game, relaying messages and pushing state changes to web pages that are subscribed to an avatar's actions.
It is SUPPOSED to have the same connection semantics as the Elko/Game server, but for some reason is not acting reasonably during region transitions (elko does a break, expecting the bridge to remake a new short-term JSON connection.) When using the Telko.js script on the default port, it will connect to the bridge, acting as a legit client and having the bridge keep the game session open across region transitions.
When using Telko.js on port 2018 (the push server) the bridge-keeps-session-alive semantics don't apply. If a bot/script tries to change regions, the bot/script will be shutdown as soon as Elko approves the region change and hangs up the connection.
Telko is a js tool that runs in node and connects to Elko via the chain and sends commands to the game. It allows you to test against the NeoHabitat server without having to log a user in. To connect to port 2018 and test using Telko, enter the test
directory in the NeoHabitat folder and use the following command which logs the Randy avatar in:
node Telko.js -p 2018 -f randy
This command will log the Randy user in and make them walk.
node Telko.js -f randy,walk
This command will log the Randy user in, perform a region change and walk.
node Telko.js -f randy,region,walk