RegisterAgent 注册 Agent
(id string, ag *agent.Agent)
| 139 | |
| 140 | // RegisterAgent 注册 Agent |
| 141 | func (os *AsterOS) RegisterAgent(id string, ag *agent.Agent) error { |
| 142 | // 注册到 Registry |
| 143 | if err := os.registry.RegisterAgent(id, ag); err != nil { |
| 144 | return err |
| 145 | } |
| 146 | |
| 147 | // 通知所有 Interfaces |
| 148 | os.notifyAgentRegistered(ag) |
| 149 | |
| 150 | return nil |
| 151 | } |
| 152 | |
| 153 | // RegisterRoom 注册 Room |
| 154 | func (os *AsterOS) RegisterRoom(id string, r *core.Room) error { |
nothing calls this directly
no test coverage detected