⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 px_ls_init.c

📁 MMORPG游戏服务器端架构及函数
💻 C
📖 第 1 页 / 共 5 页
字号:
void init_read_frame_fce(){
	char					filename[FILENAME_MAX];
	char					cache[FILENAME_MAX];
	char				*	pstr;
	FRAME_FCE_BASE		*	pf;
	int						nlines;
	int						nconfig;
	int						i;
	filename[0] = '\0';
	strcpy(filename,base_path);
	strcat(filename,"\\configuration\\frame_fce.txt");
	nlines = GetnLinesOfFile(filename);
	init_read_specify_file(filename,nlines);
	nconfig = init_get_valid_num_config(nlines);
	if (nconfig <= 0) {
		return;
	}
	g_stat->num_speed_frame_base_fce = nconfig;
	frame_fce_base_head = (LPFRAME_FCE_BASE)ms_malloc(nconfig*sizeof(FRAME_FCE_BASE));
	memset(frame_fce_base_head,0,nconfig*sizeof(FRAME_FCE_BASE));
	pf = frame_fce_base_head;
	for(i = 0;i < nlines;i++){
		pstr = pcfg_buf[i];
		if (pstr[0] == '\0') {
			continue;
		}
		PopLeftString(pstr,cache);
		pf->frame = atoi(cache);
		PopLeftString(pstr,cache);
		pf->class_human_req = atoi(cache);
		PopLeftString(pstr,cache);
		pf->class_hun_req = atoi(cache);
		PopLeftString(pstr,cache);
		pf->class_sorcer_req = atoi(cache);
		PopLeftString(pstr,cache);
		pf->class_genius_req = atoi(cache);
		PopLeftString(pstr,cache);
		pf->class_bowman_req = atoi(cache);
		PopLeftString(pstr,cache);
		pf->class_taoist_req = atoi(cache);
		PopLeftString(pstr,cache);
		pf->class_nodead_req = atoi(cache);
		PopLeftString(pstr,cache);
		pf->class_craftsman_req = atoi(cache);
		PopLeftString(pstr,cache);
		pf->class_knight_req = atoi(cache);
		PopLeftString(pstr,cache);
		pf->monster_req = atoi(cache);
		PopLeftString(pstr,cache);
		pf->genius_req = atoi(cache);
		PopLeftString(pstr,cache);
		pf->beastie_req = atoi(cache);
		PopLeftString(pstr,cache);
		pf->machine_req = atoi(cache);
		PopLeftString(pstr,cache);
		pf->country_guarder_req = atoi(cache);
		PopLeftString(pstr,cache);
		pf->country_aggresser_req = atoi(cache);
		PopLeftString(pstr,cache);
		pf->funner_req = atoi(cache);
		PopLeftString(pstr,cache);
		pf->card_tour_req = atoi(cache);
		PopLeftString(pstr,cache);
		pf->npc_req = atoi(cache);
		PopLeftString(pstr,cache);
		pf->dragon_req = atoi(cache);
		pf++;
	}
	init_free_cache(nlines);
	return;
}	

