A Swift implementation of the common functionality required for multiplayer lobby clients connecting to implementations of the Spring Lobby Protocol.
This project is primarily experiemental, and as such has been prioritising exploration over completeness. Contact MasterBel2 if you wish to make use of this project, and require any guidance or further functionality, he will be more than happy to help you out.
The implementation is based around the concept of a Client
, which may initiate a connection to a server. See a diagram below:
Client
|
Connection?
|
AutheticatedSession or UnauthenticatedSession (default)
| |
(Information about server (Implements login + register
state, login credentials, functionality.)
etc.)
When connected to a server, a client will own a Connection
. By default a connection maintains an UnauthenticatedSession
, which allows the client to log in or register. When logged in the connection will maintain an AuthenticatedSession
which contains all information about the server state, including the battle list, user list, an optional battleroom, battleroom, and a channel list. It also contains information about the account the client used to authenticate, such as its username.
Your lobby client should create a Client
object for each Connection
they wish to create, and connect using Client.connect(to serverAddress:)
. Most major data stores conform to UpdateNotifier
. UpdateNotifier
will inform associated objects . Add an associated object with addObject(_:)
.
See here for an example implementation.
Various other systems (such as downloading resources and launching games) are implemented in this package.
- For downloading, and downloaded assets, see
ResourceManager
. Battles are automatically integrated with this system, seeBattle
. - For interacting with engines, see
Engine
- For loading replays, see
ReplayController
Some systems are implemented outside this package.
- For replay file handling, see
SpringRTSReplayHandling
- For start scripts, see
SpringRTSStartScriptHandling