I'm having trouble with this to. I can't get send_data_to to trigger any kind of event client or server side. I'm sure that in this code pressing B on the server should at least change the video window test but it doesn't.

I've tried doing a send_string and that works fine. I'm sure I'm doing something silly.

Code:

#include <acknex.h>
#include <default.c>

typedef struct MYDATA{
int a;
int b;
int c;
} MYDATA;

MYDATA* mydata = {a=1;b=2;c=3;}

function client_event(void* buffer)
{
video_window(NULL, NULL, 112, "Client event triggered");
if (event_type == EVENT_DATA)
{
beep();
}
}

function server_event(void* buffer, var id)
{
video_window(NULL, NULL, 112, "Server event triggered");
if (event_type == EVENT_DATA)
{
beep();
}
}

function send_some_data()
{
video_window(NULL, NULL, 112, "Send");
send_data_to(NULL, mydata, sizeof(MYDATA));
}

function main()
{
vec_set(screen_color, vector(255,0,0));
video_mode = 7;
on_b = send_some_data;
on_client = client_event;
on_server = server_event;
}