fix Win32 errors, warnings
This commit is contained in:
@@ -32,7 +32,7 @@ NetworkSyncManager::~NetworkSyncManager ()
|
|||||||
delete NetPlayerClient;
|
delete NetPlayerClient;
|
||||||
}
|
}
|
||||||
|
|
||||||
int NetworkSyncManager::Connect(char * addy, int port)
|
int NetworkSyncManager::Connect(char * addy, unsigned short port)
|
||||||
{
|
{
|
||||||
if (port!=8765)
|
if (port!=8765)
|
||||||
return -1;
|
return -1;
|
||||||
@@ -48,7 +48,7 @@ int NetworkSyncManager::Connect(char * addy, int port)
|
|||||||
NetPlayerClient->create(); //Initilize Socket
|
NetPlayerClient->create(); //Initilize Socket
|
||||||
|
|
||||||
if(!NetPlayerClient->connect(addy,port)) {
|
if(!NetPlayerClient->connect(addy,port)) {
|
||||||
useSMserver = -1; //If connection to socket fails, tell
|
useSMserver = false; //If connection to socket fails, tell
|
||||||
//other network functions to not do anything
|
//other network functions to not do anything
|
||||||
} else {
|
} else {
|
||||||
useSMserver = 1; //Utilize other network funtions
|
useSMserver = 1; //Utilize other network funtions
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ public:
|
|||||||
|
|
||||||
void StartRequest(); //Request a start. Block until granted.
|
void StartRequest(); //Request a start. Block until granted.
|
||||||
|
|
||||||
int Connect(char * addy, int port);
|
int Connect(char * addy, unsigned short port);
|
||||||
//Connect to SM Server
|
//Connect to SM Server
|
||||||
|
|
||||||
int m_playerID; //these are currently unused, but need to stay
|
int m_playerID; //these are currently unused, but need to stay
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
#include "global.h"
|
||||||
/*******************************************
|
/*******************************************
|
||||||
ezsockets.cpp -- Header for sockets.cpp
|
ezsockets.cpp -- Header for sockets.cpp
|
||||||
Designed by Josh Allen and Charles
|
Designed by Josh Allen and Charles
|
||||||
@@ -49,7 +50,7 @@ int EzSockets::create() {
|
|||||||
return (true);
|
return (true);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool EzSockets::bind(int port) {
|
bool EzSockets::bind(unsigned short port) {
|
||||||
|
|
||||||
if (!check()) {
|
if (!check()) {
|
||||||
return false;
|
return false;
|
||||||
@@ -73,6 +74,7 @@ bool EzSockets::listen() {
|
|||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
typedef int socklen_t;
|
||||||
|
|
||||||
bool EzSockets::accept(EzSockets &socket) {
|
bool EzSockets::accept(EzSockets &socket) {
|
||||||
|
|
||||||
@@ -255,7 +257,7 @@ bool EzSockets::sendData(char data[1024], int size) {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool EzSockets::connect(std::string host, int port) {
|
bool EzSockets::connect(std::string host, unsigned short port) {
|
||||||
if (!check()) {
|
if (!check()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ class EzSockets {
|
|||||||
//Crate the socket
|
//Crate the socket
|
||||||
int create();
|
int create();
|
||||||
//Bind Socket to local port
|
//Bind Socket to local port
|
||||||
bool bind(int port);
|
bool bind(unsigned short port);
|
||||||
//Listen with socket
|
//Listen with socket
|
||||||
bool listen();
|
bool listen();
|
||||||
//Accept incomming socket
|
//Accept incomming socket
|
||||||
@@ -72,7 +72,7 @@ class EzSockets {
|
|||||||
bool send(int x);
|
bool send(int x);
|
||||||
//Connect to remote host
|
//Connect to remote host
|
||||||
//NOTE: YOU MUST PUT IN IP, NOT NAME
|
//NOTE: YOU MUST PUT IN IP, NOT NAME
|
||||||
bool connect(std::string host, int port);
|
bool connect(std::string host, unsigned short port);
|
||||||
|
|
||||||
long uAddr();
|
long uAddr();
|
||||||
//Kill socket
|
//Kill socket
|
||||||
|
|||||||
Reference in New Issue
Block a user