Make it compile. Network mode not working currently.
This commit is contained in:
+2
-1
@@ -89,7 +89,8 @@ HEADERS += \
|
|||||||
src/net/netpacket.h \
|
src/net/netpacket.h \
|
||||||
src/net/resolverthread.h \
|
src/net/resolverthread.h \
|
||||||
src/net/senderthread.h \
|
src/net/senderthread.h \
|
||||||
src/net/serverthread.h \
|
src/net/serveracceptthread.h \
|
||||||
|
src/net/serverlobbythread.h \
|
||||||
src/net/socket_helper.h \
|
src/net/socket_helper.h \
|
||||||
src/net/socket_msg.h \
|
src/net/socket_msg.h \
|
||||||
src/net/socket_startup.h \
|
src/net/socket_startup.h \
|
||||||
|
|||||||
+5
-4
@@ -56,7 +56,8 @@ HEADERS += \
|
|||||||
src/net/netpacket.h \
|
src/net/netpacket.h \
|
||||||
src/net/resolverthread.h \
|
src/net/resolverthread.h \
|
||||||
src/net/senderthread.h \
|
src/net/senderthread.h \
|
||||||
src/net/serverthread.h \
|
src/net/serveracceptthread.h \
|
||||||
|
src/net/serverlobbythread.h \
|
||||||
src/net/socket_helper.h \
|
src/net/socket_helper.h \
|
||||||
src/net/socket_msg.h \
|
src/net/socket_msg.h \
|
||||||
src/net/socket_startup.h \
|
src/net/socket_startup.h \
|
||||||
@@ -126,13 +127,13 @@ SOURCES += \
|
|||||||
src/net/common/resolverthread.cpp \
|
src/net/common/resolverthread.cpp \
|
||||||
src/net/common/senderthread.cpp \
|
src/net/common/senderthread.cpp \
|
||||||
src/net/common/sendercallback.cpp \
|
src/net/common/sendercallback.cpp \
|
||||||
src/net/common/serverthread.cpp \
|
|
||||||
src/net/common/servercontext.cpp \
|
src/net/common/servercontext.cpp \
|
||||||
src/net/common/serverexception.cpp \
|
src/net/common/serverexception.cpp \
|
||||||
src/net/common/serverrecvthread.cpp \
|
src/net/common/serveracceptthread.cpp \
|
||||||
src/net/common/serverrecvstate.cpp \
|
src/net/common/serverlobbythread.cpp \
|
||||||
src/net/common/servercallback.cpp \
|
src/net/common/servercallback.cpp \
|
||||||
src/net/common/sessiondata.cpp \
|
src/net/common/sessiondata.cpp \
|
||||||
|
src/net/common/sessionmanager.cpp \
|
||||||
src/net/common/socket_startup_cmn.cpp \
|
src/net/common/socket_startup_cmn.cpp \
|
||||||
src/net/common/socket_helper_cmn.cpp \
|
src/net/common/socket_helper_cmn.cpp \
|
||||||
src/net/common/clientexception.cpp \
|
src/net/common/clientexception.cpp \
|
||||||
|
|||||||
+2
-1
@@ -60,7 +60,8 @@ HEADERS += \
|
|||||||
src/net/netpacket.h \
|
src/net/netpacket.h \
|
||||||
src/net/resolverthread.h \
|
src/net/resolverthread.h \
|
||||||
src/net/senderthread.h \
|
src/net/senderthread.h \
|
||||||
src/net/serverthread.h \
|
src/net/serveracceptthread.h \
|
||||||
|
src/net/serverlobbythread.h \
|
||||||
src/net/socket_helper.h \
|
src/net/socket_helper.h \
|
||||||
src/net/socket_msg.h \
|
src/net/socket_msg.h \
|
||||||
src/net/socket_startup.h \
|
src/net/socket_startup.h \
|
||||||
|
|||||||
@@ -440,11 +440,11 @@ ClientStateWaitSession::InternalProcess(ClientThread &client, boost::shared_ptr<
|
|||||||
// Everything is fine - we are in the lobby.
|
// Everything is fine - we are in the lobby.
|
||||||
NetPacketInitAck::Data initAckData;
|
NetPacketInitAck::Data initAckData;
|
||||||
packet->ToNetPacketInitAck()->GetData(initAckData);
|
packet->ToNetPacketInitAck()->GetData(initAckData);
|
||||||
client.SetGuiPlayerId(initAckData.yourPlayerUniqueId);
|
client.SetGuiPlayerId(initAckData.playerId);
|
||||||
|
|
||||||
// Player number is 0 on init. Will be set when the game starts.
|
// Player number is 0 on init. Will be set when the game starts.
|
||||||
boost::shared_ptr<PlayerData> playerData(
|
boost::shared_ptr<PlayerData> playerData(
|
||||||
new PlayerData(initAckData.yourPlayerUniqueId, 0, PLAYER_TYPE_HUMAN, PLAYER_RIGHTS_NORMAL));
|
new PlayerData(initAckData.playerId, 0, PLAYER_TYPE_HUMAN, PLAYER_RIGHTS_NORMAL));
|
||||||
playerData->SetName(context.GetPlayerName());
|
playerData->SetName(context.GetPlayerName());
|
||||||
client.AddPlayerData(playerData);
|
client.AddPlayerData(playerData);
|
||||||
|
|
||||||
|
|||||||
@@ -17,10 +17,10 @@
|
|||||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
#include <net/serverthread.h>
|
#include <net/serveracceptthread.h>
|
||||||
#include <net/servercontext.h>
|
#include <net/servercontext.h>
|
||||||
#include <net/connectdata.h>
|
#include <net/connectdata.h>
|
||||||
#include <net/serverrecvthread.h>
|
#include <net/serverlobbythread.h>
|
||||||
#include <net/socket_helper.h>
|
#include <net/socket_helper.h>
|
||||||
#include <net/serverexception.h>
|
#include <net/serverexception.h>
|
||||||
#include <net/socket_msg.h>
|
#include <net/socket_msg.h>
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
#include <net/serverrecvthread.h>
|
#include <net/serverlobbythread.h>
|
||||||
#include <net/serverexception.h>
|
#include <net/serverexception.h>
|
||||||
#include <net/senderthread.h>
|
#include <net/senderthread.h>
|
||||||
#include <net/sendercallback.h>
|
#include <net/sendercallback.h>
|
||||||
|
|||||||
+3
-3
@@ -24,7 +24,7 @@
|
|||||||
#include <localenginefactory.h>
|
#include <localenginefactory.h>
|
||||||
#include <clientenginefactory.h>
|
#include <clientenginefactory.h>
|
||||||
#include <net/clientthread.h>
|
#include <net/clientthread.h>
|
||||||
#include <net/serverthread.h>
|
#include <net/serveracceptthread.h>
|
||||||
|
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
|
||||||
@@ -35,7 +35,7 @@ using namespace std;
|
|||||||
|
|
||||||
Session::Session(GuiInterface *g, ConfigFile *c)
|
Session::Session(GuiInterface *g, ConfigFile *c)
|
||||||
: currentGameID(0), myNetClient(0), myNetServer(0), myGui(g), myConfig(c)
|
: currentGameID(0), myNetClient(0), myNetServer(0), myGui(g), myConfig(c)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -164,7 +164,7 @@ void Session::startNetworkServer(const GameData &gameData)
|
|||||||
assert(false);
|
assert(false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
myNetServer = new ServerThread(*myGui, myConfig);
|
myNetServer = new ServerAcceptThread(*myGui, myConfig);
|
||||||
myNetServer->Init(
|
myNetServer->Init(
|
||||||
myConfig->readConfigInt("ServerPort"),
|
myConfig->readConfigInt("ServerPort"),
|
||||||
myConfig->readConfigInt("ServerUseIpv6") == 1,
|
myConfig->readConfigInt("ServerUseIpv6") == 1,
|
||||||
|
|||||||
+2
-2
@@ -29,7 +29,7 @@ class GuiInterface;
|
|||||||
class Game;
|
class Game;
|
||||||
class ConfigFile;
|
class ConfigFile;
|
||||||
class ClientThread;
|
class ClientThread;
|
||||||
class ServerThread;
|
class ServerAcceptThread;
|
||||||
|
|
||||||
class Session{
|
class Session{
|
||||||
public:
|
public:
|
||||||
@@ -70,7 +70,7 @@ private:
|
|||||||
int currentGameID;
|
int currentGameID;
|
||||||
|
|
||||||
ClientThread *myNetClient;
|
ClientThread *myNetClient;
|
||||||
ServerThread *myNetServer;
|
ServerAcceptThread *myNetServer;
|
||||||
|
|
||||||
boost::shared_ptr<Game> currentGame;
|
boost::shared_ptr<Game> currentGame;
|
||||||
GuiInterface *myGui;
|
GuiInterface *myGui;
|
||||||
|
|||||||
Reference in New Issue
Block a user