trainer_command.h

説明を見る。
00001 // -*-c++-*-
00002 
00008 /*
00009  *Copyright:
00010 
00011  Copyright (C) Hidehisa AKIYAMA
00012 
00013  This code is free software; you can redistribute it and/or
00014  modify it under the terms of the GNU Lesser General Public
00015  License as published by the Free Software Foundation; either
00016  version 2.1 of the License, or (at your option) any later version.
00017 
00018  This library is distributed in the hope that it will be useful,
00019  but WITHOUT ANY WARRANTY; without even the implied warranty of
00020  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00021  Lesser General Public License for more details.
00022 
00023  You should have received a copy of the GNU Lesser General Public
00024  License along with this library; if not, write to the Free Software
00025  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00026 
00027  *EndCopyright:
00028  */
00029 
00031 
00032 #ifndef RCSC_TRAINER_COMMAND_H
00033 #define RCSC_TRAINER_COMMAND_H
00034 
00035 #include <rcsc/geom/vector_2d.h>
00036 #include <rcsc/types.h>
00037 
00038 #include <string>
00039 #include <iostream>
00040 
00041 namespace rcsc {
00042 
00047 class TrainerCommand {
00048 public:
00052     enum Type {
00053         INIT, 
00054 
00055         CHECK_BALL,
00056         LOOK,
00057         TEAM_NAMES,
00058 
00059         EAR,
00060         EYE,
00061 
00062         START,
00063         CHANGE_MODE,
00064         MOVE,
00065         RECOVER,
00066         CHANGE_PLAYER_TYPE,
00067         SAY,
00068 
00069         COMPRESSION,
00070         DONE,
00071 
00072         ILLEGAL
00073     };
00074 
00075 protected:
00079     TrainerCommand()
00080       { }
00081 
00082 public:
00086     virtual
00087     ~TrainerCommand()
00088       { }
00089 
00094     virtual
00095     Type type() const = 0;
00096 
00102     virtual
00103     std::ostream & toStr( std::ostream & to ) const = 0;
00104 
00109     virtual
00110     std::string name() const = 0;
00111 };
00112 
00114 
00126 class TrainerInitCommand
00127     : public TrainerCommand {
00128 private:
00129     double M_version; 
00130 
00131 public:
00135     explicit
00136     TrainerInitCommand( const double & version )
00137         : M_version( version )
00138       { }
00139 
00144     Type type() const
00145       {
00146           return INIT;
00147       }
00148 
00154     std::ostream & toStr( std::ostream & to ) const;
00155 
00160     std::string name() const
00161       {
00162           return std::string( "init" );
00163       }
00164 };
00165 
00167 
00180 class TrainerCheckBallCommand
00181     : public TrainerCommand {
00182 private:
00183 
00184 public:
00188     TrainerCheckBallCommand()
00189       { }
00190 
00195     Type type() const
00196       {
00197           return CHECK_BALL;
00198       }
00199 
00205     std::ostream & toStr( std::ostream & to ) const;
00206 
00211     std::string name() const
00212       {
00213           return std::string( "check_ball" );
00214       }
00215 };
00216 
00218 
00229 class TrainerLookCommand
00230     : public TrainerCommand {
00231 private:
00232 
00233 public:
00237     TrainerLookCommand()
00238       { }
00239 
00244     Type type() const
00245       {
00246           return LOOK;
00247       }
00248 
00254     std::ostream & toStr( std::ostream & to ) const;
00255 
00260     std::string name() const
00261       {
00262           return std::string( "look" );
00263       }
00264 };
00265 
00267 
00278 class TrainerTeamNamesCommand
00279     : public TrainerCommand {
00280 private:
00281 
00282 public:
00286     TrainerTeamNamesCommand()
00287       { }
00288 
00293     Type type() const
00294       {
00295           return TEAM_NAMES;
00296       }
00297 
00303     std::ostream & toStr( std::ostream & to ) const;
00304 
00309     std::string name() const
00310       {
00311           return std::string( "team_names" );
00312       }
00313 };
00314 
00316 
00328 class TrainerEarCommand
00329     : public TrainerCommand {
00330 private:
00331     bool M_on; 
00332 public:
00337     explicit
00338     TrainerEarCommand( const bool on )
00339         : M_on( on )
00340       { }
00341 
00346     Type type() const
00347       {
00348           return EAR;
00349       }
00350 
00356     std::ostream & toStr( std::ostream & to ) const;
00357 
00362     std::string name() const
00363       {
00364           return std::string( "ear" );
00365       }
00366 };
00367 
00369 
00381 class TrainerEyeCommand
00382     : public TrainerCommand {
00383 private:
00384     bool M_on; 
00385 public:
00390     explicit
00391     TrainerEyeCommand( const bool on )
00392         : M_on( on )
00393       { }
00394 
00399     Type type() const
00400       {
00401           return EYE;
00402       }
00403 
00409     std::ostream & toStr( std::ostream & to ) const;
00410 
00415     std::string name() const
00416       {
00417           return std::string( "eye" );
00418       }
00419 };
00420 
00422 
00435 class TrainerKickOffCommand
00436     : public TrainerCommand {
00437 private:
00438 
00439 public:
00443     TrainerKickOffCommand()
00444       { }
00445 
00450     Type type() const
00451       {
00452           return START;
00453       }
00454 
00460     std::ostream & toStr( std::ostream & to ) const;
00461 
00466     std::string name() const
00467       {
00468           return std::string( "start" );
00469       }
00470 };
00471 
00473 
00485 class TrainerChangeModeCommand
00486     : public TrainerCommand {
00487 private:
00488     PlayMode M_playmode; 
00489 
00490 public:
00495     explicit
00496     TrainerChangeModeCommand( const PlayMode mode )
00497         : M_playmode( mode )
00498       { }
00499 
00504     Type type() const
00505       {
00506           return CHANGE_MODE;
00507       }
00508 
00514     std::ostream & toStr( std::ostream & to ) const;
00515 
00520     std::string name() const
00521       {
00522           return std::string( "change_mode" );
00523       }
00524 };
00525 
00527 
00539 class TrainerMoveBallCommand
00540     : public TrainerCommand {
00541 private:
00542     Vector2D M_pos; 
00543     Vector2D M_vel; 
00544 
00545 public:
00551     TrainerMoveBallCommand( const double & x,
00552                             const double & y );
00553 
00558     explicit
00559     TrainerMoveBallCommand( const Vector2D & pos );
00560 
00568     TrainerMoveBallCommand( const double & x,
00569                             const double & y,
00570                             const double & vx,
00571                             const double & vy );
00572 
00578     TrainerMoveBallCommand( const Vector2D & pos,
00579                             const Vector2D & vel );
00580 
00585     Type type() const
00586       {
00587           return MOVE;
00588       }
00589 
00595     std::ostream & toStr( std::ostream & to ) const;
00596 
00601     std::string name() const
00602       {
00603           return std::string( "move" );
00604       }
00605 };
00606 
00608 
00620 class TrainerMovePlayerCommand
00621     : public TrainerCommand {
00622 private:
00623     std::string M_team_name; 
00624     int M_unum; 
00625     Vector2D M_pos; 
00626     double M_angle; 
00627     Vector2D M_vel; 
00628 
00633     bool check() const;
00634 
00635 public:
00643     TrainerMovePlayerCommand( const std::string & team_name,
00644                               const int unum,
00645                               const double & x,
00646                               const double & y );
00647 
00654     TrainerMovePlayerCommand( const std::string & team_name,
00655                               const int unum,
00656                               const Vector2D & pos );
00657 
00666     TrainerMovePlayerCommand( const std::string & team_name,
00667                               const int unum,
00668                               const double & x,
00669                               const double & y,
00670                               const AngleDeg & angle );
00671 
00679     TrainerMovePlayerCommand( const std::string & team_name,
00680                               const int unum,
00681                               const Vector2D & pos,
00682                               const AngleDeg & angle );
00683 
00694     TrainerMovePlayerCommand( const std::string & team_name,
00695                               const int unum,
00696                               const double & x,
00697                               const double & y,
00698                               const AngleDeg & angle,
00699                               const double & vx,
00700                               const double & vy );
00701 
00711     TrainerMovePlayerCommand( const std::string & team_name,
00712                               const int unum,
00713                               const Vector2D & pos,
00714                               const AngleDeg & angle,
00715                               const double & vx,
00716                               const double & vy );
00717 
00726     TrainerMovePlayerCommand( const std::string & team_name,
00727                               const int unum,
00728                               const Vector2D & pos,
00729                               const AngleDeg & angle,
00730                               const Vector2D & vel );
00731 
00736     Type type() const
00737       {
00738           return MOVE;
00739       }
00740 
00746     std::ostream & toStr( std::ostream & to ) const;
00747 
00752     std::string name() const
00753       {
00754           return std::string("move");
00755       }
00756 };
00757 
00759 
00770 class TrainerRecoverCommand
00771     : public TrainerCommand {
00772 private:
00773 
00774 public:
00778     TrainerRecoverCommand()
00779       { }
00780 
00785     Type type() const
00786       {
00787           return RECOVER;
00788       }
00789 
00795     std::ostream & toStr( std::ostream & to ) const;
00796 
00801     std::string name() const
00802       {
00803           return std::string( "recover" );
00804       }
00805 };
00806 
00808 
00822 class TrainerChangePlayerTypeCommand
00823     : public TrainerCommand {
00824 private:
00825     std::string M_team_name; 
00826     int M_unum; 
00827     int M_type; 
00828 public:
00835     TrainerChangePlayerTypeCommand( const std::string & team_name,
00836                                     const int unum,
00837                                     const int type );
00838 
00843     Type type() const
00844       {
00845           return CHANGE_PLAYER_TYPE;
00846       }
00847 
00853     std::ostream & toStr( std::ostream & to ) const;
00854 
00859     std::string name() const
00860       {
00861           return std::string( "change_player_type" );
00862       }
00863 };
00864 
00866 
00877 class TrainerSayCommand
00878     : public TrainerCommand {
00879 private:
00880     std::string M_message; 
00881 public:
00886     explicit
00887     TrainerSayCommand( const std::string & msg )
00888         : M_message( msg )
00889       { }
00890 
00895     Type type() const
00896       {
00897           return SAY;
00898       }
00899 
00905     std::ostream & toStr( std::ostream & to ) const;
00906 
00911     std::string name() const
00912       {
00913           return std::string( "say" );
00914       }
00915 };
00916 
00918 
00930 class TrainerCompressionCommand
00931     : public TrainerCommand {
00932 private:
00933     int M_level; 
00934 
00935 public:
00939     explicit
00940     TrainerCompressionCommand( const int level )
00941         : M_level( level )
00942       { }
00943 
00948     Type type() const
00949       {
00950           return COMPRESSION;
00951       }
00952 
00958     std::ostream & toStr( std::ostream & to ) const;
00959 
00964     std::string name() const
00965       {
00966           return std::string( "compression" );
00967       }
00968 };
00969 
00971 
00980 class TrainerDoneCommand
00981     : public TrainerCommand {
00982 private:
00983 
00984 public:
00988     TrainerDoneCommand()
00989       { }
00990 
00995     Type type() const
00996       {
00997           return DONE;
00998       }
00999 
01005     std::ostream & toStr( std::ostream & to ) const;
01006 
01011     std::string name() const
01012       {
01013           return std::string( "done" );
01014       }
01015 };
01016 
01017 }
01018 
01019 #endif
01020 
01021 /*
01022 
01023 ----------
01024 Offline Coach Initialization Command
01025 See rcssserver/src/netif.C : void Coach::parse_init
01026 
01027 "(init (version VERSION))"
01028 if VERSION is illegal
01029 -> "(error illegal_command_form)"
01030 else
01031 -> "(init ok)"
01032 
01033 receive parameter info
01034 receive changed players info
01035 ----------
01036 
01037 ----------
01038 
01039 ----------
01040 Offline Coach Command List
01041 See rcssserver/src/netif.C : void Coach::parse_command(const char *command)l
01042 
01043 
01044 if use irregal character for command string
01045 -> "(error illegal_command_form)"
01046 else if irregal command
01047 -> "(error unknown_command)"
01048 
01049 ----------
01050 "(start)" : start game (change playmode before_kickoff to kick_off_?)
01051 -> return "(ok start)"
01052 ----------
01053 "(change_mode NEW_PLAYMODE)" : change playmode
01054 if NEW_PLAYMODE string is NULL
01055 -> "(error illegal_command_form)"
01056 else NEW_PLAYMODE is not valid
01057 -> "(error illegal_mode)"
01058 else
01059 -> "(ok change_mode)"
01060 ----------
01061 "(move OBJ_NAME X Y ANG VX VY)" : move pos, set ang, vel
01062 "(move OBJ_NAME X Y ANG)" : move pos, set ang
01063 "(move OBJ_NAME X Y)" : move pos
01064 if (X,Y,ANG,VX,VY is not a number)
01065 -> "(error illegal_command_form)"
01066 else if (arg != 2 || arg != 3 || arg != 5)
01067 -> "(error illegal_command_form)"
01068 else
01069 -> "(ok move)"
01070 ----------
01071 "(look)" : get all movable objects' positional information
01072 -> "(ok look TIME GOAL_INFO BALL_INFO PLAYER_INFO ...)"
01073 ----------
01074 "(team_names)" : get team name
01075 -> "(ok team_names (team l TEAM_NAME) (team r TEAM_NAME))"
01076 ----------
01077 "(recover)" : recover all player's stamina, effort and recover
01078 -> "(ok recover)"
01079 ----------
01080 "(check_ball)" : check ball positional state
01081 -> (ok check_ball BALL_POS_INFO)
01082 BALL_POS_INFO :- "in_field" | "goal_l" | "goal_r" | "out_of_field"
01083 ----------
01084 "(say MESSAGE)"
01085 if MESSAGE is NULL string
01086 -> "(error illegal_command_form)"
01087 else
01088 -> "(ok say)"
01089 MESSAGE is [-0-9a-zA-Z ()./+*?<>_]
01090 ----------
01091 "(ear ONOFF)" : turn on/off to get audio info
01092 if ONOFF is NULL
01093 -> "(error illegal_command_form)"
01094 else if ONOFF_MODE == "on"
01095 -> "(ok ear on)"
01096 else if ONOFF_MODE == "off"
01097 -> "(ok ear off)"
01098 else
01099 -> "(error illegal_command_form)"
01100 ----------
01101 "(eye ONOFF)" : turn on/off to get visual info
01102 if ONOFF is NULL
01103 -> "(error illegal_command_form)"
01104 else if ONOFF_MODE == "on"
01105 -> "(ok eye on)"
01106 else if ONOFF_MODE == "off"
01107 -> "(ok eye off)"
01108 else
01109 -> "(error illegal_command_form)"
01110 ----------
01111 "(change_player_type TEAM_NAME UNUM PLAYER_TYPE_ID)" : change hetero player type
01112 if TEAM_NAME is not match
01113 -> "(warning no_team_found)"
01114 else if PLAYER_TYPE_ID is out of range (ID<0 or PlayerTypes<ID)
01115 -> "(error out_of_range_player_type)"
01116 else if UNUM is not match
01117 -> "(warning no_such_player)"
01118 else
01119 -> "(ok change_player_type TEAM_NAME UNUM PLAYER_TYPE_ID)"
01120 ----------
01121 "(done)" : thinking end nortification for sync mode
01122 ----------
01123 "(compression LEVEL)" : set zlib compression level
01124 if LEVEL is NULL string
01125 -> "(error illegal_command_form)"
01126 else if not HAVE_LIBZ
01127 -> "(warning compression_unsupported)"
01128 else if (LEVEL < 0 || 9 < LEVEL)
01129 -> "(error illegal_command_form)"
01130 else
01131 -> "(ok compression LEVEL)"
01132 ----------
01133 */
01134 
01135 // void Coach::parse_command(const char *command)
01136 // //             unsigned long host, int port)
01137 // {
01138 //   // client.host = host;
01139 //   // client.port = port;
01140 //   char com[MaxStringSize];
01141 //   int n;
01142 //
01143 //   n = sscanf(command, "(%[-0-9a-zA-Z.+*/?<>_]",com);
01144 //   if (n < 1)
01145 //   {
01146 //     send("(error illegal_command_form)");
01147 //     return;
01148 //   }
01149 //
01150 //   if (!strcmp(com, "start"))
01151 //   {
01152 //     _Start ( *stadium );
01153 //     send("(ok start)");
01154 //   }
01155 //   else if (!strcmp(com,"change_mode"))
01156 //   {
01157 //     char new_mode[MaxStringSize];
01158 //     PlayMode mode_id;
01159 //     n = sscanf(command,"(change_mode %[-0-9a-zA-Z.+*/?<>_])", new_mode);
01160 //     if (n < 1)
01161 //     {
01162 //       send("(error illegal_command_form)");
01163 //       return;
01164 //     }
01165 //     mode_id = PlayModeID(new_mode);
01166 //
01167 //     if (mode_id == PM_Null)
01168 //     {
01169 //       send("(error illegal_mode)");
01170 //       return;
01171 //     }
01172 //     stadium->change_play_mode(mode_id);
01173 //     send("(ok change_mode)");
01174 //   }
01175 //   else if (!strcmp(com, "move"))
01176 //   {
01177 //     char obj[MaxStringSize];
01178 //     double x = 0.0, y = 0.0, ang = 0.0, velx = 0.0, vely = 0.0;
01179 //
01180 //     command++;
01181 //     while(*command != '(') {
01182 //       if (*command == NULLCHAR)
01183 //       {
01184 //         send("(error illegal_object_form)");
01185 //         return;
01186 //       }
01187 //       command++;
01188 //     }
01189 //     int i = 0;
01190 //     while (*command != ')') {
01191 //       if (*command == NULLCHAR)
01192 //       {
01193 //         send("(error illegal_object_form)");
01194 //         return;
01195 //       }
01196 //       *(obj+i) = *command;
01197 //       i++;
01198 //       command++;
01199 //     }
01200 //     *(obj+i) = *command;
01201 //     i++;
01202 //     command++;
01203 //     *(obj+i) = NULLCHAR;
01204 //
01205 //     if (!strcmp(obj, BALL_NAME))
01206 //     {
01207 //       stadium->M_caught_ball = NULL;
01208 //     }
01209 //
01210 //     n = sscanf(command," %lf %lf %lf %lf %lf)",&x,&y,&ang,&velx,&vely);
01211 //     if (isnan ( x ) != 0 ||
01212 //         isnan ( y ) != 0 ||
01213 //         isnan ( ang ) != 0 ||
01214 //         isnan ( velx ) != 0 ||
01215 //         isnan ( vely ) != 0)
01216 //     {
01217 //       send("(error illegal_command_form)");
01218 //       return;
01219 //     }
01220 //     if (n == 2)
01221 //     {
01222 //       if (!strcmp(obj, BALL_NAME))
01223 //       {
01224 //         stadium->set_ball(PVector(x,y), LEFT);
01225 //       }
01226 //       else
01227 //       {
01228 //         stadium->move_object(obj,PVector(x,y));
01229 //       }
01230 //       //stadium->check_collision(obj);
01231 //       stadium->collisions();
01232 //     }
01233 //     else if (n == 3)
01234 //     {
01235 //       if (!strcmp(obj, BALL_NAME))
01236 //       {
01237 //         stadium->set_ball(PVector(x,y), LEFT, ang);
01238 //       }
01239 //       else
01240 //       {
01241 //         stadium->move_object(obj,PVector(x,y),
01242 //                              Deg2Rad(max(min((ang), ServerParam::instance().maxm),
01243 //                                          ServerParam::instance().minm)));
01244 //       }
01245 //       //stadium->check_collision(obj);
01246 //       stadium->collisions();
01247 //     }
01248 //     else if (n == 5)
01249 //     {
01250 //       if (!strcmp(obj, BALL_NAME))
01251 //       {
01252 //         stadium->set_ball(PVector(x,y), LEFT, ang,
01253 //                           PVector(velx, vely));
01254 //       }
01255 //       else
01256 //       {
01257 //         stadium->move_object(obj,PVector(x,y),
01258 //                              Deg2Rad(max(min((ang),
01259 //                                              ServerParam::instance().maxm),
01260 //                                          ServerParam::instance().minm)),
01261 //                              PVector(velx, vely));
01262 //       }
01263 //       //stadium->check_collision(obj);
01264 //       stadium->collisions();
01265 //     }
01266 //     else
01267 //     {
01268 //       send("(error illegal_command_form)");
01269 //       return;
01270 //     }
01271 //     send("(ok move)");
01272 //   }
01273 //   else if (!strcmp(com,"look"))
01274 //   {
01275 //     look(*stadium);
01276 //   }
01277 //   else if (!strcmp(com,"team_names"))
01278 //   {
01279 //     team_names(*stadium);
01280 //   }
01281 //   else if (!strcmp(com,"recover"))
01282 //   {
01283 //     recover(*stadium);
01284 //   }
01285 //   else if (!strcmp(com,"check_ball"))
01286 //   {
01287 //     check_ball (*stadium);
01288 //   }
01289 //   else if(!strcmp(com, "say"))
01290 //   {
01291 //     static char msg[MaxStringSize];
01292 //     n = sscanf(command, SAY_MESSAGE_SCAN_FORMAT, com, msg);
01293 //     if (n < 2)
01294 //     {
01295 //       send("(error illegal_command_form)");
01296 //       return;
01297 //     }
01298 //     chop_last_parenthesis(msg, ServerParam::instance().sayMsgSize());
01299 //     stadium->say(msg, false);
01300 //     send("(ok say)");
01301 //   }
01302 //   else if (!strcmp(com,"ear"))
01303 //   {
01304 //     char mode[16];
01305 //     n = sscanf(command,"(%s %s)", com, mode);
01306 //     if (n < 2)
01307 //     {
01308 //       send("(error illegal_command_form)");
01309 //       return;
01310 //     }
01311 //     if (!strcmp(mode,"on)"))
01312 //     {
01313 //       hear = TRUE;
01314 //       send("(ok ear on)");
01315 //     }
01316 //     else if (!strcmp(mode, "off)"))
01317 //     {
01318 //       hear = FALSE;
01319 //       send("(ok ear off)");
01320 //     }
01321 //     else
01322 //     {
01323 //       send("(error illegal_command_form)");
01324 //       return;
01325 //     }
01326 //   }
01327 //   else if (!strcmp(com,"eye"))
01328 //   {
01329 //     char mode[16];
01330 //     n = sscanf(command,"(%s %s)", com, mode);
01331 //     if (n < 2)
01332 //     {
01333 //       send("(error illegal_command_form)");
01334 //       return;
01335 //     }
01336 //     if (!strcmp(mode,"on)"))
01337 //     {
01338 //       eye = TRUE;
01339 //       send("(ok eye on)");
01340 //     }
01341 //     else if (!strcmp(mode, "off)"))
01342 //     {
01343 //       eye = FALSE;
01344 //       send("(ok eye off)");
01345 //     }
01346 //     else
01347 //     {
01348 //       send("(error illegal_command_form)");
01349 //       return;
01350 //     }
01351 //   }
01352 //   else if (!strcmp(com, "change_player_type"))
01353 //   {
01354 //     char name[128];
01355 //     int unum, player_type;
01356 //     if (sscanf(command, "(%s %s %d %d)",
01357 //                com, name, &unum, &player_type ) < 4)
01358 //     {
01359 //       send("(error illegal_command_form)");
01360 //       return;
01361 //     }
01362 //     Team* team = NULL;
01363 //     if (stadium->team_l != NULL && stadium->team_l->name != NULL &&
01364 //         !strcmp(name, stadium->team_l->name))
01365 //     {
01366 //       team = stadium->team_l;
01367 //     }
01368 //     if (stadium->team_r != NULL && stadium->team_r->name != NULL &&
01369 //         !strcmp(name, stadium->team_r->name))
01370 //     {
01371 //       team = stadium->team_r;
01372 //     }
01373 //     if (team == NULL)
01374 //     {
01375 //       send("(warning no_team_found)");
01376 //       return;
01377 //     }
01378 //     if (player_type < 0 ||
01379 //         player_type >= PlayerParam::instance().playerTypes())
01380 //     {
01381 //       send("(error out_of_range_player_type)");
01382 //       return;
01383 //     }
01384 //     Player* player = NULL;
01385 //     for (int i = 0; i < team->n; i++) {
01386 //       if (team->player[i] != NULL &&
01387 //           team->player[i]->unum == unum)
01388 //       {
01389 //         player = team->player[i];
01390 //         break;
01391 //       }
01392 //     }
01393 //     if (player == NULL)
01394 //     {
01395 //       send("(warning no_such_player)");
01396 //       return;
01397 //     }
01398 //     player->substitute(player_type);
01399 //     if (team == stadium->team_l)
01400 //     {
01401 //       stadium->broadcastSubstitution(LEFT, unum, player_type, true);
01402 //     }
01403 //     else
01404 //     {
01405 //       stadium->broadcastSubstitution(RIGHT, unum, player_type, true);
01406 //     }
01407 //
01408 //     char buf[64];
01409 //     sprintf(buf, "(ok change_player_type %s %d %d)", name, unum, player_type);
01410 //     send(buf);
01411 //     return;
01412 //   }
01413 //   //pfr:SYNCH
01414 //   else if (!strcmp(com, "done"))
01415 //   {
01416 //     //cerr << "Recv trainer done" << endl;
01417 //     done_received = TRUE;
01418 //     return;
01419 //   }
01420 //   else if (!strcmp(com, "compression"))
01421 //   {
01422 //     int level;
01423 //     if ((n = sscanf(command,"(%s %d)",com,&level)) < 2)
01424 //     {
01425 //       send("(error illegal_command_form)");
01426 //       return;
01427 //     }
01428 // #ifdef HAVE_LIBZ
01429 //     if ( level < 0 || level > 9 )
01430 //     {
01431 //       send("(error illegal_command_form)");
01432 //       return;
01433 //     }
01434 //     ostrstream reply;
01435 //     reply << "(ok compression " << level << ")" << ends;
01436 //     send(reply.str());
01437 //     reply.freeze (false);
01438 //     setCompressionLevel (level);
01439 // #else
01440 //     send("(warning compression_unsupported)");
01441 // #endif
01442 //     return;
01443 //   }
01444 //   else
01445 //   {
01446 //     send("(error unknown_command)");
01447 //     return;
01448 //   }
01449 // }

librcscに対してThu May 1 15:41:22 2008に生成されました。  doxygen 1.5.0