Refactoring: Moving I/O functionality into netplay_io.c

This commit is contained in:
Gregor Richards 2016-12-13 20:42:53 -05:00
parent 8c59c7dd77
commit 7e2465ef1f
5 changed files with 1069 additions and 1041 deletions

View File

@ -1123,6 +1123,7 @@ ifeq ($(HAVE_NETWORKING), 1)
# Netplay
DEFINES += -DHAVE_NETWORK_CMD
OBJ += network/netplay/netplay_frontend.o \
network/netplay/netplay_io.o \
network/netplay/netplay_net.o \
network/netplay/netplay_common.o \
network/netplay/netplay_discovery.o \

View File

@ -882,6 +882,7 @@ NETPLAY
============================================================ */
#ifdef HAVE_NETWORKING
#include "../network/netplay/netplay_frontend.c"
#include "../network/netplay/netplay_io.c"
#include "../network/netplay/netplay_net.c"
#include "../network/netplay/netplay_common.c"
#include "../network/netplay/netplay_discovery.c"

File diff suppressed because it is too large Load Diff

1065
network/netplay/netplay_io.c Normal file

File diff suppressed because it is too large Load Diff

View File

@ -47,6 +47,8 @@
#define NETPLAY_PASS_HASH_LEN 64 /* length of a SHA-256 hash */
#define MAX_STALL_TIME_USEC (10*1000*1000)
#define MAX_RETRIES 16
#define RETRY_MS 500
#define PREV_PTR(x) ((x) == 0 ? netplay->buffer_size - 1 : (x) - 1)
#define NEXT_PTR(x) ((x + 1) % netplay->buffer_size)