Skip to content

Documentation

Meru edited this page Nov 29, 2019 · 1 revision

Entry Point

The class HostWindow:89 contains the entry point of the mod. It is responsible for creating the Multiplayer menu item, which allows the player to either join an existing game, or host a new game.

Initialization of Multiplayer menu item

  1. Create listener to add or update LAN server connections
  2. Create NetManager on port 5100

Async Time

Async time is disabled here: HostWindow.cs:129

Hard-coded chat commands?

It looks like there are 2 commands, which are hard-coded. Chat command loading might need to be made dynamic, preferably by registering chat commands defined in a file. MultiplayerServer:77

ClientUtil

Contains method to start hosting a server, good starting point see how the server works.

Arbiter

When hosting a server, the Arbiter is started here: ClientUtil:201

MultiplayerServer

Main server update loop: MultiplayerServer:109 The server ticks at a rate of 16.66... ms per tick. This tick rate is variable though, since the sleep timing is set to 10ms. Can the sleep time be calculated, so that the tick rate is going to be as close to 16.66...ms as possible?

Client connections to server

Steam connection

SteamIntegration:114

Mysteries

Multiplayer.cs:164