From: Brendan Hansen Date: Fri, 8 Apr 2022 14:14:40 +0000 (-0500) Subject: added timestamp field to network events X-Git-Tag: v0.0.1 X-Git-Url: https://git.brendanfh.com/?a=commitdiff_plain;h=97c1582fda5f2881588a1fc0296ba9401af8bb7e;p=onyx_net.git added timestamp field to network events --- diff --git a/src/host.onyx b/src/host.onyx index ab7f5e4..4cbf70a 100644 --- a/src/host.onyx +++ b/src/host.onyx @@ -320,6 +320,7 @@ host_get_events :: (host: ^Host, timeout: u32 = 0) -> Iterator(^Event) { host.event.peer = peer; host.event.channel_id = 255; // Magic constant host.event.data = .[]; + host.event.timestamp = host.current_time; host.produced_event = true; } @@ -329,6 +330,7 @@ host_get_events :: (host: ^Host, timeout: u32 = 0) -> Iterator(^Event) { host.event.peer = peer; host.event.channel_id = 255; // Magic constant host.event.data = .[]; + host.event.timestamp = host.current_time; host.produced_event = true; } @@ -338,6 +340,7 @@ host_get_events :: (host: ^Host, timeout: u32 = 0) -> Iterator(^Event) { host.event.peer = peer; host.event.channel_id = channel_id; host.event.data = data; + host.event.timestamp = host.current_time; host.produced_event = true; } @@ -564,6 +567,7 @@ Event :: struct { type: Type; peer: ^Peer; channel_id: Channel_ID; + timestamp: u32; data: [] u8; }