From 482740b5fa216c4ea61382cf2924d60c2d273cff Mon Sep 17 00:00:00 2001 From: twinaphex Date: Wed, 3 Feb 2016 17:05:32 +0100 Subject: [PATCH] (netplay) Style nits --- netplay/netplay.h | 71 +++++++++++++++++++++++++++------------- netplay/netplay_common.c | 3 +- 2 files changed, 50 insertions(+), 24 deletions(-) diff --git a/netplay/netplay.h b/netplay/netplay.h index 60675d3ec9..8ca7536480 100644 --- a/netplay/netplay.h +++ b/netplay/netplay.h @@ -38,39 +38,64 @@ enum rarch_netplay_ctl_state RARCH_NETPLAY_CTL_IS_DATA_INITED }; -/* TODO: most of this, actually */ -/* /!\ WARNING: A command identifier cannot exceed 16 bytes in length. */ enum netplay_cmd { -/* misc. commands */ - NETPLAY_CMD_ACK = 0x0000, /**< Acknowlegement response */ - NETPLAY_CMD_NAK = 0x0001, /**< Failed acknowlegement response */ - NETPLAY_CMD_FLIP_PLAYERS = 0x0002, /**< Swap inputs between p1 and p2. */ - NETPLAY_CMD_SPECTATE = 0x0003, /**< Toggle spectate/join mode */ - NETPLAY_CMD_DISCONNECT = 0x0004, /**< Gracefully disconnects from host. */ + /* Miscellaneous commands */ - NETPLAY_CMD_CFG = 0x0005, /**< Sends multiple config requests over, See - enum netplay_cmd_cfg. */ + /* Acknowlegement response */ + NETPLAY_CMD_ACK = 0x0000, - NETPLAY_CMD_CFG_ACK = 0x0006, /**< CMD_CFG streamlines sending multiple - configurations. This acknowledges - each one individually. */ + /* Failed acknowlegement response */ + NETPLAY_CMD_NAK = 0x0001, -/* loading and synchronization */ - NETPLAY_CMD_LOAD_SAVESTATE = 0x0012, /** Send a savestate for the client to load */ - NETPLAY_CMD_CHEATS = 0x0013, /** Sends over cheats enabled on client. */ -/* controlling game playback */ - NETPLAY_CMD_PAUSE = 0x0030, /**< Pauses the game, takes no args. */ - NETPLAY_CMD_RESUME = 0x0031 /**< Resumes the game, takes no args. */ + /* Swap inputs between player 1 and player 2 */ + NETPLAY_CMD_FLIP_PLAYERS = 0x0002, + + /* Toggle spectate/join mode */ + NETPLAY_CMD_SPECTATE = 0x0003, + + /* Gracefully disconnects from host */ + NETPLAY_CMD_DISCONNECT = 0x0004, + + /* Sends multiple config requests over, + * See enum netplay_cmd_cfg */ + NETPLAY_CMD_CFG = 0x0005, + + /* CMD_CFG streamlines sending multiple + configurations. This acknowledges + each one individually */ + NETPLAY_CMD_CFG_ACK = 0x0006, + + /* Loading and synchronization */ + + /* Send a savestate for the client to load */ + NETPLAY_CMD_LOAD_SAVESTATE = 0x0012, + /* Sends over cheats enabled on client */ + NETPLAY_CMD_CHEATS = 0x0013, + + /* Controlling game playback */ + + /* Pauses the game, takes no args */ + NETPLAY_CMD_PAUSE = 0x0030, + + /* Resumes the game, takes no args */ + NETPLAY_CMD_RESUME = 0x0031 }; /* These are the configurations sent by NETPLAY_CMD_CFG. */ enum netplay_cmd_cfg { - NETPLAY_CFG_NICK = 0x0001, /**< nickname */ - NETPLAY_CFG_SWAP_INPUT = 0x0002, /**< input.netplay_client_swap_input */ - NETPLAY_CFG_DELAY_FRAMES = 0x0004, /**< netplay.sync_frames */ - NETPLAY_CFG_PLAYER_SLOT = 0x0008 /**< For more than 2 players. */ + /* Nickname */ + NETPLAY_CFG_NICK = 0x0001, + + /* input.netplay_client_swap_input */ + NETPLAY_CFG_SWAP_INPUT = 0x0002, + + /* netplay.sync_frames */ + NETPLAY_CFG_DELAY_FRAMES = 0x0004, + + /* For more than 2 players */ + NETPLAY_CFG_PLAYER_SLOT = 0x0008 }; void input_poll_net(void); diff --git a/netplay/netplay_common.c b/netplay/netplay_common.c index e5f0bf38b7..2a0713aff7 100644 --- a/netplay/netplay_common.c +++ b/netplay/netplay_common.c @@ -266,7 +266,8 @@ bool np_get_info(netplay_t *netplay) if (np_impl_magic() != ntohl(header[1])) { - RARCH_ERR("Implementations differ, make sure you're using exact same libretro implementations and RetroArch version.\n"); + RARCH_ERR("Implementations differ, make sure you're using exact same " + "libretro implementations and RetroArch version.\n"); return false; }