2016-10-03 12:35:27 +00:00
|
|
|
// Copyright 2016 Dolphin Emulator Project
|
|
|
|
// Licensed under GPLv2+
|
|
|
|
// Refer to the license.txt file included.
|
|
|
|
|
2016-11-11 19:58:20 +00:00
|
|
|
#pragma once
|
|
|
|
|
2016-10-03 12:35:27 +00:00
|
|
|
#include <string>
|
|
|
|
#include "Common/CommonTypes.h"
|
|
|
|
|
2017-06-19 09:20:14 +00:00
|
|
|
class GameListCtrl;
|
2016-10-03 22:57:32 +00:00
|
|
|
class wxRect;
|
2016-10-03 12:35:27 +00:00
|
|
|
class wxWindow;
|
|
|
|
|
|
|
|
class NetPlayLaunchConfig
|
|
|
|
{
|
|
|
|
public:
|
2017-08-02 23:51:05 +00:00
|
|
|
void SetDialogInfo(wxWindow* parent);
|
2016-10-03 12:35:27 +00:00
|
|
|
|
2016-10-03 22:57:32 +00:00
|
|
|
const wxRect window_defaults{wxDefaultCoord, wxDefaultCoord, 768, 768 - 128};
|
2016-10-03 12:35:27 +00:00
|
|
|
|
|
|
|
std::string player_name;
|
2017-06-19 09:20:14 +00:00
|
|
|
const GameListCtrl* game_list_ctrl;
|
2016-10-03 12:35:27 +00:00
|
|
|
wxWindow* parent_window;
|
|
|
|
bool use_traversal;
|
|
|
|
std::string traversal_host;
|
|
|
|
u16 traversal_port;
|
2016-10-03 22:57:32 +00:00
|
|
|
wxRect window_pos{window_defaults};
|
2016-10-03 12:35:27 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class NetPlayHostConfig : public NetPlayLaunchConfig
|
|
|
|
{
|
|
|
|
public:
|
2017-08-02 23:52:26 +00:00
|
|
|
void FromConfig();
|
2016-10-03 12:35:27 +00:00
|
|
|
|
|
|
|
std::string game_name;
|
|
|
|
u16 listen_port = 0;
|
2017-08-07 07:27:04 +00:00
|
|
|
bool forward_port = false;
|
2016-10-03 12:35:27 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class NetPlayJoinConfig : public NetPlayLaunchConfig
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
std::string connect_host;
|
|
|
|
u16 connect_port;
|
|
|
|
std::string connect_hash_code;
|
|
|
|
};
|
|
|
|
|
|
|
|
class NetPlayLauncher
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
static bool Host(const NetPlayHostConfig& config);
|
|
|
|
static bool Join(const NetPlayJoinConfig& config);
|
2016-11-19 15:36:26 +00:00
|
|
|
};
|