Add SQLite persistence, import-snapshot tool, and karma functionality

This commit is contained in:
Ilya Groshev
2026-04-20 09:57:47 +03:00
parent c9ad3fa4f4
commit c33e738fd5
70 changed files with 4151 additions and 833 deletions
+20 -1
View File
@@ -7,4 +7,23 @@ proto:
protoc -I . $(PROTO_USED) --go_out=. --go_opt=module=lunar-tear/server --go-grpc_out=. --go-grpc_opt=module=lunar-tear/server
@echo "Generated in gen/proto/"
.PHONY: proto
build:
go build -o lunar-tear ./cmd/lunar-tear
build-import:
go build -o import-snapshot ./cmd/import-snapshot
migrate:
mkdir -p db
goose -dir migrations sqlite3 db/game.db up
import:
ifndef SNAPSHOT
$(error SNAPSHOT is required, e.g. make import SNAPSHOT=snapshots/scene_1.json UUID=...)
endif
ifndef UUID
$(error UUID is required, e.g. make import SNAPSHOT=snapshots/scene_1.json UUID=...)
endif
go run ./cmd/import-snapshot --snapshot $(SNAPSHOT) --uuid $(UUID)
.PHONY: proto build build-import migrate import