athlos library

Classes

AchievementDescriptor
Describes an in-game achievement.
Action
Represents an action that can be performed by an entity in the game.
ActionResult<StateType extends GameState<Entity<Transform>, SpatialUnit>, EventType extends WorldEventLogEntry<WorldPosition>>
Represents the result of applying an action to a state.
ActionValidator<StateType extends GameState<Entity<Transform>, SpatialUnit>, ActionType extends Action>
AnalyticsEventEntry
Represents a log entry for an analytics event.
Angle3D
A class representing a 3D angle with four components: x, y, z, and w.
BackendNode
Backend game server candidate for routing sessions.
BackendNodeStore
Persists backend node registrations to a local file.
DefaultGatewayMatchmaker
Baseline matchmaker: every player enters the default pool.
DirectMessage
Represent a message sent directly from a player to another player.
Entity<TransformType extends Transform>
Represents an entity in the world, with a unique ID, position, and other properties.
EntityType
Represents a type of entity in the game.
FriendInviteNotification
A friend invitation notification.
GameDescriptor
A game descriptor, allowing games to track versions and the need for updates or reloading internal components from scratch.
GameSession
The GameSession class represents a session for a player in the game. Initiated when a player logs into the game. Destroyed when the player logs out.
GameState<EntityType extends Entity<Transform>, TerrainCellType extends SpatialUnit>
Represents the current state of the game world. Note: In many games, due to scalability requirements, the GameState may be partial rather than a full game state. Whereas, in other, less demanding games, the GameState may be a full game state.
GameWorld<WorldConfigType extends WorldConfig>
A class representing a game world, which contains information about the world such as its name, description, and dimensions.
GatewayAuthenticator
Authenticates client-provided tokens.
GatewayDdosGuard
DDoS/rate-limit gate run before expensive gateway operations.
GatewayLoadBalancer
Selects a backend node for new sessions.
GatewayMatchmaker
Matches a player into a routing pool identifier.
GatewayPacket
Simple JSON envelope used by gateway clients.
GatewayRelay
Central orchestration layer for auth, matchmaking and session routing.
GatewayRelayResult
Result returned by gateway operations.
GatewayRouteInfo
Route information returned to clients for server handoff.
GatewaySession
Represents a routed player session managed by the gateway.
GatewaySessionRouter
Stores session-to-backend routing mappings.
GatewayTcpServer
Gateway endpoint that accepts TCP clients and returns routing decisions.
GatewayUdpServer
Gateway endpoint that accepts UDP clients and returns routing decisions.
GridPosition
A position in a grid-based world using integer x/y coordinates.
GridTransform
A transform that is specific to a grid-based world, using GridPosition for position and GridDirection for direction and orientation.
HexPosition
A position in an axial hex world with q/r coordinates.
HexTransform
A transform for entities in a hexagonal grid world, including position, direction, and orientation.
InMemoryGatewayAuthenticator
Minimal in-memory authenticator for local development.
Leaderboard<PlayerType extends Player<PlayerType, PlayerStats, PlayerPreferences>, PointType extends num>
Represents a leaderboard.
LeastConnectionsLoadBalancer
Selects the least loaded backend with available capacity.
Lobby
Represents a lobby for a world (pre-start).
LobbyInviteNotification
A notification for a lobby invite.
LobbyMessage
Represents a lobby message.
LogEntry
Matchmaker
Message
Represents a generic message.
NetworkLogger
Simple logger shared by networking clients and servers.
Notification
A generic notification class.
OfferNotification
A notification for an offer.
Player<PT extends PlayerType, PS extends PlayerStats, PP extends PlayerPreferences>
A class representing a player in the game.
PlayerAchievement
Represents a player's progress or earning of an achievement.
PlayerPreferences
Describes a player's preferences.
PlayerStats
Represents the stats of a player.
PlayerType
PurchasableItem
Represents a purchasable item in the game, which can be bought with real money.
PurchasableItemTransaction
Represents a transaction for a purchasable item.
PurchaseCart
Represents a player's cart, allowing them to purchase items.
PurchaseOffer
Represents an offer for a collection of or a single purchasable item.
Resource
Represents an in-game resource.
RuntimeErrorEntry
Represents a runtime error log entry.
ScheduledEvent<PositionType extends WorldPosition>
Represents a scheduled event in the game.
Season
Represents a season.
SlidingWindowDdosGuard
Sliding-window in-memory limiter.
SpatialPartition
Represents a spatial partition, i.e., chunk of terrain in the world or a chunk of the game's state. Each partition is a square area of the world that can be loaded and unloaded independently. This allows for efficient loading and unloading of e.g., terrain as the player moves around the world. This can also model less scalable states such as game boards.
SpatialUnit
Represents a single spatial unit in the world/game.
StateReducer<StateType extends GameState<Entity<Transform>, SpatialUnit>, ActionType extends Action, EventType extends WorldEventLogEntry<WorldPosition>>
Represents a reducer that transforms a state based on an action.
StateUpdate<EntityType extends Entity<Transform>, TerrainCellType extends SpatialUnit>
TcpClient
Represents a TCP client connected to a server.
TcpClientInfo
Represents a TCP client connected to the server.
TcpServer
Represents a TCP server.
Team
A class representing a team in the game, which can be used for team-based gameplay, matchmaking, and account management.
Transform<P, D, O>
A generic transform class that can be used for any type of position, direction, and orientation.
UdpClient
Represents a client connected to the server.
UdpClientInfo
Represents a client connected to the server.
UdpControlMessage
Special control packets used internally by the server and client to communicate with each other over UDP transport.
UdpServer
Represents a server.
VectorPosition2D
A position in a 2D vector world using x/y coordinates.
VectorPosition3D
A position in a 3D vector world using x/y/z coordinates.
VectorTransform2D
A transform for entities in a 2D vector world, including position, direction, and orientation.
VectorTransform3D
A transform for entities in a 3D vector world, including position, direction, and orientation.
WorldConfig
Represents the configuration for a world.
WorldEventLogEntry<PositionType extends WorldPosition>
Represents a record of an event in the game for logging purposes.
WorldPosition
Represents a position in a world and how it interacts with that world's direction model.
WorldSession<CameraPosition extends WorldPosition, CameraDirection extends Angle3D>
Represents a session for a player in a world. Created when a player joins a specific world in a game. Destroyed when the player leaves the world. Note: The WorldSession is more ephemeral compared to the GameSession.

