serverparam.cpp
来自「2002年」· C++ 代码 · 共 347 行 · 第 1/2 页
CPP
347 行
#include "serverparam.h"
/***** server params *************/
ServerParam::ServerParam(){};
option_t ServerParam::OptionList[] = {
{"host", (void *)&ServerParam::host, V_STRING},{"port", (void *)&ServerParam::port, V_INT},
{"coach_port", (void *)&ServerParam::coach_port, V_INT},
{"olcoach_port", (void *)&ServerParam::olcoach_port, V_INT},
{"goal_width", (void *)&ServerParam::goal_width, V_FLOAT},
{"player_size", (void *)&ServerParam::player_size, V_FLOAT},
{"player_decay", (void *)&ServerParam::player_decay, V_FLOAT},
{"player_rand", (void *)&ServerParam::player_rand, V_FLOAT},
{"player_weight", (void *)&ServerParam::player_weight, V_FLOAT},
{"player_speed_max", (void *)&ServerParam::player_speed_max, V_FLOAT},
{"stamina_max", (void *)&ServerParam::stamina_max, V_FLOAT},
{"stamina_inc_max", (void *)&ServerParam::stamina_inc, V_FLOAT},
{"recover_dec_thr", (void *)&ServerParam::recover_dec_thr, V_FLOAT},
{"recover_min", (void *)&ServerParam::recover_min, V_FLOAT},
{"recover_dec", (void *)&ServerParam::recover_dec, V_FLOAT},
{"effort_dec_thr", (void *)&ServerParam::effort_dec_thr, V_FLOAT},
{"effort_min", (void *)&ServerParam::effort_min, V_FLOAT},
{"effort_dec", (void *)&ServerParam::effort_dec, V_FLOAT},
{"effort_inc_thr", (void *)&ServerParam::effort_inc_thr, V_FLOAT},
{"effort_inc", (void *)&ServerParam::effort_inc, V_FLOAT},
{"ball_size", (void *)&ServerParam::ball_size, V_FLOAT},
{"ball_decay", (void *)&ServerParam::ball_decay, V_FLOAT},
{"ball_rand", (void *)&ServerParam::ball_rand, V_FLOAT},
{"ball_weight", (void *)&ServerParam::ball_weight, V_FLOAT},
{"ball_speed_max", (void *)&ServerParam::ball_speed_max, V_FLOAT},
{"baccel_max", (void *)&ServerParam::baccel_max, V_FLOAT},
{"dash_power_rate", (void *)&ServerParam::dash_power_rate, V_FLOAT},
{"kick_power_rate", (void *)&ServerParam::kick_power_rate, V_FLOAT},
{"kickable_margin", (void *)&ServerParam::kickable_margin, V_FLOAT},
{"catch_probability", (void *)&ServerParam::catch_prob, V_FLOAT},
{"catchable_area_l", (void *)&ServerParam::catch_area_l, V_FLOAT},
{"catchable_area_w", (void *)&ServerParam::catch_area_w, V_FLOAT},
{"maxpower", (void *)&ServerParam::max_power, V_FLOAT},
{"minpower", (void *)&ServerParam::min_power, V_FLOAT},
{"maxmoment", (void *)&ServerParam::max_moment, V_FLOAT},
{"minmoment", (void *)&ServerParam::min_moment, V_FLOAT},
{"maxneckang", (void *)&ServerParam::max_neck_angle, V_FLOAT},
{"minneckang", (void *)&ServerParam::min_neck_angle, V_FLOAT},
{"maxneckmoment", (void *)&ServerParam::max_neck_moment,V_FLOAT},
{"minneckmoment", (void *)&ServerParam::min_neck_moment,V_FLOAT},
{"visible_angle", (void *)&ServerParam::visible_angle, V_FLOAT},
{"audio_cut_dist", (void *)&ServerParam::audio_cut_dist, V_FLOAT},
{"quantize_step", (void *)&ServerParam::dist_qstep, V_FLOAT},
{"quantize_step_l", (void *)&ServerParam::land_qstep, V_FLOAT},
{"ckick_margin", (void *)&ServerParam::ckmargin, V_FLOAT},
{"wind_dir", (void *)&ServerParam::wind_dir, V_FLOAT},
{"wind_force", (void *)&ServerParam::wind_force, V_FLOAT},
{"wind_rand", (void *)&ServerParam::wind_rand, V_FLOAT},
{"wind_none", (void *)&ServerParam::wind_none, V_ONOFF},
{"wind_random", (void *)&ServerParam::wind_random, V_ONOFF},
{"half_time", (void *)&ServerParam::half_time, V_INT},
{"simulator_step", (void *)&ServerParam::simulator_step, V_INT},
{"send_step", (void *)&ServerParam::send_step, V_INT},
{"recv_step", (void *)&ServerParam::recv_step, V_INT},
{"say_msg_size", (void *)&ServerParam::say_msg_size, V_INT},
{"hear_max", (void *)&ServerParam::hear_max, V_INT},
{"hear_inc", (void *)&ServerParam::hear_inc, V_INT},
{"hear_decay", (void *)&ServerParam::hear_decay, V_INT},
{"catch_ban_cycle", (void *)&ServerParam::catch_ban_cycle,V_INT},
{"coach", (void *)&ServerParam::coach_mode, V_ONOFF},
{"coach_w_referee", (void *)&ServerParam::coach_w_referee_mode,V_ONOFF},
{"say_coach_cnt_max", (void *)&ServerParam::say_coach_cnt_max, V_INT},
{"say_coach_msg_size", (void *)&ServerParam::say_coach_msg_size, V_INT},
{"send_vi_step", (void *)&ServerParam::send_vi_step, V_INT},
{"look_step", (void *)&ServerParam::look_step, V_INT},
{"use_offside", (void *)&ServerParam::use_offside, V_ONOFF},
{"forbid_kick_off_offside",(void *)&ServerParam::forbid_kickoff_offside, V_ONOFF},
{"record_log", (void *)&ServerParam::rec_log, V_ONOFF},
{"record_version", (void *)&ServerParam::rec_ver, V_INT},
{"send_log", (void *)&ServerParam::send_log, V_ONOFF},
{"verbose", (void *)&ServerParam::verbose, V_ONOFF},
{"offside_active_area_size", (void *)&ServerParam::offside_area, V_FLOAT},
{"inertia_moment", (void *)&ServerParam::inertia_moment, V_FLOAT},
{"sense_body_step", (void *)&ServerParam::sense_body_step, V_INT},
{"offside_kick_margin", (void *)&ServerParam::offside_kick_margin,V_FLOAT},
{"record_messages", (void *)&ServerParam::record_messages,V_ONOFF},
{"clang_win_size", (void *)&ServerParam::clang_win_size, V_INT},
{"clang_define_win", (void *)&ServerParam::clang_define_win, V_INT},
{"clang_meta_win", (void *)&ServerParam::clang_meta_win, V_INT},
{"clang_advice_win", (void *)&ServerParam::clang_advice_win, V_INT},
{"clang_info_win", (void *)&ServerParam::clang_info_win, V_INT},
{"clang_mess_delay", (void *)&ServerParam::clang_mess_delay, V_INT},
{"clang_mess_per_cycle",(void *)&ServerParam::clang_mess_per_cycle,V_INT},
{"player_types", (void *)&ServerParam::player_types, V_INT},
{"subs_max", (void *)&ServerParam::subs_max, V_INT},
{"player_speed_max_delta_min", (void *)&ServerParam::player_speed_max_delta_min, V_FLOAT},
{"player_speed_max_delta_max", (void *)&ServerParam::player_speed_max_delta_max, V_FLOAT},
{"stamina_inc_max_delta_factor",(void *)&ServerParam::stamina_inc_max_delta_factor,V_FLOAT},
{"player_decay_delta_min", (void *)&ServerParam::player_decay_delta_min, V_FLOAT},
{"player_decay_delta_max", (void *)&ServerParam::player_decay_delta_max, V_FLOAT},
{"inertia_moment_delta_factor", (void *)&ServerParam::inertia_moment_delta_factor, V_FLOAT},
{"dash_power_rate_delta_min", (void *)&ServerParam::dash_power_rate_delta_min, V_FLOAT},
{"dash_power_rate_delta_max", (void *)&ServerParam::dash_power_rate_delta_max, V_FLOAT},
{"player_size_delta_factor", (void *)&ServerParam::player_size_delta_factor, V_FLOAT},
{"kickable_margin_delta_min", (void *)&ServerParam::kickable_margin_delta_min, V_FLOAT},
{"kickable_margin_delta_max", (void *)&ServerParam::kickable_margin_delta_max, V_FLOAT},
{"kick_rand_delta_factor", (void *)&ServerParam::kick_rand_delta_factor, V_FLOAT},
{"extra_stamina_delta_min", (void *)&ServerParam::extra_stamina_delta_min, V_FLOAT},
{"extra_stamina_delta_max", (void *)&ServerParam::extra_stamina_delta_max, V_FLOAT},
{"effort_max_delta_factor", (void *)&ServerParam::effort_max_delta_factor, V_FLOAT},
{"effort_min_delta_factor", (void *)&ServerParam::effort_min_delta_factor, V_FLOAT},
{"drop_ball_time", (void *)&ServerParam::drop_ball_time, V_INT},
{"goalie_max_moves", (void *)&ServerParam::goalie_max_moves, V_INT},
{"start_goal_l", (void *)&ServerParam::start_goal_l, V_INT},
{"start_goal_r", (void *)&ServerParam::start_goal_r, V_INT},
{"fullstate_l", (void *)&ServerParam::fullstate_l, V_ONOFF},
{"fullstate_r", (void *)&ServerParam::fullstate_r, V_ONOFF},
////////////////////////V8
{"slowness_on_top_for_left_team", (void *)&ServerParam::slowness_on_top_for_left_team, V_FLOAT},
{"slowness_on_top_for_right_team", (void *)&ServerParam::slowness_on_top_for_right_team,V_FLOAT },
{"portnum", (void *)&ServerParam::portnum,V_INT },
{"coach_pnum", (void *)&ServerParam::coach_pnum,V_INT },
{"olcoach_pnum", (void *)&ServerParam::olcoach_pnum,V_INT },
{"verbose", (void *)&ServerParam::verbose,V_BOOL },
{"replay", (void *)&ServerParam::replay,V_STRING },
{"synch_mode", (void *)&ServerParam::synch_mode,V_BOOL },
{"synch_offset", (void *)&ServerParam::synch_offset,V_INT },
{"synch_micro_sleep", (void *)&ServerParam::synch_micro_sleep, V_INT},
{"send_comms", (void *)&ServerParam::send_comms,V_BOOL },
{"text_logging", (void *)&ServerParam::text_logging,V_BOOL },
{"game_logging", (void *)&ServerParam::game_logging,V_BOOL},
{"game_log_version", (void *)&ServerParam::game_log_version,V_INT },
{"text_log_dir", (void *)&ServerParam::text_log_dir,V_STRING },
{"game_log_dir", (void *)&ServerParam::game_log_dir,V_STRING },
{"text_log_fixed_name", (void *)&ServerParam::text_log_fixed_name,V_STRING },
{"game_log_fixed_name", (void *)&ServerParam::game_log_fixed_name,V_STRING },
{"text_log_fixed", (void *)&ServerParam::text_log_fixed,V_BOOL },
{"game_log_fixed", (void *)&ServerParam::game_log_fixed,V_BOOL },
{"text_log_dated", (void *)&ServerParam::text_log_dated,V_BOOL },
{"game_log_dated", (void *)&ServerParam::game_log_dated,V_BOOL },
{"log_date_format", (void *)&ServerParam::log_date_format,V_STRING },
{"log_times", (void *)&ServerParam::log_times, V_BOOL},
{"record_messages", (void *)&ServerParam::record_messages,V_BOOL },
{"text_log_compression", (void *)&ServerParam::text_log_compression, V_INT},
{"game_log_compression", (void *)&ServerParam::game_log_compression, V_INT},
{"profile", (void *)&ServerParam::profile,V_INT },
{"point_to_ban", (void *)&ServerParam::point_to_ban,V_INT },
{"point_to_duration", (void *)&ServerParam::point_to_duration, V_INT},
{"slow_down_factor", (void *)&ServerParam::slow_down_factor, V_INT},
{"\0", NULL, V_NONE}
} ;
#define STRING_LENGTH 1024
float ServerParam::pitch_length = 105.0f;
float ServerParam::pitch_width = 68.0f;
float ServerParam::pitch_diameter = 125.1f;
float ServerParam::semi_pitch_length = ServerParam::pitch_length / 2.0f;
float ServerParam::semi_pitch_width = ServerParam::pitch_width / 2.0f;
float ServerParam::pitch_margin = 5.0f;
float ServerParam::penalty_area_length = 16.5f;
float ServerParam::penalty_area_width = 40.32f;
float ServerParam::goal_area_length = 5.5f;
float ServerParam::goal_area_width = 18.32f;
float ServerParam::penalty_spot_dist = 11.0f;
float ServerParam::corner_arc_r = 1.0f;
float ServerParam::free_kick_buffer = 9.15f;
float ServerParam::feel_distance = 3.0f;
float ServerParam::unum_far_length = 20.0f;
float ServerParam::unum_too_far_length = 40.0f;
float ServerParam::team_far_length = 40.0f;
float ServerParam::team_too_far_length = 60.0f;
float ServerParam::version = 8.05f;
int ServerParam::half = 1;
float ServerParam::goal_width = 14.02f;
float ServerParam::player_size = 0.3f;
float ServerParam::player_decay = 0.4f;
float ServerParam::player_rand = 0.1f;
float ServerParam::player_weight = 60.0f;
float ServerParam::player_speed_max = 1.0f;
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?