1 // Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
2 // Copyright (C) 2010 Winch Gate Property Limited
4 // This program is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU Affero General Public License as
6 // published by the Free Software Foundation, either version 3 of the
7 // License, or (at your option) any later version.
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU Affero General Public License for more details.
14 // You should have received a copy of the GNU Affero General Public License
15 // along with this program. If not, see <http://www.gnu.org/licenses/>.
17 //-----------------------------------------------------------------------------
19 //-----------------------------------------------------------------------------
22 #include "nel/misc/command.h"
25 #include "game_share/utils.h"
28 #include "cc_contest_ctrl_script.h"
31 //-----------------------------------------------------------------------------
33 //-----------------------------------------------------------------------------
36 using namespace NLMISC
;
39 //-----------------------------------------------------------------------------
40 // CContestCtrlScript Commands
41 //-----------------------------------------------------------------------------
43 NLMISC_CATEGORISED_COMMAND(ContestCtrl
,ccAdvance
,"adavnce the clock to the end of the current delay","")
45 CNLSmartLogOverride
logOverride(&log
);
50 CContestCtrlScript::getInstance()->setDelay(0);
55 NLMISC_CATEGORISED_COMMAND(ContestCtrl
,ccDisplayState
,"display the state of the contest control module","")
57 CNLSmartLogOverride
logOverride(&log
);
62 CContestCtrlScript::getInstance()->display();
67 NLMISC_CATEGORISED_COMMAND(ContestCtrl
,ccLoad
,"load a contest control script","<filename>")
69 CNLSmartLogOverride
logOverride(&log
);
75 ccsFileName
.readFromFile("gus_cc_last_ccs.txt");
80 ccsFileName
.writeToFile("gus_cc_last_ccs.txt");
87 CContestCtrlScript::getInstance()->load(ccsFileName
);
92 NLMISC_CATEGORISED_COMMAND(ContestCtrl
,ccQuit
,"stop running the current contest control script","")
94 CNLSmartLogOverride
logOverride(&log
);
99 CContestCtrlScript::getInstance()->stop();
104 NLMISC_CATEGORISED_COMMAND(ContestCtrl
,ccRun
,"start running the current contest control script","")
106 CNLSmartLogOverride
logOverride(&log
);
111 CContestCtrlScript::getInstance()->start();
116 NLMISC_CATEGORISED_COMMAND(ContestCtrl
,ccShow
,"show the current contest control script","")
118 CNLSmartLogOverride
logOverride(&log
);
123 CContestCtrlScript::getInstance()->list();
128 NLMISC_CATEGORISED_COMMAND(ContestCtrl
,ccWait
,"modify duration of current pause","<time to wait in seconds>")
130 CNLSmartLogOverride
logOverride(&log
);
135 sint32 time
= atoi(args
[0].c_str());
139 CContestCtrlScript::getInstance()->setDelay(time
*1000);
145 //-----------------------------------------------------------------------------