27 for (
unsigned i = 0; i <
NBCMDS; i++)
28 tab_[NBCMDSLOC + i] = tabs[i];
38 std::pair<bool, UInt32>,
39 std::pair<UInt32, BufferType>>
MyPair (
bool b,
44 return std::make_pair (
45 std::make_pair (b, fct),
46 std::make_pair (chan, bt));
52 bt.
Add (
"Argument is missing.");
60 bt.
Add (
"Too much argument.");
69 if (b.
Count () > nbarg)
71 if (b.
Count () < nbarg)
74 bt.
Add (
"Test argument failed.");
84 bt.
Add (
"Command list: ");
85 bt.
Add (
"/help\t\t: to display command list");
86 bt.
Add (
"/trade x\t: to trade with the player x");
96 UInt32 channb = StringHelper::Parse<int> (b[b.
Count () - 1]);
102 if (b[0].compare(
"/echo") == 0)
107 for (
size_t i = 1; i < b.
Count (); i++)
123 bt.
Add (
"Command " + s[0].substr (1) +
" not exist.");
133 if (name.
Count () != 2)
136 bt.
Add (
"Trying to trade with " + name[1] +
".");
151 return MyPair (
true, 0, 0, bt);
164 return MyPair (
true, 1, 0, bt);
175 bt.
Add (
"Channel " + b[1] +
" has been added.");
178 return MyPair (
true, 2, 0, bt);
189 bt.
Add (
"Channel : " + b[1] +
" has been removed.");
192 return MyPair (
true, 3, 0, bt);
219 bt.
Add (
"Too much argument.");
226 std::istringstream buf (chanNb);
229 if (tmp >= 0 && tmp < cm->Count)
235 bt.
Add (tmp +
" is not an tab number.");
238 bt.
Add (
"Bad argument.");
252 bt.
Add (
"Too much argument.");
259 std::istringstream buf (chanNb);
262 if (tmp >= 0 && tmp < cd->GetChanNb ())
269 bt.
Add (tmp +
" is not an chan number.");
272 bt.
Add (
"Bad argument.");
286 bt.
Add (
"Too much argument.");
293 std::istringstream buf (chanNb);
296 if (tmp >= 0 && tmp < cd->GetChanNb())
302 bt.
Add (tmp +
" is not an chan number.");
305 bt.
Add (
"Bad argument.");
320 bt.
Add (
"Too much argument.");
327 std::istringstream buf (chanNb);
330 if (tmp >= 0 && tmp < cd->GetChanNb())
336 bt.
Add (tmp +
" is not an chan number.");
339 bt.
Add (
"Bad argument.");
358 if (response.first.first)
360 (&response.second.first, &response.second.second, cm, cd);
361 if (bt.
Count () == 0)
364 cm->
Cd[i]->AddToChan (response.second.first, response.second.second);
367 if (response.first.second == 0)
370 return cm->
Cd[cm->
TabNb]->DisplayTab ();
374 cd->AddToChan (0, bt);
376 return cd->Display ();