View Source ow_session (overworld v2.0.0)

Summary

Functions

Alias for proxy(PID, self())

Alias for proxy(PID, undefined)

Get the termination callback

Set the termination callback

Get the game data

Set the game data

Get the session id of this session (network serializable)

Set the session ID for this session (network serializable)

Get the session latency

Set the session latency

Get the pid of the session's proxy process.

Set the pid of the session's proxy process, including ENet, WebSocket and internal handlers.

Get the format for serializing data.

Set the format for serializing data. If communication happens all within Erlang node(s), then there is no need to set a serializer.

Start the session server and create a new session with this ID

Stop the session server

Get the session token.

Sets the session token

Get the zone pid

Sets the zone pid

Types

-type id() :: pos_integer().
-type mfargs() :: {atom(), atom(), list()}.
-type proxy_pid() :: pid() | undefined.
-type serializer() :: undefined | protobuf.
-type token() :: binary() | undefined.
-type zone_pid() :: pid() | undefined.

Functions

Link to this function

active(EventType, EventContent, Session)

View Source
-spec connect(pid()) -> {ok, proxy_pid()}.

Alias for proxy(PID, self())

Link to this function

connected(EventType, EventContent, Session)

View Source
-spec disconnect(pid()) -> {ok, proxy_pid()}.

Alias for proxy(PID, undefined)

Link to this function

disconnect_callback(PID)

View Source
-spec disconnect_callback(pid()) -> undefined | mfargs().

Get the termination callback

Link to this function

disconnect_callback(Callback, PID)

View Source
-spec disconnect_callback(mfargs(), pid()) -> {ok, mfargs()}.

Set the termination callback

Link to this function

disconnected(EventType, EventContent, Session)

View Source
-spec game_data(pid()) -> any().

Get the game data

-spec game_data(any(), pid()) -> {ok, any()}.

Set the game data

-spec id(pid()) -> id() | undefined.

Get the session id of this session (network serializable)

-spec id(pid(), id()) -> {ok, id()}.

Set the session ID for this session (network serializable)

-spec latency(pid()) -> non_neg_integer().

Get the session latency

-spec latency(pos_integer(), pid()) -> {ok, pos_integer()}.

Set the session latency

-spec proxy(pid()) -> proxy_pid().

Get the pid of the session's proxy process.

-spec proxy(pid(), proxy_pid()) -> {ok, proxy_pid()}.

Set the pid of the session's proxy process, including ENet, WebSocket and internal handlers.

-spec serializer(pid()) -> serializer() | undefined.

Get the format for serializing data.

Link to this function

serializer(Serializer, PID)

View Source
-spec serializer(serializer(), pid()) -> {ok, serializer()}.

Set the format for serializing data. If communication happens all within Erlang node(s), then there is no need to set a serializer.

-spec start() -> {ok, pid()}.

Start the session server and create a new session with this ID

-spec start([tuple()]) -> {ok, pid()}.
-spec stop(pid()) -> ok.

Stop the session server

Link to this function

terminate(Reason, State, Data)

View Source
-spec token(pid()) -> token().

Get the session token.

-spec token(token(), pid()) -> {ok, token()}.

Sets the session token

-spec zone(pid()) -> zone_pid().

Get the zone pid

-spec zone(zone_pid(), pid()) -> {ok, pid()}.

Sets the zone pid