Skip to content

Latest commit

 

History

History
40 lines (28 loc) · 4.5 KB

README.md

File metadata and controls

40 lines (28 loc) · 4.5 KB

UberserverClientCore

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.

Structure

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.

Implementing your custom client

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.

Relevant data

Various other systems (such as downloading resources and launching games) are implemented in this package.

Some systems are implemented outside this package.