Skip to content

Commit

Permalink
Merge pull request #33 from rcsoccersim/develop
Browse files Browse the repository at this point in the history
Release candidate: version 16.0.0
  • Loading branch information
hidehisaakiyama authored Feb 10, 2020
2 parents 630667b + b5fd1d1 commit 1b5076d
Show file tree
Hide file tree
Showing 7 changed files with 79 additions and 4 deletions.
7 changes: 7 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
2020-02-03 Hidehisa Akiyama <[email protected]>

* 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 <[email protected]>

* NEWS:
Expand Down
46 changes: 45 additions & 1 deletion NEWS
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

AC_PREREQ(2.61)
LT_PREREQ([2.2])
AC_INIT([RCSSServer],[15.6.0],[[email protected]],[rcssserver])
AC_INIT([RCSSServer],[16.0.0],[[email protected]],[rcssserver])

#AM_INIT_AUTOMAKE([gnu 1.7.2 check-news dist-bzip2 dist-zip])
AM_INIT_AUTOMAKE([gnu 1.7.2 check-news foreign])
Expand Down
1 change: 1 addition & 0 deletions src/player.h
Original file line number Diff line number Diff line change
Expand Up @@ -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();

//
Expand Down
18 changes: 17 additions & 1 deletion src/referee.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 )
{
Expand All @@ -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
Expand All @@ -1543,6 +1544,7 @@ IllegalDefenseRef::analyse()
&& std::fabs( (*p)->pos().y ) < half_width )
{
right_player_illegal += 1;
(*p)->addState( ILLEGAL_DEFENSE );
}
}

Expand All @@ -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() )
Expand All @@ -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() )
Expand Down
8 changes: 7 additions & 1 deletion src/stdtimer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
1 change: 1 addition & 0 deletions src/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 1b5076d

Please sign in to comment.