summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2010-11-17 00:23:42 +0000
committerChristian Pointner <equinox@spreadspace.org>2010-11-17 00:23:42 +0000
commit5d308aa0372112bd66740d7e0964208e331b6e2f (patch)
treebe653d904a9a02242370e80cefc7f7de9910dd6e
parentmodule list load module implicit using metatables (diff)
added default values to debug shell module
git-svn-id: https://svn.spreadspace.org/gcsd/trunk@32 ac14a137-c7f1-4531-abe0-07747231d213
-rw-r--r--src/modules/debug_shell.lua3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/modules/debug_shell.lua b/src/modules/debug_shell.lua
index 3150185..e30780a 100644
--- a/src/modules/debug_shell.lua
+++ b/src/modules/debug_shell.lua
@@ -36,6 +36,7 @@ local defines = require("defines")
-- debug shell module class
local debug_shell = {}
debug_shell.properties = { type=defines.MISC_MODULE, name="debug_shell", max_instances=-1 }
+debug_shell.defaults = { host = "localhost", port = 9000 }
debug_shell.next_id = 0
-- create new instance of debug shell module class
@@ -49,6 +50,8 @@ function debug_shell:new(config)
else
inst.name = config.name
end
+ if(not config.host) then config.host = self.defaults.host end
+ if(not config.port) then config.port = self.defaults.port end
local ip, err = socket.dns.toip(config.host)
if(ip == nil) then