I'm having a similar problem. In my test code I cannot get the client event to recognise that send_data_to has been called. It works if I comment out send_data_to and uncomment send_string. Basically pressing B should cause a server event.
HELP - it's driving me nuts.
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;}
STRING* mystring = "test";
function client_event(void* buffer)
{
video_window(NULL, NULL, 112, "Client event triggered");
if (event_type == EVENT_DATA)
{
video_window(NULL, NULL, 112, "Client event triggered - Data");
}
if (event_type == EVENT_STRING)
{
video_window(NULL, NULL, 112, "Client event triggered - String");
}
}
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));
//send_string(mystring);
}
function main()
{
dplay_diag = 1;
vec_set(screen_color, vector(255,0,0));
video_mode = 7;
on_b = send_some_data;
on_client = client_event;
on_server = server_event;
}