Beispiel #1
0
void Communication_Service()
{
	char Ostr[120]="\0";
	char    chardata[10];
	float Data=0;
	float temp=0;	
	uint8_t temp_nm[12];
	uint8_t i=0,j=0;
	
	if(Flag_Rx2End)
	{
		Flag_Rx2End=0;
		Communicate(); 		
	}
	
//	if(T05_4>=2)//此处为数据输出间隔 0.5*4=2S
//	{
//		T05_4=0;
//			
//			strcat(Ostr,"\r\n");
//			Uart_send_string(Ostr);
//			
//			
//		}
//	}
	
}
Beispiel #2
0
int GetTime() {
	sprintf(msg_send, "query_time");
	strcpy(msg_receive, Communicate(msg_send));
	int current_time;
	sscanf(msg_receive, "%d", &current_time);
	return current_time;
}
Beispiel #3
0
const Status *GetStatus() {
	sprintf(msg_send, "query_status %d", -1);
	strcpy(msg_receive, Communicate(msg_send));
	LoadPlayerStatus(msg_receive);
	return &STATUS_;
}
Beispiel #4
0
const Map *GetMap() {
	sprintf(msg_send, "query_map");
	strcpy(msg_receive, Communicate(msg_send));
	LoadMapInfo(msg_receive);
	return &MAP_;
}
Beispiel #5
0
void UseSkill(SkillType skill, int user_id, int target_id, Position des) { // 选手并不需要使用这个方法
	sprintf(msg_send, "use_skill %d %d %d %.10f %.10f %.10f", skill, user_id, target_id, des.x, des.y, des.z);
	Communicate(msg_send);
}
Beispiel #6
0
void PAUSE() {
	sprintf(msg_send, "pause");
	Communicate(msg_send);
}
Beispiel #7
0
void UpgradeSkill(int user_id, SkillType skill) {
	sprintf(msg_send, "upgrade_skill %d %d", skill, user_id);
	Communicate(msg_send);
}
Beispiel #8
0
void Move(int user_id, Speed speed) {
	sprintf(msg_send, "move %d %.10f %.10f %.10f", user_id, speed.x, speed.y, speed.z);
	Communicate(msg_send);
}