mod_srvinjection: Make the map a shared table so that other plugins can use/modify it
authordaurnimator <quae@daurnimator.com>
Tue, 10 Dec 2013 23:15:15 +0000
changeset 1248 69f7840923f5
parent 1247 34fbe58d19da
child 1249 182cb8a8d2d8
mod_srvinjection: Make the map a shared table so that other plugins can use/modify it
mod_srvinjection/mod_srvinjection.lua
--- a/mod_srvinjection/mod_srvinjection.lua	Fri Dec 06 02:31:47 2013 +0000
+++ b/mod_srvinjection/mod_srvinjection.lua	Tue Dec 10 23:15:15 2013 +0000
@@ -3,9 +3,10 @@
 
 local adns = require "net.adns";
 
-local map = module:get_option("srvinjection") or {};
+local map_config = module:get_option("srvinjection") or {};
+local map = module:shared "s2s_map"
 
-for host, mapping in pairs(map) do
+for host, mapping in pairs(map_config) do
 	if type(mapping) == "table" and type(mapping[1]) == "string" and (type(mapping[2]) == "number") then
 		local connecthost, connectport = mapping[1], mapping[2] or 5269;
 		map[host] = {{