summaryrefslogtreecommitdiff
path: root/src/protocol.c
diff options
context:
space:
mode:
authorAldrik Ramaekers <aldrik@amftech.nl>2022-12-14 00:04:20 +0100
committerAldrik Ramaekers <aldrik@amftech.nl>2022-12-14 00:04:20 +0100
commit99f328fa19bb9cb266d9525629813cc0268a889e (patch)
tree514d5eb5fe51afc5f19bb3acf240a425239eba2a /src/protocol.c
parentf8ccfba637267bae8064daa320cfb00b8ffe3e66 (diff)
bullets network transfer
Diffstat (limited to 'src/protocol.c')
-rw-r--r--src/protocol.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/protocol.c b/src/protocol.c
index 2381159..dc4783b 100644
--- a/src/protocol.c
+++ b/src/protocol.c
@@ -28,6 +28,14 @@ network_message create_protocol_zombie_list() {
return network_create_message(network_buffer, sizeof(protocol_zombie_list), MAX_NETWORK_BUFFER_SIZE);
}
+network_message create_protocol_bullets_list() {
+ protocol_bullets_list* buf = (protocol_bullets_list*)network_buffer;
+ buf->type = MESSAGE_BULLET_LIST;
+ memcpy(buf->bullets, bullets, sizeof(bullets));
+ return network_create_message(network_buffer, sizeof(protocol_bullets_list), MAX_NETWORK_BUFFER_SIZE);
+}
+
+
network_message create_protocol_user_moved(protocol_move_type move, u32 id) {
protocol_move* buf = (protocol_move*)network_buffer;
buf->type = MESSAGE_USER_MOVED;
@@ -36,6 +44,15 @@ network_message create_protocol_user_moved(protocol_move_type move, u32 id) {
return network_create_message(network_buffer, sizeof(protocol_move), MAX_NETWORK_BUFFER_SIZE);
}
+network_message create_protocol_user_shoot(u32 id, float dirx, float diry) {
+ protocol_user_shoot* buf = (protocol_user_shoot*)network_buffer;
+ buf->type = MESSAGE_USER_SHOOT;
+ buf->id = id;
+ buf->dirx = dirx;
+ buf->diry = diry;
+ return network_create_message(network_buffer, sizeof(protocol_user_shoot), MAX_NETWORK_BUFFER_SIZE);
+}
+
network_message create_protocol_user_look(u32 id, float gunx, float guny) {
protocol_user_look* buf = (protocol_user_look*)network_buffer;
buf->type = MESSAGE_USER_LOOK;