This commit is contained in:
Nishi 2026-01-29 17:48:51 +09:00
commit abce75957e
3 changed files with 30 additions and 81 deletions

View file

@ -34,6 +34,10 @@ GSDECL void GSNetBaseWrite(int fd, void* data, int size, GSNetAddress* address
GSDECL void GSNetPacketRead(int fd, GSNetPacket* packet, GSNetAddress* address);
GSDECL void GSNetPacketWrite(int fd, GSNetPacket* packet, GSNetAddress* address);
/* net_state.c */
GSDECL void GSNetStateRead(GSNetState* state, int fd, GSNetPacket* packet, GSNetAddress* address);
GSDECL void GSNetStateWrite(GSNetState* state, int fd, GSNetAddress* address);
#ifdef __cplusplus
}
#endif

View file

@ -49,6 +49,7 @@ typedef struct _GSNetPacketHeader GSNetPacketHeader;
typedef struct _GSNetPacket GSNetPacket;
typedef struct _GSNetAddress GSNetAddress;
typedef struct _GSBinary GSBinary;
typedef struct _GSNetState GSNetState;
#ifdef _GEARSRC
typedef struct _GSClient* GSClient;
typedef struct _GSServer* GSServer;
@ -138,6 +139,23 @@ struct _GSBinary {
int size;
};
struct _GSNetState {
GSEngine engine;
unsigned int rxseq;
unsigned int rxindex;
unsigned int rxtotal;
unsigned int txseq;
unsigned int txindex;
unsigned int txtotal;
unsigned int txstate;
unsigned long txtick;
GSBinary* rx;
GSBinary* tx;
};
#ifdef _GEARSRC
#include <GearSrc/GL/GL.h>
#include <miniaudio.h>
@ -255,18 +273,7 @@ struct _GSNetClient {
int fd;
unsigned int rxseq;
unsigned int rxindex;
unsigned int rxtotal;
unsigned int txseq;
unsigned int txindex;
unsigned int txtotal;
unsigned int txstate;
unsigned long txtick;
GSBinary* rx;
GSBinary* tx;
GSNetState state;
};
struct _GSNetServer {