1 |
1 |
2 local tonumber, tostring = tonumber, tostring; |
2 local tonumber, tostring = tonumber, tostring; |
3 local ipairs = ipairs; |
3 local ipairs, print= ipairs, print; |
4 |
4 |
5 local m_random = math.random; |
5 local m_random = import("math", "random"); |
6 local format = string.format; |
6 local format = import("string", "format"); |
7 |
|
8 local print = print; |
|
9 |
7 |
10 local hosts = hosts; |
8 local hosts = hosts; |
11 |
9 |
12 local modulemanager = require "core.modulemanager"; |
10 local modulemanager = require "core.modulemanager"; |
13 local log = require "util.logger".init("sessionmanager"); |
11 local log = require "util.logger".init("sessionmanager"); |
77 for _, feature in ipairs(features) do |
75 for _, feature in ipairs(features) do |
78 send_to_session(session, tostring(feature)); |
76 send_to_session(session, tostring(feature)); |
79 end |
77 end |
80 |
78 |
81 send("</stream:features>"); |
79 send("</stream:features>"); |
82 log("info", "core", "Stream opened successfully"); |
80 log("info", "Stream opened successfully"); |
83 session.notopen = nil; |
81 session.notopen = nil; |
84 end |
82 end |
85 |
83 |
86 return _M; |
84 return _M; |