serverparam.cpp
来自「2009 ROBOCUP 仿真2DSERVER 源码」· C++ 代码 · 共 1,306 行 · 第 1/4 页
CPP
1,306 行
#ifdef NEW_QSTEP dir_qstep = DIR_QSTEP; dist_qstep_l = DIST_QSTEP; dist_qstep_r = DIST_QSTEP; land_qstep_l = LAND_QSTEP; land_qstep_r = LAND_QSTEP; dir_qstep_l = DIR_QSTEP; dir_qstep_r = DIR_QSTEP; defined_qstep_l = false; defined_qstep_r = false; defined_qstep_l_l = false; defined_qstep_l_r = false; defined_qstep_dir_l = false; defined_qstep_dir_r = false;#endif M_verbose = false; M_coach_mode = false; M_coach_with_referee_mode = false; M_old_coach_hear = false; M_synch_mode = false; M_synch_offset = 60; M_synch_micro_sleep = 1; M_start_goal_l = 0; M_start_goal_r = 0; M_fullstate_l = false; M_fullstate_r = false; M_slowness_on_top_for_left_team = 1.0; M_slowness_on_top_for_right_team = 1.0; M_landmark_file = LANDMARK_FILE; M_send_comms = SEND_COMMS; M_text_logging = TEXT_LOGGING; M_game_logging = GAME_LOGGING; M_game_log_version = GAME_LOG_VERSION; M_text_log_dir = TEXT_LOG_DIR; M_game_log_dir = GAME_LOG_DIR; M_text_log_fixed_name = TEXT_LOG_FIXED_NAME; M_game_log_fixed_name = GAME_LOG_FIXED_NAME; M_text_log_fixed = TEXT_LOG_FIXED; M_game_log_fixed = GAME_LOG_FIXED; M_text_log_dated = TEXT_LOG_DATED; M_game_log_dated = GAME_LOG_DATED; M_log_date_format = LOG_DATE_FORMAT; M_log_times = LOG_TIMES; M_record_messages = RECORD_MESSAGES; M_text_log_compression = TEXT_LOG_COMPRESSION; M_game_log_compression = GAME_LOG_COMPRESSION; M_profile = PROFILE; M_keepaway_logging = KAWAY_LOGGING; M_keepaway_log_dir = KAWAY_LOG_DIR; M_keepaway_log_fixed_name = KAWAY_LOG_FIXED_NAME; M_keepaway_log_fixed = KAWAY_LOG_FIXED; M_keepaway_log_dated = KAWAY_LOG_DATED; M_keepaway_start = KAWAY_START; M_point_to_ban = POINT_TO_BAN; M_point_to_duration = POINT_TO_DURATION; M_say_msg_size = SAY_MSG_SIZE; M_hear_max = HEAR_MAX; M_hear_inc = HEAR_INC; M_hear_decay = HEAR_DECAY; M_tackle_dist = TACKLE_DIST; M_tackle_back_dist = TACKLE_BACK_DIST; M_tackle_width = TACKLE_WIDTH; M_tackle_exponent = TACKLE_EXPONENT; M_tackle_cycles = TACKLE_CYCLES; M_tackle_power_rate = TACKLE_POWER_RATE; M_freeform_wait_period = FREEFORM_WAIT_PERIOD; M_freeform_send_period = FREEFORM_SEND_PERIOD; M_free_kick_faults = FREE_KICK_FAULTS; M_back_passes = BACK_PASSES; M_proper_goal_kicks = PROPER_GOAL_KICKS; M_stopped_ball_vel = STOPPED_BALL_VEL; M_max_goal_kicks = MAX_GOAL_KICKS; M_clang_del_win = CLANG_DEL_WIN; M_clang_rule_win = CLANG_RULE_WIN; M_auto_mode = S_AUTO_MODE; M_kick_off_wait = S_KICK_OFF_WAIT; M_connect_wait = S_CONNECT_WAIT; M_game_over_wait = S_GAME_OVER_WAIT; M_team_l_start = S_TEAM_L_START; M_team_r_start = S_TEAM_R_START; // 11.0.0 M_ball_stuck_area = BALL_STUCK_AREA; M_coach_msg_file = ""; // 12.0.0 M_max_tackle_power = MAX_TACKLE_POWER; M_max_back_tackle_power = MAX_BACK_TACKLE_POWER; M_player_speed_max_min = PLAYER_SPEED_MAX_MIN; M_extra_stamina = EXTRA_STAMINA; M_synch_see_offset = SYNCH_SEE_OFFSET; M_max_monitors = -1; // 13.0.0 M_stamina_capacity = STAMINA_CAPACITY; M_max_dash_angle = MAX_DASH_ANGLE; M_min_dash_angle = MIN_DASH_ANGLE; M_dash_angle_step = DASH_ANGLE_STEP; M_side_dash_rate = SIDE_DASH_RATE; M_back_dash_rate = BACK_DASH_RATE; M_max_dash_power = MAX_DASH_POWER; M_min_dash_power = MIN_DASH_POWER; // test M_reliable_catch_area_l = GOALIE_CATCHABLE_AREA_LENGTH; M_min_catch_probability = 1.0; setHalfTime( HALF_TIME ); setExtraHalfTime( EXTRA_HALF_TIME ); setSlowDownFactor(); M_kickable_area = M_player_size + M_kickable_margin + M_ball_size; M_control_radius_width = M_control_radius - M_player_size;// std::string module_dir = S_MODULE_DIR;// for ( std::string::size_type pos = module_dir.find( "//" );// pos != std::string::npos;// pos = module_dir.find( "//" ) )// {// module_dir.replace( pos, 2, "/" );// }// rcss::lib::Loader::setPath( module_dir );}server_params_tServerParam::convertToStruct() const{ server_params_t tmp; tmp.gwidth = htonl( static_cast< Int32 >( SHOWINFO_SCALE2 * M_goal_width ) ); tmp.inertia_moment = htonl( static_cast< Int32 >( SHOWINFO_SCALE2 * M_inertia_moment ) ); tmp.psize = htonl( static_cast< Int32 >( SHOWINFO_SCALE2 * M_player_size ) ); tmp.pdecay = htonl( static_cast< Int32 >( SHOWINFO_SCALE2 * M_player_decay ) ); tmp.prand = htonl( static_cast< Int32 >( SHOWINFO_SCALE2 * M_player_rand ) ); tmp.pweight = htonl( static_cast< Int32 >( SHOWINFO_SCALE2 * M_player_weight ) ); tmp.pspeed_max = htonl( static_cast< Int32 >( SHOWINFO_SCALE2 * M_player_speed_max ) ); tmp.paccel_max = htonl( static_cast< Int32 >( SHOWINFO_SCALE2 * M_player_accel_max ) ); tmp.stamina_max = htonl( static_cast< Int32 >( SHOWINFO_SCALE2 * M_stamina_max ) ); tmp.stamina_inc = htonl( static_cast< Int32 >( SHOWINFO_SCALE2 * M_stamina_inc ) ); tmp.recover_init = htonl( static_cast< Int32 >( SHOWINFO_SCALE2 * M_recover_init ) ); tmp.recover_dthr = htonl( static_cast< Int32 >( SHOWINFO_SCALE2 * M_recover_dec_thr ) ); tmp.recover_min = htonl( static_cast< Int32 >( SHOWINFO_SCALE2 * M_recover_min ) ); tmp.recover_dec = htonl( static_cast< Int32 >( SHOWINFO_SCALE2 * M_recover_dec ) ); tmp.effort_init = htonl( static_cast< Int32 >( SHOWINFO_SCALE2 * M_effort_init ) ); tmp.effort_dthr = htonl( static_cast< Int32 >( SHOWINFO_SCALE2 * M_effort_dec_thr ) ); tmp.effort_min = htonl( static_cast< Int32 >( SHOWINFO_SCALE2 * M_effort_min ) ); tmp.effort_dec = htonl( static_cast< Int32 >( SHOWINFO_SCALE2 * M_effort_dec ) ); tmp.effort_ithr = htonl( static_cast< Int32 >( SHOWINFO_SCALE2 * M_effort_inc_thr ) ); tmp.effort_inc = htonl( static_cast< Int32 >( SHOWINFO_SCALE2 * M_effort_inc ) ); tmp.kick_rand = htonl( static_cast< Int32 >( SHOWINFO_SCALE2 * M_kick_rand ) ); tmp.team_actuator_noise = htons( static_cast< Int16 >( M_team_actuator_noise ) ); tmp.prand_factor_l = htonl( static_cast< Int32 >( SHOWINFO_SCALE2 * M_player_rand_factor_l ) ); tmp.prand_factor_r = htonl( static_cast< Int32 >( SHOWINFO_SCALE2 * M_player_rand_factor_r ) ); tmp.kick_rand_factor_l = htonl( static_cast< Int32 >( SHOWINFO_SCALE2 * M_kick_rand_factor_l ) ); tmp.kick_rand_factor_r = htonl( static_cast< Int32 >( SHOWINFO_SCALE2 * M_kick_rand_factor_r ) ); tmp.bsize = htonl( static_cast< Int32 >( SHOWINFO_SCALE2 * M_ball_size ) ); tmp.bdecay = htonl( static_cast< Int32 >( SHOWINFO_SCALE2 * M_ball_decay ) ); tmp.brand = htonl( static_cast< Int32 >( SHOWINFO_SCALE2 * M_ball_rand ) ); tmp.bweight = htonl( static_cast< Int32 >( SHOWINFO_SCALE2 * M_ball_weight ) ); tmp.bspeed_max = htonl( static_cast< Int32 >( SHOWINFO_SCALE2 * M_ball_speed_max ) ); tmp.baccel_max = htonl( static_cast< Int32 >( SHOWINFO_SCALE2 * M_ball_accel_max ) ); tmp.dprate = htonl( static_cast< Int32 >( SHOWINFO_SCALE2 * M_dash_power_rate ) ); tmp.kprate = htonl( static_cast< Int32 >( SHOWINFO_SCALE2 * M_kick_power_rate ) ); tmp.kmargin = htonl( static_cast< Int32 >( SHOWINFO_SCALE2 * M_kickable_margin ) ); tmp.ctlradius = htonl( static_cast< Int32 >( SHOWINFO_SCALE2 * M_control_radius ) ); tmp.ctlradius_width = htonl( static_cast< Int32 >( SHOWINFO_SCALE2 * M_control_radius_width ) ); tmp.maxp = htonl( static_cast< Int32 >( SHOWINFO_SCALE2 * M_max_power ) ); tmp.minp = htonl( static_cast< Int32 >( SHOWINFO_SCALE2 * M_min_power ) ); tmp.maxm = htonl( static_cast< Int32 >( SHOWINFO_SCALE2 * M_max_moment ) ); tmp.minm = htonl( static_cast< Int32 >( SHOWINFO_SCALE2 * M_min_moment ) ); tmp.maxnm = htonl( static_cast< Int32 >( SHOWINFO_SCALE2 * M_max_neck_moment ) ); tmp.minnm = htonl( static_cast< Int32 >( SHOWINFO_SCALE2 * M_min_neck_moment ) ); tmp.maxn = htonl( static_cast< Int32 >( SHOWINFO_SCALE2 * M_max_neck_angle ) ); tmp.minn = htonl( static_cast< Int32 >( SHOWINFO_SCALE2 * M_min_neck_angle ) ); tmp.visangle = htonl( static_cast< Int32 >( SHOWINFO_SCALE2 * M_visible_angle ) ); tmp.visdist = htonl( static_cast< Int32 >( SHOWINFO_SCALE2 * M_visible_distance ) ); tmp.windir = htonl( static_cast< Int32 >( SHOWINFO_SCALE2 * M_wind_dir ) ); tmp.winforce = htonl( static_cast< Int32 >( SHOWINFO_SCALE2 * M_wind_force ) ); tmp.winang = htonl( static_cast< Int32 >( SHOWINFO_SCALE2 * M_wind_angle ) ); tmp.winrand = htonl( static_cast< Int32 >( SHOWINFO_SCALE2 * M_wind_rand ) ); tmp.kickable_area = htonl( static_cast< Int32 >( SHOWINFO_SCALE2 * M_kickable_area ) ); tmp.catch_area_l = htonl( static_cast< Int32 >( SHOWINFO_SCALE2 * M_catchable_area_l ) ); tmp.catch_area_w = htonl( static_cast< Int32 >( SHOWINFO_SCALE2 * M_catchable_area_w ) ); tmp.catch_prob = htonl( static_cast< Int32 >( SHOWINFO_SCALE2 * M_catch_probability ) ); tmp.goalie_max_moves = htons( static_cast< Int16 >( M_goalie_max_moves ) ); tmp.ckmargin = htonl( static_cast< Int32 >( SHOWINFO_SCALE2 * M_corner_kick_margin ) ); tmp.offside_area = htonl( static_cast< Int32 >( SHOWINFO_SCALE2 * M_offside_active_area_size ) ); tmp.win_no = htons( static_cast< Int16 >( M_wind_none ) ); tmp.win_random = htons( static_cast< Int16 >( M_wind_random ) ); tmp.say_cnt_max = htons( static_cast< Int16 >( M_say_cnt_max ) ); tmp.SayCoachMsgSize = htons( static_cast< Int16 >( M_say_coach_msg_size ) ); tmp.clang_win_size = htons( static_cast< Int16 >( M_clang_win_size ) ); tmp.clang_define_win = htons( static_cast< Int16 >( M_clang_define_win ) ); tmp.clang_meta_win = htons( static_cast< Int16 >( M_clang_meta_win ) ); tmp.clang_advice_win = htons( static_cast< Int16 >( M_clang_advice_win ) ); tmp.clang_info_win = htons( static_cast< Int16 >( M_clang_info_win ) ); tmp.clang_mess_delay = htons( static_cast< Int16 >( M_clang_mess_delay ) ); tmp.clang_mess_per_cycle = htons( static_cast< Int16 >( M_clang_mess_per_cycle ) ); tmp.half_time = htons( static_cast< Int16 >( M_raw_half_time ) ); tmp.sim_st = htons( static_cast< Int16 >( M_simulator_step ) ); tmp.send_st = htons( static_cast< Int16 >( M_send_step ) ); tmp.recv_st = htons( static_cast< Int16 >( M_recv_step ) ); tmp.sb_step = htons( static_cast< Int16 >( M_sense_body_step ) ); tmp.lcm_st = htons( static_cast< Int16 >( M_lcm_step ) ); tmp.M_say_msg_size = htons( static_cast< Int16 >( M_say_msg_size ) ); tmp.M_hear_max = htons( static_cast< Int16 >( M_hear_max ) ); tmp.M_hear_inc = htons( static_cast< Int16 >( M_hear_inc ) ); tmp.M_hear_decay = htons( static_cast< Int16 >( M_hear_decay ) ); tmp.cban_cycle = htons( static_cast< Int16 >( M_catch_ban_cycle ) ); tmp.slow_down_factor = htons( static_cast< Int16 >( M_slow_down_factor ) ); tmp.useoffside = htons( static_cast< Int16 >( M_use_offside ) ); tmp.kickoffoffside = htons( static_cast< Int16 >( M_forbid_kick_off_offside ) ); tmp.offside_kick_margin = htonl( static_cast< Int32 >( SHOWINFO_SCALE2 * M_offside_kick_margin ) ); tmp.audio_dist = htonl( static_cast< Int32 >( SHOWINFO_SCALE2 * M_audio_cut_dist ) ); tmp.dist_qstep = htonl( static_cast< Int32 >( SHOWINFO_SCALE2 * M_quantize_step ) ); tmp.land_qstep = htonl( static_cast< Int32 >( SHOWINFO_SCALE2 * M_landmark_quantize_step ) );#ifdef NEW_QSTEP tmp.dir_qstep = htonl( static_cast< Int32 >( SHOWINFO_SCALE2 * dir_qstep ) ); tmp.dist_qstep_l = htonl( static_cast< Int32 >( SHOWINFO_SCALE2 * dist_qstep_l ) ); tmp.dist_qstep_r = htonl( static_cast< Int32 >( SHOWINFO_SCALE2 * dist_qstep_r ) ); tmp.land_qstep_l = htonl( static_cast< Int32 >( SHOWINFO_SCALE2 * land_qstep_l ) ); tmp.land_qstep_r = htonl( static_cast< Int32 >( SHOWINFO_SCALE2 * land_qstep_r ) ); tmp.dir_qstep_l = htonl( static_cast< Int32 >( SHOWINFO_SCALE2 * dir_qstep_l ) ); tmp.dir_qstep_r = htonl( static_cast< Int32 >( SHOWINFO_SCALE2 * dir_qstep_r ) );#else tmp.dir_qstep = htonl( static_cast< Int32 >( SHOWINFO_SCALE2 * -1 ) ); tmp.dist_qstep_l = htonl( static_cast< Int32 >( SHOWINFO_SCALE2 * -1 ) ); tmp.dist_qstep_r = htonl( static_cast< Int32 >( SHOWINFO_SCALE2 * -1 ) ); tmp.land_qstep_l = htonl( static_cast< Int32 >( SHOWINFO_SCALE2 * -1 ) ); tmp.land_qstep_r = htonl( static_cast< Int32 >( SHOWINFO_SCALE2 * -1 ) ); tmp.dir_qstep_l = htonl( static_cast< Int32 >( SHOWINFO_SCALE2 * -1 ) ); tmp.dir_qstep_r = htonl( static_cast< Int32 >( SHOWINFO_SCALE2 * -1 ) );#endif tmp.CoachMode = htons( static_cast< Int16 >( M_coach_mode ) ); tmp.CwRMode = htons( static_cast< Int16 >( M_coach_with_referee_mode ) ); tmp.old_hear = htons( static_cast< Int16 >( M_old_coach_hear ) ); tmp.sv_st = htons( static_cast< Int16 >( M_send_vi_step ) ); tmp.slowness_on_top_for_left_team = htonl( static_cast< Int32 >( SHOWINFO_SCALE2 * M_slowness_on_top_for_left_team ) ); tmp.slowness_on_top_for_right_team = htonl( static_cast< Int32 >( SHOWINFO_SCALE2 * M_slowness_on_top_for_left_team ) ); tmp.ka_length = htonl( static_cast< Int32 >( SHOWINFO_SCALE2 * M_keepaway_length ) ); tmp.ka_width = htonl( static_cast< Int32 >( SHOWINFO_SCALE2 * M_keepaway_width ) ); tmp.ball_stuck_area = htonl( static_cast< Int32 >( SHOWINFO_SCALE2 * M_ball_stuck_area ) ); tmp.max_tackle_power = htonl( static_cast< Int32 >( SHOWINFO_SCALE2 * M_max_tackle_power ) ); tmp.max_back_tackle_power = htonl( static_cast< Int32 >( SHOWINFO_SCALE2 * M_max_back_tackle_power ) ); tmp.tackle_dist = htonl( static_cast< Int32 >( SHOWINFO_SCALE2 * M_tackle_dist ) ); tmp.tackle_back_dist = htonl( static_cast< Int32 >( SHOWINFO_SCALE2 * M_tackle_back_dist ) ); tmp.tackle_width = htonl( static_cast< Int32 >( SHOWINFO_SCALE2 * M_tackle_width ) ); tmp.start_goal_l = htons( static_cast< Int16 >( M_start_goal_l ) ); tmp.start_goal_r = htons( static_cast< Int16 >( M_start_goal_r ) ); tmp.fullstate_l = htons( static_cast< Int16 >( M_fullstate_l ) ); tmp.fullstate_r = htons( static_cast< Int16 >( M_fullstate_r ) ); tmp.drop_time = htons( static_cast< Int16 >( M_drop_ball_time ) ); tmp.synch_mode = htons( static_cast< Int16 >( M_synch_mode ) );//pfr:SYNCH tmp.synch_offset = htons( static_cast< Int16 >( M_synch_offset ) );//pfr:SYNCH tmp.synch_micro_sleep = htons( static_cast< Int16 >( M_synch_micro_sleep ) );//pfr:SYNCH tmp.point_to_ban = htons( static_cast< Int16 >( M_point_to_ban ) ); tmp.point_to_duration = htons( static_cast< Int16 >( M_point_to_duration ) ); return tmp;}boolServerParam::getInt( const std::string & param, int & value ) const{ return M_builder->get( param, value );}boolServerParam::getBool( const std::string & param, bool & value ) const{ return M_builder->get( param, value );}boolServerParam::getDoub( const std::string & param, double & value ) const{ return M_builder->get( param, value );}boolServerParam::getStr( const std::string & param, std::string & value ) const{ return M_builder->get( param, value );}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?