Browse Source

3D Server Update Defender proto

AGP
Gagua on MyIR master 7 years ago
parent
commit
53e7461cbc
  1. 36
      lib/alg/lgs/mask.h
  2. 5
      lib/data/protocol/protocolDefender.cpp

36
lib/alg/lgs/mask.h

@ -5,12 +5,8 @@
#include "../../hardware/soc/general/3DLRF.h"
#include "../../components/base/basicLogCollection.h"
#if defined( WIN32 ) || defined( __GUI__ )
#include "../../gui/gui.h"
#endif
typedef struct{
#if defined( __linux__ ) && !defined( __GUI__ )
typedef struct{
private:
int16_t m_x;
int16_t m_y;
@ -24,24 +20,26 @@ typedef struct{
int16_t x( void ){ return m_x; };
int16_t y( void ){ return m_y; };
} simplePoint;
#if defined( WIN32 ) || defined( __GUI__ )
} simplePoint;
typedef struct{
uint8_t color[3];
QPoint *points;
simplePoint *points;
uint16_t count;
} simplePolygone;
typedef std::vector<simplePolygone *> vectorMasking;
typedef std::vector<QPolygon *> vectorQPoly;
typedef std::vector<simplePolygone *> vectorQPoly;
#else
typedef struct{
#include "../../gui/gui.h"
typedef QPoint simplePoint;
typedef QPolygon simplePolygone;
typedef struct{
uint8_t color[3];
simplePoint *points;
QPoint *points;
uint16_t count;
} simplePolygone;
typedef std::vector<simplePolygone *> vectorMasking;
typedef std::vector<QPolygon *> vectorQPoly;
#endif
typedef struct{
@ -66,18 +64,16 @@ class ShadowMask{
bool m_bActive;
vectorMasking m_vVectorMask;
bool m_bRasterized;
#if defined( WIN32 ) || defined( __GUI__ )
#if defined( __linux__ ) && !defined( __GUI__ )
CSTR m_pRasterFileName;
CSTR m_pVertexFileName;
#endif
public:
ShadowMask();
~ShadowMask();
#if defined( WIN32 ) || defined( __GUI__ )
#if defined( __linux__ ) && !defined( __GUI__ )
bool loadRastered(CSTR fName = NULL);
bool saveRastered(CSTR fName = NULL);
#endif
#if defined( __linux__ ) && !defined( __GUI__ )
bool saveVertexes(CSTR fName = NULL);
bool loadVertexes(CSTR fName = NULL);
#endif
@ -89,10 +85,10 @@ class ShadowMask{
bool deletePoly( int ID );
uint8_t getPolyCount( void ){ return ( m_vVectorMask.size() & 0xFF ); };
uint16_t getRayCount( void ){ return ( m_vZoneMask.size() & 0xFFFF ); };
#if defined( WIN32 ) || defined( __GUI__ )
#if defined( __linux__ ) && !defined( __GUI__ )
bool rasterizeVertexes( void );
bool getQPoly( vectorQPoly &VM );
bool addVertex( uint16_t polyID, QPoint SP );
bool addVertex( uint16_t polyID, simplePoint SP );
bool addVertex( uint16_t polyID, uint32_t SP ); // Binary Data to Vertex
#endif
bool isOutside( uint16_t x, uint16_t y );

5
lib/data/protocol/protocolDefender.cpp

@ -1,6 +1,7 @@
#include "protocolDefender.h"
#include "../../alg/generic/md5.h"
#include "../json/json_tool.h"
#include <strings.h>
#include <json/value.h>
#include <json/writer.h>
#include <json/reader.h>
@ -760,13 +761,13 @@ bool protocolDefender::packetHandler( protocolPackage *Package ){
#ifdef DEBUG
LOG("MITIGATION MESSAGE!");
#endif
if (stricmp(tVal.asString().c_str(), "ARM") == 0) {
if ( strcasecmp(tVal.asString().c_str(), "ARM") == 0) {
#ifdef DEBUG
LOG("ARM!");
#endif
m_bMitigationStatus = true;
};
if (stricmp(tVal.asString().c_str(), "DISARM") == 0) {
if ( strcasecmp(tVal.asString().c_str(), "DISARM") == 0) {
#ifdef DEBUG
LOG("DISARM!");
#endif

Loading…
Cancel
Save