use yaml for messages
This commit is contained in:
@@ -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() {
|
||||
|
Reference in New Issue
Block a user