mirror of
https://github.com/brmlab/brmlife.git
synced 2025-08-02 01:43:36 +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
|
void
|
||||||
agent::on_action_takes(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;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (conn->error) {
|
if (conn->error) {
|
||||||
conn->cancel();
|
conn->cancel();
|
||||||
|
|
|
@ -122,6 +122,7 @@ connection::actions(int tick_id, class agent *agent)
|
||||||
|
|
||||||
if (atol(cmd_tick_id.c_str()) != tick_id - 1) {
|
if (atol(cmd_tick_id.c_str()) != tick_id - 1) {
|
||||||
/* Out of sync command, ignore and continue. */
|
/* Out of sync command, ignore and continue. */
|
||||||
|
std::cout << "agent " << agent->id << " out of sync (tick " << cmd_tick_id << " .. " << line << ") ...\n";
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue