TyrianShowdownConnection

io.github.pidoveproject.showdown.tyrian.TyrianShowdownConnection
case class TyrianShowdownConnection[F[_]](socket: WebSocket[F])(implicit evidence$1: Async[F]) extends ShowdownConnection[String, [e, r] =>> Cmd[F, UnitToNothing[r]], [r] =>> Sub[F, TyrianConnectionEvent[r]]]

An open connection to a Pokemon Showdown.

Type parameters

F

the effect type of the Tyrian app

Value parameters

socket

the web socket used to communicate with the server

Attributes

Graph
Supertypes
trait Serializable
trait Product
trait Equals
trait ShowdownConnection[String, [e, r] =>> Cmd[F, UnitToNothing[r]], [r] =>> Sub[F, TyrianConnectionEvent[r]]]
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

override def disconnect(): Cmd[F, Nothing]

Disconnect from the server.

Disconnect from the server.

Attributes

Definition Classes
ShowdownConnection
override def sendMessage(room: RoomId, message: ClientMessage): Cmd[F, Nothing]

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
ShowdownConnection
override def sendMessage(message: ClientMessage): Cmd[F, Nothing]

Send client-bound message to the server.

Send client-bound message to the server.

Value parameters

message

the message to send

Attributes

Definition Classes
ShowdownConnection
override def sendRawMessage(message: String): Cmd[F, Nothing]

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
ShowdownConnection

Inherited methods

def acceptChallenge(): [e, r] =>> Cmd[F, UnitToNothing[r]][ProtocolError, Unit]

Accept a challenge

Accept a challenge

Attributes

Inherited from:
ShowdownConnection
def cancelSearch(): [e, r] =>> Cmd[F, UnitToNothing[r]][ProtocolError, Unit]

Cancel the match search.

Cancel the match search.

Attributes

Inherited from:
ShowdownConnection
def challengeUser(user: Username, format: FormatName): [e, r] =>> Cmd[F, UnitToNothing[r]][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
def confirmLogin(name: Username, assertion: Assertion): [e, r] =>> Cmd[F, UnitToNothing[r]][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
def joinRoom(room: RoomId): [e, r] =>> Cmd[F, UnitToNothing[r]][ProtocolError, Unit]

Join a room.

Join a room.

Value parameters

room

the id of the room to join

Attributes

Inherited from:
ShowdownConnection
def leaveRoom(room: RoomId): [e, r] =>> Cmd[F, UnitToNothing[r]][ProtocolError, Unit]

Leave a room

Leave a room

Value parameters

room

the id of the room to leave

Attributes

Inherited from:
ShowdownConnection
def logout(): [e, r] =>> Cmd[F, UnitToNothing[r]][ProtocolError, Unit]

Disconnect the user

Disconnect the user

Attributes

Inherited from:
ShowdownConnection
def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product
def rename(name: Username): [e, r] =>> Cmd[F, UnitToNothing[r]][ProtocolError, Unit]

Rename current user.

Rename current user.

Value parameters

name

the new name to take

Attributes

Inherited from:
ShowdownConnection
def resetName(): [e, r] =>> Cmd[F, UnitToNothing[r]][ProtocolError, Unit]

Reset current user's name.

Reset current user's name.

Attributes

Inherited from:
ShowdownConnection
def searchBattle(format: FormatName): [e, r] =>> Cmd[F, UnitToNothing[r]][ProtocolError, Unit]

Search for a battle

Search for a battle

Value parameters

format

the format to search for

Attributes

Inherited from:
ShowdownConnection
def sendPrivateMessage(recipient: Username, message: ChatContent): [e, r] =>> Cmd[F, UnitToNothing[r]][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

Concrete fields

override val serverMessages: Sub[F, TyrianConnectionEvent[Either[ProtocolError, ServerMessage]]]

The stream of the received server messages

The stream of the received server messages

Attributes