| 37 |
|
#include "Oni_Character.h" |
| 38 |
|
#include "Flatline_Packet.h" |
| 39 |
|
|
| 40 |
– |
#define pad1_size (sizeof(int64_t) - sizeof(short)) |
| 41 |
– |
#define pad2_size (128 - (sizeof(short) + pad1_size + sizeof(int64_t))) |
| 40 |
|
|
| 41 |
< |
#define breakpoint asm("int3") |
| 41 |
> |
//#define breakpoint asm("int3") |
| 42 |
|
|
| 45 |
– |
typedef struct { |
| 46 |
– |
short ss_family; |
| 47 |
– |
char pad1[pad1_size]; |
| 48 |
– |
uint64_t pad64; |
| 49 |
– |
char pad2[pad2_size]; |
| 50 |
– |
} sockaddr_storage; |
| 51 |
– |
|
| 52 |
– |
typedef struct sockaddr sockaddr; |
| 53 |
– |
typedef struct sockaddr_in sockaddr_in; |
| 54 |
– |
typedef sockaddr_storage sockaddr_in6; |
| 55 |
– |
|
| 56 |
– |
bool NetUDPServer_Listen(uint16_t port, bool (*packet_callback)(char* data, int datalen, int from)); |
| 57 |
– |
bool NetUDPServer_Send(sockaddr* address, char* data, int datalen); |
| 43 |
|
|
| 44 |
< |
int NetUDPSocket_Create(uint16_t port); |
| 60 |
< |
int NetUDPSocket_Send(int socket, const sockaddr* address, const char* data, int datalen); |
| 61 |
< |
void NetUDPSocket_Close(int sock); |
| 62 |
< |
bool NetUDPSocket_Recieve(int socket, sockaddr_storage* address, char* data, uint16_t* datalen); |
| 44 |
> |
#include "Flatline_Net.h" |
| 45 |
|
|
| 46 |
|
DWORD WINAPI StartServer(void* lol); |
| 47 |
|
DWORD WINAPI StartClient(void* lol); |
| 148 |
|
//used for storing data about each player |
| 149 |
|
typedef struct { |
| 150 |
|
//int FLATLINE; |
| 151 |
< |
int id; |
| 152 |
< |
int packet_index; |
| 151 |
> |
short signature; |
| 152 |
> |
short id; |
| 153 |
> |
int size; |
| 154 |
> |
//int packet_index; |
| 155 |
|
union |
| 156 |
|
{ |
| 157 |
|
char data[1080]; |