From 5d308aa0372112bd66740d7e0964208e331b6e2f Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Wed, 17 Nov 2010 00:23:42 +0000 Subject: added default values to debug shell module git-svn-id: https://svn.spreadspace.org/gcsd/trunk@32 ac14a137-c7f1-4531-abe0-07747231d213 --- src/modules/debug_shell.lua | 3 +++ 1 file changed, 3 insertions(+) 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 -- cgit v1.2.3