[rcssserver3d] Add a patch to fix single-player kickoffs

Hedayat Vatankhah hedayat at fedoraproject.org
Thu Jun 21 10:45:10 UTC 2012


commit 93bccf283044b46fcfa5fb5bbeb1143abca29a08
Author: Hedayat Vatankhah <hedayat.fwd at gmail.com>
Date:   Thu Jun 21 15:13:29 2012 +0430

    Add a patch to fix single-player kickoffs

 rcssserver3d-0.6.6-penaltyfix.patch |   49 +++++++++++++++++++++++++++++++++++
 rcssserver3d.spec                   |    7 ++++-
 2 files changed, 55 insertions(+), 1 deletions(-)
---
diff --git a/rcssserver3d-0.6.6-penaltyfix.patch b/rcssserver3d-0.6.6-penaltyfix.patch
new file mode 100644
index 0000000..50f0595
--- /dev/null
+++ b/rcssserver3d-0.6.6-penaltyfix.patch
@@ -0,0 +1,49 @@
+diff -up rcssserver3d-0.6.6/plugin/soccer/soccerruleaspect/soccerruleaspect.cpp.penaltyfix rcssserver3d-0.6.6/plugin/soccer/soccerruleaspect/soccerruleaspect.cpp
+--- rcssserver3d-0.6.6/plugin/soccer/soccerruleaspect/soccerruleaspect.cpp.penaltyfix	2012-06-21 15:07:49.031513852 +0430
++++ rcssserver3d-0.6.6/plugin/soccer/soccerruleaspect/soccerruleaspect.cpp	2012-06-21 15:08:00.556369772 +0430
+@@ -4,7 +4,7 @@
+    Fri May 9 2003
+    Copyright (C) 2002,2003 Koblenz University
+    Copyright (C) 2003 RoboCup Soccer Server 3D Maintenance Group
+-   $Id: soccerruleaspect.cpp 316 2012-05-22 22:33:15Z hedayat $
++   $Id: soccerruleaspect.cpp 320 2012-06-21 09:05:56Z hedayat $
+ 
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+@@ -713,18 +713,11 @@ void
+ SoccerRuleAspect::UpdateBeforeKickOff()
+ {
+     // get game control server to check agent count
+-    static boost::shared_ptr<GameControlServer> game_control;
++    boost::shared_ptr<GameControlServer> game_control;
+ 
+-    if  (game_control.get() == 0)
++    if (!SoccerBase::GetGameControlServer(*this, game_control))
+     {
+-        game_control = shared_dynamic_cast<GameControlServer>
+-            (GetCore()->Get("/sys/server/gamecontrol"));
+-
+-        if (game_control.get() == 0)
+-        {
+-            GetLog()->Error() << "(SoccerRuleAspect) Error: can't get GameControlServer.\n";
+-            return;
+-        }
++        return;
+     }
+ 
+     // if no players are connected, just return
+@@ -786,8 +779,13 @@ SoccerRuleAspect::UpdateKickOff(TTeamInd
+     }
+     if (time > mGameState->GetLastModeChange())
+     {
++        boost::shared_ptr<GameControlServer> game_control;
++        if (SoccerBase::GetGameControlServer(*this, game_control)
++                && game_control->GetAgentCount() > 2) // todo: remove this when there is a "penalty" playmode
++        {
++            mCheckKickOffKickerFault = true;
++        }
+         mLastKickOffKickTime = time;
+-        mCheckKickOffKickerFault = true;
+         mLastKickOffTaker = agent;
+         mGameState->SetPlayMode(PM_PlayOn);
+     }
diff --git a/rcssserver3d.spec b/rcssserver3d.spec
index 9e86630..66454b9 100644
--- a/rcssserver3d.spec
+++ b/rcssserver3d.spec
@@ -1,12 +1,13 @@
 Name:           rcssserver3d
 Version:        0.6.6
-Release:        1%{?dist}
+Release:        2%{?dist}
 Summary:        Robocup 3D Soccer Simulation Server
 
 Group:          Applications/System
 License:        GPLv2
 URL:            http://sourceforge.net/projects/simspark/
 Source0:        http://downloads.sourceforge.net/simspark/%{name}-%{version}.tar.gz
+Patch0:         rcssserver3d-0.6.6-penaltyfix.patch
 
 BuildRequires:  cmake boost-devel SDL-devel desktop-file-utils simspark-devel
 BuildRequires:  ode-devel libGL-devel DevIL-devel freetype-devel libGLU-devel
@@ -46,6 +47,7 @@ you will find %{name}-doc package useful.
 
 %prep
 %setup -q
+%patch0 -p1 -b .penaltyfix
 
 %build
 mkdir build
@@ -92,6 +94,9 @@ rm -f package_docs/TODO
 
 
 %changelog
+* Thu Jun 21 2012 Hedayat Vatankhah <hedayat.fwd+rpmchlog at gmail.com> - 0.6.6-2
+- Add a patch to fix single-player kickoffs
+
 * Tue May 22 2012 Hedayat Vatankhah <hedayat.fwd+rpmchlog at gmail.com> - 0.6.6-1
 - Update to latest upstream version 0.6.6
 - Remove some old .spec stuff (e.g. defattr's)


More information about the scm-commits mailing list