MCPcopy Create free account
hub / github.com/Alex-Rachel/TGameServer / AddFunction

Method AddFunction

app/tserver/controller.go:19–28  ·  view source on GitHub ↗
(funcName string, inter interface{})

Source from the content-addressed store, hash-verified

17}
18
19func (controller *Controller) AddFunction(funcName string, inter interface{}) (map[string]interface{}, error) {
20 _, hadValue := controller.Funcs[funcName]
21 if !hadValue {
22 controller.Funcs[funcName] = inter
23 } else {
24 errorstr := "Had Func" + funcName
25 return controller.Funcs, errors.New(errorstr)
26 }
27 return controller.Funcs, nil
28}
29
30func (controller *Controller) Call(name string, params ...interface{}) (result []reflect.Value, err error) {
31 _, hadValue := controller.Funcs[name]

Callers 3

InitUserControllerFunction · 0.80
InitGameControllerFunction · 0.80
InitRoomControllerFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected