int VCR_GetMessage (qsocket_t * sock) { int ret; long *driverdata = (long *) (char *) &sock->driverdata; if (host_time != next.time || next.op != VCR_OP_GETMESSAGE || next.session != *driverdata) Sys_Error ("VCR missmatch"); Qread (vcrFile, &ret, sizeof (int)); if (ret != 1) { VCR_ReadNext (); return ret; } Qread (vcrFile, &net_message->message->cursize, sizeof (int)); Qread (vcrFile, net_message->message->data, net_message->message->cursize); VCR_ReadNext (); return 1; }
qsocket_t *VCR_CheckNewConnections (void) { qsocket_t *sock; if (host_time != next.time || next.op != VCR_OP_CONNECT) Sys_Error ("VCR missmatch"); if (!next.session) { VCR_ReadNext (); return NULL; } sock = NET_NewQSocket (); *(long *)(&sock->driverdata) = next.session; Sys_FileRead (vcrFile, sock->address, NET_NAMELEN); VCR_ReadNext (); return sock; }
int VCR_GetMessage (qsocket_t *sock) { int ret; if (host_time != next.time || next.op != VCR_OP_GETMESSAGE || next.session != *(long *)(&sock->driverdata)) Sys_Error ("VCR missmatch"); fread (&ret, 1, sizeof(int), vcrFile); if (ret != 1) { VCR_ReadNext (); return ret; } fread (&net_message.cursize, 1, sizeof(int), vcrFile); fread (net_message.data, 1, net_message.cursize, vcrFile); VCR_ReadNext (); return 1; }
qboolean VCR_CanSendMessage (qsocket_t *sock) { qboolean ret; if (host_time != next.time || next.op != VCR_OP_CANSENDMESSAGE || next.session != *(long *)(&sock->driverdata)) Sys_Error ("VCR missmatch"); Sys_FileRead(vcrFile, &ret, sizeof(int)); VCR_ReadNext (); return ret; }
int VCR_SendMessage (qsocket_t *sock, sizebuf_t *data) { int ret; if (host_time != next.time || next.op != VCR_OP_SENDMESSAGE || next.session != *(long *)(&sock->driverdata)) Sys_Error ("VCR missmatch"); fread (&ret, 1, sizeof(int), vcrFile); VCR_ReadNext (); return ret; }
int VCR_SendMessage (qsocket_t * sock, sizebuf_t *data) { int ret; long *driverdata = (long *) (char *) &sock->driverdata; if (host_time != next.time || next.op != VCR_OP_SENDMESSAGE || next.session != *driverdata) Sys_Error ("VCR missmatch"); Qread (vcrFile, &ret, sizeof (int)); VCR_ReadNext (); return ret; }