perf与性能优化

This commit is contained in:
flswld
2023-04-15 20:00:37 +08:00
parent 149b773f4b
commit 094ad5add0
26 changed files with 403 additions and 308 deletions

View File

@@ -16,8 +16,8 @@ type GMService struct {
func (s *GMService) Cmd(ctx context.Context, req *api.CmdRequest) (*api.CmdReply, error) {
commandTextInput := game.COMMAND_MANAGER.GetCommandTextInput()
commandTextInput <- &game.CommandMessage{
FuncName: req.FuncName,
Param: req.Param,
FuncName: req.FuncName,
ParamList: req.ParamList,
}
return &api.CmdReply{
Message: "OK",

View File

@@ -10,7 +10,7 @@ import (
type Service struct{}
func NewService(conn *nats.Conn) (*Service, error) {
func NewService(conn *nats.Conn, gsId uint32) (*Service, error) {
enc, err := nats.NewEncodedConn(conn, protobuf.PROTOBUF_ENCODER)
if err != nil {
return nil, err
@@ -20,7 +20,7 @@ func NewService(conn *nats.Conn) (*Service, error) {
return nil, err
}
gs := &GMService{}
_, err = api.RegisterGMNATSRPCServer(svr, gs)
_, err = api.RegisterGMNATSRPCServer(svr, gs, natsrpc.WithServiceID(gsId))
if err != nil {
return nil, err
}