gopenfusion/main.go
CPunch 5b2a8b838e major refactoring: db.Player is now core.Player
- misc. cleanup
- core/db/players.go: works with core.Player types, will also grab inventory table
2023-03-22 00:30:58 -05:00

33 lines
669 B
Go

package main
import (
"log"
"github.com/CPunch/gopenfusion/config"
"github.com/CPunch/gopenfusion/core/db"
"github.com/CPunch/gopenfusion/server"
)
func main() {
dbHndlr, err := db.OpenLiteDB("test.db")
if err != nil {
log.Panicf("failed to open db: %v", err)
}
dbHndlr.Setup()
loginServer, err := server.NewLoginServer(dbHndlr, config.LOGIN_PORT)
if err != nil {
log.Panicf("failed to create login server: %v", err)
}
shardServer, err := server.NewShardServer(dbHndlr, config.SHARD_PORT)
if err != nil {
log.Panicf("failed to create shard server: %v", err)
}
loginServer.AddShard(shardServer)
go loginServer.Start()
shardServer.Start()
}