shardserver: added Service()

also, Start() now returns an error result
This commit is contained in:
CPunch 2024-02-01 16:53:27 -06:00
parent 23170093ee
commit e5a9ed1481

View File

@ -50,9 +50,9 @@ func NewShardServer(ctx context.Context, dbHndlr *db.DBHandler, redisHndlr *redi
return server, nil return server, nil
} }
func (server *ShardServer) Start() { func (server *ShardServer) Start() error {
server.LoadNPCs() server.LoadNPCs()
server.service.Start() return server.service.Start()
} }
func (server *ShardServer) onDisconnect(peer *cnet.Peer) { func (server *ShardServer) onDisconnect(peer *cnet.Peer) {
@ -66,3 +66,7 @@ func (server *ShardServer) onDisconnect(peer *cnet.Peer) {
func (server *ShardServer) onConnect(peer *cnet.Peer) { func (server *ShardServer) onConnect(peer *cnet.Peer) {
} }
func (server *ShardServer) Service() *cnet.Service {
return server.service
}