mirror of
https://github.com/FlourishingWorld/hk4e.git
synced 2026-02-04 14:22:26 +08:00
26 lines
466 B
Go
26 lines
466 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,
|
|
ParamList: req.ParamList,
|
|
}
|
|
return &api.CmdReply{
|
|
Message: "OK",
|
|
}, nil
|
|
}
|