Table of Contents

Class ArchipelagoSession

Namespace
Archipelago.MultiClient.Net
Assembly
Archipelago.MultiClient.Net.dll

ArchipelagoSession is the overarching class to access and modify and respond to the multiworld state

public class ArchipelagoSession : IArchipelagoSession, IArchipelagoSessionActions
Inheritance
ArchipelagoSession
Implements
Inherited Members
Extension Methods

Properties

ConnectionInfo

Provides information about your current connection

public IConnectionInfoProvider ConnectionInfo { get; }

Property Value

IConnectionInfoProvider

DataStorage

Provides access to a server side data storage to share and store values across sessions and players

public IDataStorageHelper DataStorage { get; }

Property Value

IDataStorageHelper

Items

Provides simplified methods to receive items

public IReceivedItemsHelper Items { get; }

Property Value

IReceivedItemsHelper

Locations

Provides way to mark locations as checked

public ILocationCheckHelper Locations { get; }

Property Value

ILocationCheckHelper

MessageLog

Provides simplified handlers to receive messages about events that happen in the multiworld

public IMessageLogHelper MessageLog { get; }

Property Value

IMessageLogHelper

Players

Provides information about all players in the multiworld

public IPlayerHelper Players { get; }

Property Value

IPlayerHelper

RoomState

Provides information about the current state of the server

public IRoomStateHelper RoomState { get; }

Property Value

IRoomStateHelper

Socket

Provides access to the underlying websocket, so send or receive messages

public IArchipelagoSocketHelper Socket { get; }

Property Value

IArchipelagoSocketHelper

Methods

Say(string)

Send a message on behalf of the current player Can also be used to send commands like !hint item

public void Say(string message)

Parameters

message string

The message that will be broadcasted to the server and all clients

SetClientState(ArchipelagoClientState)

Updates the status of the current player

public void SetClientState(ArchipelagoClientState state)

Parameters

state ArchipelagoClientState

the state to send to the server

SetGoalAchieved()

Informs the server that the current player has reached their goal This cannot be reverted

public void SetGoalAchieved()

TryConnectAndLogin(string, string, ItemsHandlingFlags, Version, string[], string, string, bool)

Attempt to log in to the Archipelago server by opening a websocket connection and sending a Connect packet. Determining success for this attempt is done by attaching a listener to Socket.PacketReceived and listening for a Connected packet.

public LoginResult TryConnectAndLogin(string game, string name, ItemsHandlingFlags itemsHandlingFlags, Version version = null, string[] tags = null, string uuid = null, string password = null, bool requestSlotData = true)

Parameters

game string

The game this client is playing.

name string

The slot name of this client.

itemsHandlingFlags ItemsHandlingFlags

Informs the AP server how you want ReceivedItem packets to be sent to you.

version Version

The minimum AP protocol version this client supports.

tags string[]

The tags this client supports.

uuid string

The uuid of this client.

password string

The password to connect to this AP room.

requestSlotData bool

Decides if the LoginSuccessful result will contain any slot data

Returns

LoginResult

LoginSuccessful if the connection is succeeded and the server accepted the login attempt. LoginFailure if the connection to the server failed in some way.

Remarks

The connect attempt is synchronous and will lock for up to 5 seconds as it attempts to connect to the server. Most connections are instantaneous however the timeout is 5 seconds before it returns LoginFailure.