mirror of
https://github.com/glest/glest-source.git
synced 2025-08-12 11:24:00 +02:00
- a load of bugfixes including:
- proper handling of invalid client connects, after 6 bad attempts in a 60 second period of time the IP address is blocked from the current game - Added check for invalid particles for tileset objects - Made messagebox wider in game mod menu - Fixed numerous threading issues discovered while testing on my 8 core CPU - a Little bit of rendering cleanup
This commit is contained in:
@@ -50,6 +50,8 @@ protected:
|
||||
virtual void setQuitStatus(bool value);
|
||||
void deleteSelfIfRequired();
|
||||
|
||||
void *genericData;
|
||||
|
||||
public:
|
||||
BaseThread();
|
||||
virtual ~BaseThread();
|
||||
@@ -83,6 +85,11 @@ public:
|
||||
Mutex * getMutexThreadOwnerValid();
|
||||
|
||||
Mutex * getMutexThreadObjectAccessor() { return &mutexThreadObjectAccessor; }
|
||||
|
||||
template <typename T>
|
||||
T * getGenericData() { return genericData; }
|
||||
template <typename T>
|
||||
void setGenericData(T *value) { genericData = value; }
|
||||
};
|
||||
|
||||
class RunningStatusSafeWrapper {
|
||||
|
@@ -41,6 +41,11 @@ using Shared::Util::Checksum;
|
||||
|
||||
namespace Shared { namespace PlatformCommon {
|
||||
|
||||
#define STRINGIFY(x) #x
|
||||
#define TOSTRING(x) STRINGIFY(x)
|
||||
#define CODE_AT_LINE __FILE__ ":" TOSTRING(__LINE__)
|
||||
#define CODE_AT_LINE_X(x) __FILE__ ":" TOSTRING(__LINE__) ":" TOSTRING(x)
|
||||
|
||||
static const int IGNORE_CMD_RESULT_VALUE = -999999;
|
||||
|
||||
// keycode constants (unfortunately designed after DirectInput and therefore not
|
||||
|
@@ -69,6 +69,9 @@ public:
|
||||
class SimpleTaskCallbackInterface {
|
||||
public:
|
||||
virtual void simpleTask(BaseThread *callingThread) = 0;
|
||||
|
||||
virtual void setupTask(BaseThread *callingThread) {}
|
||||
virtual void shutdownTask(BaseThread *callingThread) {}
|
||||
};
|
||||
|
||||
class SimpleTaskThread : public BaseThread
|
||||
@@ -87,11 +90,12 @@ protected:
|
||||
time_t lastExecuteTimestamp;
|
||||
|
||||
public:
|
||||
SimpleTaskThread();
|
||||
SimpleTaskThread(SimpleTaskCallbackInterface *simpleTaskInterface,
|
||||
unsigned int executionCount=0,
|
||||
unsigned int millisecsBetweenExecutions=0,
|
||||
bool needTaskSignal = false);
|
||||
virtual ~SimpleTaskThread();
|
||||
|
||||
virtual void execute();
|
||||
virtual bool canShutdown(bool deleteSelfIfShutdownDelayed=false);
|
||||
|
||||
|
@@ -204,12 +204,17 @@ protected:
|
||||
class BroadCastSocketThread : public BaseThread
|
||||
{
|
||||
private:
|
||||
Mutex mutexPauseBroadcast;
|
||||
bool pauseBroadcast;
|
||||
|
||||
public:
|
||||
BroadCastSocketThread();
|
||||
virtual ~BroadCastSocketThread();
|
||||
virtual void execute();
|
||||
virtual bool canShutdown(bool deleteSelfIfShutdownDelayed=false);
|
||||
|
||||
bool getPauseBroadcast();
|
||||
void setPauseBroadcast(bool value);
|
||||
};
|
||||
|
||||
// =====================================================
|
||||
@@ -229,6 +234,7 @@ protected:
|
||||
virtual void UPNPInitStatus(bool result);
|
||||
BroadCastSocketThread *broadCastThread;
|
||||
void startBroadCastThread();
|
||||
void resumeBroadcast();
|
||||
bool isBroadCastThreadRunning();
|
||||
vector<string> blockIPList;
|
||||
|
||||
@@ -239,6 +245,8 @@ public:
|
||||
void listen(int connectionQueueSize= SOMAXCONN);
|
||||
Socket *accept();
|
||||
void stopBroadCastThread();
|
||||
void pauseBroadcast();
|
||||
|
||||
|
||||
void addIPAddressToBlockedList(string value);
|
||||
bool isIPAddressBlocked(string value) const;
|
||||
@@ -275,6 +283,7 @@ public:
|
||||
|
||||
static bool isUPNP;
|
||||
static bool enabledUPNP;
|
||||
static Mutex mutexUPNP;
|
||||
|
||||
static int upnp_init(void *param);
|
||||
|
||||
|
@@ -77,11 +77,14 @@ private:
|
||||
|
||||
class Mutex {
|
||||
private:
|
||||
|
||||
SDL_mutex* mutex;
|
||||
int refCount;
|
||||
string ownerId;
|
||||
string deleteownerId;
|
||||
|
||||
SDL_mutex* mutexAccessor;
|
||||
|
||||
public:
|
||||
Mutex(string ownerId="");
|
||||
~Mutex();
|
||||
|
Reference in New Issue
Block a user