Skip to content

Commit

Permalink
Substantial game server update + DB break
Browse files Browse the repository at this point in the history
  • Loading branch information
jchv committed Jun 25, 2023
1 parent 1ee2657 commit 44ce684
Show file tree
Hide file tree
Showing 33 changed files with 3,566 additions and 226 deletions.
2 changes: 2 additions & 0 deletions cmd/gameserver/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import (
"github.com/pangbox/server/database"
"github.com/pangbox/server/database/accounts"
gameserver "github.com/pangbox/server/game/server"
"github.com/pangbox/server/gameconfig"
log "github.com/sirupsen/logrus"
"github.com/xo/dburl"
)
Expand Down Expand Up @@ -72,6 +73,7 @@ func main() {
Database: db,
Hasher: hash.Bcrypt{},
}),
ConfigProvider: gameconfig.Default(),
})
log.Fatalln(gameServer.Listen(ctx, listenAddr))
}
2 changes: 2 additions & 0 deletions cmd/loginserver/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (
"github.com/pangbox/server/common/topology"
"github.com/pangbox/server/database"
"github.com/pangbox/server/database/accounts"
"github.com/pangbox/server/gameconfig"
"github.com/pangbox/server/login"
log "github.com/sirupsen/logrus"
"github.com/xo/dburl"
Expand Down Expand Up @@ -72,6 +73,7 @@ func main() {
Database: db,
Hasher: hash.Bcrypt{},
}),
ConfigProvider: gameconfig.Default(),
})
log.Fatalln(loginServer.Listen(ctx, listenAddr))
}
6 changes: 4 additions & 2 deletions common/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,11 @@ func (b *BaseServer) Listen(logger *log.Entry, addr string, handler BaseHandlerF
logger.WithField("error", r).Error("PANIC in connection")
}
logger.Info("Exiting connection thread.")
if err := socket.Close(); err != nil {
logger.WithError(err).Warning("error closing socket")
}
}()
err := handler(logger, socket)
if err != nil {
if err := handler(logger, socket); err != nil {
logger.WithError(err).Error("ERROR in connection")
}
}()
Expand Down
Loading

0 comments on commit 44ce684

Please sign in to comment.