diff --git a/Makefile b/Makefile index bba8f8d..89cbb36 100644 --- a/Makefile +++ b/Makefile @@ -8,9 +8,12 @@ ge: test: go run test/client.go -run: - go run main.go +account: + go run cmd/account.go +game: + go run cmd/game.go build: - go build -o bin/server main.go + go build -o bin/account account.go + go build -o bin/game game.go .PHONY: all build protos test \ No newline at end of file diff --git a/main.go b/main.go deleted file mode 100644 index e2dff38..0000000 --- a/main.go +++ /dev/null @@ -1,23 +0,0 @@ -package main - -import ( - "pro2d/actions" - "pro2d/utils" -) - -func main() { - err := make(chan error) - accountS := actions.NewAccountServer() - go func() { - defer accountS.Stop() - err <- accountS.Start() - }() - - gameS := actions.NewGameServer() - go func() { - defer gameS.Stop() - err <- gameS.Start() - }() - - utils.Sugar.Errorf("server error: %v", <- err) -} diff --git a/models/init.go b/models/init.go index 838da05..18918b8 100644 --- a/models/init.go +++ b/models/init.go @@ -10,10 +10,10 @@ func InitDoc(schema ...interface{}) { for _, s := range schema { for coll, key := range utils.FindIndex(s) { if err := db.CreateCollection(coll); err != nil { - utils.Sugar.Errorf("InitDoc err: %v", err) continue } + utils.Sugar.Debugf("InitDoc collect: %v, createIndex: %s", coll, key) res, err := db.SetUnique(coll, key) if err != nil { utils.Sugar.Errorf("InitDoc unique: %s, err: %v", res, err) diff --git a/protos b/protos index e1f5090..a552f5d 160000 --- a/protos +++ b/protos @@ -1 +1 @@ -Subproject commit e1f50907a33f6a142cad9db325e80d9027979420 +Subproject commit a552f5d0e80bb805dac51eed31a0c155d7cd5623 -- libgit2 0.21.2