summaryrefslogtreecommitdiff
path: root/src/protocol.c
diff options
context:
space:
mode:
authorAldrik Ramaekers <aldrik@amftech.nl>2023-11-02 18:24:46 +0100
committerAldrik Ramaekers <aldrik@amftech.nl>2023-11-02 18:24:46 +0100
commit11fc04b238ff9d42b17e6befa6ab4a673606fc1a (patch)
treecf4f48820fe3c55ed98c39038352924fab682ca8 /src/protocol.c
parent0648e9ec83977fe5151896097afd1dbae3f4143b (diff)
throwables on server side
Diffstat (limited to 'src/protocol.c')
-rw-r--r--src/protocol.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/protocol.c b/src/protocol.c
index 307aac3..a33f421 100644
--- a/src/protocol.c
+++ b/src/protocol.c
@@ -35,6 +35,14 @@ network_message create_protocol_user_list()
return network_create_message((u8*)buf, sizeof(protocol_user_list), MAX_NETWORK_BUFFER_SIZE);
}
+network_message create_protocol_throwables_list()
+{
+ protocol_throwables_list *buf = alloc_network_message(protocol_throwables_list);
+ buf->type = MESSAGE_THROWABLES_LIST;
+ memcpy(buf->throwables, throwables, sizeof(throwables));
+ return network_create_message((u8*)buf, sizeof(protocol_throwables_list), MAX_NETWORK_BUFFER_SIZE);
+}
+
network_message create_protocol_zombie_list()
{
protocol_zombie_list *buf = alloc_network_message(protocol_zombie_list);
@@ -70,6 +78,17 @@ network_message create_protocol_user_moved(protocol_move_type move, u32 id)
return network_create_message((u8*)buf, sizeof(protocol_move), MAX_NETWORK_BUFFER_SIZE);
}
+network_message create_protocol_user_throw(u32 id, float dirx, float diry, throwable_type type)
+{
+ protocol_user_throw *buf = alloc_network_message(protocol_user_throw);
+ buf->type = MESSAGE_USER_THROW;
+ buf->id = id;
+ buf->dirx = dirx;
+ buf->diry = diry;
+ buf->throwable = type;
+ return network_create_message((u8*)buf, sizeof(protocol_user_throw), MAX_NETWORK_BUFFER_SIZE);
+}
+
network_message create_protocol_user_shoot(u32 id, float dirx, float diry)
{
protocol_user_shoot *buf = alloc_network_message(protocol_user_shoot);