mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-05-30 23:12:40 +00:00
Use precompiled headers for faster build of the DebuggerWX and Dolphin projects. Fix a silly memory leak in debug text in the GL plugin.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@3846 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
6f28539ccc
commit
afe25626b1
14 changed files with 613 additions and 139 deletions
|
@ -18,7 +18,6 @@
|
|||
#ifndef _NETWINDOW_H_
|
||||
#define _NETWINDOW_H_
|
||||
|
||||
#include <SFML/Network.hpp>
|
||||
#include <string>
|
||||
#include <wx/wx.h>
|
||||
#include <wx/sizer.h>
|
||||
|
@ -32,6 +31,7 @@
|
|||
#include "Globals.h"
|
||||
#include "BootManager.h"
|
||||
#include "Common.h"
|
||||
#include "NetStructs.h"
|
||||
#include "Core.h"
|
||||
#include "pluginspecs_pad.h"
|
||||
#include "HW/SI.h"
|
||||
|
@ -47,109 +47,8 @@
|
|||
// Unrealistic for Internet netplay, unless you have an uberfast connexion (<10ms ping)
|
||||
// #define USE_TCP
|
||||
|
||||
class NetPlay;
|
||||
|
||||
struct Netpads {
|
||||
int nHi[128];
|
||||
int nLow[128];
|
||||
};
|
||||
|
||||
struct Clients {
|
||||
std::string nick;
|
||||
sf::SocketTCP socket;
|
||||
unsigned short port;
|
||||
sf::IPAddress address;
|
||||
bool ready;
|
||||
};
|
||||
|
||||
class NetEvent
|
||||
{
|
||||
public:
|
||||
NetEvent(NetPlay* netptr) { m_netptr = netptr; }
|
||||
~NetEvent() {};
|
||||
|
||||
void SendEvent(int EventType, std::string="NULL", int=NULL);
|
||||
void AppendText(const wxString text);
|
||||
|
||||
private:
|
||||
NetPlay *m_netptr;
|
||||
};
|
||||
|
||||
class ServerSide : public wxThread
|
||||
{
|
||||
public:
|
||||
ServerSide(NetPlay* netptr, sf::SocketTCP, sf::SocketUDP, int netmodel, std::string nick);
|
||||
~ServerSide() {};
|
||||
|
||||
virtual void *Entry();
|
||||
|
||||
void Write(int socknb, const char *data, size_t size, long *ping=NULL);
|
||||
void WriteUDP(int socknb, const char *data, size_t size);
|
||||
bool isNewPadData(u32 *netValues, bool current, int client=0);
|
||||
|
||||
private:
|
||||
bool SyncValues(unsigned char, sf::IPAddress);
|
||||
bool RecvT(sf::SocketUDP Socket, char * Data, size_t Max, size_t& Recvd, float Time = 0);
|
||||
char GetSocket(sf::SocketTCP Socket);
|
||||
void OnServerData(int sock, unsigned char data);
|
||||
void IsEveryoneReady();
|
||||
|
||||
NetPlay *m_netptr;
|
||||
NetEvent *Event;
|
||||
|
||||
u32 m_netvalues[3][3];
|
||||
bool m_data_received; // New Pad data received ?
|
||||
|
||||
unsigned char m_numplayers;
|
||||
int m_netmodel;
|
||||
std::string m_nick;
|
||||
|
||||
Clients m_client[3]; // Connected client objects
|
||||
sf::SelectorTCP m_selector;
|
||||
sf::SocketTCP m_socket; // Server 'listening' socket
|
||||
sf::SocketUDP m_socketUDP;
|
||||
|
||||
wxCriticalSection m_CriticalSection;
|
||||
};
|
||||
|
||||
class ClientSide : public wxThread
|
||||
{
|
||||
public:
|
||||
ClientSide(NetPlay* netptr, sf::SocketTCP, sf::SocketUDP, std::string addr, std::string nick);
|
||||
~ClientSide() {}
|
||||
|
||||
virtual void *Entry();
|
||||
|
||||
void Write(const char *data, size_t size, long *ping=NULL);
|
||||
void WriteUDP(const char *data, size_t size);
|
||||
bool isNewPadData(u32 *netValues, bool current, bool isVersus=true);
|
||||
|
||||
private:
|
||||
bool SyncValues();
|
||||
void CheckGameFound();
|
||||
void OnClientData(unsigned char data);
|
||||
bool RecvT(sf::SocketUDP Socket, char * Data, size_t Max, size_t& Recvd, float Time=0);
|
||||
|
||||
NetPlay *m_netptr;
|
||||
NetEvent *Event;
|
||||
|
||||
u32 m_netvalues[3][3];
|
||||
bool m_data_received; // New Pad data received ?
|
||||
|
||||
unsigned char m_numplayers;
|
||||
int m_netmodel;
|
||||
std::string m_nick;
|
||||
std::string m_hostnick;
|
||||
std::string m_selectedgame;
|
||||
|
||||
sf::SelectorTCP m_selector;
|
||||
sf::SocketTCP m_socket; // Client I/O socket
|
||||
sf::SocketUDP m_socketUDP;
|
||||
unsigned short m_port;
|
||||
std::string m_addr; // Contains the server addr
|
||||
|
||||
wxCriticalSection m_CriticalSection;
|
||||
};
|
||||
class ServerSide;
|
||||
class ClientSide;
|
||||
|
||||
class NetPlay : public wxFrame
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue