ZIOShowdownConnection

io.github.pidoveproject.showdown.client.zio.ZIOShowdownConnection
See theZIOShowdownConnection companion object
class ZIOShowdownConnection(client: Client, channel: WebSocketChannel) extends ShowdownConnection[WebSocketFrame, IO, [r] =>> Stream[Throwable, r]]

Attributes

Companion
object
Source
ZIOShowdownConnection.scala
Graph
Supertypes
trait ShowdownConnection[WebSocketFrame, IO, [r] =>> Stream[Throwable, r]]
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

override def disconnect(): IO[ProtocolError, Unit]

Disconnect from the server.

Disconnect from the server.

Attributes

Definition Classes
Source
ZIOShowdownConnection.scala
override def sendMessage(room: RoomId, message: ClientMessage): IO[ProtocolError, Unit]

Send client-bound message to the server.

Send client-bound message to the server.

Value parameters

message

the message to send

room

the room to send the message to

Attributes

Definition Classes
Source
ZIOShowdownConnection.scala
override def sendMessage(message: ClientMessage): IO[ProtocolError, Unit]

Send client-bound message to the server.

Send client-bound message to the server.

Value parameters

message

the message to send

Attributes

Definition Classes
Source
ZIOShowdownConnection.scala
override def sendRawMessage(message: WebSocketFrame): IO[ProtocolError, Unit]

Send a socket frame to the server.

Send a socket frame to the server.

Value parameters

message

the socket message to send

Attributes

Definition Classes
Source
ZIOShowdownConnection.scala

Inherited methods

def acceptChallenge(): IO[ProtocolError, Unit]

Accept a challenge

Accept a challenge

Attributes

Inherited from:
ShowdownConnection
Source
ShowdownConnection.scala
def cancelSearch(): IO[ProtocolError, Unit]

Cancel the match search.

Cancel the match search.

Attributes

Inherited from:
ShowdownConnection
Source
ShowdownConnection.scala
def challengeUser(user: Username, format: FormatName): IO[ProtocolError, Unit]

Challenge another user

Challenge another user

Value parameters

format

the format of the battle

user

the user to challenge

Attributes

Inherited from:
ShowdownConnection
Source
ShowdownConnection.scala
def confirmLogin(name: Username, assertion: Assertion): IO[ProtocolError, Unit]

Confirm login process by sending the assertion received from ShowdownClient#login or ShowdownClient#loginGuest.

Confirm login process by sending the assertion received from ShowdownClient#login or ShowdownClient#loginGuest.

Value parameters

assertion

the assertion got from the authentication process

name

the username to take

Attributes

Inherited from:
ShowdownConnection
Source
ShowdownConnection.scala
def joinRoom(room: RoomId): IO[ProtocolError, Unit]

Join a room.

Join a room.

Value parameters

room

the id of the room to join

Attributes

Inherited from:
ShowdownConnection
Source
ShowdownConnection.scala
def leaveRoom(room: RoomId): IO[ProtocolError, Unit]

Leave a room

Leave a room

Value parameters

room

the id of the room to leave

Attributes

Inherited from:
ShowdownConnection
Source
ShowdownConnection.scala
def logout(): IO[ProtocolError, Unit]

Disconnect the user

Disconnect the user

Attributes

Inherited from:
ShowdownConnection
Source
ShowdownConnection.scala
def rename(name: Username): IO[ProtocolError, Unit]

Rename current user.

Rename current user.

Value parameters

name

the new name to take

Attributes

Inherited from:
ShowdownConnection
Source
ShowdownConnection.scala
def resetName(): IO[ProtocolError, Unit]

Reset current user's name.

Reset current user's name.

Attributes

Inherited from:
ShowdownConnection
Source
ShowdownConnection.scala
def searchBattle(format: FormatName): IO[ProtocolError, Unit]

Search for a battle

Search for a battle

Value parameters

format

the format to search for

Attributes

Inherited from:
ShowdownConnection
Source
ShowdownConnection.scala
def sendPrivateMessage(recipient: Username, message: ChatContent): IO[ProtocolError, Unit]

Send a private message to another player.

Send a private message to another player.

Value parameters

message

the message to send

recipient

the recipient of the message

Attributes

Inherited from:
ShowdownConnection
Source
ShowdownConnection.scala

Concrete fields

override val serverMessages: Stream[Throwable, Either[ProtocolError, ServerMessage]]

The stream of the received server messages

The stream of the received server messages

Attributes

Source
ZIOShowdownConnection.scala