(player *Player, command string)
| 77 | } |
| 78 | |
| 79 | func (c *Core) onCommand(player *Player, command string) { |
| 80 | args := strings.Split(command, " ") |
| 81 | |
| 82 | node := &c.rootCommand |
| 83 | if !c.analyseCommand(player, args, node, 0) { |
| 84 | m := ChatMessage("Unknown command") |
| 85 | m.SetColor(&ChatColorRed) |
| 86 | player.SendMessage(m) |
| 87 | } |
| 88 | } |
| 89 | |
| 90 | func (c *Core) analyseCommand(player *Player, args []string, node *CommandNode, step int) bool { |
| 91 | if len(args) > step { |
no test coverage detected