diff --git a/Makefile b/Makefile index 7441335..d829a6c 100644 --- a/Makefile +++ b/Makefile @@ -6,7 +6,7 @@ NETHACK_DIR=$(shell pwd)/savedata IMAGE_NAME=nethack_launch -all: stat reclist +all: stat run: go run \ @@ -16,10 +16,6 @@ stat: mkdir -p bin/ $(CGOR) $(GOC) $(GOFLAGS) -o bin/nethack-launcher nethack-launcher.go -reclist: - mkdir -p bin/ - gcc -static deps/reclist.c -o bin/reclist - dependencies: go get github.com/gorilla/mux @@ -27,7 +23,6 @@ build_docker: mkdir -p stage.tmp/ cp deps/Dockerfile stage.tmp/ cp deps/server_config.gcfg stage.tmp/config.gcfg - cp bin/reclist stage.tmp/ cp bin/nethack-launcher stage.tmp/ cp deps/redis.conf stage.tmp/ cp deps/run.sh stage.tmp/ diff --git a/config.gcfg b/config.gcfg index 4a38167..b02020c 100644 --- a/config.gcfg +++ b/config.gcfg @@ -1,7 +1,7 @@ [nethacklauncher] loglevel = "debug" serverdisplay = "unixvoid.com underground nethack server" - nethackversion = "3.6.0" + nethackversion = "3.6.1" hackdir = "savedata/hack" nhdatlocation = "/usr/lib/games/nethack/nhdat" bootstrapdelay = 1 diff --git a/deps/Dockerfile b/deps/Dockerfile index 58a46d3..d058edb 100644 --- a/deps/Dockerfile +++ b/deps/Dockerfile @@ -18,7 +18,6 @@ RUN mkdir /hack/ # copy in files COPY config.gcfg / COPY nethack-launcher / -COPY reclist /bin/ COPY redis.conf / COPY run.sh / COPY nethackrc /hack/.nethackrc diff --git a/deps/server_config.gcfg b/deps/server_config.gcfg index e0f1599..1688c26 100644 --- a/deps/server_config.gcfg +++ b/deps/server_config.gcfg @@ -1,7 +1,7 @@ [nethacklauncher] loglevel = "debug" serverdisplay = "unixvoid.com underground nethack server" - nethackversion = "3.6.0" + nethackversion = "3.6.1" hackdir = "/hack" nhdatlocation = "/usr/lib/games/nethack/nhdat" bootstrapdelay = 1 diff --git a/nethack-launcher.go b/nethack-launcher.go index 9919451..b26e198 100644 --- a/nethack-launcher.go +++ b/nethack-launcher.go @@ -109,6 +109,13 @@ func checkFiles() { fmt.Printf("%s\n", err) os.Exit(1) } + // make sure initial rcfile exists + hackRCLoc := fmt.Sprintf("%s/.nethackrc", config.NethackLauncher.HackDir) + if _, err := os.Stat(hackRCLoc); os.IsNotExist(err) { + glogger.Info.Printf("initial config file not found at: %s\n", hackRCLoc) + fmt.Printf("%s\n", err) + os.Exit(1) + } } func clearScreen() { @@ -345,9 +352,6 @@ func printRegisterScreen(redisClient *redis.Client) { secHash := sha3.Sum512([]byte(sec)) redisClient.Set(fmt.Sprintf("user:%s", username), fmt.Sprintf("%x", secHash), 0).Err() - // TODO create config file - // HackDir/user/username/ - // create user directories userPath := fmt.Sprintf("%s/user/%s/ttyrec/", config.NethackLauncher.HackDir, username) exec.Command("mkdir", "-p", userPath).Run()