Enums

GatewayOpcode
Control opcodes exchanged between clients and gateway servers.
GatewayTransport
Transport used by a gateway session.
GridDirection
Represents the four cardinal directions on a 2D grid.
HexDirection
A HexDirection is a direction on a hexagonal grid. It is used to determine the direction of movement or the orientation in a hex world.
LeaderboardOrder
Defines the order in which leaderboard entries are sorted.
LeaderboardPlayerScope
Defines the scope of a leaderboard, which determines the range of players included in the leaderboard rankings.
LeaderboardWorldScope
LobbyStatus
NetworkLogOutput
Determines where Athlos networking logs are written.
PresenceStatus
Represents the presence status of a player.
WorldStatus

Typedefs

TcpClientMessageHandler = void Function(Uint8List message)
A function that is called when a framed message is received from the TCP server.
TcpClientOnTick = void Function(TcpClient client)
A function that is called periodically to update the client.
TcpServerMessageHandler = void Function(Uint8List message, TcpClientInfo client)
A function that is called when a framed message is received from a TCP client.
TcpServerOnClientConnected = void Function(TcpClientInfo client)
TcpServerOnClientDisconnected = void Function(TcpClientInfo client)
TcpServerOnTick = void Function(TcpServer server)
A function that is called periodically to update the server.
UdpClientMessageHandler = void Function(Uint8List message)
A function that is called when a message is received from the server.
UdpClientOnTick = void Function(UdpClient client)
A function that is called periodically to update the client.
UdpServerMessageHandler = void Function(Uint8List message, InternetAddress address, int port)
UdpServerOnClientConnected = void Function(UdpClientInfo client)
UdpServerOnClientDisconnected = void Function(UdpClientInfo client)
UdpServerOnTick = void Function(UdpServer server)