diff --git a/ChangeLog b/ChangeLog index 8ee864ab..65f03e0c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2020-02-03 Hidehisa Akiyama + + * NEWS: + * configure.ac: + - update a major version number. Official release 16.0.0 + - add new features, automatic illegal defense detection and anonymous games. + 2019-11-10 Hidehisa Akiyama * NEWS: diff --git a/NEWS b/NEWS index a9779c42..382ce233 100644 --- a/NEWS +++ b/NEWS @@ -1,7 +1,51 @@ +[16.0.0] + * New parameters: + - server::illegal_defense_duration (default value: 20) + - server::illegal_defense_number (default value: 0) + - server::illegal_defense_dist_x (default value: 16.5) + - server::illegal_defense_width (default value: 40.32) + - server::fixed_teamname_l (default value: '') + - server::fixed_teamname_r (default value: '') + + * Introduce an automatic illegal defense detection rule. This rule + is disabled if the value of illegal_defense_number is 0 (default + in this version). + + The illegal defense area is defined by two parameters, + illegal_defense_dist_x and illegal_defense_width. The area + defined by default values is same as the penalty area for each + side. Please note that these values may be changed in the future + version. + + If a player in the defensive side team (not a ball owner team) + exists whthin the illegal defense area for that team, the referee + marks that player is a candidate of illegal defense state. Then, + if the number of marked players is more than or equal to + illegal_defense_number, the referee judges that the team behaves + illegal defense at that cycle. Finally, if the illegal defense behavior + for a team continues for more than or equal to illegal_defense_duration, + 'illegal_defense_[lr]' playmode is called and a free kick is + awarded to the other team. The free kick position is currently + fixed at (+-41.5, 0.0). + + * Introduce a fixed team name feature. If fixed_teamname_[lr] are + given, the players and online coaches receive the given string as + their opponent team name, while receiving their own team name as + it is. This feature can be used for an anonymous game where both + teams do not know their opponent team name during a game. + + * Define a new player state flag for the monitor protocol to + represent an illegal defense state. This flag can be used to + visualize the state of illegal defense behavior on the + monitor/logplayer. + [15.6.0] * Change the default value of server::dash_angle_step from 45.0 to 1.0. This change means players can dash to almost any direction. + * Fix the problem of foul assignment during penalty + shootouts. Thanks go to Ruggero Rossi for providing the patch. + [15.5.0] * Fix build problems on Ubuntu 18.04. Replace all auto_ptr variables with unique_ptr or shared_ptr. Now, rcssserver requires c++14. @@ -34,7 +78,7 @@ called. Thanks go to Fernando Almeida for reporting the problem and providing the patch. - * Changed the defalut value of server::log_date_format from + * Changed the default value of server::log_date_format from "%Y%m%d%H%M-" to "%Y%m%d%H%M%S-". * Fixed a defect of boost detection. diff --git a/configure.ac b/configure.ac index 48cb6393..9c4613e2 100644 --- a/configure.ac +++ b/configure.ac @@ -3,7 +3,7 @@ AC_PREREQ(2.61) LT_PREREQ([2.2]) -AC_INIT([RCSSServer],[15.6.0],[sserver-admin@users.sf.net],[rcssserver]) +AC_INIT([RCSSServer],[16.0.0],[sserver-admin@users.sf.net],[rcssserver]) #AM_INIT_AUTOMAKE([gnu 1.7.2 check-news dist-bzip2 dist-zip]) AM_INIT_AUTOMAKE([gnu 1.7.2 check-news foreign]) diff --git a/src/player.h b/src/player.h index e8cded7a..cacbb81f 100644 --- a/src/player.h +++ b/src/player.h @@ -302,6 +302,7 @@ class Player // Int32 state() const { return M_state; } void addState( const Int32 state ) { M_state |= state; } + void removeState( const Int32 state ) { M_state &= ~state; } void resetState(); // diff --git a/src/referee.cpp b/src/referee.cpp index bafaebed..b4f4922c 100644 --- a/src/referee.cpp +++ b/src/referee.cpp @@ -1522,7 +1522,7 @@ IllegalDefenseRef::analyse() const double right_x = +ServerParam::PITCH_LENGTH * 0.5 - ServerParam::instance().illegalDefenseDistX(); const double half_width = ServerParam::instance().illegalDefenseWidth() * 0.5; - for ( Stadium::PlayerCont::const_iterator p = M_stadium.players().begin(), end = M_stadium.players().end(); + for ( Stadium::PlayerCont::iterator p = M_stadium.players().begin(), end = M_stadium.players().end(); p != end; ++p ) { @@ -1535,6 +1535,7 @@ IllegalDefenseRef::analyse() && std::fabs( (*p)->pos().y ) < half_width ) { left_player_illegal += 1; + (*p)->addState( ILLEGAL_DEFENSE ); } else if ( (*p)->side() == RIGHT && M_last_kicker_side == LEFT @@ -1543,6 +1544,7 @@ IllegalDefenseRef::analyse() && std::fabs( (*p)->pos().y ) < half_width ) { right_player_illegal += 1; + (*p)->addState( ILLEGAL_DEFENSE ); } } @@ -1553,6 +1555,13 @@ IllegalDefenseRef::analyse() else { M_left_illegal_counter = 0; + + for ( Stadium::PlayerCont::iterator p = M_stadium.players().begin(), end = M_stadium.players().end(); + p != end; + ++p ) + { + if ( (*p)->side() == LEFT ) (*p)->removeState( ILLEGAL_DEFENSE ); + } } if ( right_player_illegal >= ServerParam::instance().illegalDefenseNumber() ) @@ -1562,6 +1571,13 @@ IllegalDefenseRef::analyse() else { M_right_illegal_counter = 0; + + for ( Stadium::PlayerCont::iterator p = M_stadium.players().begin(), end = M_stadium.players().end(); + p != end; + ++p ) + { + if ( (*p)->side() == RIGHT ) (*p)->removeState( ILLEGAL_DEFENSE ); + } } if ( M_left_illegal_counter >= ServerParam::instance().illegalDefenseDuration() ) diff --git a/src/stdtimer.cpp b/src/stdtimer.cpp index 388d347e..305d222b 100644 --- a/src/stdtimer.cpp +++ b/src/stdtimer.cpp @@ -223,7 +223,13 @@ StandardTimer::run() printf( "WaitForSingleObject failed (%d)\n", GetLastError() ); #else if ( ! gotsig ) - sigpause( SIGUSR1 ); + { + //sigpause( SIGUSR1 ); + sigset_t mask; + sigemptyset( &mask ); + sigaddset( &mask, SIGUSR1 ); + sigsuspend( &mask ); + } #endif gotsig = false; diff --git a/src/types.h b/src/types.h index 9e4c5164..556a05a1 100644 --- a/src/types.h +++ b/src/types.h @@ -66,6 +66,7 @@ enum PlayerState { FOUL_CHARGED = 0x00020000, // player is frozen by intentional tackle foul YELLOW_CARD = 0x00040000, RED_CARD = 0x00080000, + ILLEGAL_DEFENSE = 0x00100000, }; enum Side {