Fixed PSP compilation by stubbing the socket implementation. Somebody with a PSP, please replace this code with a real implementation.
This commit is contained in:
@@ -5,6 +5,8 @@
|
|||||||
#include "Threading.h"
|
#include "Threading.h"
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
|
#define SERVER_PORT 5001
|
||||||
|
|
||||||
class JSocket{
|
class JSocket{
|
||||||
public:
|
public:
|
||||||
typedef enum {
|
typedef enum {
|
||||||
@@ -19,10 +21,11 @@ public:
|
|||||||
} SOCKET_STATE;
|
} SOCKET_STATE;
|
||||||
|
|
||||||
|
|
||||||
// Server creation
|
|
||||||
JSocket(string ipAddr);
|
|
||||||
// Client creation
|
// Client creation
|
||||||
|
JSocket(string ipAddr);
|
||||||
|
// Server creation
|
||||||
JSocket();
|
JSocket();
|
||||||
|
|
||||||
~JSocket();
|
~JSocket();
|
||||||
|
|
||||||
JSocket* Accept();
|
JSocket* Accept();
|
||||||
@@ -41,7 +44,7 @@ private:
|
|||||||
// socket handle
|
// socket handle
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
SOCKET mfd;
|
SOCKET mfd;
|
||||||
#elif LINUX
|
#elif LINUX || PSP
|
||||||
int mfd;
|
int mfd;
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -188,11 +188,7 @@ void JNetwork::ThreadProc(void* param)
|
|||||||
pThis->toSend.str("");
|
pThis->toSend.str("");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#ifdef LINUX
|
|
||||||
boost::this_thread::sleep(boost::posix_time::milliseconds(1));
|
boost::this_thread::sleep(boost::posix_time::milliseconds(1));
|
||||||
#elif WIN32
|
|
||||||
// boost::this_thread::sleep(boost::posix_time::microseconds(10));
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
DebugTrace("Quitting Thread");
|
DebugTrace("Quitting Thread");
|
||||||
@@ -209,7 +205,7 @@ int JNetwork::connect(const string& ip)
|
|||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
int JNetwork::connect(string serverIP){
|
int JNetwork::connect(const string& serverIP){
|
||||||
#ifdef NETWORK_SUPPORT
|
#ifdef NETWORK_SUPPORT
|
||||||
int err;
|
int err;
|
||||||
char buffer[4096];
|
char buffer[4096];
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
#if 0
|
|
||||||
// need a complete rewrite to comply to the new interface
|
// need a complete rewrite to comply to the new interface
|
||||||
#ifdef NETWORK_SUPPORT
|
#ifdef NETWORK_SUPPORT
|
||||||
|
|
||||||
@@ -21,23 +20,21 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "../include/JGE.h"
|
#include "../include/JGE.h"
|
||||||
|
|
||||||
#include "../include/JSocket.h"
|
#include "../include/JSocket.h"
|
||||||
JSocket * JSocket::mInstance = NULL;
|
|
||||||
|
|
||||||
#define SERVER_PORT 20666
|
JSocket::JSocket(){
|
||||||
|
|
||||||
int JSocket::connected = 0;
|
|
||||||
|
|
||||||
void JSocket::init(){
|
|
||||||
#ifdef NETWORK_SUPPORT
|
#ifdef NETWORK_SUPPORT
|
||||||
sceUtilityLoadNetModule(1);
|
sceUtilityLoadNetModule(1);
|
||||||
sceUtilityLoadNetModule(3);
|
sceUtilityLoadNetModule(3);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
JSocket::JSocket(){
|
JSocket::JSocket(string ipAddr)
|
||||||
init();
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
JSocket::JSocket(int fd)
|
||||||
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
JSocket::~JSocket(){
|
JSocket::~JSocket(){
|
||||||
@@ -48,7 +45,27 @@ JSocket::~JSocket(){
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void JSocket::Disconnect()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
JSocket* JSocket::Accept()
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int JSocket::Read(char* buff, int size)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int JSocket::Write(char* buff, int size)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#if 0
|
||||||
int JSocket::make_socket(uint16_t port)
|
int JSocket::make_socket(uint16_t port)
|
||||||
{
|
{
|
||||||
int sock = -1;
|
int sock = -1;
|
||||||
|
|||||||
@@ -16,11 +16,6 @@
|
|||||||
|
|
||||||
#include "../../include/JSocket.h"
|
#include "../../include/JSocket.h"
|
||||||
#include "../../include/DebugRoutines.h"
|
#include "../../include/DebugRoutines.h"
|
||||||
//JSocket * JSocket::mInstance = NULL;
|
|
||||||
|
|
||||||
//#define SERVER_PORT 20666
|
|
||||||
#define SERVER_PORT 5001
|
|
||||||
unsigned char ADRESSE_IP_SERVEUR [4] = {127,0,0,1};
|
|
||||||
|
|
||||||
|
|
||||||
JSocket::JSocket(string ipAddr)
|
JSocket::JSocket(string ipAddr)
|
||||||
|
|||||||
@@ -51,8 +51,8 @@ GameState::GameState(GameApp* parent, string id) :
|
|||||||
GameApp::GameApp() :
|
GameApp::GameApp() :
|
||||||
JApp()
|
JApp()
|
||||||
#ifdef NETWORK_SUPPORT
|
#ifdef NETWORK_SUPPORT
|
||||||
,mpNetwork(NULL)
|
|
||||||
, mServerAddress("")
|
, mServerAddress("")
|
||||||
|
, mpNetwork(NULL)
|
||||||
#endif //NETWORK_SUPPORT
|
#endif //NETWORK_SUPPORT
|
||||||
{
|
{
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
|
|||||||
Reference in New Issue
Block a user