Files
hk4e/gs/service/gm.go
2023-03-29 14:59:53 +08:00

26 lines
460 B
Go

package service
import (
"context"
"hk4e/gs/api"
"hk4e/gs/game"
)
var _ api.GMNATSRPCServer = (*GMService)(nil)
type GMService struct {
g *game.Game
}
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,
}
return &api.CmdReply{
Message: "OK",
}, nil
}