mirror of
https://github.com/brmlab/brmlife.git
synced 2025-08-01 17:33:35 +02:00
Report suspicious events (out-of-sync agents, unexpectedly disconnected agents)
This commit is contained in:
parent
a565d5d81d
commit
be10580643
2 changed files with 5 additions and 1 deletions
5
agent.cc
5
agent.cc
|
@ -170,8 +170,11 @@ agent::die(void)
|
|||
void
|
||||
agent::on_action_takes(void)
|
||||
{
|
||||
if (!conn)
|
||||
if (!conn) {
|
||||
if (tile && !dead && !(dynamic_cast<herb *> (this)))
|
||||
std::cout << "agent " << id << " not connected ...\n";
|
||||
return;
|
||||
}
|
||||
|
||||
if (conn->error) {
|
||||
conn->cancel();
|
||||
|
|
|
@ -122,6 +122,7 @@ connection::actions(int tick_id, class agent *agent)
|
|||
|
||||
if (atol(cmd_tick_id.c_str()) != tick_id - 1) {
|
||||
/* Out of sync command, ignore and continue. */
|
||||
std::cout << "agent " << agent->id << " out of sync (tick " << cmd_tick_id << " .. " << line << ") ...\n";
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue