class Mud::Net::Server
- Mud::Net::Server
- Reference
- Object
Overview
A TCP server to host the game, which handles client connections.
Defined in:
net.crConstructors
-
.new(host, port)
Creates a TCP socket and spawns a fiber to wait for connections.
Class Method Summary
-
.open(host, port, &)
Starts a server instance and yields it to the block.
Instance Method Summary
-
#accept
Spawns a new handler fiber on each client connection.
-
#broadcast(msg, exclude = -1)
Broadcasts a message to all connected clients.
-
#client_reader(id, socket, channel, done)
Reads messages from the client.
-
#client_writer(id, socket, channel, done)
Writes messages to the client.
-
#close
Closes the server and all channels.
-
#handle_client(socket, id, channel)
Sends and receives messages from a client connection.
-
#hide(id)
Tells the client to hide typed text.
-
#run(&)
Runs main event loop which processes messages to and from clients and then yields for game operations to take place.
-
#send(id, msg)
Sends a message to a specific connected client.
-
#unhide(id)
Tells the client to unhide typed text.
Constructor Detail
Class Method Detail
Instance Method Detail
Broadcasts a message to all connected clients. Does not send to exclude.
Runs main event loop which processes messages to and from clients and then yields for game operations to take place.