class
Circed::Network::NetworkState
- Circed::Network::NetworkState
- Reference
- Object
Overview
Global network state manager for RFC 2813 compliance Maintains network-wide information about servers, users, and channels
Defined in:
circed/network/network_state.crClass Method Summary
-
.add_channel(name : String)
Add channel to global network state
-
.add_server(name : String, hopcount : Int32, description : String, link_server : LinkServer | Nil = nil, token : String | Nil = nil)
Add server to global network state
-
.add_server_link(server1 : String, server2 : String)
Network topology management
-
.add_user(nickname : String, username : String, hostname : String, realname : String, server : String, hopcount : Int32 = 0)
Add user to global network state
- .channels
-
.clear_all_state
Clear all state (for testing)
-
.clear_caches
Clear caches when needed (call periodically or when memory pressure)
- .get_channel(name : String)
- .get_server(name : String)
- .get_user(nickname : String)
-
.get_user_server(nickname : String) : String | Nil
Fast server lookup using cache
-
.join_user_to_channel(nickname : String, channel_name : String, modes : Set(Char) = Set(Char).new)
Join user to channel
-
.part_user_from_channel(nickname : String, channel_name : String)
Part user from channel
-
.remove_channel(name : String)
Remove channel from global network state
-
.remove_server(name : String, send_squit : Bool = true)
Remove server and cascade to users/channels
- .remove_server_link(server1 : String, server2 : String)
-
.remove_user(nickname : String)
Remove user from global network state - optimized
-
.route_to_server(target_server : String, from_server : String = Server.name) : String | Nil
Find route to server (for message routing)
-
.server_list(mask : String | Nil = nil)
Generate server list for LINKS command
-
.servers
Query methods
-
.set_channel_topic(name : String, topic : String | Nil, set_by : String | Nil = nil)
Set topic for a channel
-
.set_user_away(nickname : String, message : String | Nil)
Set away message for a user - optimized
-
.stats
Network statistics
- .topology
- .users
Class Method Detail
Add server to global network state
Add user to global network state
Join user to channel
Remove server and cascade to users/channels
Find route to server (for message routing)
Set topic for a channel
Set away message for a user - optimized