mirror of
https://github.com/brmlab/brmlife.git
synced 2025-08-02 09:53:38 +02:00
Support reconnecting to agents
Agents do not die immediately on disconnect anymore. Instead, agent_id is sent at birth and can be sent during negotiation to attach to a disconnected agent.
This commit is contained in:
parent
417a5235a0
commit
8ae6051e97
4 changed files with 52 additions and 7 deletions
|
@ -143,9 +143,14 @@ $socket = IO::Socket::INET->new(
|
|||
print "[ii] connected\r\n";
|
||||
|
||||
# negotiate attributs
|
||||
print $socket "move 1.0\r\n";
|
||||
print $socket "attack 1.0\r\n";
|
||||
print $socket "defense 1.0\r\n";
|
||||
if ($ARGV[1]) {
|
||||
print "[ii] recovering agent $ARGV[1]\r\n";
|
||||
print $socket "agent_id $ARGV[1]\r\n";
|
||||
} else {
|
||||
print $socket "move 1.0\r\n";
|
||||
print $socket "attack 1.0\r\n";
|
||||
print $socket "defense 1.0\r\n";
|
||||
}
|
||||
print $socket "\r\n";
|
||||
print "[ii] agent created\r\n";
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue