mirror of
https://github.com/FlourishingWorld/hk4e.git
synced 2026-02-04 16:02:26 +08:00
perf与性能优化
This commit is contained in:
@@ -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",
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user