use yaml for messages

This commit is contained in:
gmueller
2011-01-24 23:52:12 +01:00
parent 89a4b6ffb2
commit 1dbdb25f30
71 changed files with 7632 additions and 154 deletions

View File

@@ -320,17 +320,17 @@ void Client::accelerate(double x, double y, double z) {
if (game.local_player == 0)
return;
player_accelerate_message_t msg;
msg.msg_id = MESSAGE_PLAYER_ACCELERATE;
msg.player_id = game.local_player->id;
msg.x = x;
msg.y = y;
msg.z = z;
network.sendMessage((uint8_t*) &msg, sizeof(msg));
YAML::Emitter m;
m << msg;
network.send(m);
}
void Client::drop_bomb(double rx, double ry, double rz, double ttl) {
bomb_drop_meesage_t msg;
msg.msg_id = MESSAGE_BOMB_DROP;
msg.x = game.local_player->x + rx * 20;
msg.y = game.local_player->y + ry * 20;
msg.z = game.local_player->z + rz * 20;
@@ -338,7 +338,9 @@ void Client::drop_bomb(double rx, double ry, double rz, double ttl) {
msg.vy = game.local_player->vy + ry * 100;
msg.vz = game.local_player->vz + rz * 100;
msg.ttl = ttl;
network.sendMessage((uint8_t*) &msg, sizeof(msg));
YAML::Emitter m;
m << msg;
network.send(m);
}
void Client::loadConsoleFont() {