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.crConstant Summary
-
NICKNAME_DELAY =
30.seconds
Class Method Summary
-
.add_channel(name : String, created_at : Time = Time.unix(Time.utc.to_unix))
Add channel to global network state
-
.add_server(name : String, hopcount : Int32, description : String, link_server : LinkServer | Nil = nil, token : String | Nil = nil) : Bool
Add server to global network state
-
.add_server_link(server1 : String, server2 : String) : Bool
Network topology management
-
.add_user(nickname : String, username : String, hostname : String, realname : String, server : String, hopcount : Int32 = 0, connected_at : Time = Time.unix(Time.utc.to_unix)) : Bool
Add user to global network state
- .apply_channel_modes(name : String, mode_string : String, params : Array(String), created_at : Time | Nil = nil, parameter_index : Int32 = 0) : Bool
- .channels
-
.clear_all_state
Clear all state (for testing)
- .get_channel(name : String)
- .get_server(name : String)
- .get_user(nickname : String)
-
.join_user_to_channel(nickname : String, channel_name : String, modes : Set(Char) = Set(Char).new)
Join user to channel
- .merge_channel(name : String, created_at : Time, modes : Set(Char)) : Bool
- .nickname_reserved?(nickname : String) : Bool
-
.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_at : Time = Time.unix(Time.utc.to_unix), created_at : Time | Nil = nil) : Bool
Set topic for a channel
-
.set_user_away(nickname : String, message : String | Nil)
Set away message for a user - optimized
-
.stats
Network statistics
- .sync_channel(channel : Domain::Channel) : Nil
- .sync_channel_repository(name : String) : Nil
- .topology
- .user_routed_through?(nickname : String, server_name : String) : Bool
- .users
Class Method Detail
Add channel to global network state
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