mirror of
https://github.com/glest/glest-source.git
synced 2025-08-29 19:00:07 +02:00
Removed fogofwar code that I had in my synch check logic from, long ago as it is no longer needed due to Silnarms new feature
This commit is contained in:
@@ -426,10 +426,10 @@ void MenuStateCustomGame::update()
|
|||||||
{
|
{
|
||||||
label = label + " techtree";
|
label = label + " techtree";
|
||||||
}
|
}
|
||||||
if(connectionSlot->getNetworkGameDataSynchCheckOkFogOfWar() == false)
|
//if(connectionSlot->getNetworkGameDataSynchCheckOkFogOfWar() == false)
|
||||||
{
|
//{
|
||||||
label = label + " FogOfWar == false";
|
// label = label + " FogOfWar == false";
|
||||||
}
|
//}
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -441,7 +441,8 @@ void MenuStateCustomGame::update()
|
|||||||
{
|
{
|
||||||
label = connectionSlot->getName();
|
label = connectionSlot->getName();
|
||||||
|
|
||||||
if(connectionSlot->getAllowGameDataSynchCheck() == true)
|
if(connectionSlot->getAllowGameDataSynchCheck() == true &&
|
||||||
|
connectionSlot->getNetworkGameDataSynchCheckOk() == false)
|
||||||
{
|
{
|
||||||
label += " - warning synch mismatch for:";
|
label += " - warning synch mismatch for:";
|
||||||
if(connectionSlot->getNetworkGameDataSynchCheckOkMap() == false)
|
if(connectionSlot->getNetworkGameDataSynchCheckOkMap() == false)
|
||||||
@@ -456,10 +457,10 @@ void MenuStateCustomGame::update()
|
|||||||
{
|
{
|
||||||
label = label + " techtree";
|
label = label + " techtree";
|
||||||
}
|
}
|
||||||
if(connectionSlot->getNetworkGameDataSynchCheckOkFogOfWar() == false)
|
//if(connectionSlot->getNetworkGameDataSynchCheckOkFogOfWar() == false)
|
||||||
{
|
//{
|
||||||
label = label + " FogOfWar == false";
|
// label = label + " FogOfWar == false";
|
||||||
}
|
//}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -285,10 +285,10 @@ void MenuStateJoinGame::update()
|
|||||||
{
|
{
|
||||||
label = label + " techtree";
|
label = label + " techtree";
|
||||||
}
|
}
|
||||||
if(clientInterface->getNetworkGameDataSynchCheckOkFogOfWar() == false)
|
//if(clientInterface->getNetworkGameDataSynchCheckOkFogOfWar() == false)
|
||||||
{
|
//{
|
||||||
label = label + " FogOfWar == false";
|
// label = label + " FogOfWar == false";
|
||||||
}
|
//}
|
||||||
}
|
}
|
||||||
else if(clientInterface->getAllowGameDataSynchCheck() == true)
|
else if(clientInterface->getAllowGameDataSynchCheck() == true)
|
||||||
{
|
{
|
||||||
@@ -322,10 +322,10 @@ void MenuStateJoinGame::update()
|
|||||||
{
|
{
|
||||||
label = label + " techtree";
|
label = label + " techtree";
|
||||||
}
|
}
|
||||||
if(clientInterface->getNetworkGameDataSynchCheckOkFogOfWar() == false)
|
//if(clientInterface->getNetworkGameDataSynchCheckOkFogOfWar() == false)
|
||||||
{
|
//{
|
||||||
label = label + " FogOfWar == false";
|
// label = label + " FogOfWar == false";
|
||||||
}
|
//}
|
||||||
}
|
}
|
||||||
else if(clientInterface->getAllowGameDataSynchCheck() == true)
|
else if(clientInterface->getAllowGameDataSynchCheck() == true)
|
||||||
{
|
{
|
||||||
|
@@ -43,7 +43,7 @@ ConnectionSlot::ConnectionSlot(ServerInterface* serverInterface, int playerIndex
|
|||||||
networkGameDataSynchCheckOkMap = false;
|
networkGameDataSynchCheckOkMap = false;
|
||||||
networkGameDataSynchCheckOkTile = false;
|
networkGameDataSynchCheckOkTile = false;
|
||||||
networkGameDataSynchCheckOkTech = false;
|
networkGameDataSynchCheckOkTech = false;
|
||||||
networkGameDataSynchCheckOkFogOfWar = false;
|
//networkGameDataSynchCheckOkFogOfWar = false;
|
||||||
|
|
||||||
chatText.clear();
|
chatText.clear();
|
||||||
chatSender.clear();
|
chatSender.clear();
|
||||||
@@ -71,7 +71,7 @@ void ConnectionSlot::update(bool checkForNewClients)
|
|||||||
if(networkGameDataSynchCheckOkMap) networkGameDataSynchCheckOkMap = false;
|
if(networkGameDataSynchCheckOkMap) networkGameDataSynchCheckOkMap = false;
|
||||||
if(networkGameDataSynchCheckOkTile) networkGameDataSynchCheckOkTile = false;
|
if(networkGameDataSynchCheckOkTile) networkGameDataSynchCheckOkTile = false;
|
||||||
if(networkGameDataSynchCheckOkTech) networkGameDataSynchCheckOkTech = false;
|
if(networkGameDataSynchCheckOkTech) networkGameDataSynchCheckOkTech = false;
|
||||||
if(networkGameDataSynchCheckOkFogOfWar) networkGameDataSynchCheckOkFogOfWar = false;
|
//if(networkGameDataSynchCheckOkFogOfWar) networkGameDataSynchCheckOkFogOfWar = false;
|
||||||
|
|
||||||
// Is the listener socket ready to be read?
|
// Is the listener socket ready to be read?
|
||||||
//if(serverInterface->getServerSocket()->isReadable() == true)
|
//if(serverInterface->getServerSocket()->isReadable() == true)
|
||||||
@@ -209,8 +209,8 @@ void ConnectionSlot::update(bool checkForNewClients)
|
|||||||
|
|
||||||
if( networkGameDataSynchCheckOkMap == true &&
|
if( networkGameDataSynchCheckOkMap == true &&
|
||||||
networkGameDataSynchCheckOkTile == true &&
|
networkGameDataSynchCheckOkTile == true &&
|
||||||
networkGameDataSynchCheckOkTech == true &&
|
networkGameDataSynchCheckOkTech == true) // &&
|
||||||
networkGameDataSynchCheckOkFogOfWar == true)
|
//networkGameDataSynchCheckOkFogOfWar == true)
|
||||||
{
|
{
|
||||||
SystemFlags::OutputDebug(SystemFlags::debugNetwork,"In [%s::%s] client data synch ok\n",__FILE__,__FUNCTION__);
|
SystemFlags::OutputDebug(SystemFlags::debugNetwork,"In [%s::%s] client data synch ok\n",__FILE__,__FUNCTION__);
|
||||||
}
|
}
|
||||||
@@ -347,10 +347,12 @@ void ConnectionSlot::close()
|
|||||||
SystemFlags::OutputDebug(SystemFlags::debugNetwork,"In [%s::%s] END\n",__FILE__,__FUNCTION__);
|
SystemFlags::OutputDebug(SystemFlags::debugNetwork,"In [%s::%s] END\n",__FILE__,__FUNCTION__);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
bool ConnectionSlot::getFogOfWar()
|
bool ConnectionSlot::getFogOfWar()
|
||||||
{
|
{
|
||||||
return networkGameDataSynchCheckOkFogOfWar;
|
return networkGameDataSynchCheckOkFogOfWar;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
bool ConnectionSlot::hasValidSocketId()
|
bool ConnectionSlot::hasValidSocketId()
|
||||||
{
|
{
|
||||||
|
68
source/glest_game/network/connection_slot.h
Normal file
68
source/glest_game/network/connection_slot.h
Normal file
@@ -0,0 +1,68 @@
|
|||||||
|
// ==============================================================
|
||||||
|
// This file is part of Glest (www.glest.org)
|
||||||
|
//
|
||||||
|
// Copyright (C) 2001-2008 Martio Figueroa
|
||||||
|
//
|
||||||
|
// You can redistribute this code and/or modify it under
|
||||||
|
// the terms of the GNU General Public License as published
|
||||||
|
// by the Free Software Foundation; either version 2 of the
|
||||||
|
// License, or (at your option) any later version
|
||||||
|
// ==============================================================
|
||||||
|
|
||||||
|
#ifndef _GLEST_GAME_CONNECTIONSLOT_H_
|
||||||
|
#define _GLEST_GAME_CONNECTIONSLOT_H_
|
||||||
|
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
|
#include "socket.h"
|
||||||
|
|
||||||
|
#include "network_interface.h"
|
||||||
|
|
||||||
|
using Shared::Platform::ServerSocket;
|
||||||
|
using Shared::Platform::Socket;
|
||||||
|
using std::vector;
|
||||||
|
|
||||||
|
namespace Glest{ namespace Game{
|
||||||
|
|
||||||
|
class ServerInterface;
|
||||||
|
|
||||||
|
// =====================================================
|
||||||
|
// class ConnectionSlot
|
||||||
|
// =====================================================
|
||||||
|
|
||||||
|
class ConnectionSlot: public NetworkInterface{
|
||||||
|
private:
|
||||||
|
ServerInterface* serverInterface;
|
||||||
|
Socket* socket;
|
||||||
|
int playerIndex;
|
||||||
|
string name;
|
||||||
|
bool ready;
|
||||||
|
vector<std::pair<string,int32> > vctFileList;
|
||||||
|
bool receivedNetworkGameStatus;
|
||||||
|
|
||||||
|
public:
|
||||||
|
ConnectionSlot(ServerInterface* serverInterface, int playerIndex);
|
||||||
|
~ConnectionSlot();
|
||||||
|
|
||||||
|
void update(bool checkForNewClients);
|
||||||
|
virtual void update();
|
||||||
|
|
||||||
|
void setReady() {ready= true;}
|
||||||
|
const string &getName() const {return name;}
|
||||||
|
bool isReady() const {return ready;}
|
||||||
|
|
||||||
|
virtual Socket* getSocket() {return socket;}
|
||||||
|
virtual Socket* getSocket() const {return socket;}
|
||||||
|
|
||||||
|
virtual void close();
|
||||||
|
//virtual bool getFogOfWar();
|
||||||
|
|
||||||
|
bool getReceivedNetworkGameStatus() { return receivedNetworkGameStatus; }
|
||||||
|
void setReceivedNetworkGameStatus(bool value) { receivedNetworkGameStatus = value; }
|
||||||
|
|
||||||
|
bool hasValidSocketId();
|
||||||
|
};
|
||||||
|
|
||||||
|
}}//end namespace
|
||||||
|
|
||||||
|
#endif
|
@@ -1,7 +1,7 @@
|
|||||||
// ==============================================================
|
// ==============================================================
|
||||||
// This file is part of Glest (www.glest.org)
|
// This file is part of Glest (www.glest.org)
|
||||||
//
|
//
|
||||||
// Copyright (C) 2001-2008 Marti<EFBFBD>o Figueroa
|
// Copyright (C) 2001-2008 Martio Figueroa
|
||||||
//
|
//
|
||||||
// You can redistribute this code and/or modify it under
|
// You can redistribute this code and/or modify it under
|
||||||
// the terms of the GNU General Public License as published
|
// the terms of the GNU General Public License as published
|
||||||
@@ -48,7 +48,7 @@ protected:
|
|||||||
bool networkGameDataSynchCheckOkMap;
|
bool networkGameDataSynchCheckOkMap;
|
||||||
bool networkGameDataSynchCheckOkTile;
|
bool networkGameDataSynchCheckOkTile;
|
||||||
bool networkGameDataSynchCheckOkTech;
|
bool networkGameDataSynchCheckOkTech;
|
||||||
bool networkGameDataSynchCheckOkFogOfWar;
|
//bool networkGameDataSynchCheckOkFogOfWar;
|
||||||
|
|
||||||
string chatText;
|
string chatText;
|
||||||
string chatSender;
|
string chatSender;
|
||||||
@@ -86,15 +86,15 @@ public:
|
|||||||
static void setAllowGameDataSynchCheck(bool value) { allowGameDataSynchCheck = value; }
|
static void setAllowGameDataSynchCheck(bool value) { allowGameDataSynchCheck = value; }
|
||||||
static bool getAllowGameDataSynchCheck() { return allowGameDataSynchCheck; }
|
static bool getAllowGameDataSynchCheck() { return allowGameDataSynchCheck; }
|
||||||
|
|
||||||
virtual bool getNetworkGameDataSynchCheckOk() { return (networkGameDataSynchCheckOkMap && networkGameDataSynchCheckOkTile && networkGameDataSynchCheckOkTech && networkGameDataSynchCheckOkFogOfWar); }
|
virtual bool getNetworkGameDataSynchCheckOk() { return (networkGameDataSynchCheckOkMap && networkGameDataSynchCheckOkTile && networkGameDataSynchCheckOkTech); }
|
||||||
virtual void setNetworkGameDataSynchCheckOkMap(bool value) { networkGameDataSynchCheckOkMap = value; }
|
virtual void setNetworkGameDataSynchCheckOkMap(bool value) { networkGameDataSynchCheckOkMap = value; }
|
||||||
virtual void setNetworkGameDataSynchCheckOkTile(bool value) { networkGameDataSynchCheckOkTile = value; }
|
virtual void setNetworkGameDataSynchCheckOkTile(bool value) { networkGameDataSynchCheckOkTile = value; }
|
||||||
virtual void setNetworkGameDataSynchCheckOkTech(bool value) { networkGameDataSynchCheckOkTech = value; }
|
virtual void setNetworkGameDataSynchCheckOkTech(bool value) { networkGameDataSynchCheckOkTech = value; }
|
||||||
virtual bool getNetworkGameDataSynchCheckOkMap() { return networkGameDataSynchCheckOkMap; }
|
virtual bool getNetworkGameDataSynchCheckOkMap() { return networkGameDataSynchCheckOkMap; }
|
||||||
virtual bool getNetworkGameDataSynchCheckOkTile() { return networkGameDataSynchCheckOkTile; }
|
virtual bool getNetworkGameDataSynchCheckOkTile() { return networkGameDataSynchCheckOkTile; }
|
||||||
virtual bool getNetworkGameDataSynchCheckOkTech() { return networkGameDataSynchCheckOkTech; }
|
virtual bool getNetworkGameDataSynchCheckOkTech() { return networkGameDataSynchCheckOkTech; }
|
||||||
virtual bool getNetworkGameDataSynchCheckOkFogOfWar() { return networkGameDataSynchCheckOkFogOfWar; }
|
//virtual bool getNetworkGameDataSynchCheckOkFogOfWar() { return networkGameDataSynchCheckOkFogOfWar; }
|
||||||
virtual void setNetworkGameDataSynchCheckOkFogOfWar(bool value) { networkGameDataSynchCheckOkFogOfWar = value; }
|
//virtual void setNetworkGameDataSynchCheckOkFogOfWar(bool value) { networkGameDataSynchCheckOkFogOfWar = value; }
|
||||||
|
|
||||||
const string getChatText() const {return chatText;}
|
const string getChatText() const {return chatText;}
|
||||||
const string getChatSender() const {return chatSender;}
|
const string getChatSender() const {return chatSender;}
|
||||||
|
Reference in New Issue
Block a user