2012-04-21 21:13:50 +00:00
|
|
|
/* RetroArch - A frontend for libretro.
|
2014-01-01 00:50:59 +00:00
|
|
|
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
|
2017-01-22 12:40:32 +00:00
|
|
|
* Copyright (C) 2011-2017 - Daniel De Matteis
|
|
|
|
* Copyright (C) 2016-2017 - Gregor Richards
|
2017-12-12 07:55:31 +00:00
|
|
|
*
|
2012-04-21 21:13:50 +00:00
|
|
|
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
2011-02-13 15:40:24 +00:00
|
|
|
* of the GNU General Public License as published by the Free Software Found-
|
|
|
|
* ation, either version 3 of the License, or (at your option) any later version.
|
|
|
|
*
|
2012-04-21 21:13:50 +00:00
|
|
|
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
2011-02-13 15:40:24 +00:00
|
|
|
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
|
|
|
* PURPOSE. See the GNU General Public License for more details.
|
|
|
|
*
|
2012-04-21 21:31:57 +00:00
|
|
|
* You should have received a copy of the GNU General Public License along with RetroArch.
|
2011-02-13 15:40:24 +00:00
|
|
|
* If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
2012-04-21 21:25:32 +00:00
|
|
|
#ifndef __RARCH_NETPLAY_H
|
|
|
|
#define __RARCH_NETPLAY_H
|
2011-02-13 15:40:24 +00:00
|
|
|
|
|
|
|
#include <stdint.h>
|
2012-04-05 09:47:43 +00:00
|
|
|
#include <stddef.h>
|
2015-12-05 15:24:31 +00:00
|
|
|
|
2014-10-21 03:05:52 +00:00
|
|
|
#include <boolean.h>
|
2016-05-10 17:03:53 +00:00
|
|
|
#include <libretro.h>
|
2015-12-05 15:24:31 +00:00
|
|
|
|
2016-05-19 09:46:54 +00:00
|
|
|
#include "../../core.h"
|
2011-02-13 15:40:24 +00:00
|
|
|
|
2015-01-09 17:34:00 +00:00
|
|
|
typedef struct netplay netplay_t;
|
|
|
|
|
2019-06-26 05:13:50 +00:00
|
|
|
typedef struct mitm_server
|
|
|
|
{
|
2018-02-02 20:37:02 +00:00
|
|
|
const char *name;
|
|
|
|
const char *description;
|
|
|
|
} mitm_server_t;
|
|
|
|
|
|
|
|
static const mitm_server_t netplay_mitm_server_list[] = {
|
|
|
|
{ "nyc", "New York City, USA" },
|
|
|
|
{ "madrid", "Madrid, Spain" },
|
2018-12-10 03:15:45 +00:00
|
|
|
{ "montreal", "Montreal, Canada" },
|
2020-01-06 17:14:59 +00:00
|
|
|
{ "saopaulo", "Sao Paulo, Brazil" },
|
2018-02-02 20:37:02 +00:00
|
|
|
};
|
|
|
|
|
2015-12-05 15:24:31 +00:00
|
|
|
enum rarch_netplay_ctl_state
|
|
|
|
{
|
|
|
|
RARCH_NETPLAY_CTL_NONE = 0,
|
2016-12-12 22:22:35 +00:00
|
|
|
RARCH_NETPLAY_CTL_GAME_WATCH,
|
2015-12-05 15:27:00 +00:00
|
|
|
RARCH_NETPLAY_CTL_POST_FRAME,
|
2015-12-05 15:38:24 +00:00
|
|
|
RARCH_NETPLAY_CTL_PRE_FRAME,
|
2016-10-03 21:28:20 +00:00
|
|
|
RARCH_NETPLAY_CTL_ENABLE_SERVER,
|
|
|
|
RARCH_NETPLAY_CTL_ENABLE_CLIENT,
|
2016-10-03 02:13:34 +00:00
|
|
|
RARCH_NETPLAY_CTL_DISABLE,
|
|
|
|
RARCH_NETPLAY_CTL_IS_ENABLED,
|
2018-05-31 02:01:02 +00:00
|
|
|
RARCH_NETPLAY_CTL_IS_REPLAYING,
|
2017-05-16 05:15:06 +00:00
|
|
|
RARCH_NETPLAY_CTL_IS_SERVER,
|
|
|
|
RARCH_NETPLAY_CTL_IS_CONNECTED,
|
2016-09-14 18:25:54 +00:00
|
|
|
RARCH_NETPLAY_CTL_IS_DATA_INITED,
|
|
|
|
RARCH_NETPLAY_CTL_PAUSE,
|
2016-09-14 22:03:40 +00:00
|
|
|
RARCH_NETPLAY_CTL_UNPAUSE,
|
2016-09-25 03:47:57 +00:00
|
|
|
RARCH_NETPLAY_CTL_LOAD_SAVESTATE,
|
2017-02-15 19:40:37 +00:00
|
|
|
RARCH_NETPLAY_CTL_RESET,
|
2017-02-21 00:08:31 +00:00
|
|
|
RARCH_NETPLAY_CTL_DISCONNECT,
|
2017-04-18 19:25:58 +00:00
|
|
|
RARCH_NETPLAY_CTL_FINISHED_NAT_TRAVERSAL,
|
|
|
|
RARCH_NETPLAY_CTL_DESYNC_PUSH,
|
|
|
|
RARCH_NETPLAY_CTL_DESYNC_POP
|
2015-12-05 15:24:31 +00:00
|
|
|
};
|
|
|
|
|
2017-09-11 02:49:25 +00:00
|
|
|
/* Preferences for sharing digital devices */
|
|
|
|
enum rarch_netplay_share_digital_preference
|
2017-09-11 01:46:18 +00:00
|
|
|
{
|
2018-09-25 13:00:29 +00:00
|
|
|
RARCH_NETPLAY_SHARE_DIGITAL_NO_SHARING = 0,
|
2017-09-11 02:49:25 +00:00
|
|
|
RARCH_NETPLAY_SHARE_DIGITAL_NO_PREFERENCE,
|
|
|
|
RARCH_NETPLAY_SHARE_DIGITAL_OR,
|
|
|
|
RARCH_NETPLAY_SHARE_DIGITAL_XOR,
|
|
|
|
RARCH_NETPLAY_SHARE_DIGITAL_VOTE,
|
|
|
|
RARCH_NETPLAY_SHARE_DIGITAL_LAST
|
|
|
|
};
|
2017-09-11 01:46:18 +00:00
|
|
|
|
2017-09-11 02:49:25 +00:00
|
|
|
/* Preferences for sharing analog devices */
|
|
|
|
enum rarch_netplay_share_analog_preference
|
|
|
|
{
|
2018-09-25 13:00:29 +00:00
|
|
|
RARCH_NETPLAY_SHARE_ANALOG_NO_SHARING = 0,
|
2017-09-11 02:49:25 +00:00
|
|
|
RARCH_NETPLAY_SHARE_ANALOG_NO_PREFERENCE,
|
|
|
|
RARCH_NETPLAY_SHARE_ANALOG_MAX,
|
|
|
|
RARCH_NETPLAY_SHARE_ANALOG_AVERAGE,
|
|
|
|
RARCH_NETPLAY_SHARE_ANALOG_LAST
|
2017-09-11 01:46:18 +00:00
|
|
|
};
|
|
|
|
|
2015-12-05 15:24:31 +00:00
|
|
|
bool netplay_driver_ctl(enum rarch_netplay_ctl_state state, void *data);
|
|
|
|
|
2017-03-04 06:31:24 +00:00
|
|
|
int netplay_rooms_parse(const char *buf);
|
|
|
|
|
|
|
|
struct netplay_room* netplay_room_get(int index);
|
|
|
|
|
2018-06-21 05:52:01 +00:00
|
|
|
int netplay_rooms_get_count(void);
|
2017-03-04 06:31:24 +00:00
|
|
|
|
2018-06-21 05:52:01 +00:00
|
|
|
void netplay_rooms_free(void);
|
2017-03-04 06:31:24 +00:00
|
|
|
|
2015-11-17 23:19:22 +00:00
|
|
|
#endif
|