Code: Select all
(define (init portIn host javafirst)
(if (not portIn) (set 'portIn 47011))
(if (not host) (set 'host "localhost"))
; check for server portIn and if this was started by java
; note: when this was started from inside the new console
; starting a GUI script in the console then main-args
; will contain ("newlisp" "-c" "-p" "64003"). But the
; following lines will still work because the int conversion
; doesn't fail on "-p" but takes the portIn as default
(if (main-args 2) (set 'portIn (int (main-args 2) portIn)))
(if (and(not (= (main-args 3) "javastart"))(not javafirst))
(process (string "java -jar " server-path " " portIn))
)
...
...