You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
573 B
Go

3 years ago
package game
import (
"dcg/game/room"
"git.noahlan.cn/northlan/ngs"
"git.noahlan.cn/northlan/ngs/component"
"git.noahlan.cn/northlan/ngs/serialize/protobuf"
"strings"
)
var (
Services = &component.Components{}
RoomManager = room.NewRoomManager()
3 years ago
)
func init() {
Services.Register(RoomManager,
3 years ago
component.WithName("room"),
component.WithNameFunc(func(s string) string {
return strings.ToLower(s)
}))
}
func Run(listen string) {
ngs.Listen(listen,
ngs.WithComponents(Services),
ngs.WithSerializer(protobuf.NewSerializer()),
ngs.WithDebugMode())
}