class

Mud::Net::Server

Inherits Reference < Object

A TCP server to host the game, which handles client connections.

Constructors

new(host, port)

Creates a TCP socket and spawns a fiber to wait for connections.

Source

Class methods

open(host, port, &)

Starts a server instance and yields it to the block.

Source

Instance methods

accept

Spawns a new handler fiber on each client connection.

Source
broadcast(msg, exclude = -1)

Broadcasts a message to all connected clients. Does not send to exclude.

Source
client_reader(id, socket, channel, done)

Reads messages from the client.

Source
client_writer(id, socket, channel, done)

Writes messages to the client.

Source
close

Closes the server and all channels.

Source
handle_client(socket, id, channel)

Sends and receives messages from a client connection.

Source
hide(id)

Tells the client to hide typed text.

Source
run

Runs main event loop which processes messages to and from clients and then yields for game operations to take place.

Source
send(id, msg)

Sends a message to a specific connected client.

Source
unhide(id)

Tells the client to unhide typed text.

Source