Documentation
¶
Index ¶
- Variables
- func AddMatch(playerIDs []uint, baseContestID uint, tag string, ...) (matchID uint, err error)
- func CallJSFunction(loop *eventloop.EventLoop, funcName string, args ...interface{}) (result goja.Value, err error)
- func CallOnAIAssigned(contestant model.Contestant) error
- func CallOnMatchFinished(matchID uint, replay string) error
- func ChangeMatch(tag string, state string, matchID uint) (err error)
- func CreateRuntimeWithJSFile(baseContestID uint) error
- func InitGameMq(baseContestID uint, vm *goja.Runtime)
- func InitGameMqAndRunScript(baseContestID uint)
- func InitMq()
- func ListenMsgForMatchFinished()
- func SendBuildAIMsg(ctx context.Context, aiID uint) error
- func SendBuildGameLogicMsg(ctx context.Context, gameID uint) error
- func SendRunAutoMatchMsg(ctx context.Context, matchID uint) error
- func SetCreateMatch(baseContestID uint, vm *goja.Runtime) error
- func SetGetContestantsByRanking(baseContestID uint, vm *goja.Runtime) error
- func SetGoFuncForJS(baseContestID uint, funcName string, goFunc func(goja.FunctionCall) goja.Value, ...) error
- func SetUpdateContestant(baseContestID uint, vm *goja.Runtime) error
- func Startup()
- type Msg
Constants ¶
This section is empty.
Variables ¶
View Source
var ( BaseContestIDToRuntime = make(map[uint]*eventloop.EventLoop) RuntimeToBaseContestID = make(map[*eventloop.EventLoop]uint) Mutex = &sync.Mutex{} // 用于保护 map 的并发访问 )
定义全局 map
View Source
var Ctx_callback = context.Background()
Functions ¶
func CallJSFunction ¶
func CallOnAIAssigned ¶
func CallOnAIAssigned(contestant model.Contestant) error
func CallOnMatchFinished ¶
func CreateRuntimeWithJSFile ¶
func InitGameMq ¶
func InitGameMqAndRunScript ¶
func InitGameMqAndRunScript(baseContestID uint)
func ListenMsgForMatchFinished ¶
func ListenMsgForMatchFinished()
func SetGoFuncForJS ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.