24 end |
25 end |
25 |
26 |
26 eventmanager.add_event_hook("server-starting", load_enabled_hosts); |
27 eventmanager.add_event_hook("server-starting", load_enabled_hosts); |
27 |
28 |
28 function activate(host, host_config) |
29 function activate(host, host_config) |
29 hosts[host] = {type = "local", connected = true, sessions = {}, host = host, s2sout = {} }; |
30 hosts[host] = {type = "local", connected = true, sessions = {}, host = host, s2sout = {}, events = events_new() }; |
30 log((hosts_loaded_once and "info") or "debug", "Activated host: %s", host); |
31 log((hosts_loaded_once and "info") or "debug", "Activated host: %s", host); |
31 eventmanager.fire_event("host-activated", host, host_config); |
32 eventmanager.fire_event("host-activated", host, host_config); |
32 end |
33 end |
33 |
34 |
34 function deactivate(host) |
35 function deactivate(host) |