Add infos into target window
[ryzomcore.git] / ryzom / server / src / general_utilities_service / ce_commands.cpp
blob884b6c7b8272e015e2a07bc3f871d378246b06a8
1 // Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
2 // Copyright (C) 2010 Winch Gate Property Limited
3 //
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.
8 //
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 //-----------------------------------------------------------------------------
18 // includes
19 //-----------------------------------------------------------------------------
21 //nel
22 #include "nel/misc/command.h"
24 // game share
25 #include "game_share/utils.h"
27 // local
28 #include "gus_net_types.h"
29 #include "ce_contest_executor.h"
32 //-----------------------------------------------------------------------------
33 // Namespaces
34 //-----------------------------------------------------------------------------
36 using namespace std;
37 using namespace NLMISC;
38 using namespace GUSNET;
39 using namespace GUS;
42 //-----------------------------------------------------------------------------
43 // CContestExecutor Commands
44 //-----------------------------------------------------------------------------
46 NLMISC_CATEGORISED_COMMAND(ContestExecutor,ceAnswer,"submit an answer","<player_id> <answer>")
48 CNLSmartLogOverride logOverride(&log);
50 if (args.size()!=2)
51 return false;
53 CContestExecutor::getInstance()->submitAnswer(TDataSetRow(), args[0], ucstring(args[1]));
55 return true;
58 NLMISC_CATEGORISED_COMMAND(ContestExecutor,ceChatTexts,"load the file of static chat messages","<file name>")
60 CNLSmartLogOverride logOverride(&log);
62 if (args.size()!=1)
63 return false;
65 if (CContestExecutor::getInstance()->readChatTextFile(args[0]))
67 log.displayNL("Chat text file '%s' loaded", args[0].c_str());
69 else
71 log.displayNL("FAILED to load file '%s'", args[0].c_str());
74 return true;
77 NLMISC_CATEGORISED_COMMAND(ContestExecutor,ceDisplayState,"display the state of the contest executor module","")
79 CNLSmartLogOverride logOverride(&log);
81 if (args.size()!=0)
82 return false;
84 CContestExecutor::getInstance()->display();
86 return true;
90 //-----------------------------------------------------------------------------