/* fcm */
void init_read_frame_fcm(){
	char					filename[FILENAME_MAX];
	char					cache[FILENAME_MAX];
	char				*	pstr;
	FRAME_FCM_BASE		*	pf;
	int						nlines;
	int						nconfig;
	int						i;
	filename[0] = '\0';
	strcpy(filename,base_path);
	strcat(filename,"\\configuration\\frame_fcm.txt");
	nlines = GetnLinesOfFile(filename);
	init_read_specify_file(filename,nlines);
	nconfig = init_get_valid_num_config(nlines);
	if (nconfig <= 0) {
		return;
	}
	g_stat->num_speed_frame_base_fcm = nconfig;
	frame_fcm_base_head = (LPFRAME_FCM_BASE)ms_malloc(nconfig*sizeof(FRAME_FCM_BASE));
	memset(frame_fcm_base_head,0,nconfig*sizeof(FRAME_FCM_BASE));
	pf = frame_fcm_base_head;
	for(i = 0;i < nlines;i++){
		pstr = pcfg_buf[i];
		if (pstr[0] == '\0') {
			continue;
		}
		PopLeftString(pstr,cache);
		pf->frame = atoi(cache);
		PopLeftString(pstr,cache);
		pf->class_human_req = atoi(cache);
		PopLeftString(pstr,cache);
		pf->class_hun_req = atoi(cache);
		PopLeftString(pstr,cache);
		pf->class_sorcer_req = atoi(cache);
		PopLeftString(pstr,cache);
		pf->class_genius_req = atoi(cache);
		PopLeftString(pstr,cache);
		pf->class_bowman_req = atoi(cache);
		PopLeftString(pstr,cache);
		pf->class_taoist_req = atoi(cache);
		PopLeftString(pstr,cache);
		pf->class_nodead_req = atoi(cache);
		PopLeftString(pstr,cache);
		pf->class_craftsman_req = atoi(cache);
		PopLeftString(pstr,cache);
		pf->class_knight_req = atoi(cache);
		PopLeftString(pstr,cache);
		pf->monster_req = atoi(cache);
		PopLeftString(pstr,cache);
		pf->genius_req = atoi(cache);
		PopLeftString(pstr,cache);
		pf->beastie_req = atoi(cache);
		PopLeftString(pstr,cache);
		pf->machine_req = atoi(cache);
		PopLeftString(pstr,cache);
		pf->country_guarder_req = atoi(cache);
		PopLeftString(pstr,cache);
		pf->country_aggresser_req = atoi(cache);
		PopLeftString(pstr,cache);
		pf->funner_req = atoi(cache);
		PopLeftString(pstr,cache);
		pf->card_tour_req = atoi(cache);
		PopLeftString(pstr,cache);
		pf->npc_req = atoi(cache);
		PopLeftString(pstr,cache);
		pf->dragon_req = atoi(cache);
		pf++;
	}
	init_free_cache(nlines);
	return;
}

/* fcp */
void init_read_frame_fcp(){
	char					filename[FILENAME_MAX];
	char					cache[FILENAME_MAX];
	char				*	pstr;
	FRAME_FCP_BASE		*	pf;
	int						nlines;
	int						nconfig;
	int						i;
	filename[0] = '\0';
	strcpy(filename,base_path);
	strcat(filename,"\\configuration\\frame_fcp.txt");
	nlines = GetnLinesOfFile(filename);
	init_read_specify_file(filename,nlines);
	nconfig = init_get_valid_num_config(nlines);
	if (nconfig <= 0) {
		return;
	}
	g_stat->num_speed_frame_base_fcp = nconfig;
	frame_fcp_base_head = (LPFRAME_FCP_BASE)ms_malloc(nconfig*sizeof(FRAME_FCP_BASE));
	memset(frame_fcp_base_head,0,nconfig*sizeof(FRAME_FCP_BASE));
	pf = frame_fcp_base_head;
	for(i = 0;i < nlines;i++){
		pstr = pcfg_buf[i];
		if (pstr[0] == '\0') {
			continue;
		}
		PopLeftString(pstr,cache);
		pf->frame = atoi(cache);
		PopLeftString(pstr,cache);
		pf->class_human_req = atoi(cache);
		PopLeftString(pstr,cache);
		pf->class_hun_req = atoi(cache);
		PopLeftString(pstr,cache);
		pf->class_sorcer_req = atoi(cache);
		PopLeftString(pstr,cache);
		pf->class_genius_req = atoi(cache);
		PopLeftString(pstr,cache);
		pf->class_bowman_req = atoi(cache);
		PopLeftString(pstr,cache);
		pf->class_taoist_req = atoi(cache);
		PopLeftString(pstr,cache);
		pf->class_nodead_req = atoi(cache);
		PopLeftString(pstr,cache);
		pf->class_craftsman_req = atoi(cache);
		PopLeftString(pstr,cache);
		pf->class_knight_req = atoi(cache);
		PopLeftString(pstr,cache);
		pf->monster_req = atoi(cache);
		PopLeftString(pstr,cache);
		pf->genius_req = atoi(cache);
		PopLeftString(pstr,cache);
		pf->beastie_req = atoi(cache);
		PopLeftString(pstr,cache);
		pf->machine_req = atoi(cache);
		PopLeftString(pstr,cache);
		pf->country_guarder_req = atoi(cache);
		PopLeftString(pstr,cache);
		pf->country_aggresser_req = atoi(cache);
		PopLeftString(pstr,cache);
		pf->funner_req = atoi(cache);
		PopLeftString(pstr,cache);
		pf->card_tour_req = atoi(cache);
		PopLeftString(pstr,cache);
		pf->npc_req = atoi(cache);
		PopLeftString(pstr,cache);
		pf->dragon_req = atoi(cache);
		pf++;
	}
	init_free_cache(nlines);
	return;
}		

