Incomp. Proto. Change: Maintain sync by prefixing client commands by tick id

This commit is contained in:
Petr Baudis 2011-12-22 15:28:05 +01:00
parent 091708f577
commit 9baf771807
5 changed files with 29 additions and 15 deletions

View file

@ -116,9 +116,9 @@ sub take_action($$) {
print "moves ".join(", ", @move)." => (".dirindex($max).":$max->[0],$max->[1])\n";
if ($attack[dirindex($max)]) {
print $socket "attack_dir $max->[0] $max->[1] 100\r\n";
print $socket $state->{tick}." attack_dir $max->[0] $max->[1] 100\r\n";
} else {
print $socket "move_dir $max->[0] $max->[1]\r\n";
print $socket $state->{tick}." move_dir $max->[0] $max->[1]\r\n";
}
print $socket "secrete 65536 1\r\n";
print $socket "\r\n";