/* fcr */
void init_read_frame_fcr(){
	char					filename[FILENAME_MAX];
	char					cache[FILENAME_MAX];
	char				*	pstr;
	FRAME_FCR_BASE		*	pf;
	int						nlines;
	int						nconfig;
	int						i;
	filename[0] = '\0';
	strcpy(filename,base_path);
	strcat(filename,"\\configuration\\frame_fcr.txt");
	nlines = GetnLinesOfFile(filename);
	init_read_specify_file(filename,nlines);
	nconfig = init_get_valid_num_config(nlines);
	if (nconfig <= 0) {
		return;
	}
	g_stat->num_speed_frame_base_fcr = nconfig;
	frame_fcr_base_head = (LPFRAME_FCR_BASE)ms_malloc(nconfig*sizeof(FRAME_FCR_BASE));
	memset(frame_fcr_base_head,0,nconfig*sizeof(FRAME_FCR_BASE));
	pf = frame_fcr_base_head;
	for(i = 0;i < nlines;i++){
		pstr = pcfg_buf[i];
		if (pstr[0] == '\0') {
			continue;
		}
		PopLeftString(pstr,cache);
		pf->frame = atoi(cache);
		PopLeftString(pstr,cache);
		pf->class_human_req = atoi(cache);
		PopLeftString(pstr,cache);
		pf->class_hun_req = atoi(cache);
		PopLeftString(pstr,cache);
		pf->class_sorcer_req = atoi(cache);
		PopLeftString(pstr,cache);
		pf->class_genius_req = atoi(cache);
		PopLeftString(pstr,cache);
		pf->class_bowman_req = atoi(cache);
		PopLeftString(pstr,cache);
		pf->class_taoist_req = atoi(cache);
		PopLeftString(pstr,cache);
		pf->class_nodead_req = atoi(cache);
		PopLeftString(pstr,cache);
		pf->class_craftsman_req = atoi(cache);
		PopLeftString(pstr,cache);
		pf->class_knight_req = atoi(cache);
		PopLeftString(pstr,cache);
		pf->monster_req = atoi(cache);
		PopLeftString(pstr,cache);
		pf->genius_req = atoi(cache);
		PopLeftString(pstr,cache);
		pf->beastie_req = atoi(cache);
		PopLeftString(pstr,cache);
		pf->machine_req = atoi(cache);
		PopLeftString(pstr,cache);
		pf->country_guarder_req = atoi(cache);
		PopLeftString(pstr,cache);
		pf->country_aggresser_req = atoi(cache);
		PopLeftString(pstr,cache);
		pf->funner_req = atoi(cache);
		PopLeftString(pstr,cache);
		pf->card_tour_req = atoi(cache);
		PopLeftString(pstr,cache);
		pf->npc_req = atoi(cache);
		PopLeftString(pstr,cache);
		pf->dragon_req = atoi(cache);
		pf++;
	}
	init_free_cache(nlines);
	return;
}		

/* fhr */
void init_read_frame_fhr(){
	char					filename[FILENAME_MAX];
	char					cache[FILENAME_MAX];
	char				*	pstr;
	FRAME_FHR_BASE		*	pf;
	int						nlines;
	int						nconfig;
	int						i;
	filename[0] = '\0';
	strcpy(filename,base_path);
	strcat(filename,"\\configuration\\frame_fhr.txt");
	nlines = GetnLinesOfFile(filename);
	init_read_specify_file(filename,nlines);
	nconfig = init_get_valid_num_config(nlines);
	if (nconfig <= 0) {
		return;
	}
	g_stat->num_speed_frame_base_fhr = nconfig;
	frame_fhr_base_head = (LPFRAME_FHR_BASE)ms_malloc(nconfig*sizeof(FRAME_FHR_BASE));
	memset(frame_fhr_base_head,0,nconfig*sizeof(FRAME_FHR_BASE));
	pf = frame_fhr_base_head;
	for(i = 0;i < nlines;i++){
		pstr = pcfg_buf[i];
		if (pstr[0] == '\0') {
			continue;
		}
		PopLeftString(pstr,cache);
		pf->frame = atoi(cache);
		PopLeftString(pstr,cache);
		pf->class_human_req = atoi(cache);
		PopLeftString(pstr,cache);
		pf->class_hun_req = atoi(cache);
		PopLeftString(pstr,cache);
		pf->class_sorcer_req = atoi(cache);
		PopLeftString(pstr,cache);
		pf->class_genius_req = atoi(cache);
		PopLeftString(pstr,cache);
		pf->class_bowman_req = atoi(cache);
		PopLeftString(pstr,cache);
		pf->class_taoist_req = atoi(cache);
		PopLeftString(pstr,cache);
		pf->class_nodead_req = atoi(cache);
		PopLeftString(pstr,cache);
		pf->class_craftsman_req = atoi(cache);
		PopLeftString(pstr,cache);
		pf->class_knight_req = atoi(cache);
		PopLeftString(pstr,cache);
		pf->monster_req = atoi(cache);
		PopLeftString(pstr,cache);
		pf->genius_req = atoi(cache);
		PopLeftString(pstr,cache);
		pf->beastie_req = atoi(cache);
		PopLeftString(pstr,cache);
		pf->machine_req = atoi(cache);
		PopLeftString(pstr,cache);
		pf->country_guarder_req = atoi(cache);
		PopLeftString(pstr,cache);
		pf->country_aggresser_req = atoi(cache);
		PopLeftString(pstr,cache);
		pf->funner_req = atoi(cache);
		PopLeftString(pstr,cache);
		pf->card_tour_req = atoi(cache);
		PopLeftString(pstr,cache);
		pf->npc_req = atoi(cache);
		PopLeftString(pstr,cache);
		pf->dragon_req = atoi(cache);
		pf++;
	}
	init_free_cache(nlines);
	return;
}		

/* flr */
void init_read_frame_flr(){
	char					filename[FILENAME_MAX];
	char					cache[FILENAME_MAX];
	char				*	pstr;
	FRAME_FLR_BASE		*	pf;
	int						nlines;
	int						nconfig;
	int						i;
	filename[0] = '\0';
	strcpy(filename,base_path);
	strcat(filename,"\\configuration\\frame_flr.txt");
	nlines = GetnLinesOfFile(filename);
	init_read_specify_file(filename,nlines);
	nconfig = init_get_valid_num_config(nlines);
	if (nconfig <= 0) {
		return;
	}
	g_stat->num_speed_frame_base_flr = nconfig;
	frame_flr_base_head = (LPFRAME_FLR_BASE)ms_malloc(nconfig*sizeof(FRAME_FLR_BASE));
	memset(frame_flr_base_head,0,nconfig*sizeof(FRAME_FLR_BASE));
	pf = frame_flr_base_head;
	for(i = 0;i < nlines;i++){
		pstr = pcfg_buf[i];
		if (pstr[0] == '\0') {
			continue;
		}
		PopLeftString(pstr,cache);
		pf->frame = atoi(cache);
		PopLeftString(pstr,cache);
		pf->class_human_req = atoi(cache);
		PopLeftString(pstr,cache);
		pf->class_hun_req = atoi(cache);
		PopLeftString(pstr,cache);
		pf->class_sorcer_req = atoi(cache);
		PopLeftString(pstr,cache);
		pf->class_genius_req = atoi(cache);
		PopLeftString(pstr,cache);
		pf->class_bowman_req = atoi(cache);
		PopLeftString(pstr,cache);
		pf->class_taoist_req = atoi(cache);
		PopLeftString(pstr,cache);
		pf->class_nodead_req = atoi(cache);
		PopLeftString(pstr,cache);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -