// ################################
// ##           Protokol         ##
// ##                            ##
// ################################

#pragma once
#ifndef PROTOCOL_H
#define PROTOCOL_H

#include "common.h"

#include <string>
#include <map>
#include <list>
#include <utility>
#include <vector>

#include "datetime.h"
#include "mathfunc.h"

// ################################

enum messageType 
{
	MT_REQUEST,
	MT_ANSWER,
	MT_UPDATE,
	MT_UNDEFINED   // nepouzivat, vrati to tohle pouze pri chybe
};

// ################################

enum answerKind {
	AK_OK,
	AK_FAIL,
	AK_UNDEFINED
};

// ################################

class protocolWriter
{
private:
	messageType type_;
	std :: string output_;
public:
	void beginMessage(messageType type, const std :: string& requestName);
	void writeValue(const std :: string& valueName, const std :: string& value);
	void writeValue(const std :: string& valueName, const char* value);
    void writeValue(const std :: string& valueName, double value);
	void writeValue(const std :: string& valueName, unsigned long long value);
	void writeValue(const std :: string& valueName, unsigned long value);
	void writeValue(const std :: string& valueName, signed long long value);
	void writeValue(const std :: string& valueName, signed long value);
	void writeValue(const std::string &valueName, bool value);
	const char* endMessage(bool answerOK = false);
	char* copyMessage(void);
};

// ################################

class protocolReader;

class message 
{
private:
	messageType type_;
	std :: string name_;
	answerKind ak_;
	std :: map<std :: string, std :: string> values;
public:
	message(messageType type, const std :: string& name, answerKind ak) 
							{ type_ = type; name_ = name; ak_ = ak; };
	messageType          getType(void)             { return type_;            }
	const std :: string& getRequestName(void)      { return name_;            }
	answerKind           getAnswerKind(void)       { return ak_;              }
	std :: map<std :: string, std :: string>&
		                 getValues(void)           { return values; }

	friend class protocolReader;
};

// ################################

class protocolReader
{
private:
	std :: string scannedToken_;
	const char* msg_;
public:
	message* translateMessage(const char* msg);
	bool scanToken(void);
	bool scanChars(int size);
};

// ################################

/* jednotlive zpravy */
#define BAD_REQUEST_MESSAGE          "badrequest"
#define BAD_REQUEST_MESSAGE_NAME     "request"

#define REQUEST_PING                                                "ping"
#define REQUEST_LOGIN                                               "login"
#define REQUEST_CHAT                                                "chat"
#define REQUEST_BUDDY                                               "buddy"
#define REQUEST_SHIPS                                               "ships"
#define REQUEST_BASES                                               "bases"
#define REQUEST_PLANETS                                             "planets"
#define REQUEST_SHIPSINAREA                                         "shipsinarea"

#define REQUEST_SHIPSINAREA_SHIPID                                  "ownshipid"

#define REQUEST_SHIPSINAREA_ANSWER_FAIL                             "fail"
#define REQUEST_SHIPSINAREA_ANSWER_OWNSHIPID                        "ownshipid"
#define REQUEST_SHIPSINAREA_ANSWER_NOTEXIST                         "SHIP_NOT_EXIST"        /* lod s danym id neexistuje */
#define REQUEST_SHIPSINAREA_ANSWER_NOTOWN                           "NOT_OWN_THIS_SHIP"     /* lod s danym id nevlastni hrac */
#define REQUEST_SHIPSINAREA_ANSWER_WARP                             "SHIP_IN_WARP"          /* lod je ve warpu a nelze splnit pozadavek */
#define REQUEST_SHIPSINAREA_ANSWER_IE                               "INTERNAL_ERROR"        /* interni chyba serveru */

#define REQUEST_SHIPSINAREA_ANSWER_LR_COUNT                         "longRangeDetectedCount"
#define REQUEST_SHIPSINAREA_ANSWER_LR_POSX                          "longRangeDetectedPosX"
#define REQUEST_SHIPSINAREA_ANSWER_LR_POSY                          "longRangeDetectedPosY"
#define REQUEST_SHIPSINAREA_ANSWER_LR_SHIPID                        "longRangeDetectedShipID"

#define REQUEST_SHIPSINAREA_ANSWER_HR_COUNT                         "highResolutionDetectedCount"
#define REQUEST_SHIPSINAREA_ANSWER_HR_POSX                          "highResolutionDetectedPosX"
#define REQUEST_SHIPSINAREA_ANSWER_HR_POSY                          "highResolutionDetectedPosY"
#define REQUEST_SHIPSINAREA_ANSWER_HR_SHIPID                        "highResolutionDetectedShipID"
#define REQUEST_SHIPSINAREA_ANSWER_HR_PLAYERNAME                    "highResolutionDetectedPlayerName"
#define REQUEST_SHIPSINAREA_ANSWER_HR_SHIPNAME                      "highResolutionDetectedShipName"
#define REQUEST_SHIPSINAREA_ANSWER_HR_SPEED                         "highResolutionDetectedSpeed"
#define REQUEST_SHIPSINAREA_ANSWER_HR_ACCELERATION                  "highResolutionDetectedAcceleration"
#define REQUEST_SHIPSINAREA_ANSWER_HR_COURSEX                       "highResolutionDetectedCourseX"
#define REQUEST_SHIPSINAREA_ANSWER_HR_COURSEY                       "highResolutionDetectedCourseY"
#define REQUEST_SHIPSINAREA_ANSWER_HR_SHIPCLASS                     "highResolutionDetectedShipClass"
#define REQUEST_SHIPSINAREA_ANSWER_HR_ORBITING                      "highResolutionDetectedOrbiting"
#define REQUEST_SHIPSINAREA_ANSWER_HR_ORBITING_PIVOT_X              "highResolutionDetectedOrbitingPivotX"
#define REQUEST_SHIPSINAREA_ANSWER_HR_ORBITING_PIVOT_Y              "highResolutionDetectedOrbitingPivotY"
#define REQUEST_SHIPSINAREA_ANSWER_HR_ORBITING_VELOCITY             "highResolutionDetectedOrbitingVelocity"
#define REQUEST_SHIPSINAREA_ANSWER_HR_QUARRYING                     "highResolutionDetectedQuarrying"
#define REQUEST_SHIPSINAREA_ANSWER_HR_TARGET                        "highResolutionDetectedTarget"
#define REQUEST_SHIPSINAREA_ANSWER_HR_TARGET_IS_SHIP				"highResolutionDetectedTargetIsShip" //NEW: pridano M.R.
#define REQUEST_SHIPSINAREA_ANSWER_HR_INBASE                        "highResolutionInBase"
#define REQUEST_SHIPSINAREA_ANSWER_HR_INWARP                        "highResolutionInWarp"
#define REQUEST_SHIPSINAREA_ANSWER_HR_INNORMALSPACE                 "highResolutionInNormalSpace"
#define REQUEST_SHIPSINAREA_ANSWER_HR_WARP_PIVOT_X                  "highResolutionWarpPivotX"
#define REQUEST_SHIPSINAREA_ANSWER_HR_WARP_PIVOT_Y                  "highResolutionWarpPivotY"
#define REQUEST_SHIPSINAREA_ANSWER_HR_BASE_PIVOT_X                  "highResolutionBasePivotX"
#define REQUEST_SHIPSINAREA_ANSWER_HR_BASE_PIVOT_Y                  "highResolutionBasePivotY"


#define REQUEST_SHIPSINAREA_ANSWER_OWN_COUNT                        "ownDetectedCount"
#define REQUEST_SHIPSINAREA_ANSWER_OWN_POSX                         "ownDetectedPosX"
#define REQUEST_SHIPSINAREA_ANSWER_OWN_POSY                         "ownDetectedPosY"
#define REQUEST_SHIPSINAREA_ANSWER_OWN_SHIPID                       "ownDetectedShipID"
#define REQUEST_SHIPSINAREA_ANSWER_OWN_PLAYERNAME                   "ownDetectedPlayerName"
#define REQUEST_SHIPSINAREA_ANSWER_OWN_SHIPNAME                     "ownDetectedShipName"
#define REQUEST_SHIPSINAREA_ANSWER_OWN_SPEED                        "ownDetectedSpeed"
#define REQUEST_SHIPSINAREA_ANSWER_OWN_ACCELERATION                 "ownDetectedAcceleration"
#define REQUEST_SHIPSINAREA_ANSWER_OWN_COURSEX                      "ownDetectedCourseX"
#define REQUEST_SHIPSINAREA_ANSWER_OWN_COURSEY                      "ownDetectedCourseY"
#define REQUEST_SHIPSINAREA_ANSWER_OWN_SHIPCLASS                    "ownDetectedShipClass"
#define REQUEST_SHIPSINAREA_ANSWER_OWN_ESTIMATION_DISTANCE          "ownDetectedTargetEstimationDistance"
#define REQUEST_SHIPSINAREA_ANSWER_OWN_STRUCT_INT_PERC              "ownDetectedStructuralIntegrityPerc"
#define REQUEST_SHIPSINAREA_ANSWER_OWN_SHIELD_PERC                  "ownDetectedShieldPerc"
#define REQUEST_SHIPSINAREA_ANSWER_OWN_ORBITING                     "ownDetectedOrbiting"
#define REQUEST_SHIPSINAREA_ANSWER_OWN_ORBITING_PIVOT_X             "ownDetectedOrbitingPivotX"
#define REQUEST_SHIPSINAREA_ANSWER_OWN_ORBITING_PIVOT_Y             "ownDetectedOrbitingPivotY"
#define REQUEST_SHIPSINAREA_ANSWER_OWN_ORBITING_VELOCITY            "ownDetectedOrbitingVelocity"
#define REQUEST_SHIPSINAREA_ANSWER_OWN_QUARRYING                    "ownDetectedQuarrying"
#define REQUEST_SHIPSINAREA_ANSWER_OWN_TARGET                       "ownDetectedTarget"
#define REQUEST_SHIPSINAREA_ANSWER_OWN_TARGET_IS_SHIP               "ownDetectedTargetIsShip"

#define REQUEST_SHIPSINAREA_ANSWER_OWN_INBASE                       "ownDetectedInBase"
#define REQUEST_SHIPSINAREA_ANSWER_OWN_INWARP                       "ownDetectedInWarp"
#define REQUEST_SHIPSINAREA_ANSWER_OWN_INNORMALSPACE                "ownDetectedInNormalSpace"
#define REQUEST_SHIPSINAREA_ANSWER_OWN_WARP_PIVOT_X                 "ownDetectedWarpPivotX"
#define REQUEST_SHIPSINAREA_ANSWER_OWN_WARP_PIVOT_Y                 "ownDetectedWarpPivotY"
#define REQUEST_SHIPSINAREA_ANSWER_OWN_BASE_PIVOT_X                 "ownDetectedBasePivotX"
#define REQUEST_SHIPSINAREA_ANSWER_OWN_BASE_PIVOT_Y                 "ownDetectedBasePivotY"

#define REQUEST_LOGIN_LOGINNAME                                     "player_login"
#define REQUEST_LOGIN_PASSWORD                                      "player_password"

#define REQUEST_LOGIN_ANSWER_FAIL_REASON                            "fail"
#define REQUEST_LOGIN_ANSWER_BAD_LOGIN                              "BAD_LOGIN"             /* hrac zadal spatny login */
#define REQUEST_LOGIN_ANSWER_BAD_PASSWORD                           "BAD_PASSWORD"          /* hrac zadal spatne heslo */
#define REQUEST_LOGIN_ANSWER_ALREADY_AUTHORIZED                     "ALREADY_AUTHORIZED"    /* hrac je uz prihlasen (ne nutne ze stejneho pc) */

#define REQUEST_CHAT_RECIPIENT                                      "recipient"
#define REQUEST_CHAT_MESSAGE                                        "message"

#define REQUEST_CHAT_ANSWER_SENDER                                  "sender"
#define REQUEST_CHAT_ANSWER_RECIPIENT                               REQUEST_CHAT_RECIPIENT
#define REQUEST_CHAT_ANSWER_MESSAGE                                 REQUEST_CHAT_MESSAGE
#define REQUEST_CHAT_ANSWER_TIMEFLAG                                "timeflag"

#define REQUEST_BUDDY_ANSWER_COUNT                                  "buddycnt"
#define REQUEST_BUDDY_ANSWER_IDPREFIX                               "buddyid"
#define REQUEST_BUDDY_ANSWER_NAMEPREFIX                             "buddyname"

#define REQUEST_SHIPS_ANSWER_COUNT                                  "shipscnt"
#define REQUEST_SHIPS_ANSWER_SHIPID                                 "shipid"
#define REQUEST_SHIPS_ANSWER_SHIPNAME                               "shipname"
#define REQUEST_SHIPS_ANSWER_SHIPCLASS                              "shipClass"
#define REQUEST_SHIPS_ANSWER_CAN_BE_UNBOUNDED						"canBeUnbounded"

#define REQUEST_BASES_ANSWER_COUNT                                  "basescnt"
#define REQUEST_BASES_ANSWER_BASEID                                 "baseid"
#define REQUEST_BASES_ANSWER_BASENAME                               "basename"
#define REQUEST_BASES_ANSWER_BASECLASS                              "baseClass"
#define REQUEST_BASES_ANSWER_BASETEXTURE                            "baseTexture"

#define REQUEST_PLANETS_AREAID                                      "areaid"
#define REQUEST_PLANETS_ANSWER_COUNT                                "count"
#define REQUEST_PLANETS_ANSWER_PLANETID                             "planetid"
#define REQUEST_PLANETS_ANSWER_PIVOTX                               "pivotx"
#define REQUEST_PLANETS_ANSWER_PIVOTY                               "pivoty"
#define REQUEST_PLANETS_ANSWER_SPEED                                "speed"
#define REQUEST_PLANETS_ANSWER_RADIUS                               "radius"
#define REQUEST_PLANETS_ANSWER_SIZE                                 "planetsize"
#define REQUEST_PLANETS_ANSWER_ANGLE                                "angle"
#define REQUEST_PLANETS_ANSWER_WEIGHT                               "weight"
#define REQUEST_PLANETS_ANSWER_YEARP                                "yearperiod"
#define REQUEST_PLANETS_ANSWER_DAYP                                 "dayperiod"
#define REQUEST_PLANETS_ANSWER_TYPE                                 "planettype"
#define REQUEST_PLANETS_ANSWER_DAYTEMP                              "daytemperature"
#define REQUEST_PLANETS_ANSWER_NIGHTTEMP                            "nighttemperature"
#define REQUEST_PLANETS_ANSWER_SEA                                  "sea"
#define REQUEST_PLANETS_ANSWER_HEWA                                 "heavywater"
#define REQUEST_PLANETS_ANSWER_ZISO                                 "zirconium"
#define REQUEST_PLANETS_ANSWER_ILSO                                 "ilmenite"
#define REQUEST_PLANETS_ANSWER_NAME                                 "planetName"
#define REQUEST_PLANETS_ANSWER_TEXTURE                              "texture"
#define REQUEST_PLANETS_ANSWER_TARGET_CNT                           "targetCnt"
#define REQUEST_PLANETS_ANSWER_TARGET                               "target"
#define REQUEST_PLANETS_ANSWER_TARGET_IS_SHIP						"targetIsShip" //NEW: pridano M.R.

#define REQUEST_PLANETS_ANSWER_SUN_OBJ_RADIUS                       "sunObjRadius"
#define REQUEST_PLANETS_ANSWER_SUN_ARE_RADIUS                       "starSystemAreaRadius"
#define REQUEST_PLANETS_ANSWER_SUN_NAME                             "sunName"
#define REQUEST_PLANETS_ANSWER_SUN_WEIGHT                           "sunWeight"
#define REQUEST_PLANETS_ANSWER_SUN_TYPE                             "sunType"
#define REQUEST_PLANETS_ANSWER_GAMETIME                             "gametime"

#define REQUEST_PLANETS_BAD_ANSWER_TYPE                             "fail"
#define REQUEST_PLANETS_BAD_ANSWER_BADAREAID                        "badareaid"

#define REQUEST_PLANETS_BAD_ANSWER_NOT_EXISTS                       "AREA_NOT_EXISTS"       /* dana oblast neexistuje */
#define REQUEST_PLANETS_BAD_ANSWER_NOT_STAR                         "AREA_NOT_STAR"         /* dany vesmirny objekt neni hvezda */
#define REQUEST_PLANETS_BAD_ANSWER_IE                               "INTERNAL_ERROR"        /* interni chyba serveru */

#define REQUEST_NAVIGATION_STOP                                     "navigationSTOP"
#define REQUEST_NAVIGATION_WARP                                     "navigationWARP"
#define REQUEST_NAVIGATION_MOVE_TO                                  "navigationMOVETO"
#define REQUEST_NAVIGATION_ORBIT                                    "navigationORBIT"
#define REQUEST_NAVIGATION_PURSUIT                                  "navigationPURSUIT"
#define REQUEST_NAVIGATION_MOVE_TO_SPOBJ                            "navigationMOVETOSPACEOBJECT"
#define REQUEST_NAVIGATION_BREAK_WARP                               "navigationBREAKWARP"
#define REQUEST_NAVIGATION_MOVE_TO_SPOBJ_BY_WARP                    "navigationMOVETOSPACEOBJECTBYWARP"

#define REQUEST_NAVIGATION_SHIPID                                   "shipid"
#define REQUEST_NAVIGATION_POSITIONX                                "positionx"
#define REQUEST_NAVIGATION_POSITIONY                                "positiony"
#define REQUEST_NAVIGATION_TARGET                                   "target"
#define REQUEST_NAVIGATION_SPACEOBJECT                              "spaceobject"
#define REQUEST_NAVIGATION_ENGINELIMIT                              "engineLimit"

#define REQUEST_NAVIGATION_ANSWER_FAIL                              "reason"
#define REQUEST_NAVIGATION_ANSWER_NOT_EXISTS                        "SHIP_NOT_EXISTS"       /* lod neexistuje */
#define REQUEST_NAVIGATION_ANSWER_NOT_OWNED                         "SHIP_NOT_OWNED"        /* lod nepatri hraci, ktery vznesl pozadavek */
#define REQUEST_NAVIGATION_ANSWER_IN_WARP                           "SHIP_IN_WARP"          /* lod je ve warpu, nelze splnit dany pozadavek */
#define REQUEST_NAVIGATION_ANSWER_NOT_IN_WARP                       "SHIP_NOT_IN_WARP"      /* lod neni ve warpu, nelze splnit dany pozadavek */
#define REQUEST_NAVIGATION_ANSWER_IN_BASE                           "DOCKED_IN_BASE"        /* lod pristala na zakladne */
#define REQUEST_NAVIGATION_ANSWER_BAD_TARGET1                       "TARGET_NOT_IN_NORMAL_SPACE"    /* cilova lod neni na zakladne */
#define REQUEST_NAVIGATION_ANSWER_BAD_TARGET2                       "TARGET_NOT_EXISTS"             /* cilovy objekt navigace neexistuje */
#define REQUEST_NAVIGATION_ANSWER_NOT_CONTROLLABLE					"NOT_CONTROLLABLE"		/* lod neni kontrolovatelna */
#define REQUEST_NAVIGATION_ANSWER_SHIPID                            "shipid"

#define REQUEST_SHIP_JOURNEY_DETAILS                                "journeyDetails"

#define REQUEST_SHIP_JOURNEY_DETAILS_SHIPID                         "shipid"

#define REQUEST_SHIP_JOURNEY_ANSWER_SHIPID                          "shipid"
#define REQUEST_SHIP_JOURNEY_ANSWER_POSX                            "posx"
#define REQUEST_SHIP_JOURNEY_ANSWER_POSY                            "posy"
#define REQUEST_SHIP_JOURNEY_ANSWER_DPOSX                           "dposx"
#define REQUEST_SHIP_JOURNEY_ANSWER_DPOSY                           "dposy"
#define REQUEST_SHIP_JOURNEY_ANSWER_TARGET                          "target"
#define REQUEST_SHIP_JOURNEY_ANSWER_STATE                           "state"
#define REQUEST_SHIP_JOURNEY_ANSWER_TARGETSHIP                      "targetship"
#define REQUEST_SHIP_JOURNEY_ANSWER_ESTDIST                         "estimationDistance"
#define REQUEST_SHIP_JOURNEY_ANSWER_ESTTIME                         "estimationTime"
#define REQUEST_SHIP_JOURNEY_ANSWER_TARGETSPACEOJBECT               "targetSpaceObject"
#define REQUEST_SHIP_JOURNEY_ANSWER_TARGETNAME                      "targetName"
#define REQUEST_SHIP_JOURNEY_ANSWER_SPEED                           "shipSpeed"
#define REQUEST_SHIP_JOURNEY_ANSWER_ACCELERATION                    "shipAcceleration"
#define REQUEST_SHIP_JOURNEY_ANSWER_DOCKED_IN_BASE					"dockedInBase"
#define REQUEST_SHIP_JOURNEY_ANSWER_DOCKING_RESULT				    "dockingResult"

#define REQUEST_SHIP_JOURNEY_ANSWER_FAIL                            "reason"
#define REQUEST_SHIP_JOURNEY_ANSWER_SHIPNE                          "SHIP_NOT_EXISTS"               /* dana lod neexistuje */
#define REQUEST_SHIP_JOURNEY_ANSWER_SHIPNO                          "SHIP_NOT_OWNED"                /* hrac nevlastni danou lod */
#define REQUEST_SHIP_JOURNEY_ANSWER_BADSPOBJ                        "SPACE_OBJECT_DOES_NOT_EXIST"   /* vesmirny objekt s danym id neexistuje */

#define REQUEST_SHIP_JOURNEY_ANSWER_SMT_MOVE_TO_SPACE_OBJECT        "SMT_MOVE_TO_SPACE_OBJECT"
#define REQUEST_SHIP_JOURNEY_ANSWER_SMT_MOVE_TO_POSITION            "SMT_MOVE_TO_POSITION"
#define REQUEST_SHIP_JOURNEY_ANSWER_SMT_ORBIT                       "SMT_ORBIT"
#define REQUEST_SHIP_JOURNEY_ANSWER_SMT_NONE                        "SMT_NONE"
#define REQUEST_SHIP_JOURNEY_ANSWER_SMT_MOVE_TO_SHIP                "SMT_MOVE_TO_SHIP"
#define REQUEST_SHIP_JOURNEY_ANSWER_SMT_STOP                        "SMT_STOP"

#define REQUEST_SHIP_JOURNEY_ANSWER_SMS_REGULAR                     "SMS_REGULAR"
#define REQUEST_SHIP_JOURNEY_ANSWER_SMS_STOPPED                     "SMS_STOPPED"
#define REQUEST_SHIP_JOURNEY_ANSWER_SMS_WARP                        "SMS_WARP"
#define REQUEST_SHIP_JOURNEY_ANSWER_SMS_ORBITING                    "SMS_ORBITING"

#define REQUEST_NAVIGATION_DOCK_DOWN								"navigation_dock_down"
#define REQUEST_NAVIGATION_DOCK_DOWN_SHIP_ID						"navigation_dock_down_ship_id"
#define REQUEST_NAVIGATION_DOCK_DOWN_BASE_ID						"navigation_dock_down_base_id"

#define REQUEST_NAVIGATION_DOCK_DOWN_ANSWER_SHIP_ID					"navigation_dock_down_answer_ship_id"
#define REQUEST_NAVIGATION_DOCK_DOWN_ANSWER_BASE_ID					"navigation_dock_down_answer_base_id"
#define REQUEST_NAVIGATION_DOCK_DOWN_ANSWER_DOCKING_RESULT			"navigation_dock_down_answer_docking_result"

#define	REQUEST_NAVIGATION_UNBOUND									"navigation_unbound"
#define REQUEST_NAVIGATION_UNBOUND_SHIP_ID							"navigation_unbound_ship_id"

#define REQUEST_NAVIGATION_UNBOUND_ANSWER_SHIP_ID					"navigation_unbound_answer_ship_id"
#define REQUEST_NAVIGATION_UNBOUND_ANSWER_DOCKING_RESULT			"navigation_unbound_answer_docking_result"

// ################################

/* UKAZKA POUZITI:
  
    char* msg = requestWriter :: login("Jakub", "moje tajne heslo");

    v msg je nyni nove naalokovany string se zpravou (POZOR, uvolni si ho pak sam!)

*/

// ################################

#define REQUEST_DEVICE_ENERGY_STATE                                 "energyStateDetails"
#define REQUEST_DEVICE_ENERGY_STATE_FORTRESSID                      "energyStateFORTRESSID"

struct answerDeviceEnergyState
{
	unsigned char      priority;
	unsigned int       ratio;
	double             maxPowerDrain;
	bool               shutDownOnEnergyLack;
    double             consumption;
	double             maxMaxPowerDrain;
};

// ################################

#define REQUEST_DEVICE_ENERGY_ANSWER_FORTRESSNE                     "FORTRESS_NOT_EXISTS"       /* dana zakladna/lod neexistuje */
#define REQUEST_DEVICE_ENERGY_ANSWER_FORTRESSNO                     "FORTRESS_NOT_OWNED"        /* hrac nevlastni danou lod/zakladnu */

#define REQUEST_DEVICE_ENERGY_STATE_ANSWER_FORTRESSID               "energyStateFORTRESSID"
#define REQUEST_DEVICE_ENERGY_STATE_ANSWER_FAIL_REASON              "reason"

#define REQUEST_DEVICE_ENERGY_STATE_ANSWER_SHIELDS                  "SHIELDS"
#define REQUEST_DEVICE_ENERGY_STATE_ANSWER_WEAPONS                  "WEAPONS"
#define REQUEST_DEVICE_ENERGY_STATE_ANSWER_TRANSPORT                "TRANSPORT"
#define REQUEST_DEVICE_ENERGY_STATE_ANSWER_HR_SENSORS               "HRSENSORS"
#define REQUEST_DEVICE_ENERGY_STATE_ANSWER_LR_SENSORS               "LRSENSORS"
#define REQUEST_DEVICE_ENERGY_STATE_ANSWER_MASKING                  "MASKING"
#define REQUEST_DEVICE_ENERGY_STATE_ANSWER_ANDROIDS                 "ANDROIDS"
#define REQUEST_DEVICE_ENERGY_STATE_ANSWER_MAINFRAME                "MAINFRAME"
#define REQUEST_DEVICE_ENERGY_STATE_ANSWER_LIFE_SUPPORT             "LIFESUPPORT"

#define REQUEST_DEVICE_ENERGY_STATE_ANSWER_ES_PRIORITY              "escPriority"
#define REQUEST_DEVICE_ENERGY_STATE_ANSWER_ES_RATIO                 "escRatio"
#define REQUEST_DEVICE_ENERGY_STATE_ANSWER_ES_MAX_POWER_DRAIN       "escMaxPowerDrain"
#define REQUEST_DEVICE_ENERGY_STATE_ANSWER_ES_MAX_MAX_POWER_DRAIN	"escMaxMaxPowerDrain"
#define REQUEST_DEVICE_ENERGY_STATE_ANSWER_ES_SHUT_DOWN_ON_EL       "escShutDownOnEnergyLack"
#define REQUEST_DEVICE_ENERGY_STATE_ANSWER_ES_CONSUMPTION           "escConsumption"

#define REQUEST_DEVICE_ENERGY_STATE_ANSWER_ACC_CURR_ENERGY          "accumulatorCurrentEnergy"
#define REQUEST_DEVICE_ENERGY_STATE_ANSWER_CURR_ENERGY              "totalCurrentEnergy"
#define REQUEST_DEVICE_ENERGY_STATE_ANSWER_ACC_MAX_ENERGY           "accumulatorMaximalEnergy"
#define REQUEST_DEVICE_ENERGY_STATE_ANSWER_MAX_ENERGY               "totalMaximalEnergy"
#define REQUEST_DEVICE_ENERGY_STATE_ANSWER_MIN_ENERGY_PRIORITY      "minEnergyPriority"
#define REQUEST_DEVICE_ENERGY_STATE_ANSWER_MAX_ENERGY_PRIORITY      "maxEnergyPriority"
#define REQUEST_DEVICE_ENERGY_STATE_ANSWER_MIN_MAX_ENERGY           "minMaxEnergy"
#define REQUEST_DEVICE_ENERGY_STATE_ANSWER_MIN_RATIO                "minRatio"
#define REQUEST_DEVICE_ENERGY_STATE_ANSWER_MAX_RATIO                "maxRatio"
#define REQUEST_DEVICE_ENERGY_STATE_ANSWER_ACCUMULATOR_GRADIENT		"accumulatorGradient"
#define REQUEST_DEVICE_ENERGY_STATE_ANSWER_TOTAL_ENERGY_GRADIENT	"totalEnergyGradient"

// ################################

struct WarpInfo
{
	long shipId;

    double  sposX;
    double  sposY;
	double	posX;
	double  posY;
	double  dstPosX;
	double	dstPosY;
	bool	stateChange; //true if warp->normal or normal->warp status was changed
	bool	inWarp;
    dist_t  speed;

	std::string shipName;
	unsigned long shipType;
};

#define REQUEST_SHIPWARPINFO									"shipWarpInfo"
#define REQUEST_SHIPWARPINFO_ANSWER_ID							"shipid"
#define REQUEST_SHIPWARPINFO_ANSWER_SPOSX						"sposx"
#define REQUEST_SHIPWARPINFO_ANSWER_SPOSY						"sposy"
#define REQUEST_SHIPWARPINFO_ANSWER_POSX						"posx"
#define REQUEST_SHIPWARPINFO_ANSWER_POSY						"posy"
#define REQUEST_SHIPWARPINFO_ANSWER_DPOSX						"dposx"
#define REQUEST_SHIPWARPINFO_ANSWER_DPOSY						"dposy"
#define REQUEST_SHIPWARPINFO_ANSWER_STATECHANGE					"stateChange"
#define REQUEST_SHIPWARPINFO_ANSWER_IN_WARP						"inWarp"
#define REQUEST_SHIPWARPINFO_ANSWER_SPEED						"speed"
#define REQUEST_SHIPWARPINFO_ANSWER_NAME						"shipName"
#define REQUEST_SHIPWARPINFO_ANSWER_TYPE						"shipType"

#define REQUEST_SHIPWARPINFO_ANSWER_NOT_EXISTS                  "SHIP_NOT_EXISTS"       /* lod neexistuje */
#define REQUEST_SHIPWARPINFO_ANSWER_NOT_OWNED                   "SHIP_NOT_OWNED"        /* lod nepatri hraci, ktery vznesl pozadavek */
#define REQUEST_SHIPWARPINFO_ANSWER_NOT_CONTROLLABLE			"NOT_CONTROLLABLE"		/* lod neni kontrolovatelna */
#define REQUEST_SHIPWARPINFO_ANSWER_FAIL                        "failReason"

// ################################

struct answerDeviceEnergy
{
    unsigned long long ACC_CURR_ENERGY;
    unsigned long long CURR_ENERGY;
    unsigned long long ACC_MAX_ENERGY;
    unsigned long long MAX_ENERGY;
    unsigned long long MIN_ENERGY_PRIORITY;  
    unsigned long long MAX_ENERGY_PRIORITY;    
    unsigned long long MIN_RATIO;
    unsigned long long MAX_RATIO;
	double MIN_MAX_ENERGY;

    answerDeviceEnergyState SHIELDS;
    answerDeviceEnergyState WEAPONS;
    answerDeviceEnergyState TRANSPORT;
    answerDeviceEnergyState HR_SENSORS;
    answerDeviceEnergyState LR_SENSORS;
    answerDeviceEnergyState MASKING;
    answerDeviceEnergyState ANDROIDS;
    answerDeviceEnergyState MAINFRAME;
    answerDeviceEnergyState LIFE_SUPPORT;

	double accumulatorGradient;
	double totalEnergyGradient;
};

// ################################

struct requestDeviceEnergyState
{
	unsigned char      priority;
	unsigned int       ratio;
	double             maxPowerDrain;
	bool               shutDownOnEnergyLack;
};

// ################################

struct requestDeviceEnergy
{
    requestDeviceEnergyState SHIELDS;
    requestDeviceEnergyState WEAPONS;
    requestDeviceEnergyState TRANSPORT;
    requestDeviceEnergyState HR_SENSORS;
    requestDeviceEnergyState LR_SENSORS;
    requestDeviceEnergyState MASKING;
    requestDeviceEnergyState ANDROIDS;
    requestDeviceEnergyState MAINFRAME;
    requestDeviceEnergyState LIFE_SUPPORT;
};

// ################################

#define REQUEST_CHANGE_DEVICE_ENERGY_ANSWER_FORTRESSNE                     "FORTRESS_NOT_EXISTS"    /* dana zakladna/lod neexistuje */
#define REQUEST_CHANGE_DEVICE_ENERGY_ANSWER_FORTRESSNO                     "FORTRESS_NOT_OWNED"     /* hrac nevlastni danou lod/zakladnu */

#define REQUEST_CHANGE_DEVICE_ENERGY_STATE                                 "energyStateChange"

#define REQUEST_CHANGE_DEVICE_ENERGY_STATE_ANSWER_FORTRESSID               "requestEnergyStateSHIPID"
#define REQUEST_CHANGE_DEVICE_ENERGY_STATE_ANSWER_FAIL_REASON              "reason"

#define REQUEST_CHANGE_DEVICE_ENERGY_STATE_CHANGE_SHIELDS                  "SHIELDS"
#define REQUEST_CHANGE_DEVICE_ENERGY_STATE_CHANGE_WEAPONS                  "WEAPONS"
#define REQUEST_CHANGE_DEVICE_ENERGY_STATE_CHANGE_TRANSPORT                "TRANSPORT"
#define REQUEST_CHANGE_DEVICE_ENERGY_STATE_CHANGE_HR_SENSORS               "HRSENSORS"
#define REQUEST_CHANGE_DEVICE_ENERGY_STATE_CHANGE_LR_SENSORS               "LRSENSORS"
#define REQUEST_CHANGE_DEVICE_ENERGY_STATE_CHANGE_MASKING                  "MASKING"
#define REQUEST_CHANGE_DEVICE_ENERGY_STATE_CHANGE_ANDROIDS                 "ANDROIDS"
#define REQUEST_CHANGE_DEVICE_ENERGY_STATE_CHANGE_MAINFRAME                "MAINFRAME"
#define REQUEST_CHANGE_DEVICE_ENERGY_STATE_CHANGE_LIFE_SUPPORT             "LIFESUPPORT"

#define REQUEST_CHANGE_DEVICE_ENERGY_STATE_CHANGE_ES_PRIORITY              "escPriority"
#define REQUEST_CHANGE_DEVICE_ENERGY_STATE_CHANGE_ES_RATIO                 "escRatio"
#define REQUEST_CHANGE_DEVICE_ENERGY_STATE_CHANGE_ES_MAX_POWER_DRAIN       "escMaxPowerDrain"
#define REQUEST_CHANGE_DEVICE_ENERGY_STATE_CHANGE_ES_SHUT_DOWN_ON_EL       "escShutDownOnEnergyLack"

#define REQUEST_CHANGE_DEVICE_ENERGY_STATE_ANSWER_SHIELDS                  "SHIELDS"
#define REQUEST_CHANGE_DEVICE_ENERGY_STATE_ANSWER_WEAPONS                  "WEAPONS"
#define REQUEST_CHANGE_DEVICE_ENERGY_STATE_ANSWER_TRANSPORT                "TRANSPORT"
#define REQUEST_CHANGE_DEVICE_ENERGY_STATE_ANSWER_HR_SENSORS               "HRSENSORS"
#define REQUEST_CHANGE_DEVICE_ENERGY_STATE_ANSWER_LR_SENSORS               "LRSENSORS"
#define REQUEST_CHANGE_DEVICE_ENERGY_STATE_ANSWER_MASKING                  "MASKING"
#define REQUEST_CHANGE_DEVICE_ENERGY_STATE_ANSWER_ANDROIDS                 "ANDROIDS"
#define REQUEST_CHANGE_DEVICE_ENERGY_STATE_ANSWER_MAINFRAME                "MAINFRAME"
#define REQUEST_CHANGE_DEVICE_ENERGY_STATE_ANSWER_LIFE_SUPPORT             "LIFESUPPORT"

#define REQUEST_CHANGE_DEVICE_ENERGY_STATE_ANSWER_ES_PRIORITY              "escPriority"
#define REQUEST_CHANGE_DEVICE_ENERGY_STATE_ANSWER_ES_RATIO                 "escRatio"
#define REQUEST_CHANGE_DEVICE_ENERGY_STATE_ANSWER_ES_MAX_POWER_DRAIN       "escMaxPowerDrain"
#define REQUEST_CHANGE_DEVICE_ENERGY_STATE_ANSWER_ES_SHUT_DOWN_ON_EL       "escShutDownOnEnergyLack"
#define REQUEST_CHANGE_DEVICE_ENERGY_STATE_ANSWER_ES_CONSUMPTION           "escConsumption"

#define REQUEST_CHANGE_DEVICE_ENERGY_STATE_ANSWER_ACC_CURR_ENERGY          "accumulatorCurrentEnergy"
#define REQUEST_CHANGE_DEVICE_ENERGY_STATE_ANSWER_CURR_ENERGY              "totalCurrentEnergy"
#define REQUEST_CHANGE_DEVICE_ENERGY_STATE_ANSWER_ACC_MAX_ENERGY           "accumulatorMaximalEnergy"
#define REQUEST_CHANGE_DEVICE_ENERGY_STATE_ANSWER_MAX_ENERGY               "totalMaximalEnergy"
#define REQUEST_CHANGE_DEVICE_ENERGY_STATE_ANSWER_MIN_ENERGY_PRIORITY      "minEnergyPriority"
#define REQUEST_CHANGE_DEVICE_ENERGY_STATE_ANSWER_MAX_ENERGY_PRIORITY      "maxEnergyPriority"
#define REQUEST_CHANGE_DEVICE_ENERGY_STATE_ANSWER_MIN_MAX_ENERGY           "minMaxEnergy"
#define REQUEST_CHANGE_DEVICE_ENERGY_STATE_ANSWER_MAX_MAX_ENERGY           "maxMaxEnergy"
#define REQUEST_CHANGE_DEVICE_ENERGY_STATE_ANSWER_MIN_RATIO                "minRatio"
#define REQUEST_CHANGE_DEVICE_ENERGY_STATE_ANSWER_MAX_RATIO                "maxRatio"

// ################################

void writeDateTime(protocolWriter& pw, const std :: string& prefix, dv_time:: datetime dt);

// ################################

#define REQUEST_NAVIGATION_STATUS                                          "navigationStatus"
#define REQUEST_NAVIGATION_STATUS_SHIPID                                   "shipid"

#define REQUEST_NAVIGATION_STATUS_ANSWER_MYSHIPCOUNT                       "myShipCount"
#define REQUEST_NAVIGATION_STATUS_ANSWER_MYSHIPID                          "myShipId"
#define REQUEST_NAVIGATION_STATUS_ANSWER_MYSHIPNAME                        "myShipName"
#define REQUEST_NAVIGATION_STATUS_ANSWER_MYSHIPDISTANCE                    "myShipDistance"

#define REQUEST_NAVIGATION_STATUS_ANSWER_MYBASECOUNT                        "myBaseCount"
#define REQUEST_NAVIGATION_STATUS_ANSWER_MYBASEID                           "myBaseId"
#define REQUEST_NAVIGATION_STATUS_ANSWER_MYBASENAME                         "myBaseName"
#define REQUEST_NAVIGATION_STATUS_ANSWER_MYBASEDISTANCE                     "myBaseDistance"
#define REQUEST_NAVIGATION_STATUS_ANSWER_CAN_SHIP_DOCK_DOWN					"canShipDockDown"

#define REQUEST_NAVIGATION_STATUS_ANSWER_DISCOVERED_STAR_COUNT             "discoveredStarCnt"
#define REQUEST_NAVIGATION_STATUS_ANSWER_DISCOVERED_STAR_NAME              "discoveredStarName"
#define REQUEST_NAVIGATION_STATUS_ANSWER_DISCOVERED_STAR_ID                "discoveredStarId"
#define REQUEST_NAVIGATION_STATUS_ANSWER_DISCOVERED_STAR_DISTANCE          "discoveredStarDistance"

#define REQUEST_NAVIGATION_STATUS_ANSWER_LR_COUNT                         "longRangeDetectedCount"
#define REQUEST_NAVIGATION_STATUS_ANSWER_LR_POSX                          "longRangeDetectedPosX"
#define REQUEST_NAVIGATION_STATUS_ANSWER_LR_POSY                          "longRangeDetectedPosY"
#define REQUEST_NAVIGATION_STATUS_ANSWER_LR_SHIPID                        "longRangeDetectedShipID"
#define REQUEST_NAVIGATION_STATUS_ANSWER_LR_DISTANCE                      "longRangeDetectedShipDistance"

#define REQUEST_NAVIGATION_STATUS_ANSWER_HR_COUNT                         "highResolutionDetectedCount"
#define REQUEST_NAVIGATION_STATUS_ANSWER_HR_POSX                          "highResolutionDetectedPosX"
#define REQUEST_NAVIGATION_STATUS_ANSWER_HR_POSY                          "highResolutionDetectedPosY"
#define REQUEST_NAVIGATION_STATUS_ANSWER_HR_SHIPID                        "highResolutionDetectedShipID"
#define REQUEST_NAVIGATION_STATUS_ANSWER_HR_PLAYERNAME                    "highResolutionDetectedPlayerName"
#define REQUEST_NAVIGATION_STATUS_ANSWER_HR_SHIPNAME                      "highResolutionDetectedShipName"
#define REQUEST_NAVIGATION_STATUS_ANSWER_HR_SPEED                         "highResolutionDetectedSpeed"
#define REQUEST_NAVIGATION_STATUS_ANSWER_HR_ACCELERATION                  "highResolutionDetectedAcceleration"
#define REQUEST_NAVIGATION_STATUS_ANSWER_HR_COURSEX                       "highResolutionDetectedCourseX"
#define REQUEST_NAVIGATION_STATUS_ANSWER_HR_COURSEY                       "highResolutionDetectedCourseY"
#define REQUEST_NAVIGATION_STATUS_ANSWER_HR_SHIPCLASS                     "highResolutionDetectedShipClass"
#define REQUEST_NAVIGATION_STATUS_ANSWER_HR_DISTANCE                      "highResolutionDetectedDistance"


// ################################

#define UPDATE_AREA                                                        "updateAREA"
#define UPDATE_AREA_STAR_ID                                                "starid"

#define UPDATE_SHIP                                                        "updateSHIP"
#define UPDATE_SHIP_ID                                                     "updateSHIPid"

#define UPDATE_FORTRESS														"UPDATE_FORTRESS"
#define UPDATE_FORTRESS_FORTRESS_ID											"UPDATE_FORTRESS_FORTRESS_ID"

// ################################

struct sciencetree_raw_data
{
    unsigned long tokensSCIENCE_ENTITY_SHIPS;
    unsigned long tokensSCIENCE_ENTITY_BASES;
    unsigned long tokensSCIENCE_ENTITY_ENERGETIC_ACCUMULATOR;
    unsigned long tokensSCIENCE_ENTITY_NAVIGATION_COMPUTER;
    unsigned long tokensSCIENCE_ENTITY_QUARK_GLUON_CORE;
    unsigned long tokensSCIENCE_ENTITY_SUBSPACE_BEACON;
    unsigned long tokensSCIENCE_ENTITY_INERTIAL_DAMPERS;
    unsigned long tokensSCIENCE_ENTITY_IMPULS_JET_ENGINE;
    unsigned long tokensSCIENCE_ENTITY_MECHANICAL_DAMPERS;
    unsigned long tokensSCIENCE_ENTITY_DEFLECTOR_SHIELDS;
    unsigned long tokensSCIENCE_ENTITY_WEAPON_ENERGY_CIRCUIT;
    unsigned long tokensSCIENCE_ENTITY_DRONE_MISSILE_LAUNCHER;
    unsigned long tokensSCIENCE_ENTITY_DRONE_MISSILES;
    unsigned long tokensSCIENCE_ENTITY_LASER_GUN;
    unsigned long tokensSCIENCE_ENTITY_TRANSPORT_BEAM_GENERATOR;
    unsigned long tokensSCIENCE_ENTITY_MAGNETICAL_COLLECTORS_OF_PLASMA;
    unsigned long tokensSCIENCE_ENTITY_SUBMERSIBLE_FILTRATION_TANK;
    unsigned long tokensSCIENCE_ENTITY_SUBMARINE_MINING_MACHINE;
    unsigned long tokensSCIENCE_ENTITY_UNDERGROUND_DRILLING_MACHINE;
    unsigned long tokensSCIENCE_ENTITY_PROBE;
    unsigned long tokensSCIENCE_ENTITY_HIGH_RESOLUTION_SENSORS;
    unsigned long tokensSCIENCE_ENTITY_LONG_RANGE_SENSORS;
    unsigned long tokensSCIENCE_ENTITY_CLOAKING_DEVICE;
    unsigned long tokensSCIENCE_ENTITY_ANDROIDS;
    unsigned long tokensSCIENCE_ENTITY_SCIENTIFIC_LAB;
    unsigned long tokensSCIENCE_ENTITY_LIFE_SUPPORT;
    unsigned long tokensSCIENCE_ENTITY_MAINFRAME;
    unsigned long tokensSCIENCE_ENTITY_HANGAR;
    unsigned long tokensSCIENCE_ENTITY_MAGNETICAL_FILTER;
    unsigned long tokensSCIENCE_ENTITY_DEUTERIUM_DECOMPOSER;
    unsigned long tokensSCIENCE_ENTITY_ZIRCONIUM_REACTOR;
    unsigned long tokensSCIENCE_ENTITY_ILMENITE_FURNACE;

    unsigned long tokensSCIENCE_SUPREME_ENTITY_SCIENCE;

    unsigned long tokensSCIENCE_SUPREME_ENTITY_DRIVE;
    unsigned long tokensSCIENCE_SUPREME_ENTITY_PLATFORM;
    unsigned long tokensSCIENCE_SUPREME_ENTITY_MODULES;
    unsigned long tokensSCIENCE_SUPREME_ENTITY_PRODUCTION;

    unsigned long tokensSCIENCE_SUPREME_ENTITY_SUBSPACE_DRIVE;
    unsigned long tokensSCIENCE_SUPREME_ENTITY_IMPULS_DRIVE;
    unsigned long tokensSCIENCE_SUPREME_ENTITY_CONSTRUCTION;
    unsigned long tokensSCIENCE_SUPREME_ENTITY_EQUIPMENT;
    unsigned long tokensSCIENCE_SUPREME_ENTITY_ENERGETIC_RING;
    unsigned long tokensSCIENCE_SUPREME_ENTITY_RECOGNITION_DEVICES;
    unsigned long tokensSCIENCE_SUPREME_ENTITY_FACTORIES;
    unsigned long tokensSCIENCE_SUPREME_ENTITY_QUARRYING_MACHINES;

    unsigned long specPtsQUARK_GLUON_CORE_SPEED;
    unsigned long specPtsQUARK_GLUON_CORE_CONSUMPTION;

    unsigned long specPtsNAVIGATION_COMPUTER_SPEED;

    unsigned long specPtsSUBSPACE_BEACON_SPEED;

    unsigned long specPtsINERTIAL_DAMPERS_SPEED;

    unsigned long specPtsIMPULS_ENGINE_FORCE;
    unsigned long specPtsIMPULS_ENGINE_CONSUMPTION;

    unsigned long specPtsMECHANICAL_DAMPERS_ACCELERATION;

    unsigned long specPtsDRONE_MISSILES_DAMAGE;
    unsigned long specPtsDRONE_MISSILES_PRECISION;
    unsigned long specPtsDRONE_MISSILES_RANGE;

    unsigned long specPtsDRONE_MISSILE_LAUNCHER_ACCUMULATOR;
    unsigned long specPtsDRONE_MISSILE_LAUNCHER_CHARGING;

    unsigned long specPtsSHIPS_LEVEL;

    unsigned long specPtsBASES_LEVEL;

    unsigned long specPtsHANGARS_LEVEL;

    unsigned long specPtsANDROIDS_LEVEL;
    unsigned long specPtsANDROIDS_CONSUMPTION;

    unsigned long specPtsENERGETIC_ACCUMULATOR_ACCUMULATOR;
    unsigned long specPtsENERGETIC_ACCUMULATOR_CHARGING;

    unsigned long specPtsMAINFRAME_BIO_NODES;
    unsigned long specPtsMAINFRAME_PREDICTION;
    unsigned long specPtsMAINFRAME_TIME_REUSABILITY;
    unsigned long specPtsMAINFRAME_CONSUMPTION;

    unsigned long specPtsSCIENTIFIC_LABS_LEVEL;

    unsigned long specPtsLIFE_SUPPORT_CAPACITY;
    unsigned long specPtsLIFE_SUPPORT_CONSUMPTION;

    unsigned long specPtsWEAPON_ENERGY_CIRCUIT_CHARGING;

    unsigned long specPtsTRANSPORT_BEAM_GENERATOR_ACCUMULATOR;
    unsigned long specPtsTRANSPORT_BEAM_GENERATOR_CHARGING;
    unsigned long specPtsTRANSPORT_BEAM_GENERATOR_FORCIBILITY;
    unsigned long specPtsTRANSPORT_BEAM_GENERATOR_PRECISION;
    unsigned long specPtsTRANSPORT_BEAM_GENERATOR_RANGE;

    unsigned long specPtsLASER_GUN_ACCUMULATOR;
    unsigned long specPtsLASER_GUN_CHARGING;
    unsigned long specPtsLASER_GUN_FORCIBILITY;
    unsigned long specPtsLASER_GUN_PRECISION;
    unsigned long specPtsLASER_GUN_RANGE;

    unsigned long specPtsDEFLECTOR_SHIELDS_GENERATOR_SOLIDITY;
    unsigned long specPtsDEFLECTOR_SHIELDS_GENERATOR_ACCUMULATOR;
    unsigned long specPtsDEFLECTOR_SHIELDS_GENERATOR_CHARGING;

    unsigned long specPtsHIGH_RESOLUTION_SENSORS_LEVEL;
    unsigned long specPtsHIGH_RESOLUTION_SENSORS_RANGE;
    unsigned long specPtsHIGH_RESOLUTION_SENSORS_CONSUMPTION;

    unsigned long specPtsLONG_RANGE_SENSORS_LEVEL;
    unsigned long specPtsLONG_RANGE_SENSORS_RANGE;
    unsigned long specPtsLONG_RANGE_SENSORS_CONSUMPTION;

    unsigned long specPtsCLOAKING_DEVICE_LEVEL;
    unsigned long specPtsCLOAKING_DEVICE_CONSUMPTION;

    unsigned long specPtsPROBE_DEVICE_LEVEL;

    unsigned long specPtsMAGNETICAL_FILTER_PRODUCTION;

    unsigned long specPtsDEUTERIUM_DECOMPOSER_PRODUCTION;
    unsigned long specPtsDEUTERIUM_DECOMPOSER_METAMORPHOSIS;

    unsigned long specPtsZIRCONIUM_REACTOR_PRODUCTION;
    unsigned long specPtsZIRCONIUM_REACTOR_METAMORPHOSIS;

    unsigned long specPtsILMENITE_FURNACE_PRODUCTION;
    unsigned long specPtsILMENITE_FURNACE_METAMORPHOSIS;

    unsigned long specPtsMAGNETICAL_COLLECTORS_OF_PLASMA_WINDING_SPEED;

    unsigned long specPtsSUBMERSIBLE_FILTRATION_TANK_WINDING_SPEED;
    unsigned long specPtsSUBMERSIBLE_FILTRATION_TANK_RANGE;

    unsigned long specPtsSUBMARINE_MINING_MACHINE_WINDING_SPEED;
    unsigned long specPtsSUBMARINE_MINING_MACHINE_RANGE;

    unsigned long specPtsUNDERGROUND_DRILLING_MACHINE_WINDING_SPEED;
    unsigned long specPtsUNDERGROUND_DRILLING_MACHINE_RANGE;            
};

#define TOKENS_SCIENCE_ENTITY_SHIPS                             "SCIENCE_ENTITY_SHIPS"
#define TOKENS_SCIENCE_ENTITY_BASES                             "SCIENCE_ENTITY_BASES"
#define TOKENS_SCIENCE_ENTITY_ENERGETIC_ACCUMULATOR             "SCIENCE_ENTITY_ENERGETIC_ACCUMULATOR"
#define TOKENS_SCIENCE_ENTITY_NAVIGATION_COMPUTER               "SCIENCE_ENTITY_NAVIGATION_COMPUTER"
#define TOKENS_SCIENCE_ENTITY_QUARK_GLUON_CORE                  "SCIENCE_ENTITY_QUARK_GLUON_CORE"
#define TOKENS_SCIENCE_ENTITY_SUBSPACE_BEACON                   "SCIENCE_ENTITY_SUBSPACE_BEACON"
#define TOKENS_SCIENCE_ENTITY_INERTIAL_DAMPERS                  "SCIENCE_ENTITY_INERTIAL_DAMPERS"
#define TOKENS_SCIENCE_ENTITY_IMPULS_JET_ENGINE                 "SCIENCE_ENTITY_IMPULS_JET_ENGINE"
#define TOKENS_SCIENCE_ENTITY_MECHANICAL_DAMPERS                "SCIENCE_ENTITY_MECHANICAL_DAMPERS"
#define TOKENS_SCIENCE_ENTITY_DEFLECTOR_SHIELDS                 "SCIENCE_ENTITY_DEFLECTOR_SHIELDS"
#define TOKENS_SCIENCE_ENTITY_WEAPON_ENERGY_CIRCUIT             "SCIENCE_ENTITY_WEAPON_ENERGY_CIRCUIT"
#define TOKENS_SCIENCE_ENTITY_DRONE_MISSILE_LAUNCHER            "SCIENCE_ENTITY_DRONE_MISSILE_LAUNCHER"
#define TOKENS_SCIENCE_ENTITY_DRONE_MISSILES                    "SCIENCE_ENTITY_DRONE_MISSILES"
#define TOKENS_SCIENCE_ENTITY_LASER_GUN                         "SCIENCE_ENTITY_LASER_GUN"
#define TOKENS_SCIENCE_ENTITY_TRANSPORT_BEAM_GENERATOR          "SCIENCE_ENTITY_TRANSPORT_BEAM_GENERATOR"
#define TOKENS_SCIENCE_ENTITY_MAGNETICAL_COLLECTORS_OF_PLASMA   "SCIENCE_ENTITY_MAGNETICAL_COLLECTORS_OF_PLASMA"
#define TOKENS_SCIENCE_ENTITY_SUBMERSIBLE_FILTRATION_TANK       "SCIENCE_ENTITY_SUBMERSIBLE_FILTRATION_TANK"
#define TOKENS_SCIENCE_ENTITY_SUBMARINE_MINING_MACHINE          "SCIENCE_ENTITY_SUBMARINE_MINING_MACHINE"
#define TOKENS_SCIENCE_ENTITY_UNDERGROUND_DRILLING_MACHINE      "SCIENCE_ENTITY_UNDERGROUND_DRILLING_MACHINE"
#define TOKENS_SCIENCE_ENTITY_PROBE                             "SCIENCE_ENTITY_PROBE"
#define TOKENS_SCIENCE_ENTITY_HIGH_RESOLUTION_SENSORS           "SCIENCE_ENTITY_HIGH_RESOLUTION_SENSORS"
#define TOKENS_SCIENCE_ENTITY_LONG_RANGE_SENSORS                "SCIENCE_ENTITY_LONG_RANGE_SENSORS"
#define TOKENS_SCIENCE_ENTITY_CLOAKING_DEVICE                   "SCIENCE_ENTITY_CLOAKING_DEVICE"
#define TOKENS_SCIENCE_ENTITY_ANDROIDS                          "SCIENCE_ENTITY_ANDROIDS"
#define TOKENS_SCIENCE_ENTITY_SCIENTIFIC_LAB                    "SCIENCE_ENTITY_SCIENTIFIC_LAB"
#define TOKENS_SCIENCE_ENTITY_LIFE_SUPPORT                      "SCIENCE_ENTITY_LIFE_SUPPORT"
#define TOKENS_SCIENCE_ENTITY_MAINFRAME                         "SCIENCE_ENTITY_MAINFRAME"
#define TOKENS_SCIENCE_ENTITY_HANGAR                            "SCIENCE_ENTITY_HANGAR"
#define TOKENS_SCIENCE_ENTITY_MAGNETICAL_FILTER                 "SCIENCE_ENTITY_MAGNETICAL_FILTER"
#define TOKENS_SCIENCE_ENTITY_DEUTERIUM_DECOMPOSER              "SCIENCE_ENTITY_DEUTERIUM_DECOMPOSER"
#define TOKENS_SCIENCE_ENTITY_ZIRCONIUM_REACTOR                 "SCIENCE_ENTITY_ZIRCONIUM_REACTOR"
#define TOKENS_SCIENCE_ENTITY_ILMENITE_FURNACE                  "SCIENCE_ENTITY_ILMENITE_FURNACE"

#define TOKENS_SCIENCE_SUPREME_ENTITY_SCIENCE                   "SCIENCE_SUPREME_ENTITY_SCIENCE"

#define TOKENS_SCIENCE_SUPREME_ENTITY_DRIVE                     "SCIENCE_SUPREME_ENTITY_DRIVE"
#define TOKENS_SCIENCE_SUPREME_ENTITY_PLATFORM                  "SCIENCE_SUPREME_ENTITY_PLATFORM"
#define TOKENS_SCIENCE_SUPREME_ENTITY_MODULES                   "SCIENCE_SUPREME_ENTITY_MODULES"
#define TOKENS_SCIENCE_SUPREME_ENTITY_PRODUCTION                "SCIENCE_SUPREME_ENTITY_PRODUCTION"

#define TOKENS_SCIENCE_SUPREME_ENTITY_SUBSPACE_DRIVE            "SCIENCE_SUPREME_ENTITY_SUBSPACE_DRIVE"
#define TOKENS_SCIENCE_SUPREME_ENTITY_IMPULS_DRIVE              "SCIENCE_SUPREME_ENTITY_IMPULS_DRIVE"
#define TOKENS_SCIENCE_SUPREME_ENTITY_CONSTRUCTION              "SCIENCE_SUPREME_ENTITY_CONSTRUCTION"
#define TOKENS_SCIENCE_SUPREME_ENTITY_EQUIPMENT                 "SCIENCE_SUPREME_ENTITY_EQUIPMENT"
#define TOKENS_SCIENCE_SUPREME_ENTITY_ENERGETIC_RING            "SCIENCE_SUPREME_ENTITY_ENERGETIC_RING"
#define TOKENS_SCIENCE_SUPREME_ENTITY_RECOGNITION_DEVICES       "SCIENCE_SUPREME_ENTITY_RECOGNITION_DEVICES"
#define TOKENS_SCIENCE_SUPREME_ENTITY_FACTORIES                 "SCIENCE_SUPREME_ENTITY_FACTORIES"
#define TOKENS_SCIENCE_SUPREME_ENTITY_QUARRYING_MACHINES        "SCIENCE_SUPREME_ENTITY_QUARRYING_MACHINES"

#define SPEC_PTS_QUARK_GLUON_CORE_SPEED                         "SPEC_PTS_QUARK_GLUON_CORE_SPEED"
#define SPEC_PTS_QUARK_GLUON_CORE_CONSUMPTION                   "SPEC_PTS_QUARK_GLUON_CORE_CONSUMPTION"

#define SPEC_PTS_NAVIGATION_COMPUTER_SPEED                      "SPEC_PTS_NAVIGATION_COMPUTER_SPEED"

#define SPEC_PTS_SUBSPACE_BEACON_SPEED                          "SPEC_PTS_SUBSPACE_BEACON_SPEED"

#define SPEC_PTS_INERTIAL_DAMPERS_SPEED                         "SPEC_PTS_INERTIAL_DAMPERS_SPEED"

#define SPEC_PTS_IMPULS_ENGINE_FORCE                            "SPEC_PTS_IMPULS_ENGINE_FORCE"
#define SPEC_PTS_IMPULS_ENGINE_CONSUMPTION                      "SPEC_PTS_IMPULS_ENGINE_CONSUMPTION"

#define SPEC_PTS_MECHANICAL_DAMPERS_ACCELERATION                "SPEC_PTS_MECHANICAL_DAMPERS_ACCELERATION"

#define SPEC_PTS_DRONE_MISSILES_DAMAGE                          "SPEC_PTS_DRONE_MISSILES_DAMAGE"
#define SPEC_PTS_DRONE_MISSILES_PRECISION                       "SPEC_PTS_DRONE_MISSILES_PRECISION"
#define SPEC_PTS_DRONE_MISSILES_RANGE                           "SPEC_PTS_DRONE_MISSILES_RANGE"

#define SPEC_PTS_DRONE_MISSILE_LAUNCHER_ACCUMULATOR             "SPEC_PTS_DRONE_MISSILE_LAUNCHER_ACCUMULATOR"
#define SPEC_PTS_DRONE_MISSILE_LAUNCHER_CHARGING                "SPEC_PTS_DRONE_MISSILE_LAUNCHER_CHARGING"

#define SPEC_PTS_SHIPS_LEVEL                                    "SPEC_PTS_SHIPS_LEVEL"

#define SPEC_PTS_BASES_LEVEL                                    "SPEC_PTS_BASES_LEVEL"

#define SPEC_PTS_HANGARS_LEVEL                                  "SPEC_PTS_HANGARS_LEVEL"

#define SPEC_PTS_ANDROIDS_LEVEL                                 "SPEC_PTS_ANDROIDS_LEVEL"
#define SPEC_PTS_ANDROIDS_CONSUMPTION                           "SPEC_PTS_ANDROIDS_CONSUMPTION"

#define SPEC_PTS_ENERGETIC_ACCUMULATOR_ACCUMULATOR              "SPEC_PTS_ENERGETIC_ACCUMULATOR_ACCUMULATOR"
#define SPEC_PTS_ENERGETIC_ACCUMULATOR_CHARGING                 "SPEC_PTS_ENERGETIC_ACCUMULATOR_CHARGING"

#define SPEC_PTS_MAINFRAME_BIO_NODES                            "SPEC_PTS_MAINFRAME_BIO_NODES"
#define SPEC_PTS_MAINFRAME_PREDICTION                           "SPEC_PTS_MAINFRAME_PREDICTION"
#define SPEC_PTS_MAINFRAME_TIME_REUSABILITY                     "SPEC_PTS_MAINFRAME_TIME_REUSABILITY"
#define SPEC_PTS_MAINFRAME_CONSUMPTION                          "SPEC_PTS_MAINFRAME_CONSUMPTION"

#define SPEC_PTS_SCIENTIFIC_LABS_LEVEL                          "SPEC_PTS_SCIENTIFIC_LABS_LEVEL"

#define SPEC_PTS_LIFE_SUPPORT_CAPACITY                          "SPEC_PTS_LIFE_SUPPORT_CAPACITY"
#define SPEC_PTS_LIFE_SUPPORT_CONSUMPTION                       "SPEC_PTS_LIFE_SUPPORT_CONSUMPTION"

#define SPEC_PTS_WEAPON_ENERGY_CIRCUIT_CHARGING                 "SPEC_PTS_WEAPON_ENERGY_CIRCUIT_CHARGING"

#define SPEC_PTS_TRANSPORT_BEAM_GENERATOR_ACCUMULATOR           "SPEC_PTS_TRANSPORT_BEAM_GENERATOR_ACCUMULATOR"
#define SPEC_PTS_TRANSPORT_BEAM_GENERATOR_CHARGING              "SPEC_PTS_TRANSPORT_BEAM_GENERATOR_CHARGING"
#define SPEC_PTS_TRANSPORT_BEAM_GENERATOR_FORCIBILITY           "SPEC_PTS_TRANSPORT_BEAM_GENERATOR_FORCIBILITY"
#define SPEC_PTS_TRANSPORT_BEAM_GENERATOR_PRECISION             "SPEC_PTS_TRANSPORT_BEAM_GENERATOR_PRECISION"
#define SPEC_PTS_TRANSPORT_BEAM_GENERATOR_RANGE                 "SPEC_PTS_TRANSPORT_BEAM_GENERATOR_RANGE"

#define SPEC_PTS_LASER_GUN_ACCUMULATOR                          "SPEC_PTS_LASER_GUN_ACCUMULATOR"
#define SPEC_PTS_LASER_GUN_CHARGING                             "SPEC_PTS_LASER_GUN_CHARGING"
#define SPEC_PTS_LASER_GUN_FORCIBILITY                          "SPEC_PTS_LASER_GUN_FORCIBILITY"
#define SPEC_PTS_LASER_GUN_PRECISION                            "SPEC_PTS_LASER_GUN_PRECISION"
#define SPEC_PTS_LASER_GUN_RANGE                                "SPEC_PTS_LASER_GUN_RANGE"

#define SPEC_PTS_DEFLECTOR_SHIELDS_GENERATOR_SOLIDITY           "SPEC_PTS_DEFLECTOR_SHIELDS_GENERATOR_SOLIDITY"
#define SPEC_PTS_DEFLECTOR_SHIELDS_GENERATOR_ACCUMULATOR        "SPEC_PTS_DEFLECTOR_SHIELDS_GENERATOR_ACCUMULATOR"
#define SPEC_PTS_DEFLECTOR_SHIELDS_GENERATOR_CHARGING           "SPEC_PTS_DEFLECTOR_SHIELDS_GENERATOR_CHARGING"

#define SPEC_PTS_HIGH_RESOLUTION_SENSORS_LEVEL                  "SPEC_PTS_HIGH_RESOLUTION_SENSORS_LEVEL"
#define SPEC_PTS_HIGH_RESOLUTION_SENSORS_RANGE                  "SPEC_PTS_HIGH_RESOLUTION_SENSORS_RANGE"
#define SPEC_PTS_HIGH_RESOLUTION_SENSORS_CONSUMPTION            "SPEC_PTS_HIGH_RESOLUTION_SENSORS_CONSUMPTION"

#define SPEC_PTS_LONG_RANGE_SENSORS_LEVEL                       "SPEC_PTS_LONG_RANGE_SENSORS_LEVEL"
#define SPEC_PTS_LONG_RANGE_SENSORS_RANGE                       "SPEC_PTS_LONG_RANGE_SENSORS_RANGE"
#define SPEC_PTS_LONG_RANGE_SENSORS_CONSUMPTION                 "SPEC_PTS_LONG_RANGE_SENSORS_CONSUMPTION"

#define SPEC_PTS_CLOAKING_DEVICE_LEVEL                          "SPEC_PTS_CLOAKING_DEVICE_LEVEL"
#define SPEC_PTS_CLOAKING_DEVICE_CONSUMPTION                    "SPEC_PTS_CLOAKING_DEVICE_CONSUMPTION"

#define SPEC_PTS_PROBE_DEVICE_LEVEL                             "SPEC_PTS_PROBE_DEVICE_LEVEL"

#define SPEC_PTS_MAGNETICAL_FILTER_PRODUCTION                   "SPEC_PTS_MAGNETICAL_FILTER_PRODUCTION"

#define SPEC_PTS_DEUTERIUM_DECOMPOSER_PRODUCTION                "SPEC_PTS_DEUTERIUM_DECOMPOSER_PRODUCTION"
#define SPEC_PTS_DEUTERIUM_DECOMPOSER_METAMORPHOSIS             "SPEC_PTS_DEUTERIUM_DECOMPOSER_METAMORPHOSIS"

#define SPEC_PTS_ZIRCONIUM_REACTOR_PRODUCTION                   "SPEC_PTS_ZIRCONIUM_REACTOR_PRODUCTION"
#define SPEC_PTS_ZIRCONIUM_REACTOR_METAMORPHOSIS                "SPEC_PTS_ZIRCONIUM_REACTOR_METAMORPHOSIS"

#define SPEC_PTS_ILMENITE_FURNACE_PRODUCTION                    "SPEC_PTS_ZIRCONIUM_REACTOR_METAMORPHOSIS"
#define SPEC_PTS_ILMENITE_FURNACE_METAMORPHOSIS                 "SPEC_PTS_ILMENITE_FURNACE_METAMORPHOSIS"

#define SPEC_PTS_MAGNETICAL_COLLECTORS_OF_PLASMA_WINDING_SPEED  "SPEC_PTS_MAGNETICAL_COLLECTORS_OF_PLASMA_WINDING_SPEED"

#define SPEC_PTS_SUBMERSIBLE_FILTRATION_TANK_WINDING_SPEED      "SPEC_PTS_SUBMERSIBLE_FILTRATION_TANK_WINDING_SPEED"
#define SPEC_PTS_SUBMERSIBLE_FILTRATION_TANK_RANGE              "SPEC_PTS_SUBMERSIBLE_FILTRATION_TANK_RANGE"

#define SPEC_PTS_SUBMARINE_MINING_MACHINE_WINDING_SPEED         "SPEC_PTS_SUBMARINE_MINING_MACHINE_WINDING_SPEED"
#define SPEC_PTS_SUBMARINE_MINING_MACHINE_RANGE                 "SPEC_PTS_SUBMARINE_MINING_MACHINE_RANGE"

#define SPEC_PTS_UNDERGROUND_DRILLING_MACHINE_WINDING_SPEED     "SPEC_PTS_UNDERGROUND_DRILLING_MACHINE_WINDING_SPEED"
#define SPEC_PTS_UNDERGROUND_DRILLING_MACHINE_RANGE             "SPEC_PTS_UNDERGROUND_DRILLING_MACHINE_RANGE"

#define SCLEVEL_QUARK_GLUON_CORE_SPEED                         "SCLEVEL_QUARK_GLUON_CORE_SPEED"
#define SCLEVEL_QUARK_GLUON_CORE_CONSUMPTION                   "SCLEVEL_QUARK_GLUON_CORE_CONSUMPTION"

#define SCLEVEL_NAVIGATION_COMPUTER_SPEED                      "SCLEVEL_NAVIGATION_COMPUTER_SPEED"

#define SCLEVEL_SUBSPACE_BEACON_SPEED                          "SCLEVEL_SUBSPACE_BEACON_SPEED"

#define SCLEVEL_INERTIAL_DAMPERS_SPEED                         "SCLEVEL_INERTIAL_DAMPERS_SPEED"

#define SCLEVEL_IMPULS_ENGINE_FORCE                            "SCLEVEL_IMPULS_ENGINE_FORCE"
#define SCLEVEL_IMPULS_ENGINE_CONSUMPTION                      "SCLEVEL_IMPULS_ENGINE_CONSUMPTION"

#define SCLEVEL_MECHANICAL_DAMPERS_ACCELERATION                "SCLEVEL_MECHANICAL_DAMPERS_ACCELERATION"

#define SCLEVEL_DRONE_MISSILES_DAMAGE                          "SCLEVEL_DRONE_MISSILES_DAMAGE"
#define SCLEVEL_DRONE_MISSILES_PRECISION                       "SCLEVEL_DRONE_MISSILES_PRECISION"
#define SCLEVEL_DRONE_MISSILES_RANGE                           "SCLEVEL_DRONE_MISSILES_RANGE"

#define SCLEVEL_DRONE_MISSILE_LAUNCHER_ACCUMULATOR             "SCLEVEL_DRONE_MISSILE_LAUNCHER_ACCUMULATOR"
#define SCLEVEL_DRONE_MISSILE_LAUNCHER_CHARGING                "SCLEVEL_DRONE_MISSILE_LAUNCHER_CHARGING"

#define SCLEVEL_SHIPS_LEVEL                                    "SCLEVEL_SHIPS_LEVEL"

#define SCLEVEL_BASES_LEVEL                                    "SCLEVEL_BASES_LEVEL"

#define SCLEVEL_HANGARS_LEVEL                                  "SCLEVEL_HANGARS_LEVEL"

#define SCLEVEL_ANDROIDS_LEVEL                                 "SCLEVEL_ANDROIDS_LEVEL"
#define SCLEVEL_ANDROIDS_CONSUMPTION                           "SCLEVEL_ANDROIDS_CONSUMPTION"

#define SCLEVEL_ENERGETIC_ACCUMULATOR_ACCUMULATOR              "SCLEVEL_ENERGETIC_ACCUMULATOR_ACCUMULATOR"
#define SCLEVEL_ENERGETIC_ACCUMULATOR_CHARGING                 "SCLEVEL_ENERGETIC_ACCUMULATOR_CHARGING"

#define SCLEVEL_MAINFRAME_BIO_NODES                            "SCLEVEL_MAINFRAME_BIO_NODES"
#define SCLEVEL_MAINFRAME_PREDICTION                           "SCLEVEL_MAINFRAME_PREDICTION"
#define SCLEVEL_MAINFRAME_TIME_REUSABILITY                     "SCLEVEL_MAINFRAME_TIME_REUSABILITY"
#define SCLEVEL_MAINFRAME_CONSUMPTION                          "SCLEVEL_MAINFRAME_CONSUMPTION"

#define SCLEVEL_SCIENTIFIC_LABS_LEVEL                          "SCLEVEL_SCIENTIFIC_LABS_LEVEL"

#define SCLEVEL_LIFE_SUPPORT_CAPACITY                          "SCLEVEL_LIFE_SUPPORT_CAPACITY"
#define SCLEVEL_LIFE_SUPPORT_CONSUMPTION                       "SCLEVEL_LIFE_SUPPORT_CONSUMPTION"

#define SCLEVEL_WEAPON_ENERGY_CIRCUIT_CHARGING                 "SCLEVEL_WEAPON_ENERGY_CIRCUIT_CHARGING"

#define SCLEVEL_TRANSPORT_BEAM_GENERATOR_ACCUMULATOR           "SCLEVEL_TRANSPORT_BEAM_GENERATOR_ACCUMULATOR"
#define SCLEVEL_TRANSPORT_BEAM_GENERATOR_CHARGING              "SCLEVEL_TRANSPORT_BEAM_GENERATOR_CHARGING"
#define SCLEVEL_TRANSPORT_BEAM_GENERATOR_FORCIBILITY           "SCLEVEL_TRANSPORT_BEAM_GENERATOR_FORCIBILITY"
#define SCLEVEL_TRANSPORT_BEAM_GENERATOR_PRECISION             "SCLEVEL_TRANSPORT_BEAM_GENERATOR_PRECISION"
#define SCLEVEL_TRANSPORT_BEAM_GENERATOR_RANGE                 "SCLEVEL_TRANSPORT_BEAM_GENERATOR_RANGE"

#define SCLEVEL_LASER_GUN_ACCUMULATOR                          "SCLEVEL_LASER_GUN_ACCUMULATOR"
#define SCLEVEL_LASER_GUN_CHARGING                             "SCLEVEL_LASER_GUN_CHARGING"
#define SCLEVEL_LASER_GUN_FORCIBILITY                          "SCLEVEL_LASER_GUN_FORCIBILITY"
#define SCLEVEL_LASER_GUN_PRECISION                            "SCLEVEL_LASER_GUN_PRECISION"
#define SCLEVEL_LASER_GUN_RANGE                                "SCLEVEL_LASER_GUN_RANGE"

#define SCLEVEL_DEFLECTOR_SHIELDS_GENERATOR_SOLIDITY           "SCLEVEL_DEFLECTOR_SHIELDS_GENERATOR_SOLIDITY"
#define SCLEVEL_DEFLECTOR_SHIELDS_GENERATOR_ACCUMULATOR        "SCLEVEL_DEFLECTOR_SHIELDS_GENERATOR_ACCUMULATOR"
#define SCLEVEL_DEFLECTOR_SHIELDS_GENERATOR_CHARGING           "SCLEVEL_DEFLECTOR_SHIELDS_GENERATOR_CHARGING"

#define SCLEVEL_HIGH_RESOLUTION_SENSORS_LEVEL                  "SCLEVEL_HIGH_RESOLUTION_SENSORS_LEVEL"
#define SCLEVEL_HIGH_RESOLUTION_SENSORS_RANGE                  "SCLEVEL_HIGH_RESOLUTION_SENSORS_RANGE"
#define SCLEVEL_HIGH_RESOLUTION_SENSORS_CONSUMPTION            "SCLEVEL_HIGH_RESOLUTION_SENSORS_CONSUMPTION"

#define SCLEVEL_LONG_RANGE_SENSORS_LEVEL                       "SCLEVEL_LONG_RANGE_SENSORS_LEVEL"
#define SCLEVEL_LONG_RANGE_SENSORS_RANGE                       "SCLEVEL_LONG_RANGE_SENSORS_RANGE"
#define SCLEVEL_LONG_RANGE_SENSORS_CONSUMPTION                 "SCLEVEL_LONG_RANGE_SENSORS_CONSUMPTION"

#define SCLEVEL_CLOAKING_DEVICE_LEVEL                          "SCLEVEL_CLOAKING_DEVICE_LEVEL"
#define SCLEVEL_CLOAKING_DEVICE_CONSUMPTION                    "SCLEVEL_CLOAKING_DEVICE_CONSUMPTION"

#define SCLEVEL_PROBE_DEVICE_LEVEL                             "SCLEVEL_PROBE_DEVICE_LEVEL"

#define SCLEVEL_MAGNETICAL_FILTER_PRODUCTION                   "SCLEVEL_MAGNETICAL_FILTER_PRODUCTION"

#define SCLEVEL_DEUTERIUM_DECOMPOSER_PRODUCTION                "SCLEVEL_DEUTERIUM_DECOMPOSER_PRODUCTION"
#define SCLEVEL_DEUTERIUM_DECOMPOSER_METAMORPHOSIS             "SCLEVEL_DEUTERIUM_DECOMPOSER_METAMORPHOSIS"

#define SCLEVEL_ZIRCONIUM_REACTOR_PRODUCTION                   "SCLEVEL_ZIRCONIUM_REACTOR_PRODUCTION"
#define SCLEVEL_ZIRCONIUM_REACTOR_METAMORPHOSIS                "SCLEVEL_ZIRCONIUM_REACTOR_METAMORPHOSIS"

#define SCLEVEL_ILMENITE_FURNACE_PRODUCTION                    "SCLEVEL_ZIRCONIUM_REACTOR_METAMORPHOSIS"
#define SCLEVEL_ILMENITE_FURNACE_METAMORPHOSIS                 "SCLEVEL_ILMENITE_FURNACE_METAMORPHOSIS"

#define SCLEVEL_MAGNETICAL_COLLECTORS_OF_PLASMA_WINDING_SPEED  "SCLEVEL_MAGNETICAL_COLLECTORS_OF_PLASMA_WINDING_SPEED"

#define SCLEVEL_SUBMERSIBLE_FILTRATION_TANK_WINDING_SPEED      "SCLEVEL_SUBMERSIBLE_FILTRATION_TANK_WINDING_SPEED"
#define SCLEVEL_SUBMERSIBLE_FILTRATION_TANK_RANGE              "SCLEVEL_SUBMERSIBLE_FILTRATION_TANK_RANGE"

#define SCLEVEL_SUBMARINE_MINING_MACHINE_WINDING_SPEED         "SCLEVEL_SUBMARINE_MINING_MACHINE_WINDING_SPEED"
#define SCLEVEL_SUBMARINE_MINING_MACHINE_RANGE                 "SCLEVEL_SUBMARINE_MINING_MACHINE_RANGE"

#define SCLEVEL_UNDERGROUND_DRILLING_MACHINE_WINDING_SPEED     "SCLEVEL_UNDERGROUND_DRILLING_MACHINE_WINDING_SPEED"
#define SCLEVEL_UNDERGROUND_DRILLING_MACHINE_RANGE             "SCLEVEL_UNDERGROUND_DRILLING_MACHINE_RANGE"

#define REQUEST_SCIENCE                                        "science"
#define REQUEST_SCIENCE_CHANGE                                 "scienceChange"

#define REQUEST_MAX_SCIENCE_PTS                                "maxSciencePts"
#define REQUEST_SCIENCE_ANSWER_FAIL_REASON                     "failReason"

#define REQUEST_SCIENCE_ANSWER_IE                              "INTERNAL_ERROR"

// ################################

#define REQUEST_SHIP_CENTRAL_INFORMATION                       "shipsCentralInformation"
#define REQUEST_SHIP_CENTRAL_INFORMATION_SHIPID                "shipsCentralInformationShipId"

#define REQUEST_SHIP_CENTRAL_INFORMATION_ANSWER_SINTEGRITY_ACT "actualStructuralIntegrity"
#define REQUEST_SHIP_CENTRAL_INFORMATION_ANSWER_SINTEGRITY_MAX "maximalStructuralIntegrity"
#define REQUEST_SHIP_CENTRAL_INFORMATION_ANSWER_SINTEGRITY_GRADIENT	"gradStructuralIntegrity"
#define REQUEST_SHIP_CENTRAL_INFORMATION_ANSWER_MAN            "manoeuvruability"
#define REQUEST_SHIP_CENTRAL_INFORMATION_ANSWER_WIDTH          "width"
#define REQUEST_SHIP_CENTRAL_INFORMATION_ANSWER_LENGTH         "length"
#define REQUEST_SHIP_CENTRAL_INFORMATION_ANSWER_HEIGHT         "height"
#define REQUEST_SHIP_CENTRAL_INFORMATION_ANSWER_WEIGHT         "weight"

#define REQUEST_SHIP_CENTRAL_INFORMATION_ANSWER_ACT_QGPLAZMA			 "actualQuarkGluonPlazma"
#define REQUEST_SHIP_CENTRAL_INFORMATION_ANSWER_FREE_CAPACITY_QGPLAZMA	 "free_capacity_qgplazma"
#define REQUEST_SHIP_CENTRAL_INFORMATION_ANSWER_GRAD_QGPLAZMA			 "gradQuarkGluonPlazma"

#define REQUEST_SHIP_CENTRAL_INFORMATION_ANSWER_ACT_ULREA       "actualUlrea"
#define REQUEST_SHIP_CENTRAL_INFORMATION_ANSWER_GRAD_ULREA      "gradUlrea"

#define REQUEST_SHIP_CENTRAL_INFORMATION_ANSWER_ACT_HWATER      "actualHeavyWater"
#define REQUEST_SHIP_CENTRAL_INFORMATION_ANSWER_SIZE_HWATER     "sizeHeavyWater"
#define REQUEST_SHIP_CENTRAL_INFORMATION_ANSWER_GRAD_HWATER     "gradHeavyWater"
#define REQUEST_SHIP_CENTRAL_INFORMATION_ANSWER_FREE_CAPACITY_HWATER	"free_capacity_hwater"

#define REQUEST_SHIP_CENTRAL_INFORMATION_ANSWER_ACT_DEUT        "actualDeuterium"
#define REQUEST_SHIP_CENTRAL_INFORMATION_ANSWER_SIZE_DEUT       "sizeDeuterium"
#define REQUEST_SHIP_CENTRAL_INFORMATION_ANSWER_GRAD_DEUT       "gradDeuterium"
#define REQUEST_SHIP_CENTRAL_INFORMATION_ANSWER_FREE_CAPACITY_DEUT		"free_capacity_deut"

#define REQUEST_SHIP_CENTRAL_INFORMATION_ANSWER_ACT_ZCRYSTAL    "actualZirconiumCrystals"
#define REQUEST_SHIP_CENTRAL_INFORMATION_ANSWER_SIZE_ZCRYSTAL   "sizeZirconiumCrystals"
#define REQUEST_SHIP_CENTRAL_INFORMATION_ANSWER_GRAD_ZCRYSTAL   "gradZirconiumCrystals"
#define REQUEST_SHIP_CENTRAL_INFORMATION_ANSWER_FREE_CAPACITY_ZCRYSTAL	"free_capacity_zcrystal"

#define REQUEST_SHIP_CENTRAL_INFORMATION_ANSWER_ACT_ENERGY		 "actualEnergy"
#define REQUEST_SHIP_CENTRAL_INFORMATION_ANSWER_GRAD_ENERGY		 "gradEnergy"
#define REQUEST_SHIP_CENTRAL_INFORMATION_ANSWER_FREE_CAPACITY_ENERGY	"free_capacity_energy"

#define REQUEST_SHIP_CENTRAL_INFORMATION_ANSWER_ACT_ILMENITE    "actualIlmenite"
#define REQUEST_SHIP_CENTRAL_INFORMATION_ANSWER_SIZE_ILMENITE   "sizeIlmenite"
#define REQUEST_SHIP_CENTRAL_INFORMATION_ANSWER_GRAD_ILMENITE   "gradIlmenite"
#define REQUEST_SHIP_CENTRAL_INFORMATION_ANSWER_FREE_CAPACITY_ILMENITE	"free_capacity_ilmenite"

#define REQUEST_SHIP_CENTRAL_INFORMATION_ANSWER_ACT_TITANIUM    "actualTitanium"
#define REQUEST_SHIP_CENTRAL_INFORMATION_ANSWER_SIZE_TITANIUM   "sizeTitanium"
#define REQUEST_SHIP_CENTRAL_INFORMATION_ANSWER_GRAD_TITANIUM   "gradTitanium"
#define REQUEST_SHIP_CENTRAL_INFORMATION_ANSWER_FREE_CAPACITY_TITANIUM	"free_capacity_titanium"

#define REQUEST_SHIP_CENTRAL_INFORMATION_ANSWER_WEIGHT_WITH_CARGO			"weight_with_cargo"
#define REQUEST_SHIP_CENTRAL_INFORMATION_ANSWER_LOADING_WEIGHT_LIMIT		"loading_weight_limit"
#define REQUEST_SHIP_CENTRAL_INFORMATION_ANSWER_LOADING_CAPACITY_LIMIT		"loading_capacity_limit"
#define REQUEST_SHIP_CENTRAL_INFORMATION_ANSWER_ACTUAL_TOTAL_CARGO_WEIGHT	"actual_total_cargo_weight"
#define REQUEST_SHIP_CENTRAL_INFORMATION_ANSWER_FREE_WEIGHT					"free_weight"
#define REQUEST_SHIP_CENTRAL_INFORMATION_ANSWER_CARGO_SIZE					"cargo_size"
#define REQUEST_SHIP_CENTRAL_INFORMATION_ANSWER_FREE_CAPACITY				"free_capacity"

#define REQUEST_SHIP_CENTRAL_INFORMATION_ANSWER_FREE_RES_WEIGHT				"REQUEST_SHIP_CENTRAL_INFORMATION_ANSWER_FREE_RES_WEIGHT"
#define REQUEST_SHIP_CENTRAL_INFORMATION_ANSWER_FREE_RES_CAPACITY			"REQUEST_SHIP_CENTRAL_INFORMATION_ANSWER_FREE_RES_CAPACITY"
#define REQUEST_SHIP_CENTRAL_INFORMATION_ANSWER_HEAVY_WATER_DENSITY			"REQUEST_SHIP_CENTRAL_INFORMATION_ANSWER_HEAVY_WATER_DENSITY"
#define REQUEST_SHIP_CENTRAL_INFORMATION_ANSWER_DEUTERIUM_DENSITY			"REQUEST_SHIP_CENTRAL_INFORMATION_ANSWER_DEUTERIUM_DENSITY"
#define REQUEST_SHIP_CENTRAL_INFORMATION_ANSWER_ZIRCONIUM_CRYSTAL_DENSITY	"REQUEST_SHIP_CENTRAL_INFORMATION_ANSWER_ZIRCONIUM_CRYSTAL_DENSITY"
#define	REQUEST_SHIP_CENTRAL_INFORMATION_ANSWER_ILMENITE_DENSITY			"REQUEST_SHIP_CENTRAL_INFORMATION_ANSWER_ILMENITE_DENSITY"
#define REQUEST_SHIP_CENTRAL_INFORMATION_ANSWER_TITANIUM_DENSITY			"REQUEST_SHIP_CENTRAL_INFORMATION_ANSWER_TITANIUM_DENSITY"

#define REQUEST_SHIP_CENTRAL_INFORMATION_ANSWER_FAIL           "reason"
#define REQUEST_SHIP_CENTRAL_INFORMATION_ANSWER_SHIPNE         "SHIP_NOT_EXISTS"               /* dana lod neexistuje */
#define REQUEST_SHIP_CENTRAL_INFORMATION_ANSWER_SHIPNO         "SHIP_NOT_OWNED"                /* hrac nevlastni danou lod */

// ################################

#define REQUEST_FORTRESS_SHIELDS_INFORMATION                       "fortresssShieldsInformation"
#define REQUEST_FORTRESS_SHIELDS_INFORMATION_FORTRESSID            "fortresssShieldsInformationShipId"

#define REQUEST_FORTRESS_SHIELDS_INFORMATION_ANSWER_ENERGY         "actualEnergy"
#define REQUEST_FORTRESS_SHIELDS_INFORMATION_ANSWER_ACCUMULATOR    "actualAccumulator"
#define REQUEST_FORTRESS_SHIELDS_INFORMATION_ANSWER_SOLIDITY       "actualSolidity"
#define REQUEST_FORTRESS_SHIELDS_INFORMATION_ANSWER_CHARGING       "actualCharging"
#define REQUEST_FORTRESS_SHIELDS_INFORMATION_ANSWER_LEAK           "actualLeak"
#define REQUEST_FORTRESS_SHIELDS_INFORMATION_ANSWER_TARGET_ENERGY  "targetEnergy"
#define REQUEST_FORTRESS_SHIELDS_INFORMATION_ANSWER_CONSUMPTION    "actualConsumption"
#define REQUEST_FORTRESS_SHIELDS_INFORMATION_ANSWER_STATUS         "actualStatus"
#define REQUEST_FORTRESS_SHIELDS_INFORMATION_ANSWER_AVAILABLE	   "deflectorShieldsAvailable"
#define REQUEST_FORTRESS_SHIELDS_INFORMATION_ANSWER_GRADIENT       "gradient"

#define REQUEST_FORTRESS_SHIELDS_INFORMATION_ANSWER_FAIL           "reason"
#define REQUEST_FORTRESS_SHIELDS_INFORMATION_ANSWER_FORTRESSNE     "FORTRESS_NOT_EXISTS"               /* dana lod neexistuje */
#define REQUEST_FORTRESS_SHIELDS_INFORMATION_ANSWER_FORTRESSNO     "FORTRESS_NOT_OWNED"                /* hrac nevlastni danou lod */

// ################################

#define REQUEST_SHIP_SUBSPACE_DRIVE_INFORMATION								"shipsSubspaceDriveInformation"
#define REQUEST_SHIP_SUBSPACE_DRIVE_INFORMATION_SHIPID						"shipsSubspaceDriveInformationShipId"
#define REQUEST_SHIP_SUBSPACE_DRIVE_INFORMATION_ANSWER_NAVIGATION_COMPUTER_MAX_SPEED	"shipsSubspaceDriveNavigationMaxSpeed"
#define REQUEST_SHIP_SUBSPACE_DRIVE_INFORMATION_ANSWER_NAVIGATION_COMPUTER_STATUS		"shipsSubspaceDriveNavigationStatus"
#define REQUEST_SHIP_SUBSPACE_DRIVE_INFORMATION_ANSWER_NAVIGATION_COMPUTER_AVAILABLE	"shipsSubspaceDriveNavigationAvailable"
#define REQUEST_SHIP_SUBSPACE_DRIVE_INFORMATION_ANSWER_INTERTIAL_DAMPERS_MAX_SPEED		"shipsSubspaceDriveDampersSpeed"
#define REQUEST_SHIP_SUBSPACE_DRIVE_INFORMATION_ANSWER_INTERTIAL_DAMPERS_STATUS			"shipsSubspaceDriveDampersStatus"
#define REQUEST_SHIP_SUBSPACE_DRIVE_INFORMATION_ANSWER_INTERTIAL_DAMPERS_AVAILABLE		"shipsSubspaceDriveDampersAvailable"
#define REQUEST_SHIP_SUBSPACE_DRIVE_INFORMATION_ANSWER_SUBSPACE_BEACON_MAX_SPEED		"shipsSubspaceDriveBeaconSpeed"
#define REQUEST_SHIP_SUBSPACE_DRIVE_INFORMATION_ANSWER_SUBSPACE_BEACON_STATUS			"shipsSubspaceDriveBeaconStatus"
#define REQUEST_SHIP_SUBSPACE_DRIVE_INFORMATION_ANSWER_SUBSPACE_BEACON_AVAILABLE		"shipsSubspaceDriveBeaconAvailable"
#define REQUEST_SHIP_SUBSPACE_DRIVE_INFORMATION_ANSWER_QUARK_GLUON_CORE_MAX_SPEED		"shipsSubspaceDriveQuarkMaxSpeed"
#define REQUEST_SHIP_SUBSPACE_DRIVE_INFORMATION_ANSWER_QUARK_GLUON_CORE_CONSUMPTION		"shipsSubspaceDriveQuarkConsumption"
#define REQUEST_SHIP_SUBSPACE_DRIVE_INFORMATION_ANSWER_QUARK_GLUON_CORE_STATUS			"shipsSubspaceDriveQuarkStatus"
#define REQUEST_SHIP_SUBSPACE_DRIVE_INFORMATION_ANSWER_QUARK_GLUON_CORE_AVAILABLE		"shipsSubspaceDriveQuarkAvailable"

#define REQUEST_SHIP_SUBSPACE_DRIVE_INFORMATION_ANSWER_CONSUMPTION						"shipsSubspaceDriveConsumption"
#define REQUEST_SHIP_SUBSPACE_DRIVE_INFORMATION_ANSWER_SPEED_TOC						"shipsSubspaceDriveSpeedToC"

#define REQUEST_SHIP_SUBSPACE_DRIVE_INFORMATION_ANSWER_FAIL           "reason"
#define REQUEST_SHIP_SUBSPACE_DRIVE_INFORMATION_ANSWER_SHIPNE         "SHIP_NOT_EXISTS"               /* dana lod neexistuje */
#define REQUEST_SHIP_SUBSPACE_DRIVE_INFORMATION_ANSWER_SHIPNO         "SHIP_NOT_OWNED"                /* hrac nevlastni danou lod */


struct subspace_drive_status
{
    double navigation_computer_max_speed;
    double navigation_computer_status;
	bool navigation_computer_available;

    double inertial_dampers_max_speed;
    double inertial_dampers_status;
	bool inertial_dampers_available;

    double subspace_beacon_max_speed;
    double subspace_beacon_status;
	bool subspace_beacon_available;

    double quark_gluon_core_max_speed;
    double quark_gluon_core_consumption;
    double quark_gluon_core_status;
	bool quark_gluon_core_available;

	unsigned long actualConsumption;    
	double actualSpeedToC;     
};

// ################################

#define REQUEST_SHIP_IMPULSE_DRIVE_INFORMATION                       "shipsImpulseDriveInformation"
#define REQUEST_SHIP_IMPULSE_DRIVE_INFORMATION_SHIPID                "shipsImpulseDriveInformationShipId"

#define REQUEST_SHIP_IMPULSE_DRIVE_INFORMATION_ANSWER_FAIL           "reason"
#define REQUEST_SHIP_IMPULSE_DRIVE_INFORMATION_ANSWER_SHIPNE         "SHIP_NOT_EXISTS"               /* dana lod neexistuje */
#define REQUEST_SHIP_IMPULSE_DRIVE_INFORMATION_ANSWER_SHIPNO         "SHIP_NOT_OWNED"                /* hrac nevlastni danou lod */


#define REQUEST_SHIP_IMPULSE_DRIVE_INFORMATION_ANSWER_ACTUAL_JET_FORCE							"shipsImpulseActualJetForce"
#define REQUEST_SHIP_IMPULSE_DRIVE_INFORMATION_ANSWER_ACTUAL_CONSUMPTION						"shipsImpulseActualConsumption"
#define REQUEST_SHIP_IMPULSE_DRIVE_INFORMATION_ANSWER_MECHANICAL_DAMPERS_MAX_ACCELERATION		"shipsImpulseDampersMaxAcc"
#define REQUEST_SHIP_IMPULSE_DRIVE_INFORMATION_ANSWER_MECHANICAL_DAMPERS_STATUS					"shipsImpulseDampersStatus"
#define REQUEST_SHIP_IMPULSE_DRIVE_INFORMATION_ANSWER_MECHANICAL_DAMPERS_AVAILABLE				"shipsImpulseDampersAvailable"
#define REQUEST_SHIP_IMPULSE_DRIVE_INFORMATION_ANSWER_IMPULSE_JET_ENGINE_ACTUAL_FORCE			"shipsImpulseEngineForce"
#define REQUEST_SHIP_IMPULSE_DRIVE_INFORMATION_ANSWER_IMPULSE_JET_ENGINE_ACTUAL_CONSUMPTION		"shipsImpulseEngineConsumption"
#define REQUEST_SHIP_IMPULSE_DRIVE_INFORMATION_ANSWER_IMPULSE_JET_ENGINE_STATUS					"shipsImpulseEngineStatus"
#define REQUEST_SHIP_IMPULSE_DRIVE_INFORMATION_ANSWER_IMPULSE_JET_ENGINE_AVAILABLE				"shipsImpulseEngineAvailable"


struct impulse_drive_status
{
    unsigned long long  actualJetForce;
    unsigned long long  actualConsumption;

    unsigned long long  mechanical_dampers_max_acceleration;
    double              mechanical_dampers_status;
	bool				mechanical_dampers_available;

    unsigned long long  impulse_jet_engine_actual_force;
    unsigned long long  impulse_jet_engine_actual_consumption;
    double              impulse_jet_engine_status;
	bool				impulse_jet_engine_available;
};

// ################################

#define REQUEST_FORTRESS_WEAPONS_INFORMATION                            "fortressWeaponsInformation"
#define REQUEST_FORTRESS_WEAPONS_INFORMATION_FORTRESSID                 "fortressWeaponsInformationFortressId"

#define REQUEST_FORTRESS_WEAPONS_INFORMATION_ANSWER_FAIL                "reason"
#define REQUEST_FORTRESS_WEAPONS_INFORMATION_ANSWER_FORTRESSNE          "FORTRESS_NOT_EXISTS"               /* dana pevnost neexistuje */
#define REQUEST_FORTRESS_WEAPONS_INFORMATION_ANSWER_FORTRESSNO          "FORTRESS_NOT_OWNED"                /* hrac nevlastni danou pevnost */

#define REQUEST_FORTRESS_WEAPONS_INFORMATION_ANSWER_DRONE_LAUNCHER_ENERGY				"fortressWeaponsDroneLauncherEnergy"
#define REQUEST_FORTRESS_WEAPONS_INFORMATION_ANSWER_DRONE_LAUNCHER_TARGET_ENERGY		"fortressWeaponsDroneLauncherTargetEnergy"
#define REQUEST_FORTRESS_WEAPONS_INFORMATION_ANSWER_DRONE_LAUNCHER_ACTUAL_ACCUMULATOR	"fortressWeaponsDroneLauncherAccumulator"
#define REQUEST_FORTRESS_WEAPONS_INFORMATION_ANSWER_DRONE_LAUNCHER_STATUS				"fortressWeaponsDroneLauncherStatus"
#define REQUEST_FORTRESS_WEAPONS_INFORMATION_ANSWER_DRONE_LAUNCHER_INDEX				"fortressWeaponsDroneLauncherIndex"
#define REQUEST_FORTRESS_WEAPONS_INFORMATION_ANSWER_DRONE_LAUNCHER_COUNT				"fortressWeaponsDroneLauncherCount"
#define REQUEST_FORTRESS_WEAPONS_INFORMATION_ANSWER_DRONE_LAUNCHER_ID					"fortressWeaponsDroneLauncherId"
#define REQUEST_FORTRESS_WEAPONS_INFORMATION_ANSWER_DRONE_LAUNCHER_GRADIENT				"fortressWeaponsDroneLauncherGradient"

struct drone_missile_launcher_status
{
    unsigned long long energy;
    unsigned long long targetEnergy;
    unsigned long long actualAccumulator;
    double             status;
    unsigned long long index;
	unsigned long      id;
	double			   gradient;
};

#define REQUEST_FORTRESS_WEAPONS_INFORMATION_ANSWER_LASER_GUN_ENERGY				"fortressWeaponsLaserGunEnergy"
#define REQUEST_FORTRESS_WEAPONS_INFORMATION_ANSWER_LASER_GUN_TARGET_ENERGY			"fortressWeaponsLaserGunTargetEnergy"
#define REQUEST_FORTRESS_WEAPONS_INFORMATION_ANSWER_LASER_GUN_ACTUAL_ACCUMULATOR	"fortressWeaponsLaserGunActualAccumulator"
#define REQUEST_FORTRESS_WEAPONS_INFORMATION_ANSWER_LASER_GUN_ACTUAL_RANGE			"fortressWeaponsLaserGunActualRange"
#define REQUEST_FORTRESS_WEAPONS_INFORMATION_ANSWER_LASER_GUN_ACTUAL_PRECISION		"fortressWeaponsLaserGunActualPrecision"
#define REQUEST_FORTRESS_WEAPONS_INFORMATION_ANSWER_LASER_GUN_ACTUAL_FORCIBILITY	"fortressWeaponsLaserGunActualForcibility"
#define REQUEST_FORTRESS_WEAPONS_INFORMATION_ANSWER_LASER_GUN_STATUS				"fortressWeaponsLaserGunStatus"
#define REQUEST_FORTRESS_WEAPONS_INFORMATION_ANSWER_LASER_GUN_INDEX					"fortressWeaponsLaserGunIndex"
#define REQUEST_FORTRESS_WEAPONS_INFORMATION_ANSWER_LASER_GUN_COUNT					"fortressWeaponsLaserGunCount"
#define REQUEST_FORTRESS_WEAPONS_INFORMATION_ANSWER_LASER_GUN_ID					"fortressWeaponsLaserGunId"
#define REQUEST_FORTRESS_WEAPONS_INFORMATION_ANSWER_LASER_GUN_GRADIENT				"fortressWeaponsLaserGradient"

#define REQUEST_FORTRESS_WEAPONS_INFORMATION_ANSWER_AVAL_WEAPON_ENERGY_CIRCUIT		"aval_weapon_energy_circuit"
#define REQUEST_FORTRESS_WEAPONS_INFORMATION_ANSWER_AVAL_LASER_GUNS					"aval_laser_guns"
#define REQUEST_FORTRESS_WEAPONS_INFORMATION_ANSWER_AVAL_DRONE_MISSILE_LAUNCHERS	"aval_drone_missile_launchers"
#define REQUEST_FORTRESS_WEAPONS_INFORMATION_ANSWER_AVAL_DRONE_MISSILES				"aval_drone_missiles"

#define REQUEST_FORTRESS_WEAPONS_INFORMATION_ANSWER_MAX_DRONE_MISSILE_LAUNCHERS		"max_drone_missile_launchers"
#define REQUEST_FORTRESS_WEAPONS_INFORMATION_ANSWER_MAX_LASER_GUNS					"max_laser_guns"

struct laser_gun_status
{
    unsigned long long energy;
    unsigned long long targetEnergy;
    unsigned long long actualAccumulator;
    unsigned long long actualRange;
    unsigned long long actualPrecision;
    unsigned long long actualForcibility;
    double             status;
    unsigned long long index;
	unsigned long      id;
	double			   gradient;
};

#define REQUEST_FORTRESS_WEAPONS_INFORMATION_ANSWER_WEAPON_ENERGY_CIRTUIT_CHARGING			"fortressWeaponsWeaponEnergyCircuitCharging"
#define REQUEST_FORTRESS_WEAPONS_INFORMATION_ANSWER_WEAPON_ENERGY_CIRTUIT_CLIENT_CHARGING	"fortressWeaponsInformationWeaponEnergyCirtuitClientCharging"
#define REQUEST_FORTRESS_WEAPONS_INFORMATION_ANSWER_WEAPON_ENERGY_CIRCUIT_STATUS			"fortressWeaponsWeaponEnergyCircuitStatus"
#define REQUEST_FORTRESS_WEAPONS_INFORMATION_ANSWER_WEAPON_DISTANCE_TO_THE_WEAPONS_TARGET	"fortressWeaponsWeaponDistanceToTheWeaponsTarget"
#define REQUEST_FORTRESS_WEAPONS_INFORMATION_ANSWER_WEAPON_TOTAL_CHARGING					"fortressWeaponsWeaponCharging"
#define REQUEST_FORTRESS_WEAPONS_INFORMATION_ANSWER_WEAPON_ACTUAL_ENERGY_CONSUMPTION		"fortressWeaponsWeaponEnergyConsumption"
#define REQUEST_FORTRESS_WEAPONS_INFORMATION_ANSWER_WEAPON_DRONE_MISSILES_ACTUAL_LAUNCH		"fortressWeaponsWeaponDroneMissilesActualLaunch"
#define REQUEST_FORTRESS_WEAPONS_INFORMATION_ANSWER_WEAPON_DRONE_MISSILES_ACTUAL_RANGE		"fortressWeaponsWeaponDroneMissilesActualRange"
#define REQUEST_FORTRESS_WEAPONS_INFORMATION_ANSWER_WEAPON_DRONE_MISSILES_ACTUAL_PRECISION	"fortressWeaponsWeaponDroneMissilesActualPrecision"
#define REQUEST_FORTRESS_WEAPONS_INFORMATION_ANSWER_WEAPON_DRONE_MISSILES_ACTUAL_DAMAGE		"fortressWeaponsWeaponDroneMissilesActualDamage"
#define REQUEST_FORTRESS_WEAPONS_INFORMATION_ANSWER_WEAPON_DRONE_MISSILES_COUNT				"fortressWeaponsWeaponDroneMissilesCount"
#define REQUEST_FORTRESS_WEAPONS_INFORMATION_ANSWER_WEAPON_DRONE_MISSILES_WORKING			"fortressWeaponsWeaponDroneMissilesWorking"
#define REQUEST_FORTRESS_WEAPONS_INFORMATION_ANSWER_WEAPON_DRONE_MISSILES_DAMAGED			"fortressWeaponsWeaponDroneMissilesDamaged"

struct weapons_status
{
    unsigned long long  weapon_energy_circuit_charging;
    double              weapon_energy_circuit_status;

    unsigned long long  weapon_distance_to_the_weapons_target;
    unsigned long long  weapon_total_charging;
    double              weapon_actual_energy_consumption;

    unsigned long long  drone_missiles_actual_launch;
    unsigned long long  drone_missiles_actual_range;
    unsigned long long  drone_missiles_actual_precision;
    unsigned long long  drone_missiles_actual_damage;
    unsigned long long  drone_missiles_count;
    unsigned long long  drone_missiles_working;
    unsigned long long  drone_missiles_damaged;

    std :: list<drone_missile_launcher_status> drone_missile_launchers;
    std :: list<laser_gun_status> laser_guns;

	bool avalWeaponEnergyCircuit;
	bool avalLaserGuns;
	bool avalDroneMissileLaunchers;
	bool avalDroneMissiles;

	unsigned long max_drone_missile_launchers;
	unsigned long max_laser_guns;

	unsigned long long weapon_energy_circuit_client_charging;
};

#define REQUEST_FORTRESS_WEAPONS_SET                "fortressWeaponsSet"
#define REQUEST_FORTRESS_WEAPONS_SET_FORTRESSID     "fortressWeaponsSetFortressId"

#define REQUEST_FORTRESS_WEAPONS_LAUNCHER_PREFIX    "droneTargetEnergy"
#define REQUEST_FORTRESS_WEAPONS_LASER_PREFIX       "laserTargetEnergy"

#define REQUEST_FORTRESS_WEAPONS_LAUNCHER_IS_SET	"droneIsSet"
#define REQUEST_FORTRESS_WEAPONS_LASER_IS_SET		"laserIsSet"

// ################################

struct mainframe_status
{
    unsigned long long actualBioNodes;
    unsigned long long actualPrediction;
    unsigned long long actualTimeReusability;
    double             actualConsumption;
    double             status;
};

#define REQUEST_FORTRESS_MAINFRAME_INFORMATION                            "fortressMainframeInformation"
#define REQUEST_FORTRESS_MAINFRAME_INFORMATION_FORTRESSID                 "fortressMainframeInformationFortressId"

#define REQUEST_FORTRESS_MAINFRAME_INFORMATION_ACTUAL_BIONODES				"fortressMainframeInformationActualBioNodes"
#define REQUEST_FORTRESS_MAINFRAME_INFORMATION_ACTUAL_PREDICTION			"fortressMainframeInformationActualPrediction"
#define REQUEST_FORTRESS_MAINFRAME_INFORMATION_ACTUAL_TIME_REUSABILITY		"fortressMainframeInformationActualTimeReusability"
#define REQUEST_FORTRESS_MAINFRAME_INFORMATION_ACTUAL_CONSUMPTION			"fortressMainframeInformationActualConsumption"
#define REQUEST_FORTRESS_MAINFRAME_INFORMATION_STATUS						"fortressMainframeInformationStatus"

#define REQUEST_FORTRESS_MAINFRAME_INFORMATION_ANSWER_FAIL                "reason"
#define REQUEST_FORTRESS_MAINFRAME_INFORMATION_ANSWER_FORTRESSNE          "FORTRESS_NOT_EXISTS"               /* dana pevnost neexistuje */
#define REQUEST_FORTRESS_MAINFRAME_INFORMATION_ANSWER_FORTRESSNO          "FORTRESS_NOT_OWNED"                /* hrac nevlastni danou pevnost */

// ################################

enum crew_type {
	CREW_TYPE_CAPTAIN = 1,
	CREW_TYPE_OFFICERS = 2,
	CREW_TYPE_PILOTS = 3, 
	CREW_TYPE_ENGINEERS = 4,
	CREW_TYPE_SCIENTISTS = 5,
	CREW_TYPE_DOCTORS = 6,
	CREW_TYPE_PASSENGERS = 7,
};

#define REQUEST_FORTRESS_CREW_INFORMATION                            "fortressCrewInformation"
#define REQUEST_FORTRESS_CREW_INFORMATION_FORTRESSID                 "fortressCrewInformationFortressId"

#define REQUEST_FORTRESS_CREW_INFORMATION_ABLE_CREW_CAPITAN             "fortress_crew_information_able_crew_capitan"
#define REQUEST_FORTRESS_CREW_INFORMATION_ABLE_CREW_DOCTOR				"fortress_crew_information_able_crew_doctor"
#define REQUEST_FORTRESS_CREW_INFORMATION_ABLE_CREW_OFFICER				"fortress_crew_information_able_crew_officer"
#define REQUEST_FORTRESS_CREW_INFORMATION_ABLE_CREW_ENGINEER			"fortress_crew_information_able_crew_engineer"
#define REQUEST_FORTRESS_CREW_INFORMATION_ABLE_CREW_PILOT				"fortress_crew_information_able_crew_pilot"
#define REQUEST_FORTRESS_CREW_INFORMATION_ABLE_CREW_SCIENTIST			"fortress_crew_information_able_crew_scientist"
#define REQUEST_FORTRESS_CREW_INFORMATION_ABLE_CREW_PASSENGER			"fortress_crew_information_able_crew_passenger"

#define REQUEST_FORTRESS_CREW_INFORMATION_WOUNDED_CREW_CAPITAN			"fortress_crew_information_wounded_crew_capitan"
#define REQUEST_FORTRESS_CREW_INFORMATION_WOUNDED_CREW_DOCTOR			"fortress_crew_information_wounded_crew_doctor"
#define REQUEST_FORTRESS_CREW_INFORMATION_WOUNDED_CREW_OFFICER			"fortress_crew_information_wounded_crew_officer"
#define REQUEST_FORTRESS_CREW_INFORMATION_WOUNDED_CREW_ENGINEER			"fortress_crew_information_wounded_crew_engineer"
#define REQUEST_FORTRESS_CREW_INFORMATION_WOUNDED_CREW_PILOT			"fortress_crew_information_wounded_crew_pilot"
#define REQUEST_FORTRESS_CREW_INFORMATION_WOUNDED_CREW_SCIENTIST		"fortress_crew_information_wounded_crew_scientist"
#define REQUEST_FORTRESS_CREW_INFORMATION_WOUNDED_CREW_PASSENGER		"fortress_crew_information_wounded_crew_passenger"

#define REQUEST_FORTRESS_CREW_INFORMATION_TOTAL_CREW_CAPITAN			"fortress_crew_information_total_crew_capitan"
#define REQUEST_FORTRESS_CREW_INFORMATION_TOTAL_CREW_DOCTOR				"fortress_crew_information_total_crew_doctor"
#define REQUEST_FORTRESS_CREW_INFORMATION_TOTAL_CREW_OFFICER			"fortress_crew_information_total_crew_officer"
#define REQUEST_FORTRESS_CREW_INFORMATION_TOTAL_CREW_ENGINEER			"fortress_crew_information_total_crew_engineer"
#define REQUEST_FORTRESS_CREW_INFORMATION_TOTAL_CREW_PILOT				"fortress_crew_information_total_crew_pilot"
#define REQUEST_FORTRESS_CREW_INFORMATION_TOTAL_CREW_SCIENTIST			"fortress_crew_information_total_crew_scientist"
#define REQUEST_FORTRESS_CREW_INFORMATION_TOTAL_CREW_PASSENGER			"fortress_crew_information_total_crew_passenger"

#define REQUEST_FORTRESS_CREW_INFORMATION_ACT_PEOPLE_WEIGHT				"fortress_crew_information_act_people_weight"

#define REQUEST_FORTRESS_CREW_INFORMATION_ANSWER_FAIL                "reason"
#define REQUEST_FORTRESS_CREW_INFORMATION_ANSWER_FORTRESSNE          "FORTRESS_NOT_EXISTS"               /* dana pevnost neexistuje */
#define REQUEST_FORTRESS_CREW_INFORMATION_ANSWER_FORTRESSNO          "FORTRESS_NOT_OWNED"                /* hrac nevlastni danou pevnost */

struct crew_status
{
    unsigned long long ABLE_CREW_CAPITAN;
    unsigned long long ABLE_CREW_DOCTOR;
    unsigned long long ABLE_CREW_OFFICER;
    unsigned long long ABLE_CREW_ENGINEER;
    unsigned long long ABLE_CREW_PILOT;
    unsigned long long ABLE_CREW_SCIENTIST;
    unsigned long long ABLE_CREW_PASSENGER;

    unsigned long long WOUNDED_CREW_CAPITAN;
    unsigned long long WOUNDED_CREW_DOCTOR;
    unsigned long long WOUNDED_CREW_OFFICER;
    unsigned long long WOUNDED_CREW_ENGINEER;
    unsigned long long WOUNDED_CREW_PILOT;
    unsigned long long WOUNDED_CREW_SCIENTIST;
    unsigned long long WOUNDED_CREW_PASSENGER;

    unsigned long long TOTAL_CREW_CAPITAN;
    unsigned long long TOTAL_CREW_DOCTOR;
    unsigned long long TOTAL_CREW_OFFICER;
    unsigned long long TOTAL_CREW_ENGINEER;
    unsigned long long TOTAL_CREW_PILOT;
    unsigned long long TOTAL_CREW_SCIENTIST;
    unsigned long long TOTAL_CREW_PASSENGER;

    unsigned long long ACT_PEOPLE_WEIGHT;
};

// ################################

#define REQUEST_FORTRESS_ADD_CREW										"fortress_add_crew"
#define REQUEST_FORTRESS_ADD_CREW_FORTRESS_ID							"fortress_add_crew_fortress_id"
#define REQUEST_FORTRESS_ADD_CREW_ABLE_COUNT							"fortress_add_crew_able_count"
#define REQUEST_FORTRESS_ADD_CREW_WOUNDED_COUNT							"fortress_add_crew_wounded_count"
#define REQUEST_FORTRESS_ADD_CREW_CREW_TYPE								"fortress_add_crew_crew_type"

#define REQUEST_FORTRESS_ADD_CREW_ANSWER_FORTRESS_ID					"fortress_add_crew_answer_fortress_id"
#define REQUEST_FORTRESS_ADD_CREW_ANSWER_ABLE_COUNT						"fortress_add_crew_answer_able_count"
#define REQUEST_FORTRESS_ADD_CREW_ANSWER_WOUNDED_COUNT					"fortress_add_crew_answer_wounded_count"
#define REQUEST_FORTRESS_ADD_CREW_ANSWER_CREW_TYPE						"fortress_add_crew_answer_crew_type"

#define REQUEST_FORTRESS_ADD_CREW_ANSWER_FAIL							"FORTRESS_ADD_CREW_ANSWER_FAIL"
#define REQUEST_FORTRESS_ADD_CREW_ANSWER_FORTRESSNE						"FORTRESS_ADD_CREW_ANSWER_FORTRESSNE"
#define REQUEST_FORTRESS_ADD_CREW_ANSWER_FORTRESSNO						"FORTRESS_ADD_CREW_ANSWER_FORTRESSNO"

// ################################

#define REQUEST_FORTRESS_REMOVE_CREW									"fortress_remove_crew"
#define REQUEST_FORTRESS_REMOVE_CREW_FORTRESS_ID						"fortress_remove_crew_fortress_id"
#define REQUEST_FORTRESS_REMOVE_CREW_ABLE_COUNT							"fortress_remove_crew_able_count"
#define REQUEST_FORTRESS_REMOVE_CREW_WOUNDED_COUNT						"fortress_remove_crew_wounded_count"
#define REQUEST_FORTRESS_REMOVE_CREW_CREW_TYPE							"fortress_remove_crew_crew_type"

#define REQUEST_FORTRESS_REMOVE_CREW_ANSWER_FORTRESS_ID					"fortress_remove_crew_answer_fortress_id"
#define REQUEST_FORTRESS_REMOVE_CREW_ANSWER_ABLE_COUNT					"fortress_remove_crew_answer_able_count"
#define REQUEST_FORTRESS_REMOVE_CREW_ANSWER_WOUNDED_COUNT				"fortress_remove_crew_answer_wounded_count"
#define REQUEST_FORTRESS_REMOVE_CREW_ANSWER_CREW_TYPE					"fortress_remove_crew_answer_crew_type"

#define REQUEST_FORTRESS_REMOVE_CREW_ANSWER_FAIL						"FORTRESS_REMOVE_CREW_ANSWER_FAIL"
#define REQUEST_FORTRESS_REMOVE_CREW_ANSWER_FORTRESSNE					"FORTRESS_REMOVE_CREW_ANSWER_FORTRESSNE"
#define REQUEST_FORTRESS_REMOVE_CREW_ANSWER_FORTRESSNO					"FORTRESS_REMOVE_CREW_ANSWER_FORTRESSNO"


// ################################

struct quarry_status
{
    double QuarkGluonPlasmaQuarryingSpeed;
    double HeavyWaterQuarryingSpeed;
    double ZirconiumCrystalQuarryingSpeed;
    double IlmeniteQuarryingSpeed;

    unsigned long long QuarkGluonPlasmaQuarryingActualMaximalSpeed;
    unsigned long long HeavyWaterQuarryingActualMaximalSpeed;
    unsigned long long ZirconiumCrystalQuarryingActualMaximalSpeed;
    unsigned long long IlmeniteQuarryingActualMaximalSpeed;

    unsigned long QuarkGluonPlasmaQuarryingActualRange;
    unsigned long HeavyWaterQuarryingActualRange;
    unsigned long ZirconiumCrystalQuarryingActualRange;
    unsigned long IlmeniteQuarryingActualRange;

    unsigned long long QuarkGluonPlasmaQuarryingCount;
    unsigned long long HeavyWaterQuarryingCount;
    unsigned long long ZirconiumCrystalQuarryingCount;
    unsigned long long IlmeniteQuarryingCount;

    unsigned long long QuarkGluonPlasmaQuarryingWorking;
    unsigned long long HeavyWaterQuarryingWorking;
    unsigned long long ZirconiumCrystalQuarryingWorking;
    unsigned long long IlmeniteQuarryingWorking;

    unsigned long long QuarkGluonPlasmaQuarryingDamaged;
    unsigned long long HeavyWaterQuarryingDamaged;
    unsigned long long ZirconiumCrystalQuarryingDamaged;
    unsigned long long IlmeniteQuarryingDamaged;

    bool isPossibleToQuarryQuarkGluonPlasma;
    bool isPossibleToQuarryHeavyWater;
    bool isPossibleToQuarryZirconiumCrystals;
    bool isPossibleToQuarryIlmenite;

    bool isActuallyQuarryingQuarkGluonPlasma;
    bool isActuallyQuarryingHeavyWater;
    bool isActuallyQuarryingZirconiumCrystals;
    bool isActuallyQuarryingIlmenite;

	bool avalSubmersibleFiltrationTank;	
	bool avalUndergroundDrillingMachine;	
	bool avalMagneticalCollectorsOfPlasma;	
	bool avalSubmarineMiningMachine;	
};

#define REQUEST_FORTRESS_QUARRY_INFORMATION                         "fortressQuarryInformation"
#define REQUEST_FORTRESS_QUARRY_INFORMATION_FORTRESSID              "fortressQuarryInformationFortressId"

#define REQUEST_FORTRESS_QUARRY_INFORMATION_ANSWER_FORTRESSID       "fortressQuarryInformationFortressId"

#define REQUEST_FORTRESS_QUARRY_INFORMATION_ANSWER_QGP_SPEED        "QuarkGluonPlasmaQuarryingSpeed"
#define REQUEST_FORTRESS_QUARRY_INFORMATION_ANSWER_HWA_SPEED        "HeavyWaterQuarryingSpeed"
#define REQUEST_FORTRESS_QUARRY_INFORMATION_ANSWER_ZRC_SPEED        "ZirconiumCrystalQuarryingSpeed"
#define REQUEST_FORTRESS_QUARRY_INFORMATION_ANSWER_ILM_SPEED        "IlmeniteQuarryingSpeed"

#define REQUEST_FORTRESS_QUARRY_INFORMATION_ANSWER_QGP_COUNT        "QuarkGluonPlasmaQuarryingCount"
#define REQUEST_FORTRESS_QUARRY_INFORMATION_ANSWER_HWA_COUNT        "HeavyWaterQuarryingCount"
#define REQUEST_FORTRESS_QUARRY_INFORMATION_ANSWER_ZRC_COUNT        "ZirconiumCrystalQuarryingCount"
#define REQUEST_FORTRESS_QUARRY_INFORMATION_ANSWER_ILM_COUNT        "IlmeniteQuarryingCount"

#define REQUEST_FORTRESS_QUARRY_INFORMATION_ANSWER_QGP_WORKING      "QuarkGluonPlasmaQuarryingWorking"
#define REQUEST_FORTRESS_QUARRY_INFORMATION_ANSWER_HWA_WORKING      "HeavyWaterQuarryingWorking"
#define REQUEST_FORTRESS_QUARRY_INFORMATION_ANSWER_ZRC_WORKING      "ZirconiumCrystalQuarryingWorking"
#define REQUEST_FORTRESS_QUARRY_INFORMATION_ANSWER_ILM_WORKING      "IlmeniteQuarryingWorking"

#define REQUEST_FORTRESS_QUARRY_INFORMATION_ANSWER_QGP_DAMAGED      "QuarkGluonPlasmaQuarryingDamaged"
#define REQUEST_FORTRESS_QUARRY_INFORMATION_ANSWER_HWA_DAMAGED      "HeavyWaterQuarryingDamaged"
#define REQUEST_FORTRESS_QUARRY_INFORMATION_ANSWER_ZRC_DAMAGED      "ZirconiumCrystalQuarryingDamaged"
#define REQUEST_FORTRESS_QUARRY_INFORMATION_ANSWER_ILM_DAMAGED      "IlmeniteQuarryingDamaged"

#define REQUEST_FORTRESS_QUARRY_INFORMATION_ANSWER_QGP_ACT_RANGE    "QuarkGluonPlasmaQuarryingActualRange"
#define REQUEST_FORTRESS_QUARRY_INFORMATION_ANSWER_HWA_ACT_RANGE    "HeavyWaterQuarryingActualRange"
#define REQUEST_FORTRESS_QUARRY_INFORMATION_ANSWER_ZRC_ACT_RANGE    "ZirconiumCrystalQuarryingActualRange"
#define REQUEST_FORTRESS_QUARRY_INFORMATION_ANSWER_ILM_ACT_RANGE    "IlmeniteQuarryingActualRange"

#define REQUEST_FORTRESS_QUARRY_INFORMATION_ANSWER_QGP_MAX_SPEED    "QuarkGluonPlasmaQuarryingMaxSpeed"
#define REQUEST_FORTRESS_QUARRY_INFORMATION_ANSWER_HWA_MAX_SPEED    "HeavyWaterQuarryingMaxSpeed"
#define REQUEST_FORTRESS_QUARRY_INFORMATION_ANSWER_ZRC_MAX_SPEED    "ZirconiumCrystalQuarryingMaxSpeed"
#define REQUEST_FORTRESS_QUARRY_INFORMATION_ANSWER_ILM_MAX_SPEED    "IlmeniteQuarryingMaxSpeed"

#define REQUEST_FORTRESS_QUARRY_INFORMATION_ANSWER_ISP_QGP          "isPossibleToQuarryQuarkGluonPlasma"
#define REQUEST_FORTRESS_QUARRY_INFORMATION_ANSWER_ISP_HWA          "isPossibleToQuarryHeavyWater"
#define REQUEST_FORTRESS_QUARRY_INFORMATION_ANSWER_ISP_ZRC          "isPossibleToQuarryZirconiumCrystals"
#define REQUEST_FORTRESS_QUARRY_INFORMATION_ANSWER_ISP_ILM          "isPossibleToQuarryIlmenite"

#define REQUEST_FORTRESS_QUARRY_INFORMATION_ANSWER_IAQ_QGP          "isActualQuarryingQuarkGluonPlasma"
#define REQUEST_FORTRESS_QUARRY_INFORMATION_ANSWER_IAQ_HWA          "isActualQuarryingHeavyWater"
#define REQUEST_FORTRESS_QUARRY_INFORMATION_ANSWER_IAQ_ZRC          "isActualQuarryingZirconiumCrystals"
#define REQUEST_FORTRESS_QUARRY_INFORMATION_ANSWER_IAQ_ILM          "isActualQuarryingIlmenite"

#define REQUEST_FORTRESS_QUARRY_INFORMATION_ANSWER_AVAL_MAGNETICAL_COLLECTORS				"aval_magnetical_collectors"
#define REQUEST_FORTRESS_QUARRY_INFORMATION_ANSWER_AVAL_SUBMARINE_MINING_MACHINE			"aval_submarine_mining_machine"
#define REQUEST_FORTRESS_QUARRY_INFORMATION_ANSWER_AVAL_SUBMERSIBLE_FILTRATION_TANK			"aval_submersible_filtration_tank"
#define REQUEST_FORTRESS_QUARRY_INFORMATION_ANSWER_AVAL_UNDERGROUND_DRILLING_MACHINE		"aval_underground_drilling_machine"

#define REQUEST_FORTRESS_QUARRY_CHANGE_STATE                        "fortressQuarryChangeState"
#define REQUEST_FORTRESS_QUARRY_CHANGE_STATE_FORTRESS_ID            "FortressId"
#define REQUEST_FORTRESS_QUARRY_CHANGE_STATE_PQ_TYPE                "PQType"
#define REQUEST_FORTRESS_QUARRY_CHANGE_STATE_NEW_STATE              "newState"

#define REQUEST_FORTRESS_QUARRY_INFORMATION_ANSWER_FAIL             "reason"

#define REQUEST_FORTRESS_QUARRY_INFORMATION_ANSWER_FORTRESSNE       "FORTRESS_NOT_EXISTS"               /* dana pevnost neexistuje */
#define REQUEST_FORTRESS_QUARRY_INFORMATION_ANSWER_FORTRESSNO       "FORTRESS_NOT_OWNED"                /* hrac nevlastni danou pevnost */

#define REQUEST_FORTRESS_QUARRY_CHANGE_STATE_ANSWER_FAIL            "reason"

#define REQUEST_FORTRESS_QUARRY_CHANGE_STATE_ANSWER_FORTRESSNE      "FORTRESS_NOT_EXISTS"               /* dana pevnost neexistuje */
#define REQUEST_FORTRESS_QUARRY_CHANGE_STATE_ANSWER_FORTRESSNO      "FORTRESS_NOT_OWNED"                /* hrac nevlastni danou pevnost */
#define REQUEST_FORTRESS_QUARRY_CHANGE_STATE_ANSWER_BAD_TYPE        "BAD_RESOURCE_TYPE"                 /* spatna (nedefinovana) surovina */

enum protQuarryType
{
    PQT_QuarkGluonPlasma = 4,
    PQT_HeavyWater = 64,
    PQT_ZirconiumCrystal = 128,
    PQT_Ilmenite = 256,
    PQT_All = 1024
};

// ################################

enum accommodation_type {
	ACCOMMODATION_COMFORTABLE_ROOM = 1,
	ACCOMMODATION_LUXURY_APPARTEMENT = 2,
	ACCOMMODATION_WAREHOUSE_WITH_LIFE_SUPPORT = 3, 
	ACCOMMODATION_COMMON_CABIN = 4,
};

struct accommodation_status {
	unsigned long long accommodationsSize;
	unsigned long long accommodationsWeight;

	unsigned long comfortableRoomsCount;
	unsigned long commonCabinsCount;
	unsigned long luxuryAccommodationsCount;
	unsigned long warehousesWithLifeSupportCount;

	unsigned long freeLuxuryAccommodations;
	unsigned long freeComfortableRooms;
	unsigned long freeCommonCabins;
	unsigned long freeWarehousesWithLifeSupport;

	unsigned long comfortableRoomsPrice;
	unsigned long commonCabinsPrice;
	unsigned long luxuryAccommodationsPrice;
	unsigned long warehousesWithLifeSupportPrice;

	unsigned long totalPoints;
	unsigned long consumedPoints;
};

#define REQUEST_FORTRESS_ACCOMMODATIONS_INFORMATION                            "fortress_accommodations_information"
#define REQUEST_FORTRESS_ACCOMMODATIONS_INFORMATION_FORTRESSID                 "fortress_accommodations_information_fortressid"

#define REQUEST_FORTRESS_ACCOMMODATIONS_INFORMATION_ANSWER_FAIL                "reason"
#define REQUEST_FORTRESS_ACCOMMODATIONS_INFORMATION_ANSWER_FORTRESSNE          "FORTRESS_NOT_EXISTS"               /* dana pevnost neexistuje */
#define REQUEST_FORTRESS_ACCOMMODATIONS_INFORMATION_ANSWER_FORTRESSNO          "FORTRESS_NOT_OWNED"                /* hrac nevlastni danou pevnost */

#define REQUEST_FORTRESS_ACCOMMODATIONS_INFORMATION_ACCOMMODATIONS_SIZE					"fortress_accommodations_information_accommodations_size"
#define REQUEST_FORTRESS_ACCOMMODATIONS_INFORMATION_ACCOMMODATIONS_WEIGHT				"fortress_accommodations_information_accommodations_weight"

#define REQUEST_FORTRESS_ACCOMMODATIONS_INFORMATION_COMFORTABLE_ROOMS_COUNT				"fortress_accommodations_information_comfortable_rooms_count"
#define REQUEST_FORTRESS_ACCOMMODATIONS_INFORMATION_COMMON_CABINS_COUNT					"fortress_accommodations_information_common_cabins_count"
#define REQUEST_FORTRESS_ACCOMMODATIONS_INFORMATION_LUXURY_ACCOMMODATIONS_COUNT			"fortress_accommodations_information_luxury_accommodations_count"
#define REQUEST_FORTRESS_ACCOMMODATIONS_INFORMATION_WAREHOUSES_WITH_LIFESUPPORT_COUNT	"fortress_accommodations_information_warehouses_with_lifesupport_count"

#define REQUEST_FORTRESS_ACCOMMODATIONS_INFORMATION_FREE_COMFORTABLE_ROOMS				"fortress_accommodations_information_free_comfortable_rooms"
#define REQUEST_FORTRESS_ACCOMMODATIONS_INFORMATION_FREE_COMMON_CABINS					"fortress_accommodations_information_free_common_cabins_count"
#define REQUEST_FORTRESS_ACCOMMODATIONS_INFORMATION_FREE_LUXURY_ACCOMMODATIONS			"fortress_accommodations_information_free_luxury_accommodations"
#define REQUEST_FORTRESS_ACCOMMODATIONS_INFORMATION_FREE_WAREHOUSES_WITH_LIFESUPPORT	"fortress_accommodations_information_free_warehouses_with_lifesupport"

#define REQUEST_FORTRESS_ACCOMMODATIONS_INFORMATION_COMFORTABLE_ROOMS_PRICE				"fortress_accommodations_information_comfortable_rooms_price"
#define REQUEST_FORTRESS_ACCOMMODATIONS_INFORMATION_COMMON_CABINS_PRICE					"fortress_accommodations_information_common_cabins_price"
#define REQUEST_FORTRESS_ACCOMMODATIONS_INFORMATION_LUXURY_ACCOMMODATIONS_PRICE			"fortress_accommodations_information_luxury_accommodations_price"
#define REQUEST_FORTRESS_ACCOMMODATIONS_INFORMATION_WAREHOUSES_WITH_LIFESUPPORT_PRICE	"fortress_accommodations_information_warehouses_with_lifesupport_price"

#define REQUEST_FORTRESS_ACCOMMODATIONS_INFORMATION_TOTAL_POINTS						"fortress_accommodations_information_total_points"
#define REQUEST_FORTRESS_ACCOMMODATIONS_INFORMATION_CONSUMED_POINTS						"fortress_accommodations_information_consumed_points"

// ################################

#define REQUEST_FORTRESS_ADD_ACCOMMODATIONS												"fortress_add_accommodations"
#define REQUEST_FORTRESS_ADD_ACCOMMODATIONS_FORTRESS_ID									"fortress_add_accommodations_fortress_id"
#define REQUEST_FORTRESS_ADD_ACCOMMODATIONS_ACCOMMODATION_COUNT							"fortress_add_accommodations_accommodation_count"
#define REQUEST_FORTRESS_ADD_ACCOMMODATIONS_ACCOMMODATION_TYPE							"fortress_add_accommodations_accommodation_type"

#define REQUEST_FORTRESS_ADD_ACCOMMODATIONS_ANSWER_FAIL									"REQUEST_FORTRESS_ADD_ACCOMMODATIONS_ANSWER_FAIL"
#define REQUEST_FORTRESS_ADD_ACCOMMODATIONS_ANSWER_FORTRESSNE							"REQUEST_FORTRESS_ADD_ACCOMMODATIONS_ANSWER_FORTRESSNE"
#define REQUEST_FORTRESS_ADD_ACCOMMODATIONS_ANSWER_FORTRESSNO							"REQUEST_FORTRESS_ADD_ACCOMMODATIONS_ANSWER_FORTRESSNO"

#define REQUEST_FORTRESS_ADD_ACCOMMODATIONS_ANSWER_ACCOMMODATION_COUNT					"REQUEST_FORTRESS_ADD_ACCOMMODATIONS_ANSWER_ACCOMMODATION_COUNT"
#define REQUEST_FORTRESS_ADD_ACCOMMODATIONS_ANSWER_ACCOMMODATION_TYPE					"REQUEST_FORTRESS_ADD_ACCOMMODATIONS_ANSWER_ACCOMMODATION_TYPE"
#define REQUEST_FORTRESS_ADD_ACCOMMODATIONS_ANSWER_FORTRESS_ID							"REQUEST_FORTRESS_ADD_ACCOMMODATIONS_ANSWER_FORTRESS_ID"

// ################################

struct other_equipment_status
{
	bool isLifeSupportAvailable;
	bool isPlasmaFilterAvailable;
	bool isScietificLabAvailable ;
	bool isSubspaceTransmitterAvailable;

	double actualEnergyConsumption;
	unsigned long long otherEquipmentWeight;
		
	unsigned long plasmaFilterActualTotalFilteringSpeed;
	double plasmaFilterStatus;
	
	unsigned long lifeSupportActualCapacity;
	double lifeSupportActualConsumption;
	double lifeSupportStatus;

	unsigned long scientificLabActualCapacity;
	unsigned long scientificLabActualLevel;
	double scientificLabStatus;

	unsigned long subspaceTransmitterActualMessageCost;
	double subspaceTransmitterStatus;
};

#define REQUEST_FORTRESS_OTHER_EQUIPMENT_INFORMATION                            "fortress_other_equipment_information"
#define REQUEST_FORTRESS_OTHER_EQUIPMENT_INFORMATION_FORTRESSID                 "fortress_other_equipment_information_fortressid"

#define REQUEST_FORTRESS_OTHER_EQUIPMENT_INFORMATION_ANSWER_FAIL                "reason"
#define REQUEST_FORTRESS_OTHER_EQUIPMENT_INFORMATION_ANSWER_FORTRESSNE          "FORTRESS_NOT_EXISTS"               /* dana pevnost neexistuje */
#define REQUEST_FORTRESS_OTHER_EQUIPMENT_INFORMATION_ANSWER_FORTRESSNO          "FORTRESS_NOT_OWNED"                /* hrac nevlastni danou pevnost */

#define REQUEST_FORTRESS_OTHER_EQUIPMENT_INFORMATION_LIFE_SUPPORT_AVAILABLE					"fortress_other_equipment_information_life_support_available"
#define REQUEST_FORTRESS_OTHER_EQUIPMENT_INFORMATION_PLASMA_FILTER_AVAILABLE				"fortress_other_equipment_information_plasma_filter_available"
#define REQUEST_FORTRESS_OTHER_EQUIPMENT_INFORMATION_SCIENTIFIC_LAB_AVAILABLE				"fortress_other_equipment_information_scientific_lab_available"
#define REQUEST_FORTRESS_OTHER_EQUIPMENT_INFORMATION_SUBSPACE_TRANSMITTER_AVAILABLE			"fortress_other_equipment_information_subspace_transmitter_available"
	
#define REQUEST_FORTRESS_OTHER_EQUIPMENT_INFORMATION_ACT_ENERGY_CONSUMPTION						"fortress_other_equipment_information_act_energy_consumption"
#define REQUEST_FORTRESS_OTHER_EQUIPMENT_INFORMATION_OTHER_EQUIPMENT_WEIGHT						"fortress_other_equipment_information_other_equipment_weight"

#define REQUEST_FORTRESS_OTHER_EQUIPMENT_INFORMATION_PLASMA_FILTER_ACT_TOTAL_FILTERING_SPEED	"fortress_other_equipment_information_plasma_filter_act_total_filtering_speed"
#define REQUEST_FORTRESS_OTHER_EQUIPMENT_INFORMATION_PLASMA_FILTER_STATUS						"fortress_other_equipment_information_plasma_filter_status"
	
#define REQUEST_FORTRESS_OTHER_EQUIPMENT_INFORMATION_LIFE_SUPPORT_CAPACITY						"fortress_other_equipment_information_life_support_capacity"
#define REQUEST_FORTRESS_OTHER_EQUIPMENT_INFORMATION_LIFE_SUPPORT_ACT_CONSUMPTION				"fortress_other_equipment_information_life_support_act_consumption"
#define REQUEST_FORTRESS_OTHER_EQUIPMENT_INFORMATION_LIFE_SUPPORT_STATUS						"fortress_other_equipment_information_life_support_status"

#define REQUEST_FORTRESS_OTHER_EQUIPMENT_INFORMATION_SCIENTIFIC_LAB_ACT_CAPACITY				"fortress_other_equipment_information_scientific_lab_act_capacity"
#define REQUEST_FORTRESS_OTHER_EQUIPMENT_INFORMATION_SCIENTIFIC_LAB_ACT_LEVEL					"fortress_other_equipment_information_scientific_lab_act_level"
#define REQUEST_FORTRESS_OTHER_EQUIPMENT_INFORMATION_SCIENTIFIC_LAB_STATUS						"fortress_other_equipment_information_scientific_lab_status"

#define REQUEST_FORTRESS_OTHER_EQUIPMENT_INFORMATION_SUBSPACE_TRANSMITTER_MESSAGE_COST			"fortress_other_equipment_information_subspace_transmitter_message_cost"
#define REQUEST_FORTRESS_OTHER_EQUIPMENT_INFORMATION_SUBSPACE_TRANSMITTER_STATUS				"fortress_other_equipment_information_subspace_transmitter_status"

// ################################

struct factories_status
{
	struct ilmenite_furnace_status 
	{
		bool isAvailable;
		unsigned long long count;
		unsigned long long actualTotalProduction;
		unsigned long long actualTotalConsumption;
		double actualMetamorphosisEffectivity;
		double actualSpaceMetamorphosisEffectivity;
		unsigned long long damaged;
		unsigned long long working;
	};

	struct magnetical_filter_status
	{
		bool isAvailable;
		unsigned long long count;
		double actualTotalProduction;
		unsigned long long damaged;
		unsigned long long working;
	};

	struct zirconium_reactor_status
	{
		bool isAvailable;
		unsigned long long count;
		double actualTotalProduction;
		unsigned long actualTotalConsumption;
		double actualMetamorphosisEffectivity;
		double actualSpaceMetamorphosisEffectivity;
		unsigned long long damaged;
		unsigned long long working;
	};

	struct deuterium_decomposer_status
	{
		bool isAvailable;
		unsigned long long count;
		unsigned long long actualTotalProduction;
		unsigned long long actualTotalConsumption;
		double actualMetamorphosisEffectivity;
		double actualSpaceMetamorphosisEffectivity;
		unsigned long long damaged;
		unsigned long long working;
	};

	unsigned long long factoriesSize;
	unsigned long long factoriesWeight;

	ilmenite_furnace_status	ilmeniteFurnace;
	magnetical_filter_status magneticalFilter;
	zirconium_reactor_status zirconiumReactor;
	deuterium_decomposer_status deuteriumDecomposer;
};

#define REQUEST_BASE_FACTORIES_INFORMATION									"base_factories_information"
#define REQUEST_BASE_FACTORIES_INFORMATION_FORTRESSID						"base_factories_information_fortressid"

#define REQUEST_BASE_FACTORIES_INFORMATION_ANSWER_FAIL						  "reason"
#define REQUEST_BASE_FACTORIES_INFORMATION_ANSWER_FORTRESSNE				  "FORTRESS_NOT_EXISTS"               /* dana pevnost neexistuje */
#define REQUEST_BASE_FACTORIES_INFORMATION_ANSWER_FORTRESSNO				  "FORTRESS_NOT_OWNED"                /* hrac nevlastni danou pevnost */
#define REQUEST_BASE_FACTORIES_INFORMATION_ANSWER_FORTRESSNOTBASE			  "FORTRESS_NOT_BASE"                 /* dana pevnost neni zakladna */

#define REQUEST_BASE_FACTORIES_INFORMATION_SIZE								"base_factories_information_size"
#define REQUEST_BASE_FACTORIES_INFORMATION_WEIGHT							"base_factories_information_weight"

#define REQUEST_BASE_FACTORIES_INFORMATION_ILMENITE_FURNACE_AVAILABLE									"base_factories_information_ilmenite_furnace_available"
#define REQUEST_BASE_FACTORIES_INFORMATION_ILMENITE_FURNACE_COUNT										"base_factories_information_ilmenite_furnace_count"
#define REQUEST_BASE_FACTORIES_INFORMATION_ILMENITE_FURNACE_ACTUAL_TOTAL_PRODUCTION						"base_factories_information_ilmenite_furnace_actual_total_production"
#define REQUEST_BASE_FACTORIES_INFORMATION_ILMENITE_FURNACE_ACTUAL_TOTAL_CONSUMPTION					"base_factories_information_ilmenite_furnace_actual_total_consumption"
#define REQUEST_BASE_FACTORIES_INFORMATION_ILMENITE_FURNACE_ACTUAL_METAMORPHOSIS_EFFECTIVITY			"base_factories_information_ilmenite_furnace_actual_metamorphosis_effectivity"
#define REQUEST_BASE_FACTORIES_INFORMATION_ILMENITE_FURNACE_ACTUAL_SPACE_METAMORPHOSIS_EFFECTIVITY		"base_factories_information_ilmenite_furnace_actual_space_metamorphosis_effectivity"
#define REQUEST_BASE_FACTORIES_INFORMATION_ILMENITE_FURNACE_DAMAGED										"base_factories_information_ilmenite_furnace_damaged"
#define REQUEST_BASE_FACTORIES_INFORMATION_ILMENITE_FURNACE_WORKING										"base_factories_information_ilmenite_furnace_working"
																													
#define REQUEST_BASE_FACTORIES_INFORMATION_MAGNETICAL_FILTER_AVAILABLE									"base_factories_information_magnetical_filter_available"
#define REQUEST_BASE_FACTORIES_INFORMATION_MAGNETICAL_FILTER_COUNT										"base_factories_information_magnetical_filter_count"
#define REQUEST_BASE_FACTORIES_INFORMATION_MAGNETICAL_FILTER_ACTUAL_TOTAL_PRODUCTION					"base_factories_information_magnetical_filter_actual_total_production"
#define REQUEST_BASE_FACTORIES_INFORMATION_MAGNETICAL_FILTER_DAMAGED									"base_factories_information_magnetical_filter_damaged"
#define REQUEST_BASE_FACTORIES_INFORMATION_MAGNETICAL_FILTER_WORKING									"base_factories_information_magnetical_filter_working"
																												
#define REQUEST_BASE_FACTORIES_INFORMATION_ZIRCONIUM_REACTOR_AVAILABLE									"base_factories_information_zirconium_reactor_available"
#define REQUEST_BASE_FACTORIES_INFORMATION_ZIRCONIUM_REACTOR_COUNT										"base_factories_information_zirconium_reactor_count"
#define REQUEST_BASE_FACTORIES_INFORMATION_ZIRCONIUM_REACTOR_ACTUAL_TOTAL_PRODUCTION					"base_factories_information_zirconium_reactor_actual_total_production"
#define REQUEST_BASE_FACTORIES_INFORMATION_ZIRCONIUM_REACTOR_ACTUAL_TOTAL_CONSUMPTION					"base_factories_information_zirconium_reactor_actual_total_consumption"
#define REQUEST_BASE_FACTORIES_INFORMATION_ZIRCONIUM_REACTOR_ACTUAL_METAMORPHOSIS_EFFECTIVITY			"base_factories_information_zirconium_reactor_actual_metamorphosis_effectivity"
#define REQUEST_BASE_FACTORIES_INFORMATION_ZIRCONIUM_REACTOR_ACTUAL_SPACE_METAMORPHOSIS_EFFECTIVITY		"base_factories_information_zirconium_reactor_actual_space_metamorphosis_effectivity"
#define REQUEST_BASE_FACTORIES_INFORMATION_ZIRCONIUM_REACTOR_DAMAGED									"base_factories_information_zirconium_reactor_damaged"
#define REQUEST_BASE_FACTORIES_INFORMATION_ZIRCONIUM_REACTOR_WORKING									"base_factories_information_zirconium_reactor_working"
																														
#define REQUEST_BASE_FACTORIES_INFORMATION_DEUTERIUM_DECOMPOSER_AVAILABLE								"base_factories_information_deuterium_decomposer_availale"
#define REQUEST_BASE_FACTORIES_INFORMATION_DEUTERIUM_DECOMPOSER_COUNT									"base_factories_information_deuterium_decomposer_count"
#define REQUEST_BASE_FACTORIES_INFORMATION_DEUTERIUM_DECOMPOSER_ACTUAL_TOTAL_PRODUCTION					"base_factories_information_deuterium_decomposer_actual_total_production"
#define REQUEST_BASE_FACTORIES_INFORMATION_DEUTERIUM_DECOMPOSER_ACTUAL_TOTAL_CONSUMPTION				"base_factories_information_deuterium_decomposer_actual_total_consumption"
#define REQUEST_BASE_FACTORIES_INFORMATION_DEUTERIUM_DECOMPOSER_ACTUAL_METAMORPHOSIS_EFFECTIVITY		"base_factories_information_deuterium_decomposer_actual_metamorphosis_effectivity"
#define REQUEST_BASE_FACTORIES_INFORMATION_DEUTERIUM_DECOMPOSER_ACTUAL_SPACE_METAMORPHOSIS_EFFECTIVITY	"base_factories_information_deuterium_decomposer_actual_space_metamorphosis_effectivity"
#define REQUEST_BASE_FACTORIES_INFORMATION_DEUTERIUM_DECOMPOSER_DAMAGED									"base_factories_information_deuterium_decomposer_damaged"
#define REQUEST_BASE_FACTORIES_INFORMATION_DEUTERIUM_DECOMPOSER_WORKING									"base_factories_information_deuterium_decomposer_working"

// ################################

struct warehouse_device_status {
	bool isAvailable;
	unsigned long actualCapacity;
	unsigned long long working ;
	unsigned long long damaged;
	unsigned long long count;
};

enum warehouse_parameter_type {
	WAREHOUSE_PARAMETER_UNSIGNED_LONG_LONG = 1,
	WAREHOUSE_PARAMETER_UNSIGNED_LONG = 2,
	WAREHOUSE_PARAMETER_SIGNED_LONG_LONG = 3,
	WAREHOUSE_PARAMETER_SIGNED_LONG = 4,
	WAREHOUSE_PARAMETER_DOUBLE = 5, 
	WAREHOUSE_PARAMETER_OTHER = 6,
};

struct warehouse_parameter_status {
	warehouse_parameter_type type;
	std::string name;
	std::string value;
	bool scienceIndependent;
};

struct warehouse_item_status {	
	typedef warehouse_parameter_status parameter_t;
	typedef std::list<parameter_t> parameters_list_t;

	bool isStackable;
	unsigned long id;
	unsigned long long working;
	unsigned long long damaged;
	std::string patternName;
	parameters_list_t parameters;
};

struct warehouses_status {			
	typedef std::list<warehouse_item_status> items_list_t;

	unsigned long long size;
	unsigned long long weight;

	warehouse_device_status energeticCell;
	warehouse_device_status magneticGrid;
	warehouse_device_status transportContainer;

	items_list_t warehouseItems;
};

#define REQUEST_FORTRESS_WAREHOUSES_INFORMATION									"fortress_warehouses_information"
#define REQUEST_FORTRESS_WAREHOUSES_INFORMATION_FORTRESSID						"fortress_warehouses_information_fortressid"

#define REQUEST_FORTRESS_WAREHOUSES_INFORMATION_ANSWER_FAIL						  "reason"
#define REQUEST_FORTRESS_WAREHOUSES_INFORMATION_ANSWER_FORTRESSNE				  "FORTRESS_NOT_EXISTS"               /* dana pevnost neexistuje */
#define REQUEST_FORTRESS_WAREHOUSES_INFORMATION_ANSWER_FORTRESSNO				  "FORTRESS_NOT_OWNED"                /* hrac nevlastni danou pevnost */

#define REQUEST_FORTRESS_WAREHOUSES_INFORMATION_WEIGHT							"fortress_warehouses_information_weight"
#define REQUEST_FORTRESS_WAREHOUSES_INFORMATION_SIZE							"fortress_warehouses_information_size"

#define REQUEST_FORTRESS_WAREHOUSES_INFORMATION_ENERGETIC_CELL_AVAILABLE				"fortress_warehouses_information_energetic_cell_available"
#define REQUEST_FORTRESS_WAREHOUSES_INFORMATION_ENERGETIC_CELL_CAPACITY					"fortress_warehouses_information_energetic_cell_capacity"
#define REQUEST_FORTRESS_WAREHOUSES_INFORMATION_ENERGETIC_CELL_WORKING					"fortress_warehouses_information_energetic_cell_working"
#define REQUEST_FORTRESS_WAREHOUSES_INFORMATION_ENERGETIC_CELL_DAMAGED					"fortress_warehouses_information_energetic_cell_damaged"
#define REQUEST_FORTRESS_WAREHOUSES_INFORMATION_ENERGETIC_CELL_COUNT					"fortress_warehouses_information_energetic_cell_count"

#define REQUEST_FORTRESS_WAREHOUSES_INFORMATION_MAGNETIC_GRID_AVAILABLE					"fortress_warehouses_information_magnetic_grid_available"
#define REQUEST_FORTRESS_WAREHOUSES_INFORMATION_MAGNETIC_GRID_CAPACITY					"fortress_warehouses_information_magnetic_grid_capacity"
#define REQUEST_FORTRESS_WAREHOUSES_INFORMATION_MAGNETIC_GRID_WORKING					"fortress_warehouses_information_magnetic_grid_working"
#define REQUEST_FORTRESS_WAREHOUSES_INFORMATION_MAGNETIC_GRID_DAMAGED					"fortress_warehouses_information_magnetic_grid_damaged"
#define REQUEST_FORTRESS_WAREHOUSES_INFORMATION_MAGNETIC_GRID_COUNT						"fortress_warehouses_information_magnetic_grid_count"

#define REQUEST_FORTRESS_WAREHOUSES_INFORMATION_TRANSPORT_CONTAINER_AVAILABLE			"fortress_warehouses_information_transport_container_available"
#define REQUEST_FORTRESS_WAREHOUSES_INFORMATION_TRANSPORT_CONTAINER_CAPACITY			"fortress_warehouses_information_transport_container_capacity"
#define REQUEST_FORTRESS_WAREHOUSES_INFORMATION_TRANSPORT_CONTAINER_WORKING				"fortress_warehouses_information_transport_container_working"
#define REQUEST_FORTRESS_WAREHOUSES_INFORMATION_TRANSPORT_CONTAINER_DAMAGED				"fortress_warehouses_information_transport_container_damaged"
#define REQUEST_FORTRESS_WAREHOUSES_INFORMATION_TRANSPORT_CONTAINER_COUNT				"fortress_warehouses_information_transport_container_count"

#define REQUEST_FORTRESS_WAREHOUSES_INFORMATION_ITEMS_PREFIX							"" // Nepotrebujeme zadny rozlisovaci prefix

#define WAREHOUSES_ITEM_STATUS_DAMAGED								"warehouses_item_status_working"
#define WAREHOUSES_ITEM_STATUS_WORKING								"warehouses_item_status_damaged"
#define WAREHOUSES_ITEM_STATUS_ID									"warehouses_item_status_item_id"
#define WAREHOUSES_ITEM_STATUS_NAME									"warehouses_item_status_item_name"
#define WAREHOUSES_ITEM_STATUS_COUNT								"warehouses_item_status_count"
#define WAREHOUSES_ITEM_STATUS_PARAM_COUNT							"warehouses_item_status_item_param_count"
#define WAREHOUSES_ITEM_STATUS_STACKABLE							"warehouses_item_status_stackable"
#define WAREHOUSES_ITEM_STATUS_PARAM_NAME							"warehouses_item_status_param_name"				
#define WAREHOUSES_ITEM_STATUS_PARAM_VALUE							"warehouses_item_status_param_value"
#define WAREHOUSES_ITEM_STATUS_PARAM_TYPE							"warehouses_item_status_param_type"
#define WAREHOUSES_ITEM_STATUS_PARAM_SCIENCE_INDEPENDENT				"warehouses_item_status_param_science_independent"

// ################################

#define PROTOCOL_PARAM_NAME_ACCUMULATOR							"PROTOCOL_PARAM_NAME_ACCUMULATOR"
#define PROTOCOL_PARAM_NAME_CHARGING							"PROTOCOL_PARAM_NAME_CHARGING"
#define PROTOCOL_PARAM_NAME_LEAK								"PROTOCOL_PARAM_NAME_LEAK"
#define PROTOCOL_PARAM_NAME_SOLIDITY							"PROTOCOL_PARAM_NAME_SOLIDITY"
#define PROTOCOL_PARAM_NAME_MAX_SPEED_TOC						"PROTOCOL_PARAM_NAME_MAX_SPEED_TOC"
#define PROTOCOL_PARAM_NAME_CONSUMPTION							"PROTOCOL_PARAM_NAME_CONSUMPTION"
#define PROTOCOL_PARAM_NAME_ENGINE_FORCE						"PROTOCOL_PARAM_NAME_ENGINE_FORCE"
#define PROTOCOL_PARAM_NAME_MAX_ACCELERATION					"PROTOCOL_PARAM_NAME_MAX_ACCELERATION"
#define PROTOCOL_PARAM_NAME_FORCIBILITY							"PROTOCOL_PARAM_NAME_FORCIBILITY"
#define PROTOCOL_PARAM_NAME_PRECISION							"PROTOCOL_PARAM_NAME_PRECISION"
#define PROTOCOL_PARAM_NAME_RANGE								"PROTOCOL_PARAM_NAME_RANGE"
#define PROTOCOL_PARAM_NAME_TOTAL_WINDING_SPEED					"PROTOCOL_PARAM_NAME_TOTAL_WINDING_SPEED"
#define PROTOCOL_PARAM_NAME_LEVEL								"PROTOCOL_PARAM_NAME_LEVEL"
#define PROTOCOL_PARAM_NAME_POINTS_PER_SECOND					"PROTOCOL_PARAM_NAME_POINTS_PER_SECOND"
#define PROTOCOL_PARAM_NAME_WORKING_CONSUMPTION					"PROTOCOL_PARAM_NAME_WORKING_CONSUMPTION"
#define PROTOCOL_PARAM_NAME_CAPACITY							"PROTOCOL_PARAM_NAME_CAPACITY"
#define PROTOCOL_PARAM_NAME_TOTAL_FILTERING_SPEED				"PROTOCOL_PARAM_NAME_TOTAL_FILTERING_SPEED"
#define PROTOCOL_PARAM_NAME_CONSUMPTION_FOR_ONE_PERSON			"PROTOCOL_PARAM_NAME_CONSUMPTION_FOR_ONE_PERSON"
#define PROTOCOL_PARAM_NAME_MESSAGE_COST						"PROTOCOL_PARAM_NAME_MESSAGE_COST"
#define PROTOCOL_PARAM_NAME_BIO_NODES							"PROTOCOL_PARAM_NAME_BIO_NODES"
#define PROTOCOL_PARAM_NAME_PREDICTION							"PROTOCOL_PARAM_NAME_PREDICTION"
#define PROTOCOL_PARAM_NAME_TIME_REUSABILITY					"PROTOCOL_PARAM_NAME_TIME_REUSABILITY"
#define PROTOCOL_PARAM_NAME_HEIGHT								"PROTOCOL_PARAM_NAME_HEIGHT"
#define PROTOCOL_PARAM_NAME_LENGTH								"PROTOCOL_PARAM_NAME_LENGTH"
#define PROTOCOL_PARAM_NAME_WIDTH								"PROTOCOL_PARAM_NAME_WIDTH"
#define PROTOCOL_PARAM_NAME_TOTAL_PRODUCTION					"PROTOCOL_PARAM_NAME_TOTAL_PRODUCTION"
#define PROTOCOL_PARAM_NAME_METAMORPHOSIS_EFFECTIVITY			"PROTOCOL_PARAM_NAME_METAMORPHOSIS_EFFECTIVITY"
#define PROTOCOL_PARAM_NAME_DAMAGE								"PROTOCOL_PARAM_NAME_DAMAGE"

// ################################

struct androids_assignment {
	unsigned char priority;
	unsigned long ratio;
};

struct androids_status {
	unsigned long long clientAndroidsStateSliderMax;
	unsigned long long clientAndroidsStateSliderBackground;
	unsigned long long clientWorkingAndroidsSliderMax;
	unsigned long long clientWorkingAndroidsSliderValue;
	unsigned long long clientWorkingAndroidsSliderBackground;	
	unsigned long long clientRepConSliderMax;
	unsigned long long clientRepConSliderValue;	
	unsigned long long clientRepConSliderBackground;	

	unsigned long long actualWorkingAndroids;
	unsigned long long actualRepairingAndroids;
	unsigned long long actualConstructingAndroids;

	unsigned long androidsMinPriority;
	unsigned long androidsMaxPriority;

	unsigned long androidsMinRatio;
	unsigned long androidsMaxRatio;

	androids_assignment energeticSystem;
	androids_assignment deflectorShields;
	androids_assignment weapons;
	androids_assignment transportBeam;
	androids_assignment miningDevices;
	androids_assignment probeDevices;
	androids_assignment sensors;
	androids_assignment cloaking;
	androids_assignment mechanics;
	androids_assignment warehouse;
	androids_assignment otherEquipment;
	androids_assignment mainframeSystem;
	androids_assignment structuralIntegrity;
};

struct ship_androids_status : public androids_status {
	androids_assignment impulsDrive;
	androids_assignment subspaceDrive;
};

struct base_androids_status : public androids_status {
	androids_assignment factories;
	androids_assignment hangars;
};

#define REQUEST_FORTRESS_ANDRODIS_INFORMATION_CLIENT_ANDROIDS_STATE_SLIDER_MAX				"client_androids_state_slider_max"
#define REQUEST_FORTRESS_ANDRODIS_INFORMATION_CLIENT_ANDROIDS_STATE_SLIDER_BACKGROUND		"client_androids_state_slider_background"
#define REQUEST_FORTRESS_ANDRODIS_INFORMATION_CLIENT_WORKING_ANDROIDS_SLIDER_MAX			"client_working_androids_slider_max"
#define REQUEST_FORTRESS_ANDRODIS_INFORMATION_CLIENT_WORKING_ANDROIDS_SLIDER_VALUE			"client_working_androids_slider_value"
#define REQUEST_FORTRESS_ANDRODIS_INFORMATION_CLIENT_WORKING_ANDROIDS_SLIDER_BACKGROUND		"client_working_androids_slider_background"
#define REQUEST_FORTRESS_ANDRODIS_INFORMATION_CLIENT_REPCON_SLIDER_MAX						"client_repcon_slider_max"
#define REQUEST_FORTRESS_ANDRODIS_INFORMATION_CLIENT_REPCON_SLIDER_VALUE					"client_repcon_slider_value"
#define REQUEST_FORTRESS_ANDRODIS_INFORMATION_CLIENT_REPCON_SLIDER_BACKGROUND				"client_repcon_slider_background"
	
#define REQUEST_FORTRESS_ANDRODIS_INFORMATION_ACTUAL_WORKING_ANDROIDS						"actual_working_androids"
#define REQUEST_FORTRESS_ANDRODIS_INFORMATION_ACTUAL_REPAIRING_ANDROIDS						"actual_repairing_androids"
#define REQUEST_FORTRESS_ANDRODIS_INFORMATION_ACTUAL_CONSTRUCTING_ANDROIDS					"actual_constructing_androids"

#define REQUEST_FORTRESS_ANDROIDS_INFORMATION_ANDROIDS_MIN_PRIORITY				"androids_min_priority"
#define REQUEST_FORTRESS_ANDROIDS_INFORMATION_ANDROIDS_MAX_PRIORITY				"androids_max_priority"

#define REQUEST_FORTRESS_ANDROIDS_INFORMATION_ANDROIDS_MIN_RATIO				"androids_min_ratio"
#define REQUEST_FORTRESS_ANDROIDS_INFORMATION_ANDROIDS_MAX_RATIO				"androids_max_ratio"

#define REQUEST_ANDROIDS_ASSIGNMENT_SECTION_ENERGETICSYSTEM					"androids_assignment_section_energeticsystem"		
#define REQUEST_ANDROIDS_ASSIGNMENT_SECTION_DEFLECTORSHIELDS				"androids_assignment_section_deflectorshields" 		
#define REQUEST_ANDROIDS_ASSIGNMENT_SECTION_WEAPONS							"androids_assignment_section_weapons"				
#define REQUEST_ANDROIDS_ASSIGNMENT_SECTION_TRANSPORTBEAM					"androids_assignment_section_transportbeam"		
#define REQUEST_ANDROIDS_ASSIGNMENT_SECTION_MAINFRAMESYSTEM					"androids_assignment_section_mainframesystem"
#define REQUEST_ANDROIDS_ASSIGNMENT_SECTION_MININGDEVICES					"androids_assignment_section_miningdevices"			
#define REQUEST_ANDROIDS_ASSIGNMENT_SECTION_PROBEDEVICES					"androids_assignment_section_probedevices"		
#define REQUEST_ANDROIDS_ASSIGNMENT_SECTION_SENSORS							"androids_assignment_section_sensors"		
#define REQUEST_ANDROIDS_ASSIGNMENT_SECTION_CLOAKING						"androids_assignment_section_cloaking"			
#define REQUEST_ANDROIDS_ASSIGNMENT_SECTION_CREW							"androids_assignment_section_crew"				
#define REQUEST_ANDROIDS_ASSIGNMENT_SECTION_ACCOMMODATIONS					"androids_assignment_section_accommodations"	
#define REQUEST_ANDROIDS_ASSIGNMENT_SECTION_MECHANICS						"androids_assignment_section_mechanics"				
#define REQUEST_ANDROIDS_ASSIGNMENT_SECTION_WAREHOUSE						"androids_assignment_section_warehouse"				
#define REQUEST_ANDROIDS_ASSIGNMENT_SECTION_OTHEREQUIPMENT					"androids_assignment_section_otherequipment"	
#define REQUEST_ANDROIDS_ASSIGNMENT_SECTION_STRUCTURALINTEGRITY				"androids_assignment_section_structuralintegrity"	
#define REQUEST_ANDROIDS_ASSIGNMENT_SECTION_IMPULSDRIVE						"androids_assignment_section_impulsdrive"	
#define REQUEST_ANDROIDS_ASSIGNMENT_SECTION_SUBSPACEDRIVE					"androids_assignment_section_subspacedrive"
#define REQUEST_ANDROIDS_ASSIGNMENT_SECTION_HANGARS							"androids_assignment_section_hangars"
#define REQUEST_ANDROIDS_ASSIGNMENT_SECTION_FACTORIES						"androids_assignment_section_factories"

#define REQUEST_ANDROIDS_ASSSIGNMENT_PRIORITY								"priority"
#define REQUEST_ANDROIDS_ASSSIGNMENT_RATIO									"ratio"

#define REQUEST_SHIP_ANDROIDS_INFORMATION									"ship_androids_information"
#define REQUEST_SHIP_ANDROIDS_INFORMATION_FORTRESSID						"ship_androids_information_fortressid"

#define REQUEST_SHIP_ANDROIDS_INFORMATION_ANSWER_FAIL					    "reason"
#define REQUEST_SHIP_ANDROIDS_INFORMATION_ANSWER_FORTRESSNE					"FORTRESS_NOT_EXISTS"               /* dana pevnost neexistuje */
#define REQUEST_SHIP_ANDROIDS_INFORMATION_ANSWER_FORTRESSNO					"FORTRESS_NOT_OWNED"                /* hrac nevlastni danou pevnost */
#define REQUEST_SHIP_ANDROIDS_INFORMATION_ANSWER_FORTRESSNOTSHIP			"FORTRESS_NOT_SHIP"					/* dany objekt neni lod */
			
#define REQUEST_BASE_ANDROIDS_INFORMATION									"base_androids_information"
#define REQUEST_BASE_ANDROIDS_INFORMATION_FORTRESSID						"base_androids_information_fortressid"
			
#define REQUEST_BASE_ANDROIDS_INFORMATION_ANSWER_FAIL					    "reason"
#define REQUEST_BASE_ANDROIDS_INFORMATION_ANSWER_FORTRESSNE					"FORTRESS_NOT_EXISTS"               /* dana pevnost neexistuje */
#define REQUEST_BASE_ANDROIDS_INFORMATION_ANSWER_FORTRESSNO					"FORTRESS_NOT_OWNED"                /* hrac nevlastni danou pevnost */	
#define REQUEST_BASE_ANDROIDS_INFORMATION_ANSWER_FORTRESSNOTBASE			"FORTRESS_NOT_BASE"					/* dany objekt neni zakladna */

struct androids_request_status {
	unsigned long long workingAndroidsSlider;
	unsigned long long repConSlider;

	androids_assignment energeticSystem;
	androids_assignment deflectorShields;
	androids_assignment weapons;
	androids_assignment transportBeam;
	androids_assignment miningDevices;
	androids_assignment probeDevices;
	androids_assignment sensors;
	androids_assignment cloaking;
	androids_assignment mechanics;
	androids_assignment warehouse;
	androids_assignment otherEquipment;
	androids_assignment mainframeSystem;
	androids_assignment structuralIntegrity;
};

struct ship_androids_request_status : public androids_request_status {
	androids_assignment impulsDrive;
	androids_assignment subspaceDrive;
};

struct base_androids_request_status : public androids_request_status {
	androids_assignment factories;
	androids_assignment hangars;
};

#define REQUEST_CHANGE_SHIP_ANDROIDS_STATE									"change_ship_androids_state"
#define REQUEST_CHANGE_SHIP_ANDROIDS_STATE_ANSWER_FORTRESSID				"change_ship_androids_state_answer_fortressid"

#define REQUEST_CHANGE_SHIP_ANDROIDS_STATE_ANSWER_FAIL					    "reason"
#define REQUEST_CHANGE_SHIP_ANDROIDS_STATE_ANSWER_FORTRESSNE				"FORTRESS_NOT_EXISTS"               /* dana pevnost neexistuje */
#define REQUEST_CHANGE_SHIP_ANDROIDS_STATE_ANSWER_FORTRESSNO				"FORTRESS_NOT_OWNED"                /* hrac nevlastni danou pevnost */
#define REQUEST_CHANGE_SHIP_ANDROIDS_STATE_ANSWER_FORTRESSNOTSHIP			"FORTRESS_NOT_SHIP"					/* dany objekt neni lod */

#define REQUEST_CHANGE_BASE_ANDROIDS_STATE									"change_base_androids_state"
#define REQUEST_CHANGE_BASE_ANDROIDS_STATE_ANSWER_FORTRESSID				"change_base_androids_state_answer_fortressid"

#define REQUEST_CHANGE_BASE_ANDROIDS_STATE_ANSWER_FAIL					    "reason"
#define REQUEST_CHANGE_BASE_ANDROIDS_STATE_ANSWER_FORTRESSNE				"FORTRESS_NOT_EXISTS"               /* dana pevnost neexistuje */
#define REQUEST_CHANGE_BASE_ANDROIDS_STATE_ANSWER_FORTRESSNO				"FORTRESS_NOT_OWNED"                /* hrac nevlastni danou pevnost */
#define REQUEST_CHANGE_BASE_ANDROIDS_STATE_ANSWER_FORTRESSNOTBASE			"FORTRESS_NOT_BASE"					/* dany objekt neni zakladna */

#define REQUEST_CHANGE_BASE_ANDROIDS_STATE_WORKING_ANDROIDS_SLIDER			"working_androids_slider"
#define REQUEST_CHANGE_BASE_ANDROIDS_STATE_REP_CON_SLIDER					"rep_con_slider"

// ################################

struct location_status
{
    unsigned long nearestStar;
    unsigned long actualStar;
    unsigned long actualSpaceObject;
};

#define REQUEST_SHIP_LOCATION_INFORMATION									    "ship_location_information"
#define REQUEST_SHIP_LOCATION_INFORMATION_SHIPID						        "ship_location_information_shipid"

#define REQUEST_SHIP_LOCATION_INFORMATION_ANSWER_FAIL						    "reason"
#define REQUEST_SHIP_LOCATION_INFORMATION_ANSWER_SHIPNE					        "SHIP_NOT_EXISTS"               /* dana pevnost neexistuje */
#define REQUEST_SHIP_LOCATION_INFORMATION_ANSWER_SHIPNO					        "SHIP_NOT_OWNED"                /* hrac nevlastni danou pevnost */

#define REQUEST_SHIP_LOCATION_INFORMATION_NEAREST_STAR                          "nearestStar"
#define REQUEST_SHIP_LOCATION_INFORMATION_SPACE_OBJECT_ACT_IN                   "spaceObjectActuallyIn"
#define REQUEST_SHIP_LOCATION_INFORMATION_STAR_IN                               "starSystemActuallyIn"

// --------------------------------

#define PROTOCOL_HANGARS_SHIP_CLASS_ID_0							"HANGARS_SHIP_CLASS_ID_0"
#define PROTOCOL_HANGARS_SHIP_CLASS_ID_1							"HANGARS_SHIP_CLASS_ID_1"
#define PROTOCOL_HANGARS_SHIP_CLASS_ID_2							"HANGARS_SHIP_CLASS_ID_2"
#define PROTOCOL_HANGARS_SHIP_CLASS_ID_3							"HANGARS_SHIP_CLASS_ID_3"
#define PROTOCOL_HANGARS_SHIP_CLASS_ID_4							"HANGARS_SHIP_CLASS_ID_4"
#define PROTOCOL_HANGARS_SHIP_CLASS_ID_5							"HANGARS_SHIP_CLASS_ID_5"

#define PROTOCOL_HANGARS_PATTERN_ID_ENERGETIC_ACCUMULATOR           "HANGARS_PATTERN_ID_ENERGETIC_ACCUMULATOR"
																	
#define PROTOCOL_HANGARS_PATTERN_ID_NAVIGATION_COMPUTER             "HANGARS_PATTERN_ID_NAVIGATION_COMPUTER"
#define PROTOCOL_HANGARS_PATTERN_ID_QUARK_GLUON_CORE                "HANGARS_PATTERN_ID_QUARK_GLUON_CORE"
#define PROTOCOL_HANGARS_PATTERN_ID_SUBSPACE_BEACON                 "HANGARS_PATTERN_ID_SUBSPACE_BEACON"
#define PROTOCOL_HANGARS_PATTERN_ID_INERTIAL_DAMPERS                "HANGARS_PATTERN_ID_INERTIAL_DAMPERS"
																	
#define PROTOCOL_HANGARS_PATTERN_ID_IMPULS_JET_ENGINE               "HANGARS_PATTERN_ID_IMPULS_JET_ENGINE"
#define PROTOCOL_HANGARS_PATTERN_ID_MECHANICAL_DAMPERS              "HANGARS_PATTERN_ID_MECHANICAL_DAMPERS"
																	
#define PROTOCOL_HANGARS_PATTERN_ID_DEFLECTOR_SHIELDS               "HANGARS_PATTERN_ID_DEFLECTOR_SHIELDS"
																	
#define PROTOCOL_HANGARS_PATTERN_ID_WEAPON_ENERGY_CIRCUIT           "HANGARS_PATTERN_ID_WEAPON_ENERGY_CIRCUIT"
#define PROTOCOL_HANGARS_PATTERN_ID_DRONE_MISSILES                  "HANGARS_PATTERN_ID_DRONE_MISSILES"
#define PROTOCOL_HANGARS_PATTERN_ID_DRONE_MISSILE_LAUNCHER          "HANGARS_PATTERN_ID_DRONE_MISSILE_LAUNCHER"
#define PROTOCOL_HANGARS_PATTERN_ID_LASER_GUN                       "HANGARS_PATTERN_ID_LASER_GUN"
																	
#define PROTOCOL_HANGARS_PATTERN_ID_TRANSPORT_BEAM_GENERATOR        "HANGARS_PATTERN_ID_TRANSPORT_BEAM_GENERATOR"
																	
#define PROTOCOL_HANGARS_PATTERN_ID_MAGNETICAL_COLLECTORS_OF_PLASMA "HANGARS_PATTERN_ID_MAGNETICAL_COLLECTORS_OF_PLASMA"
#define PROTOCOL_HANGARS_PATTERN_ID_SUBMERSIBLE_FILTRATION_TANK     "HANGARS_PATTERN_ID_SUBMERSIBLE_FILTRATION_TANK"
#define PROTOCOL_HANGARS_PATTERN_ID_SUBMARINE_MINING_MACHINE        "HANGARS_PATTERN_ID_SUBMARINE_MINING_MACHINE"
#define PROTOCOL_HANGARS_PATTERN_ID_UNDERGROUND_DRILLIG_MACHINE     "HANGARS_PATTERN_ID_UNDERGROUND_DRILLIG_MACHINE"
																	
#define PROTOCOL_HANGARS_PATTERN_ID_PROBE                           "HANGARS_PATTERN_ID_PROBE"
																	
#define PROTOCOL_HANGARS_PATTERN_ID_HIGH_RESOLUTION_SENSORS         "HANGARS_PATTERN_ID_HIGH_RESOLUTION_SENSORS"
#define PROTOCOL_HANGARS_PATTERN_ID_LONG_RANGE_SENSORS              "HANGARS_PATTERN_ID_LONG_RANGE_SENSORS"
																	
#define PROTOCOL_HANGARS_PATTERN_ID_CLOAKING_DEVICE                 "HANGARS_PATTERN_ID_CLOAKING_DEVICE"
																	
#define PROTOCOL_HANGARS_PATTERN_ID_ANDROIDS                        "HANGARS_PATTERN_ID_ANDROIDS"
																	
#define PROTOCOL_HANGARS_PATTERN_ID_MAGNETICAL_GRID                 "HANGARS_PATTERN_ID_MAGNETICAL_GRID"
#define PROTOCOL_HANGARS_PATTERN_ID_TRANSPORT_CONTAINER             "HANGARS_PATTERN_ID_TRANSPORT_CONTAINER"
#define PROTOCOL_HANGARS_PATTERN_ID_ENERGETIC_CELL                  "HANGARS_PATTERN_ID_ENERGETIC_CELL"
																	
#define PROTOCOL_HANGARS_PATTERN_ID_PLASMA_FILTER                   "HANGARS_PATTERN_ID_PLASMA_FILTER"
#define PROTOCOL_HANGARS_PATTERN_ID_SCIENTIFIC_LAB                  "HANGARS_PATTERN_ID_SCIENTIFIC_LAB"
#define PROTOCOL_HANGARS_PATTERN_ID_LIFE_SUPPORT                    "HANGARS_PATTERN_ID_LIFE_SUPPORT"
#define PROTOCOL_HANGARS_PATTERN_ID_SUBSPACE_TRANSMITTER            "HANGARS_PATTERN_ID_SUBSPACE_TRANSMITTER"
																	
#define PROTOCOL_HANGARS_PATTERN_ID_MAINFRAME                       "HANGARS_PATTERN_ID_MAINFRAME"
																	
#define PROTOCOL_HANGARS_PATTERN_ID_HANGAR                          "HANGARS_PATTERN_ID_HANGAR"
																	
#define PROTOCOL_HANGARS_PATTERN_ID_MAGNETICAL_FILTER               "HANGARS_PATTERN_ID_MAGNETICAL_FILTER"
#define PROTOCOL_HANGARS_PATTERN_ID_DEUTERIUM_DECOMPOSER            "HANGARS_PATTERN_ID_DEUTERIUM_DECOMPOSER"
#define PROTOCOL_HANGARS_PATTERN_ID_ZIRCONIUM_REACTOR               "HANGARS_PATTERN_ID_ZIRCONIUM_REACTOR"
#define PROTOCOL_HANGARS_PATTERN_ID_ILMENITE_FURNACE                "HANGARS_PATTERN_ID_ILMENITE_FURNACE"

#define REQUEST_BASE_HANGARS_INFORMATION										"base_hangars_information"
#define REQUEST_BASE_HANGARS_INFORMATION_SELECTED_ITEM_ID						"selected_item_id"
#define	REQUEST_BASE_HANGARS_INFORMATION_ANSWER_HANGAR_FREE						"hangar_free"
#define REQUEST_BASE_HANGARS_INFORMATION_ANSWER_HANGAR_SHIP_IN_DOCK				"ship_in_dock"
#define REQUEST_BASE_HANGARS_INFORMATION_ANSWER_HANGAR_LEVEL					"hangar_level"

#define REQUEST_BASE_HANGARS_INFORMATION_ANSWER_HANGAR_ITEM_UNDER_CONSTRUCTION		"item_under_construction"
#define REQUEST_BASE_HANGARS_INFORMATION_ANSWER_HANGAR_SHIP_UNDER_CONSTRUCTION		"ship_under_construction"
#define REQUEST_BASE_HANGARS_INFORMATION_ANSWER_HANGAR_WHATEVER_UNDER_CONSTRUCTION	"whatever_under_construction"

#define REQUEST_BASE_HANGARS_INFORMATION_ANSWER_HANGAR_DAMAGE_STATUS		"hangar_damage_status"

#define REQUEST_BASE_HANGARS_INFORMATION_ANSWER_HANGAR_SELECTED_PATTERN_NAME			"selected_pattern_name"
#define REQUEST_BASE_HANGARS_INFORMATION_ANSWER_HANGAR_SELECTED_DEUTERIUM				"selected_deuterium"
#define REQUEST_BASE_HANGARS_INFORMATION_ANSWER_HANGAR_SELECTED_HEAVY_WATER				"selected_heavy_water"
#define REQUEST_BASE_HANGARS_INFORMATION_ANSWER_HANGAR_SELECTED_TITANIUM				"selected_titanium"
#define REQUEST_BASE_HANGARS_INFORMATION_ANSWER_HANGAR_SELECTED_ULREI					"selected_ulrei"
#define REQUEST_BASE_HANGARS_INFORMATION_ANSWER_HANGAR_SELECTED_ITEM_NAME				"selected_item_name"
#define REQUEST_BASE_HANGARS_INFORMATION_ANSWER_HANGAR_SELECTED_ITEM_MIN_WEIGHT			"selected_min_weight"
#define REQUEST_BASE_HANGARS_INFORMATION_ANSWER_HANGAR_SELECTED_ITEM_MAX_WEIGHT			"selected_max_weight"
#define REQUEST_BASE_HANGARS_INFORMATION_ANSWER_HANGAR_SELECTED_ITEM_STACKABLE			"selected_stackable"

#define REQUEST_BASE_HANGARS_INFORMATION_ANSWER_HANGAR_SELECTED_ITEM_MIN_SIZE			"selected_min_size"
#define REQUEST_BASE_HANGARS_INFORMATION_ANSWER_HANGAR_SELECTED_ITEM_MAX_SIZE			"selected_max_size"
#define REQUEST_BASE_HANGARS_INFORMATION_ANSWER_HANGAR_SELECTED_ITEM_MIN_ANDROIDS		"selected_min_androids"
#define REQUEST_BASE_HANGARS_INFORMATION_ANSWER_HANGAR_SELECTED_ITEM_MAX_ANDROIDS		"selected_max_androids"

#define REQUEST_BASE_HANGARS_INFORMATION_ANSWER_HANGAR_CONSTRUCTED_PATTERN_NAME			"constructed_pattern_name"
#define REQUEST_BASE_HANGARS_INFORMATION_ANSWER_HANGAR_CONSTRUCTED_DEUTERIUM			"constructed_deuterium"
#define REQUEST_BASE_HANGARS_INFORMATION_ANSWER_HANGAR_CONSTRUCTED_HEAVY_WATER			"constructed_heavy_water"
#define REQUEST_BASE_HANGARS_INFORMATION_ANSWER_HANGAR_CONSTRUCTED_TITANIUM				"constructed_titanium"
#define REQUEST_BASE_HANGARS_INFORMATION_ANSWER_HANGAR_CONSTRUCTED_ULREI				"constructed_ulrei"
#define REQUEST_BASE_HANGARS_INFORMATION_ANSWER_HANGAR_CONSTRUCTED_ITEM_NAME			"constructed_item_name"

#define REQUEST_BASE_HANGARS_INFORMATION_ANSWER_HANGAR_CONSTRUCTED_ITEM_MIN_SIZE			"constructed_min_size"
#define REQUEST_BASE_HANGARS_INFORMATION_ANSWER_HANGAR_CONSTRUCTED_ITEM_MAX_SIZE			"constructed_max_size"
#define REQUEST_BASE_HANGARS_INFORMATION_ANSWER_HANGAR_CONSTRUCTED_ITEM_ACT_SIZE			"constructed_act_size"
#define REQUEST_BASE_HANGARS_INFORMATION_ANSWER_HANGAR_CONSTRUCTED_ITEM_ACT_ANDROIDS		"constructed_act_androids"
#define REQUEST_BASE_HANGARS_INFORMATION_ANSWER_HANGAR_CONSTRUCTED_ITEM_MIN_ANDROIDS		"constructed_min_androids"
#define REQUEST_BASE_HANGARS_INFORMATION_ANSWER_HANGAR_CONSTRUCTED_ITEM_MAX_ANDROIDS		"constructed_max_androids"
#define REQUEST_BASE_HANGARS_INFORMATION_ANSWER_HANGAR_CONSTRUCTED_ITEM_CONSTRUCTION_TIME	"constructed_construction_time"
#define REQUEST_BASE_HANGARS_INFORMATION_ANSWER_HANGAR_CONSTRUCTED_ITEM_COUNT				"constructed_count"
#define REQUEST_BASE_HANGARS_INFORMATION_ANSWER_HANGAR_CONSTRUCTED_ITEM_STACKABLE			"constructed_stackable"

#define REQUEST_BASE_HANGARS_INFORMATION_ANSWER_HANGAR_ACTUAL_POINTS					"hangar_actual_points"
#define REQUEST_BASE_HANGARS_INFORMATION_ANSWER_HANGAR_TARGET_POINTS					"hangar_target_points"
#define REQUEST_BASE_HANGARS_INFORMATION_ANSWER_HANGAR_CONSTRUCTION_GRADIENT			"constructionGradient"
		
#define REQUEST_BASE_HANGARS_INFORMATION_HANGAR_ID								"hangar_id"
#define REQUEST_BASE_HANGARS_INFORMATION_FORTRESSID								"fortressid"
#define REQUEST_BASE_HANGARS_INFORMATION_ARBITRARY_HANGAR						"arbitrary_hangar"

#define REQUEST_BASE_HANGARS_INFORMATION_ITEM_SELECTED_ITEM_ID					"selected_item_id"

#define REQUEST_BASE_HANGAR_ITEM_INFORMATION									"base_hangars_item_information"
#define REQUEST_BASE_HANGARS_INFORMATION_ANSWER_FORTRESS_ID						"fortress_id"

#define REQUEST_BASE_HANGAR_ITEM_INFORMATION_ANSWER_HANGAR_ITEM_PATTERN_NAME		"selected_pattern_name"
#define REQUEST_BASE_HANGAR_ITEM_INFORMATION_ANSWER_HANGAR_ITEM_DEUTERIUM			"selected_deuterium"
#define REQUEST_BASE_HANGAR_ITEM_INFORMATION_ANSWER_HANGAR_ITEM_HEAVY_WATER			"selected_heavy_water"
#define REQUEST_BASE_HANGAR_ITEM_INFORMATION_ANSWER_HANGAR_ITEM_TITANIUM			"selected_titanium"
#define REQUEST_BASE_HANGAR_ITEM_INFORMATION_ANSWER_HANGAR_ITEM_ULREI				"selected_ulrei"
#define REQUEST_BASE_HANGAR_ITEM_INFORMATION_ANSWER_HANGAR_ITEM_STACKABLE			"selected_is_stackable"
#define REQUEST_BASE_HANGAR_ITEM_INFORMATION_ANSWER_HANGAR_ITEM_ITEM_NAME			"selected_item_name"
#define REQUEST_BASE_HANGAR_ITEM_INFORMATION_ANSWER_HANGAR_ITEM_MIN_WEIGHT			"selected_min_weight"
#define REQUEST_BASE_HANGAR_ITEM_INFORMATION_ANSWER_HANGAR_ITEM_MAX_WEIGHT			"selected_max_weight"
#define REQUEST_BASE_HANGAR_ITEM_INFORMATION_ANSWER_HANGAR_ITEM_MIN_SIZE			"selected_min_size"
#define REQUEST_BASE_HANGAR_ITEM_INFORMATION_ANSWER_HANGAR_ITEM_MAX_SIZE			"selected_max_size"
#define REQUEST_BASE_HANGAR_ITEM_INFORMATION_ANSWER_HANGAR_ITEM_MIN_ANDROIDS		"selected_min_androids"
#define REQUEST_BASE_HANGAR_ITEM_INFORMATION_ANSWER_HANGAR_ITEM_MAX_ANDROIDS		"selected_max_androids"

#define REQUEST_BASE_HANGAR_ITEM_INFORMATION_ITEM_ID								"item_id"

#define REQUEST_BASE_HANGARS_INFORMATION_ANSWER_HANGAR_HANGAR_ID					"hangar_id"
#define REQUEST_BASE_HANGARS_INFORMATION_ANSWER_HANGAR_SELECTED_HANGAR_ID			"selected_hangar_id"
#define REQUEST_BASE_HANGARS_INFORMATION_ANSWER_HANGAR_HANGAR_COUNT					"hangar_count"

#define REQUEST_BASE_HANGARS_INFORMATION_ANSWER_HANGARNE							"HANGAR_NOT_EXISTS"
#define REQUEST_BASE_HANGARS_INFORMATION_ANSWER_FORTRESSNE							"FORTRESS_NOT_EXISTS"
#define REQUEST_BASE_HANGARS_INFORMATION_ANSWER_FORTRESSNO							"FORTRESS_NOT_OWNED"
#define REQUEST_BASE_HANGARS_INFORMATION_ANSWER_FORTRESSNOTBASE						"FORTRESS_NOT_BASE"
#define REQUEST_BASE_HANGARS_INFORMATION_ANSWER_HANGAR_NOT_EXISTS					"HANGAR_NOT_EXISTS"
#define REQUEST_BASE_HANGARS_INFORMATION_ANSWER_FAIL								"reason"

#define PROTOCOL_HANGAR_ICR_OK														"PROTOCOL_HANGAR_ICR_OK"
#define PROTOCOL_HANGAR_ICR_INVALID_PARAMS											"PROTOCOL_HANGAR_ICR_INVALID_PARAMS"
#define PROTOCOL_HANGAR_ICR_FULL_HANGAR												"PROTOCOL_HANGAR_ICR_FULL_HANGAR"
#define PROTOCOL_HANGAR_ICR_NOT_ENOUGH_ULREI										"PROTOCOL_HANGAR_ICR_NOT_ENOUGH_ULREI"
#define PROTOCOL_HANGAR_ICR_NOT_ENOUGH_TITANIUM										"PROTOCOL_HANGAR_ICR_NOT_ENOUGH_TITANIUM"
#define PROTOCOL_HANGAR_ICR_NOT_ENOUGH_DEUTERIUM									"PROTOCOL_HANGAR_ICR_NOT_ENOUGH_DEUTERIUM"
#define PROTOCOL_HANGAR_ICR_NOT_ENOUGH_HEAVY_WATER									"PROTOCOL_HANGAR_ICR_NOT_ENOUGH_HEAVY_WATER"

#define REQUEST_BASE_HANGARS_INFORMATION_ANSWER_FORTRESS_CLASS_ID					"fortress_class_id"
#define REQUEST_BASE_HANGARS_INFORMATION_ANSWER_FORTRESS_CLASS_NAME					"fortress_class_name"
#define REQUEST_BASE_HANGARS_INFORMATION_ANSWER_FORTRESS_CLASS_QUALITY				"fortress_class_quality"
#define REQUEST_BASE_HANGARS_INFORMATION_ANSWER_FORTRESS_CLASS_COUNT				"fortress_class_count"

struct hangar_item_status
{
	std::string itemName;
	std::string patternName; /**< Kind of object to build */ 
	bool isStackable;
	unsigned long long constructionDeuterium; /**< Deuterium cost for building the object */
	unsigned long long constructionHeavyWater; /**< Heavy water cost for building the object */
	unsigned long long constructionTitanium; /**< Titan cost for building the object */
	unsigned long long constructionUlrei; /**< Ulrea cost for building the object */

	unsigned long long constructionTime;	/**< Construstion time of object */

	/**< Number of adroids required for building the object */
	unsigned long long minRequiredAndroidCount;
	unsigned long long maxRequiredAndroidCount;
	unsigned long long actRequiredAndroidCount;

	unsigned long minWeight;
	unsigned long maxWeight;

	double density;
	unsigned long long count;
	
	double actSize;
	double minSize;
	double maxSize;

	hangar_item_status()
	{
		constructionDeuterium = 0;
		constructionHeavyWater = 0;
		constructionTitanium = 0;
		constructionUlrei = 0;

		constructionTime = 0;
		minRequiredAndroidCount = 0;
		maxRequiredAndroidCount = 0;
		actRequiredAndroidCount = 0;

		minWeight = 0;
		maxWeight = 0;
		density = 0;
		count = 0;
	};
};

struct fortress_class_simple_data
{
	unsigned long id;
	std::string name;
	double quality;
};

struct hangars_status 
{
	hangar_item_status selectedItem;
	hangar_item_status constructedItem;

	unsigned long long actualConstructedPoints;
	unsigned long long targetConstructedPoints;

	double damageStatus;
	unsigned long actualLevel;
	bool isShipInDock;

	bool isShipUnderConstruction;
	bool isWhateverUnderConstruction;
	bool isItemUnderConstruction;
	bool isHangarFree;

	unsigned long selectedHangarId;
	std::list<unsigned long> hangarIds;
	std::list<fortress_class_simple_data> availableShipClasses;

	double constructionGradient;	
};

struct HangarServerInputData
{
	std::string type; /**<Kind of object to build */

	unsigned int length;	/**< Size of object we want to build ( size can be specified for some object ) */
	unsigned int width;
	unsigned int height;
	unsigned int weight;	/**< Weight of object we want to build ( weight can be specified for some object ) */
	unsigned int quantity; /**< Quantity of object we want to build ( quantity can be specified for some object ) */
	unsigned long hangarId;
};

#define REQUEST_HANGAR_CANCEL_ITEM										"hangar_cancel_item"
#define REQUEST_HANGAR_CANCEL_ITEM_FORTRESS_ID							"hangar_cancel_item_fortress_id"
#define REQUEST_HANGAR_CANCEL_ITEM_HANGAR_ID							"hangar_cancel_item_hangar_id"

#define REQUEST_HANGAR_CANCEL_ITEM_FORTRESSNE								"hangar_cancel_item_fortressne"
#define REQUEST_HANGAR_CANCEL_ITEM_FORTRESSNO								"hangar_cancel_item_fortressno"
#define REQUEST_HANGAR_CANCEL_ITEM_FORTRESSNOTBASE							"hangar_cancel_item_fortressnotbase"
#define REQUEST_HANGAR_CANCEL_ITEM_HANGARNE									"hangar_cancel_item_hangarne"

#define REQUEST_HANGAR_BUILD_ITEM											"hangar_build_item"
#define REQUEST_HANGAR_BUILD_ITEM_FORTRESS_ID								"hangar_build_item_fortress_id"
#define REQUEST_HANGAR_BUILD_ITEM_HANGAR_ID									"hangar_build_item_hangar_id"
#define REQUEST_HANGAR_BUILD_ITEM_QUANTITY									"hangar_build_item_quantity"
#define REQUEST_HANGAR_BUILD_ITEM_LENGTH									"hangar_build_item_length"
#define REQUEST_HANGAR_BUILD_ITEM_WIDTH										"hangar_build_item_width"
#define REQUEST_HANGAR_BUILD_ITEM_HEIGHT									"hangar_build_item_height"
#define REQUEST_HANGAR_BUILD_ITEM_PATTERN_NAME								"hangar_build_item_pattern_name"
#define	REQUEST_HANGAR_BUILD_ITEM_WEIGHT									"hangar_build_item_weight"

#define REQUEST_HANGAR_BUILD_ITEM_FORTRESSNE								"hangar_build_item_fortressne"
#define REQUEST_HANGAR_BUILD_ITEM_FORTRESSNO								"hangar_build_item_fortressno"
#define REQUEST_HANGAR_BUILD_ITEM_FORTRESSNOTBASE							"hangar_build_item_fortressnotbase"
#define REQUEST_HANGAR_BUILD_ITEM_HANGARNE									"hangar_build_item_hangarne"

#define REQUEST_HANGAR_BUILD_ITEM											"hangar_build_item"
#define REQUEST_HANGAR_BUILD_ITEM_ANSWER_FORTRESSID							"fortressid"
#define REQUEST_HANGAR_BUILD_ITEM_ANSWER_FAIL								"reason"
#define REQUEST_HANGAR_BUILD_ITEM_ANSWER_HANGAR_ID							"hangar_id"
#define REQUEST_HANGAR_BUILD_ITEM_ANSWER_CREATION_RESULT					"creation_result"

#define REQUEST_HANGAR_CANCEL_ITEM											"hangar_cancel_item"
#define REQUEST_HANGAR_CANCEL_ITEM_ANSWER_FORTRESSID						"fortressid"
#define REQUEST_HANGAR_CANCEL_ITEM_ANSWER_FAIL								"reason"
#define REQUEST_HANGAR_CANCEL_ITEM_ANSWER_HANGAR_ID							"hangar_id"

// ################################

#define REQUEST_HANGAR_BUILD_SHIP											"REQUEST_HANGAR_BUILD_SHIP"
#define REQUEST_HANGAR_BUILD_SHIP_HANGAR_ID								"REQUEST_HANGAR_BUILD_SHIP_HANGAR_ID"
#define REQUEST_HANGAR_BUILD_SHIP_SELF_FORTRESS_ID							"REQUEST_HANGAR_BUILD_SHIP_SELF_FORTRESS_ID"
#define REQUEST_HANGAR_BUILD_SHIP_HANGARNE									"REQUEST_HANGAR_BUILD_SHIP_HANGARNE"
#define REQUEST_HANGAR_BUILD_SHIP_FORTRESS_CLASS_ID						"REQUEST_HANGAR_BUILD_SHIP_FORTRESS_CLASS_ID"
#define REQUEST_HANGAR_BUILD_SHIP_TITANIUM									"REQUEST_HANGAR_BUILD_SHIP_TITANIUM"

#define REQUEST_HANGAR_BUILD_SHIP_ANSWER_FORTRESSNE						"REQUEST_HANGAR_BUILD_SHIP_ANSWER_FORTRESSNE"
#define REQUEST_HANGAR_BUILD_SHIP_ANSWER_FORTRESS_NOT_BASE					"REQUEST_HANGAR_BUILD_SHIP_ANSWER_FORTRESS_NOT_BASE"
#define REQUEST_HANGAR_BUILD_SHIP_ANSWER_FORTRESSNO						"REQUEST_HANGAR_BUILD_SHIP_ANSWER_FORTRESSNO"

#define REQUEST_HANGAR_BUILD_SHIP_ANSWER_FORTRESSID							"fortressid"
#define REQUEST_HANGAR_BUILD_SHIP_ANSWER_FAIL								"reason"
#define REQUEST_HANGAR_BUILD_SHIP_ANSWER_HANGAR_ID							"hangar_id"
#define REQUEST_HANGAR_BUILD_SHIP_ANSWER_CREATION_RESULT					"creation_result"

// ################################

struct unmount_device_info
{
	unsigned long fortressId;
	unsigned long concreteId;
	unsigned long long damaged;
	unsigned long long working; 
	std::string patternName;
};

#define REQUEST_UNMOUNT_FORTRESS_DEVICE										"unmount_fortress_device"
#define REQUEST_UNMOUNT_FORTRESS_DEVICE_FORTRESSID							"fortressid"
#define REQUEST_UNMOUNT_FORTRESS_DEVICE_WORKING								"working"
#define REQUEST_UNMOUNT_FORTRESS_DEVICE_DAMAGED								"damaged"
#define REQUEST_UNMOUNT_FORTRESS_DEVICE_CONCRETEID							"concreteid"
#define REQUEST_UNMOUNT_FORTRESS_DEVICE_PATTERN_NAME						"pattern_name"

#define REQUEST_UNMOUNT_FORTRESS_DEVICE_ANSWER_FAIL							"reason"
#define REQUEST_UNMOUNT_FORTRESS_DEVICE_ANSWER_FORTRESSNE					"FORTRESS_NOT_EXISTS"
#define REQUEST_UNMOUNT_FORTRESS_DEVICE_ANSWER_FORTRESSNO					"FORTRESS_NOT_OWNED"
#define REQUEST_UNMOUNT_FORTRESS_DEVICE_ANSWER_DEVICE_NOT_EXISTS			"DEVICE_ANSWER_DEVICE_NOT_EXISTS"
#define REQUEST_UNMOUNT_FORTRESS_DEVICE_ANSWER_FORTRESS_NOT_BASE			"DEVICE_ANSWER_FORTRESS_NOT_BASE"

#define REQUEST_UNMOUNT_FORTRESS_DEVICE_ANSWER_FORTRESSID					"fortressid"
#define REQUEST_UNMOUNT_FORTRESS_DEVICE_ANSWER_MOUNTING_RESULT				"mounting_result"
#define REQUEST_UNMOUNT_FORTRESS_DEVICE_ANSWER_PATTERN_NAME					"pattern_name"
#define REQUEST_UNMOUNT_FORTRESS_DEVICE_ANSWER_WORKING						"REQUEST_UNMOUNT_FORTRESS_DEVICE_ANSWER_WORKING"
#define REQUEST_UNMOUNT_FORTRESS_DEVICE_ANSWER_DAMAGED						"REQUEST_UNMOUNT_FORTRESS_DEVICE_ANSWER_DAMAGED"

#define PROTOCOL_MOUNTING_RESULT_DONE									"PROTOCOL_MOUNTING_RESULT_DONE"
#define PROTOCOL_MOUNTING_RESULT_SLOT_OCCUPIED							"PROTOCOL_MOUNTING_RESULT_SLOT_OCCUPIED"
#define PROTOCOL_MOUNTING_SLOT_EMPTY									"PROTOCOL_MOUNTING_SLOT_EMPTY"
#define PROTOCOL_MOUNTING_RESULT_NOT_ENOUGH_ANDROIDS					"PROTOCOL_MOUNTING_RESULT_NOT_ENOUGH_ANDROIDS"
#define PROTOCOL_MOUNTING_RESULT_NOT_ENOUGH_ENERGY						"PROTOCOL_MOUNTING_RESULT_NOT_ENOUGH_ENERGY"
#define PROTOCOL_MOUNTING_RESULT_NOT_ENOUGH_STORAGE_SPACE				"PROTOCOL_MOUNTING_RESULT_NOT_ENOUGH_STORAGE_SPACE"
#define PROTOCOL_MOUNTING_RESULT_UNKNOWN_FAIL							"PROTOCOL_MOUNTING_RESULT_UNKNOWN_FAIL"
#define PROTOCOL_MOUNTING_RESULT_HANGAR_NOT_EMPTY						"PROTOCOL_MOUNTING_RESULT_HANGAR_NOT_EMPTY"
#define PROTOCOL_MOUNTING_RESULT_BAD_FORTRESS_TYPE						"PROTOCOL_MOUNTING_RESULT_BAD_FORTRESS_TYPE"

// ################################

struct mount_device_info
{
	unsigned long fortressId;
	unsigned long itemId;
	unsigned long long count;
};

#define REQUEST_MOUNT_FORTRESS_DEVICE										"mount_fortress_device"
#define REQUEST_MOUNT_FORTRESS_DEVICE_FORTRESSID							"fortressid"
#define REQUEST_MOUNT_FORTRESS_DEVICE_ITEM_ID								"item_id"
#define REQUEST_MOUNT_FORTRESS_DEVICE_COUNT									"count"

#define REQUEST_MOUNT_FORTRESS_DEVICE_ANSWER_FAIL							"reason"
#define REQUEST_MOUNT_FORTRESS_DEVICE_ANSWER_FORTRESSNE						"FORTRESS_NOT_EXISTS"
#define REQUEST_MOUNT_FORTRESS_DEVICE_ANSWER_FORTRESSNO						"FORTRESS_NOT_OWNED"
#define REQUEST_MOUNT_FORTRESS_DEVICE_ANSWER_ITEM_NOT_IN_WAREHOUSE			"ITEM_NOT_IN_WAREHOUSE"

#define REQUEST_MOUNT_FORTRESS_DEVICE_ANSWER_FORTRESSID						"fortressid"
#define REQUEST_MOUNT_FORTRESS_DEVICE_ANSWER_MOUNTING_RESULT				"mounting_result"
#define REQUEST_MOUNT_FORTRESS_DEVICE_ANSWER_ITEM_ID						"item_id"

// ################################

#define REQUEST_SEND_TRADE_INVITATION											"REQUEST_SEND_TRADE_INVITATION"
#define REQUEST_SEND_TRADE_INVITATION_HOST_FORTRESS_ID							"REQUEST_SEND_TRADE_INVITATION_HOST_FORTRESS_ID"
#define REQUEST_SEND_TRADE_INVITATION_INVITED_FORTRESS_ID						"REQUEST_SEND_TRADE_INVITATION_INVITED_FORTRESS_ID"

#define REQUEST_SEND_TRADE_INVITATION_ANSWER_FAIL_PARTNER_NOT_EXISTS			"REQUEST_SEND_TRADE_INVITATION_ANSWER_FAIL_PARTNER_NOT_EXISTS"
#define REQUEST_SEND_TRADE_INVITATION_ANSWER_FAIL_PARTNER_FORTRESS_NOT_EXISTS	"REQUEST_SEND_TRADE_INVITATION_ANSWER_FAIL_PARTNER_FORTRESS_NOT_EXISTS"
#define REQUEST_SEND_TRADE_INVITATION_ANSWER_FAIL_OWNED_FORTRESS_NOT_EXISTS		"REQUEST_SEND_TRADE_INVITATION_ANSWER_FAIL_OWNED_FORTRESS_NOT_EXISTS"
#define REQUEST_SEND_TRADE_INVITATION_ANSWER_FAIL_FORTRESSNO					"REQUEST_SEND_TRADE_INVITATION_ANSWER_FAIL_FORTRESSNO"

#define REQUEST_SEND_TRADE_INVITATION_ANSWER_REASON								"REQUEST_SEND_TRADE_INVITATION_ANSWER_REASON"
#define REQUEST_SEND_TRADE_INVITATION_ANSWER_TRADE_ROLE							"REQUEST_SEND_TRADE_INVITATION_ANSWER_TRADE_ROLE"
#define REQUEST_SEND_TRADE_INVITATION_ANSWER_RESULT								"REQUEST_SEND_TRADE_INVITATION_ANSWER_RESULT"
#define REQUEST_SEND_TRADE_INVITATION_ANSWER_FAIL								"REQUEST_SEND_TRADE_INVITATION_ANSWER_FAIL"

// ################################

#define PROTOCOL_TRADE_ROLE_NONE												"PROTOCOL_TRADE_ROLE_NONE"
#define PROTOCOL_TRADE_ROLE_HOST												"PROTOCOL_TRADE_ROLE_HOST"
#define PROTOCOL_TRADE_ROLE_INVITED												"PROTOCOL_TRADE_ROLE_INVITED"
#define PROTOCOL_TRADE_ROLE_PARTNER_TRADER										"PROTOCOL_TRADE_ROLE_PARTNER_TRADER"
#define PROTOCOL_TRADE_ROLE_LOOT_TRADER											"PROTOCOL_TRADE_ROLE_LOOT_TRADER"
#define PROTOCOL_TRADE_ROLE_SELF_TRADER											"PROTOCOL_TRADE_ROLE_SELF_TRADER"
#define PROTOCOL_TRADE_ROLE_SPACE_TRADER										"PROTOCOL_TRADE_ROLE_SPACE_TRADER"

#define REQUEST_SEND_TRADE_INVITATION_ANSWER_FAIL_YOU_ARE_TRADER_ALREADY		"REQUEST_SEND_TRADE_INVITATION_ANSWER_FAIL_YOU_ARE_TRADER_ALREADY"
#define REQUEST_SEND_TRADE_INVITATION_ANSWER_FAIL_YOU_ARE_HOST_ALREADY			"REQUEST_SEND_TRADE_INVITATION_ANSWER_FAIL_YOU_ARE_HOST_ALREADY"

#define REQUEST_SEND_TRADE_INVITATION_ANSWER_YOU_INVITED_YOUR_HOST				"REQUEST_SEND_TRADE_INVITATION_ANSWER_YOU_INVITED_YOUR_HOST"
#define REQUEST_SEND_TRADE_INVITATION_ANSWER_YOU_INVITED_UNCONTROLLABLE			"REQUEST_SEND_TRADE_INVITATION_ANSWER_YOU_INVITED_UNCONTROLLABLE"
#define REQUEST_SEND_TRADE_INVITATION_ANSWER_YOU_INVITED_BUSY_TRADER			"REQUEST_SEND_TRADE_INVITATION_ANSWER_YOU_INVITED_BUSY_TRADER"
#define REQUEST_SEND_TRADE_INVITATION_ANSWER_YOU_INVITED_BUSY_HOST				"REQUEST_SEND_TRADE_INVITATION_ANSWER_YOU_INVITED_BUSY_HOST"
#define REQUEST_SEND_TRADE_INVITATION_ANSWER_YOU_INVITED_FREE_PARTNER			"REQUEST_SEND_TRADE_INVITATION_ANSWER_YOU_INVITED_FREE_PARTNER"
#define REQUEST_SEND_TRADE_INVITATION_ANSWER_YOU_INVITED_YOURSELF				"REQUEST_SEND_TRADE_INVITATION_ANSWER_YOU_INVITED_YOURSELF"

// ################################

#define REQUEST_CANCEL_TRADE											"REQUEST_CANCEL_TRADE"

#define REQUEST_CANCEL_TRADE_OWNED_FORTRESS_ID							"REQUEST_CANCEL_TRADE_OWNED_FORTRESS_ID"
#define REQUEST_CANCEL_TRADE_PARTNER_FORTRESS_ID						"REQUEST_CANCEL_TRADE_PARTNER_FORTRESS_ID"

#define REQUEST_CANCEL_TRADE_ANSWER_REASON								"REQUEST_CANCEL_TRADE_ANSWER_REASON"
#define REQUEST_CANCEL_TRADE_ANSWER_TRADE_ROLE							"REQUEST_CANCEL_TRADE_ANSWER_TRADE_ROLE"
#define REQUEST_CANCEL_TRADE_ANSWER_OWNED_FORTRESS_ID					"REQUEST_CANCEL_TRADE_ANSWER_OWNED_FORTRESS_ID"
#define REQUEST_CANCEL_TRADE_ANSWER_PARTNER_FORTRESS_ID					"REQUEST_CANCEL_TRADE_ANSWER_PARTNER_FORTRESS_ID"
#define REQUEST_CANCEL_TRADE_ANSWER_REASON_YOU_ARE_PARTICIPANT			"REQUEST_CANCEL_TRADE_ANSWER_REASON_YOU_ARE_PARTICIPANT"
#define REQUEST_CANCEL_TRADE_ANSWER_REASON_PARTNER_CANCELED_TRADE		"REQUEST_CANCEL_TRADE_ANSWER_REASON_PARTNER_CANCELED_TRADE"

#define REQUEST_CANCEL_TRADE_ANSWER_FAIL_YOU_ARE_NOT_PARTICIPANT		"REQUEST_CANCEL_TRADE_ANSWER_FAIL_YOU_ARE_NOT_PARTICIPANT"

// ------------------------------

#define RECEIVE_TRADE_INVITATION										"RECEIVE_TRADE_INVITATION"

#define RECEIVE_TRADE_CANCELATION										"RECEIVE_TRADE_CANCELATION"
#define RECEIVE_TRADE_CANCELATION_OWNED_FORTRESS_ID						"RECEIVE_TRADE_CANCELATION_OWNED_FORTRESS_ID"
#define RECEIVE_TRADE_CANCELATION_PARTNER_FORTRESS_ID					"RECEIVE_TRADE_CANCELATION_PARTNER_FORTRESS_ID"

// ################################

struct trade_invitation_data
{
	unsigned long hostId;
	std::string hostName;
	
	unsigned long hostFortressId;
	std::string hostFortressName;

	unsigned long invitedId;
	std::string invitedName;

	unsigned long invitedFortressId;
	std::string invitedFortressName;

	bool hostIsShip;
	bool invitedIsShip;
};

#define TRADE_INVITATION_HOST_ID							"TRADE_INVITATION_HOST_ID"
#define TRADE_INVITATION_HOST_NAME							"TRADE_INVITATION_HOST_NAME"
#define TRADE_INVITATION_HOST_FORTRESS_ID					"TRADE_INVITATION_HOST_FORTRESS_ID"
#define TRADE_INVITATION_HOST_FORTRESS_NAME					"TRADE_INVITATION_HOST_FORTRESS_NAME"
#define TRADE_INVITATION_INVITED_ID							"TRADE_INVITATION_INVITED_ID"
#define TRADE_INVITATION_INVITED_NAME						"TRADE_INVITATION_INVITED_NAME"
#define TRADE_INVITATION_INVITED_FORTRESS_ID				"TRADE_INVITATION_INVITED_FORTRESS_ID"
#define TRADE_INVITATION_INVITED_FORTRESS_NAME				"TRADE_INVITATION_INVITED_FORTRESS_NAME"
#define TRADE_INVITATION_HOST_IS_SHIP						"TRADE_INVITATION_HOST_IS_SHIP"
#define TRADE_INVITATION_INVITED_IS_SHIP					"TRADE_INVITATION_INVITED_IS_SHIP"

// ################################

#define	REQUEST_TRADE_PARTNER_FORTRESSES										"REQUEST_TRADE_PARTNER_FORTRESSES"

// --------------------------------

#define REQUEST_TRADE_PARTNER_FORTRESSES_ANSWER_FORTRESS_ID						"REQUEST_TRADE_PARTNER_FORTRESSES_ANSWER_FORTRESS_ID"

#define REQUEST_TRADE_PARTNER_FORTRESSES_ANSWER_OWNED_FORTRESS_COUNT			"REQUEST_TRADE_PARTNER_FORTRESSES_ANSWER_OWNED_FORTRESS_COUNT"
#define REQUEST_TRADE_PARTNER_FORTRESSES_ANSWER_OWNED_FORTRESS_ID				"REQUEST_TRADE_PARTNER_FORTRESSES_ANSWER_OWNED_FORTRESS_ID"
#define REQUEST_TRADE_PARTNER_FORTRESSES_ANSWER_OWNED_FORTRESS_NAME				"REQUEST_TRADE_PARTNER_FORTRESSES_ANSWER_OWNED_FORTRESS_NAME"
#define REQUEST_TRADE_PARTNER_FORTRESSES_ANSWER_OWNED_FORTRESS_TYPE				"REQUEST_TRADE_PARTNER_FORTRESSES_ANSWER_OWNED_FORTRESS_TYPE"
#define REQUEST_TRADE_PARTNER_FORTRESSES_ANSWER_OWNED_FORTRESS_SHELL			"REQUEST_TRADE_PARTNER_FORTRESSES_ANSWER_OWNED_FORTRESS_SHELL"

#define REQUEST_TRADE_PARTNER_FORTRESSES_ANSWER_NOT_OWNED_FORTRESS_COUNT		"REQUEST_TRADE_PARTNER_FORTRESSES_ANSWER_NOT_OWNED_FORTRESS_COUNT"
#define REQUEST_TRADE_PARTNER_FORTRESSES_ANSWER_NOT_OWNED_FORTRESS_ID			"REQUEST_TRADE_PARTNER_FORTRESSES_ANSWER_NOT_OWNED_FORTRESS_ID"
#define REQUEST_TRADE_PARTNER_FORTRESSES_ANSWER_NOT_OWNED_FORTRESS_NAME			"REQUEST_TRADE_PARTNER_FORTRESSES_ANSWER_NOT_OWNED_FORTRESS_NAME"
#define REQUEST_TRADE_PARTNER_FORTRESSES_ANSWER_NOT_OWNED_FORTRESS_TYPE			"REQUEST_TRADE_PARTNER_FORTRESSES_ANSWER_NOT_OWNED_FORTRESS_TYPE"
#define REQUEST_TRADE_PARTNER_FORTRESSES_ANSWER_NOT_OWNED_FORTRESS_REALM_NAME	"REQUEST_TRADE_PARTNER_FORTRESSES_ANSWER_NOT_OWNED_FORTRESS_REALM_NAME"
#define REQUEST_TRADE_PARTNER_FORTRESSES_ANSWER_NOT_OWNED_FORTRESS_SHELL		"REQUEST_TRADE_PARTNER_FORTRESSES_ANSWER_NOT_OWNED_FORTRESS_SHELL"

#define REQUEST_TRADE_PARTNER_FORTRESSES_ANSWER_REASON							"REQUEST_TRADE_PARTNER_FORTRESSES_ANSWER_REASON"
#define REQUEST_TRADE_PARTNER_FORTRESSES_ANSWER_FORTRESSNE						"REQUEST_TRADE_PARTNER_FORTRESSES_ANSWER_FORTRESSNE"
#define REQUEST_TRADE_PARTNER_FORTRESSES_ANSWER_FORTRESSNO						"REQUEST_TRADE_PARTNER_FORTRESSES_ANSWER_FORTRESSNO"

// ################################

#define REQUEST_TRADE_PARTNER_FORTRESSES										"REQUEST_TRADE_PARTNER_FORTRESSES"
#define REQUEST_TRADE_PARTNER_FORTRESSES_FORTRESS_ID							"REQUEST_TRADE_PARTNER_FORTRESSES_FORTRESS_ID"

// ################################

#define REQUEST_DECIDE_TRADE_INVITATION										"REQUEST_DECIDE_TRADE_INVITATION"
#define REQUEST_DECIDE_TRADE_INVITATION_ACCEPTED							"REQUEST_DECIDE_TRADE_INVITATION_ACCEPTED"

#define REQUEST_DECIDE_TRADE_INVITATION_HOST_FORTRESS_ID					"REQUEST_DECIDE_TRADE_INVITATION_HOST_FORTRESS_ID"
#define REQUEST_DECIDE_TRADE_INVITATION_INVITED_FORTRESS_ID					"REQUEST_DECIDE_TRADE_INVITATION_INVITED_FORTRESS_ID"

// --------------------------------

#define REQUEST_DECIDE_TRADE_INVITATION_ANSWER_INVITED_FORTRESS_ID			"REQUEST_DECIDE_TRADE_INVITATION_ANSWER_INVITED_FORTRESS_ID"
#define REQUEST_DECIDE_TRADE_INVITATION_ANSWER_HOST_FORTRESS_ID				"REQUEST_DECIDE_TRADE_INVITATION_ANSWER_HOST_FORTRESS_ID"

#define REQUEST_DECIDE_TRADE_INVITATION_ANSWER_FAIL							"REQUEST_DECIDE_TRADE_INVITATION_ANSWER_FAIL"
#define REQUEST_DECIDE_TRADE_INVITATION_ANSWER_INVITATION_NOT_EXISTS		"REQUEST_DECIDE_TRADE_INVITATION_ANSWER_INVITATION_NOT_EXISTS"
#define	REQUEST_DECIDE_TRADE_INVITATION_ANSWER_PARTNER_FORTRESS_NOT_EXISTS	"REQUEST_DECIDE_TRADE_INVITATION_ANSWER_PARTNER_FORTRESS_NOT_EXISTS"
#define REQUEST_DECIDE_TRADE_INVITATION_ANSWER_INVITED_FORTRESS_NOT_EXISTS	"REQUEST_DECIDE_TRADE_INVITATION_ANSWER_INVITED_FORTRESS_NOT_EXISTS"
#define REQUEST_DECIDE_TRADE_INVITATION_ANSWER_INVITED_FORTRESS_NOT_OWNED	"REQUEST_DECIDE_TRADE_INVITATION_ANSWER_INVITED_FORTRESS_NOT_OWNED"
#define REQUEST_DECIDE_TRADE_INVITATION_ANSWER_YOU_ARE_TRADER_ALREADY		"REQUEST_DECIDE_TRADE_INVITATION_ANSWER_YOU_ARE_TRADER_ALREADY"

// --------------------------------

#define REQUEST_DECIDE_TRADE_INVITATION_ANSWER_ACCEPTED						"REQUEST_DECIDE_TRADE_INVITATION_ANSWER_ACCEPTED"
#define REQUEST_DECIDE_TRADE_INVITATION_ANSWER_SELF_DATA_PREFIX				"REQUEST_DECIDE_TRADE_INVITATION_ANSWER_SELF_DATA_PREFIX"

// ################################

#define RECEIVE_TRADE_INVITATION_DECISION									"RECEIVE_TRADE_INVITATION_DECISION"
#define RECEIVE_TRADE_INVITATION_DECISION_ACCEPTED							"RECEIVE_TRADE_INVITATION_DECISION_ACCEPTED"
#define RECEIVE_TRADE_INVITATION_DECISION_ANSWER_SELF_DATA_PREFIX			"RECEIVE_TRADE_INVITATION_DECISION_ANSWER_SELF_DATA_PREFIX"

// ################################

struct trade_data
{
	std::list<warehouse_item_status> tradeItems;

	unsigned long long deuterium;
	unsigned long long heavyWater;
	unsigned long long ilmenite;
	unsigned long long quarkGluonPlasma;
	unsigned long long titanium;
	unsigned long long ulrea;
	unsigned long long zirconiumCrystal;
	unsigned long long energy;
};

struct client_trade_item_data {	
	unsigned long id;
	unsigned long long working;
	unsigned long long damaged;
	std::string patternName;
};

struct client_trade_data
{
	std::list<client_trade_item_data> tradeItems;

	unsigned long long deuterium;
	unsigned long long heavyWater;
	unsigned long long ilmenite;
	unsigned long long quarkGluonPlasma;
	unsigned long long titanium;
	unsigned long long ulrea;
	unsigned long long zirconiumCrystal;
	unsigned long long energy;
};

#define TRADE_ITEM_DATA_DAMAGED								"TRADE_ITEM_DATA_WORKING"
#define TRADE_ITEM_DATA_WORKING								"TRADE_ITEM_DATA_DAMAGED"
#define TRADE_ITEM_DATA_ID									"TRADE_ITEM_DATA_ITEM_ID"
#define TRADE_ITEM_DATA_PATTERN_NAME						"TRADE_ITEM_DATA_PATTERN_NAME"
#define TRADE_ITEM_DATA_ITEM_COUNT							"TRADE_ITEM_DATA_ITEM_COUNT"
#define TRADE_ITEM_DATA_PARAM_COUNT							"TRADE_ITEM_DATA_ITEM_PARAM_COUNT"
#define TRADE_ITEM_DATA_STACKABLE							"TRADE_ITEM_DATA_STACKABLE"
#define TRADE_ITEM_DATA_PARAM_NAME							"TRADE_ITEM_DATA_PARAM_NAME"				
#define TRADE_ITEM_DATA_PARAM_VALUE							"TRADE_ITEM_DATA_PARAM_VALUE"

#define TRADE_ITEM_DATA_DEUTERIUM					"TRADE_ITEM_DATA_DEUTERIUM"
#define	TRADE_ITEM_DATA_HEAVY_WATER					"TRADE_ITEM_DATA_HEAVY_WATER"
#define TRADE_ITEM_DATA_ILMENITE					"TRADE_ITEM_DATA_ILMENITE"
#define TRADE_ITEM_DATA_QUARK_GLUON_PLASMA			"TRADE_ITEM_DATA_QUARK_GLUON_PLASMA"
#define TRADE_ITEM_DATA_TITANIUM					"TRADE_ITEM_DATA_TITANIUM"
#define TRADE_ITEM_DATA_ULREA						"TRADE_ITEM_DATA_ULREA"
#define TRADE_ITEM_DATA_ZIRCONIUM_CRYSTAL			"TRADE_ITEM_DATA_ZIRCONIUM_CRYSTAL"
#define TRADE_ITEM_DATA_ENERGY						"TRADE_ITEM_DATA_ENERGY"

#define REQUEST_SEND_TRADE_INVITATION_SELF_DATA_PREFIX		"REQUEST_SEND_TRADE_INVITATION_SELF_DATA_PREFIX"
#define REQUEST_SEND_TRADE_INVITATION_PARTNER_DATA_PREFIX	"REQUEST_SEND_TRADE_INVITATION_PARTNER_DATA_PREFIX"

// ################################

#define TRADE_CLIENT_MOVEMENT_DATA_ITEM_ID								"TRADE_CLIENT_MOVEMENT_DATA_ITEM_ID"
#define TRADE_CLIENT_MOVEMENT_DATA_SELF_FORTRESS_ID						"TRADE_CLIENT_MOVEMENT_DATA_SELF_FORTRESS_ID"
#define TRADE_CLIENT_MOVEMENT_DATA_PARTNER_FORTRESS_ID					"TRADE_CLIENT_MOVEMENT_DATA_PARTNER_FORTRESS_ID"
#define TRADE_CLIENT_MOVEMENT_DATA_WORKING								"TRADE_CLIENT_MOVEMENT_DATA_WORKING"
#define TRADE_CLIENT_MOVEMENT_DATA_DAMAGED								"TRADE_CLIENT_MOVEMENT_DATA_DAMAGED"
#define TRADE_CLIENT_MOVEMENT_DATA_TRADE_DIRECTION						"TRADE_CLIENT_MOVEMENT_DATA_TRADE_DIRECTION"
#define TRADE_CLIENT_MOVEMENT_DATA_PATTERN_NAME							"TRADE_CLIENT_MOVEMENT_DATA_PATTERN_NAME"

#define TRADE_MOVEMENT_DATA_SELF_FORTRESS_ID					"TRADE_MOVEMENT_DATA_SELF_FORTRESS_ID"
#define TRADE_MOVEMENT_DATA_PARTNER_FORTRESS_ID					"TRADE_MOVEMENT_DATA_PARTNER_FORTRESS_ID"
#define TRADE_MOVEMENT_DATA_TRADE_DIRECTION						"TRADE_MOVEMENT_DATA_TRADE_DIRECTION"
#define TRADE_MOVEMENT_DATA_PREFIX								"TRADE_MOVEMENT_DATA_PREFIX"

struct trade_movement_data
{
	warehouse_item_status item;
	unsigned long selfFortressId;
	unsigned long partnerFortressId;
	std::string tradeDirection;
};

struct trade_client_movement_data
{
	unsigned long selfFortressId;
	unsigned long partnerFortressId;
	unsigned long itemId;
	unsigned long long working;
	unsigned long long damaged;
	std::string tradeDirection;
	std::string patternName;
};

#define REQUEST_MOVE_TRADE_ITEM						"REQUEST_MOVE_TRADE_ITEM"

#define TRADE_DIRECTION_OWNED_OFFER					"TRADE_DIRECTION_OWNED_OFFER"
#define TRADE_DIRECTION_OWNED_ITEMS					"TRADE_DIRECTION_OWNED_ITEMS"
#define TRADE_DIRECTION_PARTNER_OFFER				"TRADE_DIRECTION_PARTNER_OFFER"
#define TRADE_DIRECTION_PARTNER_ITEMS				"TRADE_DIRECTION_PARTNER_ITEMS"

#define REQUEST_MOVE_TRADE_ITEM_SELF_FORTRESS_ID						"REQUEST_MOVE_TRADE_ITEM_SELF_FORTRESS_ID"
#define REQUEST_MOVE_TRADE_ITEM_PARTNER_FORTRESS_ID						"REQUEST_MOVE_TRADE_ITEM_PARTNER_FORTRESS_ID"
#define REQUEST_MOVE_TRADE_ITEM_ITEM_ID									"REQUEST_MOVE_TRADE_ITEM_ITEM_ID"
#define REQUEST_MOVE_TRADE_ITEM_STACKABLE								"REQUEST_MOVE_TRADE_ITEM_STACKABLE"
#define REQUEST_MOVE_TRADE_ITEM_DIRECTION								"REQUEST_MOVE_TRADE_ITEM_DIRECTION"
#define REQUEST_MOVE_TRADE_ITEM_WORKING									"REQUEST_MOVE_TRADE_ITEM_WORKING"
#define REQUEST_MOVE_TRADE_ITEM_DAMAGED									"REQUEST_MOVE_TRADE_ITEM_DAMAGED"

#define REQUEST_MOVE_TRADE_ITEM_ANSWER_AUTHOR							"REQUEST_MOVE_TRADE_ITEM_ANSWER_AUTHOR"
#define REQUEST_MOVE_TRADE_ITEM_ANSWER_FAIL_REASON						"REQUEST_MOVE_TRADE_ITEM_ANSWER_FAIL_REASON"
#define REQUEST_MOVE_TRADE_ITEM_ANSWER_FAIL_FORBIDDEN_DIRECTION			"REQUEST_MOVE_TRADE_ITEM_ANSWER_FAIL_FORBIDDEN_DIRECTION"
#define REQUEST_MOVE_TRADE_ITEM_ANSWER_FAIL_SOURCE_FORTRESS_NOT_EXISTS	"REQUEST_MOVE_TRADE_ITEM_ANSWER_FAIL_SOURCE_FORTRESS_NOT_EXISTS"
#define REQUEST_MOVE_TRADE_ITEM_ANSWER_FAIL_TARGET_FORTRESS_NOT_PARTNER	"REQUEST_MOVE_TRADE_ITEM_ANSWER_FAIL_TARGET_FORTRESS_NOT_PARTNER"
#define REQUEST_MOVE_TRADE_ITEM_ANSWER_FAIL_TARGET_REALM_NOT_PARTNER	"REQUEST_MOVE_TRADE_ITEM_ANSWER_FAIL_TARGET_REALM_NOT_PARTNER"
#define REQUEST_MOVE_TRADE_ITEM_ANSWER_FAIL_SOURCE_FORTRESS_NOT_PARTNER	"REQUEST_MOVE_TRADE_ITEM_ANSWER_FAIL_SOURCE_FORTRESS_NOT_PARTNER"
#define REQUEST_MOVE_TRADE_ITEM_ANSWER_FAIL_YOU_ARE_NOT_TRADER			"REQUEST_MOVE_TRADE_ITEM_ANSWER_FAIL_YOU_ARE_NOT_TRADER"
#define REQUEST_MOVE_TRADE_ITEM_ANSWER_FAIL_TARGET_FORTRESS_NOT_EXISTS	"REQUEST_MOVE_TRADE_ITEM_ANSWER_FAIL_TARGET_FORTRESS_NOT_EXISTS"
#define REQUEST_MOVE_TRADE_ITEM_ANSWER_FAIL_UNKNOWN_ITEM				"REQUEST_MOVE_TRADE_ITEM_ANSWER_FAIL_UNKNOWN_ITEM"

// ################################

#define PROTOCOL_RESOURCE_TYPE_DEUTERIUM								"PROTOCOL_RESOURCE_TYPE_DEUTERIUM"
#define PROTOCOL_RESOURCE_TYPE_ENERGY									"PROTOCOL_RESOURCE_TYPE_ENERGY"
#define PROTOCOL_RESOURCE_TYPE_HEAVY_WATER								"PROTOCOL_RESOURCE_TYPE_HEAVY_WATER"
#define PROTOCOL_RESOURCE_TYPE_ILMENITE									"PROTOCOL_RESOURCE_TYPE_ILMENITE"
#define PROTOCOL_RESOURCE_TYPE_QUARK_GLUON_PLASMA						"PROTOCOL_RESOURCE_TYPE_QUARK_GLUON_PLASMA"
#define PROTOCOL_RESOURCE_TYPE_TITANIUM									"PROTOCOL_RESOURCE_TYPE_TITANIUM"
#define PROTOCOL_RESOURCE_TYPE_ULREA									"PROTOCOL_RESOURCE_TYPE_ULREA"
#define PROTOCOL_RESOURCE_TYPE_ZIRCONIUM_CRYSTALS						"PROTOCOL_RESOURCE_TYPE_ZIRCONIUM_CRYSTALS"

enum game_resource_type {
	GAME_RESOURCE_TYPE_DEUTERIUM,
	GAME_RESOURCE_TYPE_ENERGY,
	GAME_RESOURCE_TYPE_HEAVY_WATER,
	GAME_RESOURCE_TYPE_ILMENITE,
	GAME_RESOURCE_TYPE_QUARK_GLUON_PLASMA,
	GAME_RESOURCE_TYPE_TITANIUM,
	GAME_RESOURCE_TYPE_ULREA,
	GAME_RESOURCE_TYPE_ZIRCONIUM_CRYSTALS,		

	GAME_RESOURCE_TYPE_UNKNOWN_MAPPING,
};

#define TRADE_RESOURCE_MOVEMENT_DATA_SELF_FORTRESS_ID						"TRADE_RESOURCE_MOVEMENT_DATA_SELF_FORTRESS_ID"
#define TRADE_RESOURCE_MOVEMENT_DATA_PARTNER_FORTRESS_ID					"TRADE_RESOURCE_MOVEMENT_DATA_PARTNER_FORTRESS_ID"
#define TRADE_RESOURCE_MOVEMENT_DATA_RESOURCE_TYPE							"TRADE_RESOURCE_MOVEMENT_DATA_RESOURCE_TYPE"
#define TRADE_RESOURCE_MOVEMENT_DATA_COUNT									"TRADE_RESOURCE_MOVEMENT_DATA_COUNT"
#define TRADE_RESOURCE_MOVEMENT_DATA_TRADE_DIRECTION						"TRADE_RESOURCE_MOVEMENT_DATA_TRADE_DIRECTION"

#define REQUEST_MOVE_TRADE_RESOURCE_ANSWER_AUTHOR							"REQUEST_MOVE_TRADE_RESOURCE_ANSWER_AUTHOR"
#define REQUEST_MOVE_TRADE_RESOURCE_ANSWER_FAIL_REASON						"REQUEST_MOVE_TRADE_RESOURCE_ANSWER_FAIL_REASON"
#define REQUEST_MOVE_TRADE_RESOURCE_ANSWER_FAIL_FORBIDDEN_DIRECTION			"REQUEST_MOVE_TRADE_RESOURCE_ANSWER_FAIL_FORBIDDEN_DIRECTION"
#define REQUEST_MOVE_TRADE_RESOURCE_ANSWER_FAIL_SOURCE_FORTRESS_NOT_EXISTS	"REQUEST_MOVE_TRADE_RESOURCE_ANSWER_FAIL_SOURCE_FORTRESS_NOT_EXISTS"
#define REQUEST_MOVE_TRADE_RESOURCE_ANSWER_FAIL_TARGET_FORTRESS_NOT_PARTNER	"REQUEST_MOVE_TRADE_RESOURCE_ANSWER_FAIL_TARGET_FORTRESS_NOT_PARTNER"
#define REQUEST_MOVE_TRADE_RESOURCE_ANSWER_FAIL_TARGET_REALM_NOT_PARTNER	"REQUEST_MOVE_TRADE_RESOURCE_ANSWER_FAIL_TARGET_REALM_NOT_PARTNER"
#define REQUEST_MOVE_TRADE_RESOURCE_ANSWER_FAIL_SOURCE_FORTRESS_NOT_PARTNER	"REQUEST_MOVE_TRADE_RESOURCE_ANSWER_FAIL_SOURCE_FORTRESS_NOT_PARTNER"
#define REQUEST_MOVE_TRADE_RESOURCE_ANSWER_FAIL_YOU_ARE_NOT_TRADER			"REQUEST_MOVE_TRADE_RESOURCE_ANSWER_FAIL_YOU_ARE_NOT_TRADER"
#define REQUEST_MOVE_TRADE_RESOURCE_ANSWER_FAIL_TARGET_FORTRESS_NOT_EXISTS	"REQUEST_MOVE_TRADE_RESOURCE_ANSWER_FAIL_TARGET_FORTRESS_NOT_EXISTS"

struct trade_resource_movement_data
{
	unsigned long selfFortressId;
	unsigned long partnerFortressId;
	game_resource_type resourceType;
	unsigned long long count;
	std::string tradeDirection;
};

#define REQUEST_MOVE_TRADE_RESOURCE											"REQUEST_MOVE_TRADE_RESOURCE"

// ################################

#define REQUEST_COMMIT_TRADE											"REQUEST_COMMIT_TRADE"

#define REQUEST_COMMIT_TRADE_SELF_DATA_PREFIX							"REQUEST_COMMIT_TRADE_SELF_DATA_PREFIX"
#define REQUEST_COMMIT_TRADE_PARTNER_DATA_PREFIX						"REQUEST_COMMIT_TRADE_PARTNER_DATA_PREFIX"
#define REQUEST_COMMIT_TRADE_SELF_FORTRESS_ID							"REQUEST_COMMIT_TRADE_SELF_FORTRESS_ID"
#define REQUEST_COMMIT_TRADE_PARTNER_FORTRESS_ID						"REQUEST_COMMIT_TRADE_PARTNER_FORTRESS_ID"

#define REQUEST_COMMIT_TRADE_ANSWER_FAIL_REASON							"REQUEST_COMMIT_TRADE_ANSWER_FAIL_REASON"
#define REQUEST_COMMIT_TRADE_ANSWER_SELF_FORTRESS_ID					"REQUEST_COMMIT_TRADE_ANSWER_SELF_FORTRESS_ID"
#define REQUEST_COMMIT_TRADE_ANSWER_PARTNER_FORTRESS_ID					"REQUEST_COMMIT_TRADE_ANSWER_PARTNER_FORTRESS_ID"
#define REQUEST_COMMIT_TRADE_ANSWER_RESULT								"REQUEST_COMMIT_TRADE_ANSWER_RESULT"

#define REQUEST_PREPARE_COMMIT_TRADE									"REQUEST_PREPARE_COMMIT_TRADE"
#define REQUEST_PREPARE_COMMIT_TRADE_ANSWER_SELF_FORTRESS_ID			"REQUEST_PREPARE_COMMIT_TRADE_ANSWER_SELF_FORTRESS_ID"
#define REQUEST_PREPARE_COMMIT_TRADE_ANSWER_PARTNER_FORTRESS_ID			"REQUEST_PREPARE_COMMIT_TRADE_ANSWER_PARTNER_FORTRESS_ID"
#define REQUEST_PREPARE_COMMIT_TRADE_ANSWER_TRADE_COMMIT_ROLE			"REQUEST_PREPARE_COMMIT_TRADE_ANSWER_TRADE_COMMIT_ROLE"

#define REQUEST_COMMIT_TRADE_ANSWER_FAIL_SOURCE_FORTRESS_NOT_EXISTS		"REQUEST_COMMIT_TRADE_ANSWER_FAIL_SOURCE_FORTRESS_NOT_EXISTS"
#define REQUEST_COMMIT_TRADE_ANSWER_FAIL_TARGET_FORTRESS_NOT_EXISTS		"REQUEST_COMMIT_TRADE_ANSWER_FAIL_TARGET_FORTRESS_NOT_EXISTS"
#define REQUEST_COMMIT_TRADE_ANSWER_FAIL_TARGET_REALM_NOT_EXISTS		"REQUEST_COMMIT_TRADE_ANSWER_FAIL_TARGET_REALM_NOT_EXISTS"
#define REQUEST_COMMIT_TRADE_ANSWER_FAIL_YOU_ARE_NOT_TRADER				"REQUEST_COMMIT_TRADE_ANSWER_FAIL_YOU_ARE_NOT_TRADER"
#define REQUEST_COMMIT_TRADE_ANSWER_FAIL_SOURCE_FORTRESS_NOT_PARTNER	"REQUEST_COMMIT_TRADE_ANSWER_FAIL_SOURCE_FORTRESS_NOT_PARTNER"
#define REQUEST_COMMIT_TRADE_ANSWER_FAIL_TARGET_FORTRESS_NOT_PARTNER	"REQUEST_COMMIT_TRADE_ANSWER_FAIL_TARGET_FORTRESS_NOT_PARTNER"
#define REQUEST_COMMIT_TRADE_ANSWER_FAIL_TARGET_REALM_NOT_PARTNER		"REQUEST_COMMIT_TRADE_ANSWER_FAIL_TARGET_REALM_NOT_PARTNER"
#define REQUEST_COMMIT_TRADE_ANSWER_FAIL_YOU_ARE_COMMITER_HOST_ALREADY	"REQUEST_COMMIT_TRADE_ANSWER_FAIL_YOU_ARE_COMMITER_HOST_ALREADY"

#define	PROTOCOL_TRADE_RESULT_DONE											"PROTOCOL_TRADE_RESULT_DONE"
#define	PROTOCOL_TRADE_RESULT_FIRST_FORTRESS_WEIGHT_LIMIT					"PROTOCOL_TRADE_RESULT_FIRST_FORTRESS_WEIGHT_LIMIT"
#define	PROTOCOL_TRADE_RESULT_SECOND_FORTRESS_WEIGHT_LIMIT					"PROTOCOL_TRADE_RESULT_SECOND_FORTRESS_WEIGHT_LIMIT"
#define	PROTOCOL_TRADE_RESULT_FIRST_FORTRESS_CAPACITY_LIMIT					"PROTOCOL_TRADE_RESULT_FIRST_FORTRESS_CAPACITY_LIMIT"
#define	PROTOCOL_TRADE_RESULT_SECOND_FORTRESS_CAPACITY_LIMIT				"PROTOCOL_TRADE_RESULT_SECOND_FORTRESS_CAPACITY_LIMIT"
#define	PROTOCOL_TRADE_RESULT_FIRST_FORTRESS_NOT_STORING_ITEMS				"PROTOCOL_TRADE_RESULT_FIRST_FORTRESS_NOT_STORING_ITEMS"
#define	PROTOCOL_TRADE_RESULT_SECOND_FORTRESS_NOT_STORING_ITEMS				"PROTOCOL_TRADE_RESULT_SECOND_FORTRESS_NOT_STORING_ITEMS"
#define	PROTOCOL_TRADE_RESULT_FIRST_FORTRESS_MAGNETICAL_GRIDS_LACK			"PROTOCOL_TRADE_RESULT_FIRST_FORTRESS_MAGNETICAL_GRIDS_LACK"
#define	PROTOCOL_TRADE_RESULT_SECOND_FORTRESS_MAGNETICAL_GRIDS_LACK			"PROTOCOL_TRADE_RESULT_SECOND_FORTRESS_MAGNETICAL_GRIDS_LACK"
#define	PROTOCOL_TRADE_RESULT_FIRST_FORTRESS_TRANSPORT_CONTAINERS_LACK		"PROTOCOL_TRADE_RESULT_FIRST_FORTRESS_TRANSPORT_CONTAINERS_LACK"
#define	PROTOCOL_TRADE_RESULT_SECOND_FORTRESS_TRANSPORT_CONTAINERS_LACK		"PROTOCOL_TRADE_RESULT_SECOND_FORTRESS_TRANSPORT_CONTAINERS_LACK"
#define	PROTOCOL_TRADE_RESULT_FIRST_FORTRESS_ENERGETIC_CELLS_LACK			"PROTOCOL_TRADE_RESULT_FIRST_FORTRESS_ENERGETIC_CELLS_LACK"
#define	PROTOCOL_TRADE_RESULT_SECOND_FORTRESS_ENERGETIC_CELLS_LACK			"PROTOCOL_TRADE_RESULT_SECOND_FORTRESS_ENERGETIC_CELLS_LACK"
#define PROTOCOL_TRADE_RESULT_NOT_IN_RANGE									"PROTOCOL_TRADE_RESULT_NOT_IN_RANGE"
#define	PROTOCOL_TRADE_RESULT_UNKNOWN_FAIL									"PROTOCOL_TRADE_RESULT_UNKNOWN_FAIL"

#define PROTOCOL_TRADE_COMMIT_ROLE_HOST										"PROTOCOL_TRADE_COMMIT_ROLE_HOST"
#define PROTOCOL_TRADE_COMMIT_ROLE_INVITED									"PROTOCOL_TRADE_COMMIT_ROLE_INVITED"
#define PROTOCOL_TRADE_COMMIT_ROLE_NONE										"PROTOCOL_TRADE_COMMIT_ROLE_NONE"

// ################################

#define REQUEST_CANCEL_TRADE_COMMIT												"REQUEST_CANCEL_TRADE_COMMIT"
#define REQUEST_CANCEL_TRADE_COMMIT_SELF_FORTRESS_ID							"REQUEST_CANCEL_TRADE_COMMIT_SELF_FORTRESS_ID"
#define REQUEST_CANCEL_TRADE_COMMIT_PARTNER_FORTRESS_ID							"REQUEST_CANCEL_TRADE_COMMIT_PARTNER_FORTRESS_ID"

#define REQUEST_CANCEL_TRADE_COMMIT_ANSWER_FAIL_SOURCE_FORTRESS_NOT_EXISTS		"REQUEST_CANCEL_TRADE_COMMIT_ANSWER_FAIL_SOURCE_FORTRESS_NOT_EXISTS"
#define REQUEST_CANCEL_TRADE_COMMIT_ANSWER_FAIL_TARGET_FORTRESS_NOT_EXISTS		"REQUEST_CANCEL_TRADE_COMMIT_ANSWER_FAIL_TARGET_FORTRESS_NOT_EXISTS"
#define REQUEST_CANCEL_TRADE_COMMIT_ANSWER_FAIL_TARGET_REALM_NOT_EXISTS			"REQUEST_CANCEL_TRADE_COMMIT_ANSWER_FAIL_TARGET_REALM_NOT_EXISTS"
#define REQUEST_CANCEL_TRADE_COMMIT_ANSWER_FAIL_YOU_ARE_NOT_TRADER				"REQUEST_CANCEL_TRADE_COMMIT_ANSWER_FAIL_YOU_ARE_NOT_TRADER"
#define REQUEST_CANCEL_TRADE_COMMIT_ANSWER_FAIL_SOURCE_FORTRESS_NOT_PARTNER		"REQUEST_CANCEL_TRADE_COMMIT_ANSWER_FAIL_SOURCE_FORTRESS_NOT_PARTNER"
#define REQUEST_CANCEL_TRADE_COMMIT_ANSWER_FAIL_TARGET_FORTRESS_NOT_PARTNER		"REQUEST_CANCEL_TRADE_COMMIT_ANSWER_FAIL_TARGET_FORTRESS_NOT_PARTNER"
#define REQUEST_CANCEL_TRADE_COMMIT_ANSWER_FAIL_TARGET_REALM_NOT_PARTNER		"REQUEST_CANCEL_TRADE_COMMIT_ANSWER_FAIL_TARGET_REALM_NOT_PARTNER"
#define REQUEST_CANCEL_TRADE_COMMIT_ANSWER_FAIL_NO_COMMIT_TO_REJECT				"REQUEST_CANCEL_TRADE_COMMIT_ANSWER_FAIL_NO_COMMIT_TO_REJECT"

#define REQUEST_CANCEL_TRADE_COMMIT_ANSWER_REASON_SELF_CANCELLED_COMMIT			"REQUEST_CANCEL_TRADE_COMMIT_ANSWER_REASON_SELF_CANCELLED_COMMIT"
#define REQUEST_CANCEL_TRADE_COMMIT_ANSWER_REASON_PARTNER_CANCELLED_COMMIT		"REQUEST_CANCEL_TRADE_COMMIT_ANSWER_REASON_PARTNER_CANCELLED_COMMIT"

#define REQUEST_CANCEL_TRADE_COMMIT_ANSWER_REASON								"REQUEST_CANCEL_TRADE_COMMIT_ANSWER_REASON"
#define REQUEST_CANCEL_TRADE_COMMIT_ANSWER_SELF_FORTRESS_ID						"REQUEST_CANCEL_TRADE_COMMIT_ANSWER_SELF_FORTRESS_ID"
#define REQUEST_CANCEL_TRADE_COMMIT_ANSWER_PARTNER_FORTRESS_ID					"REQUEST_CANCEL_TRADE_COMMIT_ANSWER_PARTNER_FORTRESS_ID"

// ###############################

#define REQUEST_FORTRESSES_IN_WEAPONS_RANGE										"REQUEST_FORTRESSES_IN_WEAPONS_RANGE"
#define REQUEST_FORTRESSES_IN_WEAPONS_RANGE_FORTRESS_ID							"REQUEST_FORTRESSES_IN_WEAPONS_RANGE_FORTRESS_ID"

#define REQUEST_FORTRESSES_IN_WEAPONS_RANGE_ANSWER_FORTRESS_ID					"REQUEST_FORTRESSES_IN_WEAPONS_RANGE_ANSWER_FORTRESS_ID"
#define REQUEST_FORTRESSES_IN_WEAPONS_RANGE_ANSWER_FAIL							"REQUEST_FORTRESSES_IN_WEAPONS_RANGE_ANSWER_FAIL"

#define REQUEST_FORTRESSES_IN_WEAPONS_RANGE_ANSWER_SHIP_COUNT					"REQUEST_FORTRESSES_IN_WEAPONS_RANGE_ANSWER_SHIP_COUNT"
#define REQUEST_FORTRESSES_IN_WEAPONS_RANGE_ANSWER_SHIP_ID						"REQUEST_FORTRESSES_IN_WEAPONS_RANGE_ANSWER_SHIP_ID"
#define REQUEST_FORTRESSES_IN_WEAPONS_RANGE_ANSWER_SHIP_NAME					"REQUEST_FORTRESSES_IN_WEAPONS_RANGE_ANSWER_SHIP_NAME"
#define REQUEST_FORTRESSES_IN_WEAPONS_RANGE_ANSWER_SHIP_REALM_NAME				"REQUEST_FORTRESSES_IN_WEAPONS_RANGE_ANSWER_SHIP_REALM_NAME"

#define REQUEST_FORTRESSES_IN_WEAPONS_RANGE_ANSWER_BASE_COUNT					"REQUEST_FORTRESSES_IN_WEAPONS_RANGE_ANSWER_BASE_COUNT"
#define REQUEST_FORTRESSES_IN_WEAPONS_RANGE_ANSWER_BASE_ID						"REQUEST_FORTRESSES_IN_WEAPONS_RANGE_ANSWER_BASE_ID"
#define REQUEST_FORTRESSES_IN_WEAPONS_RANGE_ANSWER_BASE_NAME					"REQUEST_FORTRESSES_IN_WEAPONS_RANGE_ANSWER_BASE_NAME"
#define REQUEST_FORTRESSES_IN_WEAPONS_RANGE_ANSWER_BASE_REALM_NAME				"REQUEST_FORTRESSES_IN_WEAPONS_RANGE_ANSWER_BASE_REALM_NAME"

#define REQUEST_FORTRESSES_IN_WEAPONS_RANGE_ANSWER_FAIL_FORTRESSNE				"REQUEST_FORTRESSES_IN_WEAPONS_RANGE_ANSWER_FAIL_FORTRESSNE"

struct fortress_detailed_fight_data 
{
	unsigned long id;
	std::string name;
	unsigned long type;
	unsigned long long actualStructuralIntegrity;
	unsigned long long totalStructuralIntegrity;
	double structuralIntegrityGradient;
	unsigned long long shieldsEnergy;
	unsigned long long shieldsActualAccumulator;
	unsigned long long shieldsClientAccumulator;
	double shieldsGradient;
};

#define FORTRESS_DETAILED_FIGHT_DATA_FORTRESS_ID								"FORTRESS_DETAILED_FIGHT_DATA_FORTRESS_ID"
#define FORTRESS_DETAILED_FIGHT_DATA_FORTRESS_NAME								"FORTRESS_DETAILED_FIGHT_DATA_FORTRESS_NAME"
#define FORTRESS_DETAILED_FIGHT_DATA_FORTRESS_TYPE								"FORTRESS_DETAILED_FIGHT_DATA_FORTRESS_TYPE"
#define FORTRESS_DETAILED_FIGHT_DATA_FORTRESS_ACTUAL_INTEGRITY					"FORTRESS_DETAILED_FIGHT_DATA_FORTRESS_ACTUAL_INTEGRITY"
#define FORTRESS_DETAILED_FIGHT_DATA_FORTRESS_TOTAL_INTEGRITY					"FORTRESS_DETAILED_FIGHT_DATA_FORTRESS_TOTAL_INTEGRITY"
#define FORTRESS_DETAILED_FIGHT_DATA_FORTRESS_INTEGRITY_GRADIENT				"FORTRESS_DETAILED_FIGHT_DATA_FORTRESS_INTEGRITY_GRADIENT"
#define FORTRESS_DETAILED_FIGHT_DATA_FORTRESS_SHIELDS_ENERGY					"FORTRESS_DETAILED_FIGHT_DATA_FORTRESS_SHIELDS_ENERGY"
#define FORTRESS_DETAILED_FIGHT_DATA_FORTRESS_SHIELDS_ACCUMULATOR				"FORTRESS_DETAILED_FIGHT_DATA_FORTRESS_SHIELDS_ACCUMULATOR"
#define FORTRESS_DETAILED_FIGHT_DATA_FORTRESS_SHIELDS_CLIENT_ACCUMULATOR		"FORTRESS_DETAILED_FIGHT_DATA_FORTRESS_SHIELDS_CLIENT_ACCUMULATOR"
#define FORTRESS_DETAILED_FIGHT_DATA_FORTRESS_SHIELDS_GRADIENT					"FORTRESS_DETAILED_FIGHT_DATA_FORTRESS_SHIELDS_GRADIENT"

#define REQUEST_FORTRESSES_IN_WEAPONS_RANGE_ANSWER_FORTRESS_IN_WEAPONS_TARGET_ID			"REQUEST_FORTRESSES_IN_WEAPONS_RANGE_ANSWER_FORTRESS_IN_WEAPONS_TARGET_ID"
#define REQUEST_FORTRESSES_IN_WEAPONS_RANGE_ANSWER_FORTRESS_IN_WEAPONS_TARGET_NAME			"REQUEST_FORTRESSES_IN_WEAPONS_RANGE_ANSWER_FORTRESS_IN_WEAPONS_TARGET_NAME"
#define REQUEST_FORTRESSES_IN_WEAPONS_RANGE_ANSWER_FORTRESS_COUNT							"REQUEST_FORTRESSES_IN_WEAPONS_RANGE_ANSWER_FORTRESS_COUNT"
#define REQUEST_FORTRESSES_IN_WEAPONS_RANGE_ANSWER_FORTRESS_TYPE							"REQUEST_FORTRESSES_IN_WEAPONS_RANGE_ANSWER_FORTRESS_TYPE"
#define REQUEST_FORTRESSES_IN_WEAPONS_RANGE_ANSWER_FORTRESS_IN_WEAPONS_TARGET_REALM_NAME	"REQUEST_FORTRESSES_IN_WEAPONS_RANGE_ANSWER_FORTRESS_IN_WEAPONS_TARGET_REALM_NAME"
#define REQUEST_FORTRESSES_IN_WEAPONS_RANGE_ANSWER_FORTRESS_IN_WEAPONS_TARGET_TYPE			"REQUEST_FORTRESSES_IN_WEAPONS_RANGE_ANSWER_FORTRESS_IN_WEAPONS_TARGET_TYPE"

struct fortress_fight_data 
{
	std::string name;
	std::string realmName;
	unsigned long id;
};

struct fortresses_in_range_data 
{
	unsigned long fortressId;
	std::list<fortress_fight_data> ships;
	std::list<fortress_fight_data> bases;
};

// ################################

#define REQUEST_ATTACK_FORTRESS													"REQUEST_ATTACK_FORTRESS"
#define REQUEST_ATTACK_FORTRESS_SELF_FORTRESS_ID								"REQUEST_ATTACK_FORTRESS_SELF_FORTRESS_ID"
#define REQUEST_ATTACK_FORTRESS_ENEMY_FORTRESS_ID								"REQUEST_ATTACK_FORTRESS_ENEMY_FORTRESS_ID"

#define REQUEST_ATTACK_FORTRESS_ANSWER_SELF_FORTRESS_ID							"REQUEST_ATTACK_FORTRESS_ANSWER_SELF_FORTRESS_ID"
#define REQUEST_ATTACK_FORTRESS_ANSWER_ENEMY_FORTRESS_ID						"REQUEST_ATTACK_FORTRESS_ANSWER_ENEMY_FORTRESS_ID"
#define REQUEST_ATTACK_FORTRESS_ANSWER_FAIL_SELF_FORTRESSNE						"REQUEST_ATTACK_FORTRESS_ANSWER_FAIL_SELF_FORTRESSNE"
#define REQUEST_ATTACK_FORTRESS_ANSWER_FAIL_SELF_FORTRESSNO						"REQUEST_ATTACK_FORTRESS_ANSWER_FAIL_SELF_FORTRESSNO"
#define REQUEST_ATTACK_FORTRESS_ANSWER_FAIL_ENEMY_FORTRESSNE					"REQUEST_ATTACK_FORTRESS_ANSWER_FAIL_ENEMY_FORTRESSNE"
#define REQUEST_ATTACK_FORTRESS_ANSWER_FAIL										"REQUEST_ATTACK_FORTRESS_ANSWER_FAIL"

// ################################

#define REQUEST_STOP_ATTACK_FORTRESS												"REQUEST_STOP_ATTACK_FORTRESS"
#define REQUEST_STOP_ATTACK_FORTRESS_SELF_FORTRESS_ID								"REQUEST_STOP_ATTACK_FORTRESS_SELF_FORTRESS_ID"

#define REQUEST_STOP_ATTACK_FORTRESS_ANSWER_SELF_FORTRESS_ID						"REQUEST_STOP_ATTACK_FORTRESS_ANSWER_SELF_FORTRESS_ID"
#define REQUEST_STOP_ATTACK_FORTRESS_ANSWER_FAIL_SELF_FORTRESSNE					"REQUEST_STOP_ATTACK_FORTRESS_ANSWER_FAIL_SELF_FORTRESSNE"
#define REQUEST_STOP_ATTACK_FORTRESS_ANSWER_FAIL_SELF_FORTRESSNO					"REQUEST_STOP_ATTACK_FORTRESS_ANSWER_FAIL_SELF_FORTRESSNO"
#define REQUEST_STOP_ATTACK_FORTRESS_ANSWER_FAIL									"REQUEST_STOP_ATTACK_FORTRESS_ANSWER_FAIL"


// ################################

enum fight_action_type
{
	FIGHT_ACTION_OUR_WEAPONS_UNLOCKED,				
	FIGHT_ACTION_OUR_WEAPONS_LOCKED_ON_ENEMY,
	FIGHT_ACTION_ENEMY_WEAPONS_UNLOCKED,			
	FIGHT_ACTION_ENEMY_WEAPONS_LOCKED_ON_WARNING,	
	FIGHT_ACTION_WEAPONS_TARGET_HAS_BEEN_ANNIHILATED,
	FIGHT_ACTION_THIS_FORTRESS_HAS_BEEN_ANNIHILATED,
};

struct fight_action_report 
{
	bool enemyFortressExists;

	unsigned long selfFortressId;
	std::string selfFortressName;
	std::string selfRealmName;
	bool selfIsShip;

	unsigned long enemyFortressId;
	std::string enemyFortressName;
	std::string enemyRealmName;
	bool enemyIsShip;

	fight_action_type action;
};

#define PROTOCOL_FIGHT_ACTION_OUR_WEAPONS_UNLOCKED									"PROTOCOL_FIGHT_ACTION_OUR_WEAPONS_UNLOCKED"
#define PROTOCOL_FIGHT_ACTION_OUR_WEAPONS_LOCKED_ON_ENEMY							"PROTOCOL_FIGHT_ACTION_OUR_WEAPONS_LOCKED_ON_ENEMY"
#define PROTOCOL_FIGHT_ACTION_ENEMY_WEAPONS_UNLOCKED								"PROTOCOL_FIGHT_ACTION_ENEMY_WEAPONS_UNLOCKED"
#define PROTOCOL_FIGHT_ACTION_ENEMY_WEAPONS_LOCKED_ON_WARNING						"PROTOCOL_FIGHT_ACTION_ENEMY_WEAPONS_LOCKED_ON_WARNING"
#define PROTOCOL_FIGHT_ACTION_WEAPONS_TARGET_HAS_BEEN_ANNIHILATED					"PROTOCOL_FIGHT_ACTION_WEAPONS_TARGET_HAS_BEEN_ANNIHILATED"
#define PROTOCOL_FIGHT_ACTION_THIS_FORTRESS_HAS_BEEN_ANNIHILATED					"PROTOCOL_FIGHT_ACTION_THIS_FORTRESS_HAS_BEEN_ANNIHILATED"

#define REQUEST_FIGHT_ACTION_REPORT													"REQUEST_FIGHT_ACTION_REPORT"
#define REQUEST_FIGHT_ACTION_REPORT_SELF_FORTRESS_ID								"REQUEST_FIGHT_ACTION_REPORT_SELF_FORTRESS_ID"
#define REQUEST_FIGHT_ACTION_REPORT_SELF_FORTRESS_NAME								"REQUEST_FIGHT_ACTION_REPORT_SELF_FORTRESS_NAME"
#define REQUEST_FIGHT_ACTION_REPORT_SELF_FORTRESS_REALM_NAME						"REQUEST_FIGHT_ACTION_REPORT_SELF_FORTRESS_REALM_NAME"
#define REQUEST_FIGHT_ACTION_REPORT_SELF_SHIP										"REQUEST_FIGHT_ACTION_REPORT_SELF_SHIP"
#define REQUEST_FIGHT_ACTION_REPORT_ENEMY_FORTRESS_ID								"REQUEST_FIGHT_ACTION_REPORT_ENEMY_FORTRESS_ID"
#define REQUEST_FIGHT_ACTION_REPORT_ENEMY_FORTRESS_NAME								"REQUEST_FIGHT_ACTION_REPORT_ENEMY_FORTRESS_NAME"
#define REQUEST_FIGHT_ACTION_REPORT_ENEMY_FORTRESS_REALM_NAME						"REQUEST_FIGHT_ACTION_REPORT_ENEMY_FORTRESS_REALM_NAME"
#define REQUEST_FIGHT_ACTION_REPORT_ENEMY_SHIP										"REQUEST_FIGHT_ACTION_REPORT_ENEMY_SHIP"
#define REQUEST_FIGHT_ACTION_REPORT_ACTION											"REQUEST_FIGHT_ACTION_REPORT_ACTION"
#define REQUEST_FIGHT_ACTION_REPORT_ENEMY_FORTRESS_EXISTS							"REQUEST_FIGHT_ACTION_REPORT_ENEMY_FORTRESS_EXISTS"

// ################################

#define REQUEST_AVAILABLE_FORTRESS_CLASSES											"REQUEST_AVAILABLE_FORTRESS_CLASSES"
#define	REQUEST_AVAILABLE_FORTRESS_CLASSES_SELF_FORTRESS_ID							"REQUEST_AVAILABLE_FORTRESS_CLASSES_SELF_FORTRESS_ID"

#define REQUEST_AVAILABLE_FORTRESS_CLASSES_ANSWER_SELF_FORTRESS_ID					"REQUEST_AVAILABLE_FORTRESS_CLASSES_ANSWER_SELF_FORTRESS_ID"
#define REQUEST_AVAILABLE_FORTRESS_CLASSES_ANSWER_SHIP_CLASS_COUNT					"REQUEST_AVAILABLE_FORTRESS_CLASSES_ANSWER_SHIP_CLASS_COUNT"
#define REQUEST_AVAILABLE_FORTRESS_CLASSES_ANSWER_SHIP_CLASS_ID						"REQUEST_AVAILABLE_FORTRESS_CLASSES_ANSWER_SHIP_CLASS_ID"
#define REQUEST_AVAILABLE_FORTRESS_CLASSES_ANSWER_SHIP_CLASS_NAME					"REQUEST_AVAILABLE_FORTRESS_CLASSES_ANSWER_SHIP_CLASS_NAME"
#define REQUEST_AVAILABLE_FORTRESS_CLASSES_ANSWER_SHIP_CLASS_QUALITY				"REQUEST_AVAILABLE_FORTRESS_CLASSES_ANSWER_SHIP_CLASS_QUALITY"
#define REQUEST_AVAILABLE_FORTRESS_CLASSES_ANSWER_BASE_CLASS_COUNT					"REQUEST_AVAILABLE_FORTRESS_CLASSES_ANSWER_BASE_CLASS_COUNT"
#define REQUEST_AVAILABLE_FORTRESS_CLASSES_ANSWER_BASE_CLASS_ID						"REQUEST_AVAILABLE_FORTRESS_CLASSES_ANSWER_BASE_CLASS_ID"
#define REQUEST_AVAILABLE_FORTRESS_CLASSES_ANSWER_BASE_CLASS_NAME					"REQUEST_AVAILABLE_FORTRESS_CLASSES_ANSWER_BASE_CLASS_NAME"
#define REQUEST_AVAILABLE_FORTRESS_CLASSES_ANSWER_BASE_CLASS_QUALITY				"REQUEST_AVAILABLE_FORTRESS_CLASSES_ANSWER_BASE_CLASS_QUALITY"

#define REQUEST_AVAILABLE_FORTRESS_CLASSES_ANSWER_FAIL								"REQUEST_AVAILABLE_FORTRESS_CLASSES_ANSWER_FAIL"
#define REQUEST_AVAILABLE_FORTRESS_CLASSES_ANSWER_FORTRESSNE						"REQUEST_AVAILABLE_FORTRESS_CLASSES_ANSWER_FORTRESSNE"
																							 
// --------------------------------	

#define REQUEST_FORTRESSES_IN_CONQUER_RANGE											"REQUEST_FORTRESSES_IN_CONQUER_RANGE"
#define REQUEST_FORTRESSES_IN_CONQUER_RANGE_SELF_FORTRESS_ID						"REQUEST_FORTRESSES_IN_CONQUER_RANGE_SELF_FORTRESS_ID"
																							 
#define REQUEST_FORTRESSES_IN_CONQUER_RANGE_ANSWER_FORTRESS_ID						"REQUEST_FORTRESSES_IN_CONQUER_RANGE_ANSWER_FORTRESS_ID"
																							 
#define REQUEST_FORTRESSES_IN_CONQUER_RANGE_ANSWER_SHIP_COUNT				"REQUEST_FORTRESSES_IN_CONQUER_RANGE_ANSWER_SHIP_COUNT"
#define REQUEST_FORTRESSES_IN_CONQUER_RANGE_ANSWER_SHIP_ID					"REQUEST_FORTRESSES_IN_CONQUER_RANGE_ANSWER_SHIP_ID"
#define REQUEST_FORTRESSES_IN_CONQUER_RANGE_ANSWER_SHIP_NAME				"REQUEST_FORTRESSES_IN_CONQUER_RANGE_ANSWER_SHIP_NAME"
#define REQUEST_FORTRESSES_IN_CONQUER_RANGE_ANSWER_SHIP_IN_TRADE_RANGE		"REQUEST_FORTRESSES_IN_CONQUER_RANGE_ANSWER_SHIP_IN_TRADE_RANGE"	
#define REQUEST_FORTRESSES_IN_CONQUER_RANGE_ANSWER_SHIP_IN_CONQUER_RANGE	"REQUEST_FORTRESSES_IN_CONQUER_RANGE_ANSWER_SHIP_IN_CONQUER_RANGE"
#define	REQUEST_FORTRESSES_IN_CONQUER_RANGE_ANSWER_SHIP_IN_IS_SHELL			"REQUEST_FORTRESSES_IN_CONQUER_RANGE_ANSWER_SHIP_IN_IS_SHELL"
#define REQUEST_FORTRESSES_IN_CONQUER_RANGE_ANSWER_SHIP_ACTUAL_POINTS		"REQUEST_FORTRESSES_IN_CONQUER_RANGE_ANSWER_SHIP_ACTUAL_POINTS"
#define REQUEST_FORTRESSES_IN_CONQUER_RANGE_ANSWER_SHIP_TARGET_POINTS		"REQUEST_FORTRESSES_IN_CONQUER_RANGE_ANSWER_SHIP_TARGET_POINTS"

#define REQUEST_FORTRESSES_IN_CONQUER_RANGE_ANSWER_BASE_COUNT				"REQUEST_FORTRESSES_IN_CONQUER_RANGE_ANSWER_BASE_COUNT"
#define REQUEST_FORTRESSES_IN_CONQUER_RANGE_ANSWER_BASE_ID					"REQUEST_FORTRESSES_IN_CONQUER_RANGE_ANSWER_BASE_ID"
#define REQUEST_FORTRESSES_IN_CONQUER_RANGE_ANSWER_BASE_NAME				"REQUEST_FORTRESSES_IN_CONQUER_RANGE_ANSWER_BASE_NAME"
#define REQUEST_FORTRESSES_IN_CONQUER_RANGE_ANSWER_BASE_REALM_NAME			"REQUEST_FORTRESSES_IN_CONQUER_RANGE_ANSWER_BASE_REALM_NAME"
#define REQUEST_FORTRESSES_IN_CONQUER_RANGE_ANSWER_BASE_IN_TRADE_RANGE		"REQUEST_FORTRESSES_IN_CONQUER_RANGE_ANSWER_BASE_IN_TRADE_RANGE"	
#define REQUEST_FORTRESSES_IN_CONQUER_RANGE_ANSWER_BASE_IN_CONQUER_RANGE	"REQUEST_FORTRESSES_IN_CONQUER_RANGE_ANSWER_BASE_IN_CONQUER_RANGE"
#define REQUEST_FORTRESSES_IN_CONQUER_RANGE_ANSWER_BASE_IN_IS_SHELL			"REQUEST_FORTRESSES_IN_CONQUER_RANGE_ANSWER_BASE_IN_IS_SHELL"
#define REQUEST_FORTRESSES_IN_CONQUER_RANGE_ANSWER_BASE_ACTUAL_POINTS		"REQUEST_FORTRESSES_IN_CONQUER_RANGE_ANSWER_BASE_ACTUAL_POINTS"
#define REQUEST_FORTRESSES_IN_CONQUER_RANGE_ANSWER_BASE_TARGET_POINTS		"REQUEST_FORTRESSES_IN_CONQUER_RANGE_ANSWER_BASE_TARGET_POINTS"

#define REQUEST_FORTRESSES_IN_CONQUER_RANGE_ANSWER_FORTRESSNE				"REQUEST_FORTRESSES_IN_CONQUER_RANGE_ANSWER_FORTRESSNE"
#define REQUEST_FORTRESSES_IN_CONQUER_RANGE_ANSWER_FAIL						"REQUEST_FORTRESSES_IN_CONQUER_RANGE_ANSWER_FAIL"

// ################################

#define REQUEST_BUILD_NEW_BASE_SHELL											"REQUEST_BUILD_NEW_BASE_SHELL"
#define REQUEST_BUILD_NEW_BASE_SHELL_SELF_FORTRESS_ID							"REQUEST_BUILD_NEW_BASE_SHELL_SELF_FORTRESS_ID"
#define REQUEST_BUILD_NEW_BASE_SHELL_FORTRESS_CLASS_ID							"REQUEST_BUILD_NEW_BASE_SHELL_FORTRESS_CLASS_ID"
#define REQUEST_BUILD_NEW_BASE_SHELL_TITANIUM									"REQUEST_BUILD_NEW_BASE_SHELL_TITANIUM"

#define REQUEST_BUILD_NEW_BASE_SHELL_ANSWER_SELF_FORTRESS_ID					"REQUEST_BUILD_NEW_BASE_SHELL_ANSWER_SELF_FORTRESS_ID"
#define REQUEST_BUILD_NEW_BASE_SHELL_ANSWER_BUILDING_RESULT						"REQUEST_BUILD_NEW_BASE_SHELL_ANSWER_BUILDING_RESULT"
#define REQUEST_BUILD_NEW_BASE_SHELL_ANSWER_NEW_TITAN							"REQUEST_BUILD_NEW_BASE_SHELL_ANSWER_NEW_TITAN"

#define REQUEST_BUILD_NEW_BASE_SHELL_ANSWER_FAIL								"REQUEST_BUILD_NEW_BASE_SHELL_ANSWER_FAIL"
#define REQUEST_BUILD_NEW_BASE_SHELL_ANSWER_FORTRESSNE							"REQUEST_BUILD_NEW_BASE_SHELL_ANSWER_FORTRESSNE"
#define REQUEST_BUILD_NEW_BASE_SHELL_ANSWER_FORTRESSNO							"REQUEST_BUILD_NEW_BASE_SHELL_ANSWER_FORTRESSNO"

struct fortress_class_complex_data {
	std::string name;
	unsigned long id;
	double massRating;
	unsigned long maxDroneMissileLaunchers;
	double maxHeight;
	double maxWidth;
	unsigned long maxLaserGuns;
	double maxLength;
	unsigned long long maxTotalStructuralIntegrity;
	unsigned long maxWeapons;
	unsigned long long minTotalStructuralIntegrity;
	unsigned long long minWeight;
	unsigned long long maxWeight;
	double qualityRating;
	bool isBaseClass;
};

#define REQUEST_FORTRESS_CLASS_DATA														"REQUEST_FORTRESS_CLASS_DATA"
#define REQUEST_FORTRESS_CLASS_DATA_FORTRESS_CLASS_ID									"REQUEST_FORTRESS_CLASS_DATA_FORTRESS_CLASS_ID"

#define REQUEST_FORTRESS_CLASS_DATA_ANSWER_CLASS_NAME									"REQUEST_FORTRESS_CLASS_DATA_ANSWER_CLASS_NAME"
#define REQUEST_FORTRESS_CLASS_DATA_ANSWER_ID											"REQUEST_FORTRESS_CLASS_DATA_ANSWER_ID"
#define REQUEST_FORTRESS_CLASS_DATA_ANSWER_MASS_RATING									"REQUEST_FORTRESS_CLASS_DATA_ANSWER_MASS_RATING"
#define REQUEST_FORTRESS_CLASS_DATA_ANSWER_MAX_DRONE_MISSILE_LAUNCHERS					"REQUEST_FORTRESS_CLASS_DATA_ANSWER_MAX_DRONE_MISSILE_LAUNCHERS"
#define REQUEST_FORTRESS_CLASS_DATA_ANSWER_MAX_HEIGHT									"REQUEST_FORTRESS_CLASS_DATA_ANSWER_MAX_HEIGHT"
#define REQUEST_FORTRESS_CLASS_DATA_ANSWER_MAX_LASER_GUNS								"REQUEST_FORTRESS_CLASS_DATA_ANSWER_MAX_LASER_GUNS"
#define REQUEST_FORTRESS_CLASS_DATA_ANSWER_MAX_WIDTH									"REQUEST_FORTRESS_CLASS_DATA_ANSWER_MAX_WIDTH"
#define REQUEST_FORTRESS_CLASS_DATA_ANSWER_MAX_LENGTH									"REQUEST_FORTRESS_CLASS_DATA_ANSWER_MAX_LENGTH"
#define REQUEST_FORTRESS_CLASS_DATA_ANSWER_MAX_TOTAL_STRUCTURAL_INTEGRITY				"REQUEST_FORTRESS_CLASS_DATA_ANSWER_MAX_TOTAL_STRUCTURAL_INTEGRITY"
#define REQUEST_FORTRESS_CLASS_DATA_ANSWER_MAX_WEAPONS									"REQUEST_FORTRESS_CLASS_DATA_ANSWER_MAX_WEAPONS"
#define REQUEST_FORTRESS_CLASS_DATA_ANSWER_MIN_TOTAL_STRUCTURAL_INTEGRITY				"REQUEST_FORTRESS_CLASS_DATA_ANSWER_MIN_TOTAL_STRUCTURAL_INTEGRITY"
#define REQUEST_FORTRESS_CLASS_DATA_ANSWER_MIN_WEIGHT									"REQUEST_FORTRESS_CLASS_DATA_ANSWER_MIN_WEIGHT"
#define REQUEST_FORTRESS_CLASS_DATA_ANSWER_MAX_WEIGHT									"REQUEST_FORTRESS_CLASS_DATA_ANSWER_MAX_WEIGHT"
#define REQUEST_FORTRESS_CLASS_DATA_ANSWER_QUALITY_RATING								"REQUEST_FORTRESS_CLASS_DATA_ANSWER_QUALITY_RATING"
#define REQUEST_FORTRESS_CLASS_DATA_ANSWER_IS_BASE_CLASS								"REQUEST_FORTRESS_CLASS_DATA_ANSWER_IS_BASE_CLASS"

#define REQUEST_FORTRESS_CLASS_DATA_ANSWER_FAIL											"REQUEST_FORTRESS_CLASS_DATA_ANSWER_FAIL"
#define REQUEST_FORTRESS_CLASS_DATA_FORTRESS_CLASS_ANSWER_FORTRESSNE					"REQUEST_FORTRESS_CLASS_DATA_FORTRESS_CLASS_ANSWER_FORTRESSNE"

// ################################

struct fortress_build_information {
	unsigned long fortressId;
	std::string fortressName;
	bool isTherePlanetToBuildABase;
	std::string planetToBuildABaseName;
	unsigned long long fortressTitan;
	unsigned long long requiredTitan;
};

#define REQUEST_PLAYER_FORTRESSES_BUILD_INFORMATION												"REQUEST_PLAYER_FORTRESSES_BUILD_INFORMATION"

#define REQUEST_PLAYER_FORTRESSES_BUILD_INFORMATION_ANSWER_SHIP_ID								"REQUEST_PLAYER_FORTRESSES_BUILD_INFORMATION_ANSWER_SHIP_ID"
#define REQUEST_PLAYER_FORTRESSES_BUILD_INFORMATION_ANSWER_SHIP_NAME							"REQUEST_PLAYER_FORTRESSES_BUILD_INFORMATION_ANSWER_SHIP_NAME"
#define REQUEST_PLAYER_FORTRESSES_BUILD_INFORMATION_ANSWER_SHIP_PLANET_TO_BUILD_A_BASE			"REQUEST_PLAYER_FORTRESSES_BUILD_INFORMATION_ANSWER_SHIP_PLANET_TO_BUILD_A_BASE"
#define REQUEST_PLAYER_FORTRESSES_BUILD_INFORMATION_ANSWER_SHIP_PLANET_TO_BUILD_A_BASE_NAME		"REQUEST_PLAYER_FORTRESSES_BUILD_INFORMATION_ANSWER_SHIP_PLANET_TO_BUILD_A_BASE_NAME"
#define REQUEST_PLAYER_FORTRESSES_BUILD_INFORMATION_ANSWER_SHIP_COUNT							"REQUEST_PLAYER_FORTRESSES_BUILD_INFORMATION_ANSWER_SHIP_COUNT"
#define REQUEST_PLAYER_FORTRESSES_BUILD_INFORMATION_ANSWER_SHIP_TITAN							"REQUEST_PLAYER_FORTRESSES_BUILD_INFORMATION_ANSWER_SHIP_TITAN"
#define REQUEST_PLAYER_FORTRESSES_BUILD_INFORMATION_ANSWER_SHIP_REQUIRED_TITAN					"REQUEST_PLAYER_FORTRESSES_BUILD_INFORMATION_ANSWER_SHIP_REQUIRED_TITAN"

#define REQUEST_PLAYER_FORTRESSES_BUILD_INFORMATION_ANSWER_BASE_ID								"REQUEST_PLAYER_FORTRESSES_BUILD_INFORMATION_ANSWER_BASE_ID"
#define REQUEST_PLAYER_FORTRESSES_BUILD_INFORMATION_ANSWER_BASE_NAME							"REQUEST_PLAYER_FORTRESSES_BUILD_INFORMATION_ANSWER_BASE_NAME"
#define REQUEST_PLAYER_FORTRESSES_BUILD_INFORMATION_ANSWER_BASE_PLANET_TO_BUILD_A_BASE			"REQUEST_PLAYER_FORTRESSES_BUILD_INFORMATION_ANSWER_BASE_PLANET_TO_BUILD_A_BASE"
#define REQUEST_PLAYER_FORTRESSES_BUILD_INFORMATION_ANSWER_BASE_PLANET_TO_BUILD_A_BASE_NAME		"REQUEST_PLAYER_FORTRESSES_BUILD_INFORMATION_ANSWER_BASE_PLANET_TO_BUILD_A_BASE_NAME"
#define REQUEST_PLAYER_FORTRESSES_BUILD_INFORMATION_ANSWER_BASE_COUNT							"REQUEST_PLAYER_FORTRESSES_BUILD_INFORMATION_ANSWER_BASE_COUNT"
#define REQUEST_PLAYER_FORTRESSES_BUILD_INFORMATION_ANSWER_BASE_TITAN							"REQUEST_PLAYER_FORTRESSES_BUILD_INFORMATION_ANSWER_BASE_TITAN"
#define REQUEST_PLAYER_FORTRESSES_BUILD_INFORMATION_ANSWER_BASE_REQUIRED_TITAN					"REQUEST_PLAYER_FORTRESSES_BUILD_INFORMATION_ANSWER_BASE_REQUIRED_TITAN"

// ################################

#define REQUEST_PLAYER_FORTRESSES												"REQUEST_PLAYER_FORTRESSES"

#define REQUEST_PLAYER_FORTRESSES_ANSWER_FORTRESS_ID								"REQUEST_PLAYER_FORTRESSES_ANSWER_FORTRESS_ID"
#define REQUEST_PLAYER_FORTRESSES_ANSWER_FORTRESS_NAME								"REQUEST_PLAYER_FORTRESSES_ANSWER_FORTRESS_NAME"
#define REQUEST_PLAYER_FORTRESSES_ANSWER_FORTRESS_TYPE								"REQUEST_PLAYER_FORTRESSES_ANSWER_FORTRESS_TYPE"
#define REQUEST_PLAYER_FORTRESSES_ANSWER_FORTRESS_COUNT								"REQUEST_PLAYER_FORTRESSES_ANSWER_FORTRESS_COUNT"

// ################################

#define REQUEST_CONQUER_FORTRESS																"REQUEST_CONQUER_FORTRESS"
#define REQUEST_CONQUER_FORTRESS_SELF_FORTRESS_ID												"REQUEST_CONQUER_FORTRESS_SELF_FORTRESS_ID"
#define REQUEST_CONQUER_FORTRESS_ENEMY_FORTRESS_ID												"REQUEST_CONQUER_FORTRESS_ENEMY_FORTRESS_ID"

#define REQUEST_CONQUER_FORTRESS_ANSWER_IS_CONQUERED											"REQUEST_CONQUER_FORTRESS_ANSWER_IS_CONQUERED"
#define REQUEST_CONQUER_FORTRESS_ANSWER_IS_DETAILS_AVAILABLE									"REQUEST_CONQUER_FORTRESS_ANSWER_IS_DETAILS_AVAILABLE"
#define REQUEST_CONQUER_FORTRESS_ANSWER_IS_MANFRAME_FAILURE										"REQUEST_CONQUER_FORTRESS_ANSWER_IS_MANFRAME_FAILURE"
#define REQUEST_CONQUER_FORTRESS_ANSWER_IS_ENERGETIC_ACCUMULATOR_FAILURE						"REQUEST_CONQUER_FORTRESS_ANSWER_IS_ENERGETIC_ACCUMULATOR_FAILURE"
#define REQUEST_CONQUER_FORTRESS_ANSWER_ENERGY_IN_TARGET										"REQUEST_CONQUER_FORTRESS_ANSWER_ENERGY_IN_TARGET"

#define REQUEST_CONQUER_FORTRESS_ANSWER_SELF_FORTRESS_ID										"REQUEST_CONQUER_FORTRESS_ANSWER_SELF_FORTRESS_ID"
#define REQUEST_CONQUER_FORTRESS_ANSWER_ENEMY_FORTRESS_ID										"REQUEST_CONQUER_FORTRESS_ANSWER_ENEMY_FORTRESS_ID"
#define REQUEST_CONQUER_FORTRESS_ANSWER_FORTRESS_ADDING_RESULT									"REQUEST_CONQUER_FORTRESS_ANSWER_FORTRESS_ADDING_RESULT"

#define REQUEST_CONQUER_FORTRESS_ANSWER_FAIL													"REQUEST_CONQUER_FORTRESS_ANSWER_FAIL"
#define REQUEST_CONQUER_FORTRESS_ANSWER_FORTRESSNE												"REQUEST_CONQUER_FORTRESS_ANSWER_FORTRESSNE"
#define REQUEST_CONQUER_FORTRESS_ANSWER_FORTRESSNO												"REQUEST_CONQUER_FORTRESS_ANSWER_FORTRESSNO"
#define REQUEST_CONQUER_FORTRESS_ANSWER_TARGET_FORTRESSNE										"REQUEST_CONQUER_FORTRESS_ANSWER_TARGET_FORTRESSNE"

// ################################

// ADMINISTRACE 

// ################################

struct realm_information
{
	std::string login;
	std::string name;
	unsigned long id;
	bool hasBan;
};

#define REQUEST_ADMIN_CREATE_SHIP							"admin_create_ship"
#define REQUEST_ADMIN_CREATE_SHIP_CREATED					"ship_created"
#define REQUEST_ADMIN_CREATE_SHIP_FORTRESS_ID				"fortress_id"
#define REQUEST_ADMIN_CREATE_SHIP_FORTRESS_CLASS			"fortress_class"
#define REQUEST_ADMIN_CREATE_SHIP_FORTRESS_NAME				"fortress_name"
#define REQUEST_ADMIN_CREATE_SHIP_PLAYER_ID					"player_id"
#define REQUEST_ADMIN_CREATE_SHIP_CREATED_SHIP_PREFIX		"created_ship"

// ---------------------------------------

#define REQUEST_ADMIN_PLAYERS									"admin_players"
#define REQUEST_ADMIN_PLAYERS_PLAYER_LOGIN_FILTER				"player_login_filter"
#define REQUEST_ADMIN_PLAYERS_PLAYER_PREFIX						"player"
#define REQUEST_ADMIN_PLAYERS_PLAYER_ID							"player_id"
#define REQUEST_ADMIN_PLAYERS_PLAYER_LOGIN						"player_login"
#define REQUEST_ADMIN_PLAYERS_PLAYER_NAME						"player_name"
#define REQUEST_ADMIN_PLAYERS_PLAYER_PLAYER_HAS_BAN				"player_has_ban"

// ---------------------------------------

#define REQUEST_ADMIN_PLAYER_INFORMATION									"admin_player_information"

#define	REQUEST_ADMIN_PLAYER_INFORMATION_PLAYER_PREFIX						"player"
#define REQUEST_ADMIN_PLAYER_INFORMATION_PLAYER_NAME						"player_name"
#define REQUEST_ADMIN_PLAYER_INFORMATION_PLAYER_LOGIN						"player_login"
#define REQUEST_ADMIN_PLAYER_INFORMATION_PLAYER_ID							"player_id"
#define REQUEST_ADMIN_PLAYER_INFORMATION_PLAYER_PLAYER_HAS_BAN				"player_has_ban"

#define REQUEST_ADMIN_PLAYER_INFORMATION_SHIP_PREFIX						"ship"
#define REQUEST_ADMIN_PLAYER_INFORMATION_SHIP_FORTRESS_ID					"fortress_id"
#define REQUEST_ADMIN_PLAYER_INFORMATION_SHIP_FORTRESS_NAME					"fortress_name"
#define REQUEST_ADMIN_PLAYER_INFORMATION_SHIP_FORTRESS_CLASS				"fortress_class"

#define REQUEST_ADMIN_PLAYER_INFORMATION_BASE_PREFIX						"base"
#define REQUEST_ADMIN_PLAYER_INFORMATION_BASE_FORTRESS_ID					"fortress_id"
#define REQUEST_ADMIN_PLAYER_INFORMATION_BASE_FORTRESS_NAME					"fortress_name"
#define REQUEST_ADMIN_PLAYER_INFORMATION_BASE_FORTRESS_CLASS				"fortress_class"

// ---------------------------------------

#define REQUEST_ADMIN_SHIP_INFORMATION						"admin_ship_information"
#define REQUEST_ADMIN_SHIP_INFORMATION_FORTRESS_ID			"fortress_id"
#define REQUEST_ADMIN_SHIP_INFORMATION_FORTRESS_NAME		"fortress_name"
#define REQUEST_ADMIN_SHIP_INFORMATION_FORTRESS_CLASS		"fortress_class"
#define REQUEST_ADMIN_SHIP_INFORMATION_COORDINATE_X			"coordinate_x"
#define REQUEST_ADMIN_SHIP_INFORMATION_COORDINATE_Y			"coordinate_y"

// ---------------------------------------

#define REQUEST_ADMIN_BASE_INFORMATION						"admin_base_information"
#define REQUEST_ADMIN_BASE_INFORMATION_FORTRESS_ID			"fortress_id"
#define REQUEST_ADMIN_BASE_INFORMATION_FORTRESS_NAME		"fortress_name"
#define REQUEST_ADMIN_BASE_INFORMATION_FORTRESS_CLASS		"fortress_class"
// ---------------------------------------

#define ADMIN_PROBLEM_FORTRESSNE					"FORTRESS_NOT_EXISTS"
#define ADMIN_PROBLEM_FORTRESSNOTSHIP				"FORTRESS_NOT_SHIP"

// ---------------------------------------

#define REQUEST_ADMIN_PLAYER_BAN_INFORMATION						"admin_player_ban_information"
#define REQUEST_ADMIN_PLAYER_BAN_INFORMATION_PLAYER_ID				"player_id"
#define REQUEST_ADMIN_PLAYER_BAN_INFORMATION_BAN_REASON				"ban_reason"
#define REQUEST_ADMIN_PLAYER_BAN_INFORMATION_BAN_DURATION_IN_DAYS	"ban_duration_in_days"
#define REQUEST_ADMIN_PLAYER_BAN_INFORMATION_BAN_LEVEL				"ban_level"
#define REQUEST_ADMIN_PLAYER_BAN_INFORMATION_PLAYER_HAS_BAN			"player_has_ban"

// ---------------------------------------

#define REQUEST_ADMIN_BAN_PLAYER						"admin_ban_player"
#define REQUEST_ADMIN_BAN_PLAYER_PLAYER_ID				"player_id"
#define REQUEST_ADMIN_BAN_PLAYER_BAN_REASON				"ban_reason"
#define REQUEST_ADMIN_BAN_PLAYER_BAN_DURATION_IN_DAYS	"ban_duration_in_days"
#define REQUEST_ADMIN_BAN_PLAYER_BAN_LEVEL				"ban_level"
#define REQUEST_ADMIN_BAN_PLAYER_PLAYER_HAS_BAN			"player_has_ban"

#define REQUEST_ADMIN_BAN_PLAYER_BAN_RESULT				"ban_result"
#define REQUEST_ADMIN_BAN_PLAYER_RESULT_ADDED			"player_result_added"
#define REQUEST_ADMIN_BAN_PLAYER_RESULT_UPDATED			"player_result_updated"
#define REQUEST_ADMIN_BAN_PLAYER_RESULT_CANCELED		"player_result_canceled"

// ---------------------------------------

#define REQUEST_NAVIGATION_PLANETS                                             "navigationPlanets"

#define REQUEST_NAVIGATION_PLANETS_AREAID                                      "areaid"
#define REQUEST_NAVIGATION_PLANETS_SHIPID                                      "shipid"
#define REQUEST_NAVIGATION_PLANETS_ANSWER_COUNT                                "count"
#define REQUEST_NAVIGATION_PLANETS_ANSWER_PLANETID                             "planetid"
#define REQUEST_NAVIGATION_PLANETS_ANSWER_PIVOTX                               "pivotx"
#define REQUEST_NAVIGATION_PLANETS_ANSWER_PIVOTY                               "pivoty"
#define REQUEST_NAVIGATION_PLANETS_ANSWER_SPEED                                "speed"
#define REQUEST_NAVIGATION_PLANETS_ANSWER_RADIUS                               "radius"
#define REQUEST_NAVIGATION_PLANETS_ANSWER_SIZE                                 "planetsize"
#define REQUEST_NAVIGATION_PLANETS_ANSWER_ANGLE                                "angle"
#define REQUEST_NAVIGATION_PLANETS_ANSWER_WEIGHT                               "weight"
#define REQUEST_NAVIGATION_PLANETS_ANSWER_YEARP                                "yearperiod"
#define REQUEST_NAVIGATION_PLANETS_ANSWER_DAYP                                 "dayperiod"
#define REQUEST_NAVIGATION_PLANETS_ANSWER_TYPE                                 "planettype"
#define REQUEST_NAVIGATION_PLANETS_ANSWER_DAYTEMP                              "daytemperature"
#define REQUEST_NAVIGATION_PLANETS_ANSWER_NIGHTTEMP                            "nighttemperature"
#define REQUEST_NAVIGATION_PLANETS_ANSWER_SEA                                  "sea"
#define REQUEST_NAVIGATION_PLANETS_ANSWER_HWSO                                 "heavywater"
#define REQUEST_NAVIGATION_PLANETS_ANSWER_ZISO                                 "zirconium"
#define REQUEST_NAVIGATION_PLANETS_ANSWER_ILSO                                 "ilmenite"
#define REQUEST_NAVIGATION_PLANETS_ANSWER_NAME                                 "planetName"
#define REQUEST_NAVIGATION_PLANETS_ANSWER_DISTSHP                              "distShp"

#define REQUEST_NAVIGATION_PLANETS_ANSWER_HW_MODIFIER							"hwmodifier"
#define REQUEST_NAVIGATION_PLANETS_ANSWER_ZI_MODIFIER							"zimodifier"
#define REQUEST_NAVIGATION_PLANETS_ANSWER_IL_MODIFIER							"ilmodifier"

#define REQUEST_NAVIGATION_PLANETS_ANSWER_SUN_OBJ_RADIUS                       "sunObjRadius"
#define REQUEST_NAVIGATION_PLANETS_ANSWER_SUN_ARE_RADIUS                       "starSystemAreaRadius"
#define REQUEST_NAVIGATION_PLANETS_ANSWER_SUN_NAME                             "sunName"
#define REQUEST_NAVIGATION_PLANETS_ANSWER_SUN_WEIGHT                           "sunWeight"
#define REQUEST_NAVIGATION_PLANETS_ANSWER_SUN_TYPE                             "sunType"

#define REQUEST_NAVIGATION_PLANETS_BAD_ANSWER_TYPE                             "fail"
#define REQUEST_NAVIGATION_PLANETS_BAD_ANSWER_BADAREAID                        "badareaid"

#define REQUEST_NAVIGATION_PLANETS_BAD_ANSWER_NOT_EXISTS                       "AREA_NOT_EXISTS"       /* dana oblast neexistuje */
#define REQUEST_NAVIGATION_PLANETS_BAD_ANSWER_NOT_STAR                         "AREA_NOT_STAR"         /* dany vesmirny objekt neni hvezda */
#define REQUEST_NAVIGATION_PLANETS_BAD_ANSWER_IE                               "INTERNAL_ERROR"        /* interni chyba serveru */

#define REQUEST_NAVIGATION_PLANETS_ANSWER_FAIL						           "reason"
#define REQUEST_NAVIGATION_PLANETS_ANSWER_SHIPNE					           "SHIP_NOT_EXISTS"               /* dana pevnost neexistuje */
#define REQUEST_NAVIGATION_PLANETS_ANSWER_SHIPNO					           "SHIP_NOT_OWNED"                /* hrac nevlastni danou pevnost */

// ---------------------------------------

struct discovered_star
{
    std :: string name;
    unsigned long id;
    vector_dist_t pos;
};

// ---------------------------------------

struct discovered_stars
{
    std :: vector<discovered_star> dsc_stars;
};

// ---------------------------------------

#define REQUEST_DISCOVERED_STARS                                                "discoveredStars"

#define REQUEST_DISCOVERED_STARS_LIST_PREFIX                                    "dStar"

#define REQUEST_DISCOVERED_STAR_ANSWER_DISCOVERED_STAR_COUNT                    "discoveredStarCnt"
#define REQUEST_DISCOVERED_STAR_ANSWER_DISCOVERED_STAR_NAME                     "dscStarName"
#define REQUEST_DISCOVERED_STAR_ANSWER_DISCOVERED_STAR_ID                       "dscStarId"
#define REQUEST_DISCOVERED_STAR_ANSWER_DISCOVERED_STAR_POS_X                    "dscStarPosX"
#define REQUEST_DISCOVERED_STAR_ANSWER_DISCOVERED_STAR_POS_Y                    "dscStarPosY"

// #################################

#define REQUEST_ADMIN_ADD_REALM							"request_admin_add_realm"
#define USERNAME										"username"
#define REALNAME										"realname"
#define PASSWORD										"password"
#define SHIP_COUNT										"ship_count"
#define BASE_COUNT										"base_count"
#define SHIP_QUALITY									"ship_quality"
#define BASE_QUALITY									"base_quality"
#define SCIENCE_QUALITY									"science_quality"

#define PLAYER_ADDING_RESULT							"player_adding_result"

#define PROTOCOL_PAR_OK									"protocol_par_ok"
#define PROTOCOL_PAR_NAME_ALREADY_EXISTS				"protocol_par_name_already_exists"
#define PROTOCOL_PAR_LOGIN_ALREADY_EXISTS				"protocol_par_login_already_exists"
#define PROTOCOL_PAR_INTERNAL_ERROR						"protocol_par_internal_error"

// #################################

#define REQUEST_REGISTER_PLAYER													"REQUEST_REGISTER_PLAYER"
#define REQUEST_REGISTER_PLAYER_USERNAME										"REQUEST_REGISTER_PLAYER_USERNAME"
#define REQUEST_REGISTER_PLAYER_REALNAME										"REQUEST_REGISTER_PLAYER_REALNAME"
#define REQUEST_REGISTER_PLAYER_PASSWORD										"REQUEST_REGISTER_PLAYER_PASSWORD"
#define REQUEST_REGISTER_PLAYER_PLANET_ID										"REQUEST_REGISTER_PLAYER_PLANET_ID"
#define REQUEST_REGISTER_PLAYER_SHIP_COUNT										"REQUEST_REGISTER_PLAYER_SHIP_COUNT"
#define REQUEST_REGISTER_PLAYER_BASE_COUNT										"REQUEST_REGISTER_PLAYER_BASE_COUNT"
#define REQUEST_REGISTER_PLAYER_SHIP_QUALITY									"REQUEST_REGISTER_PLAYER_SHIP_QUALITY"
#define REQUEST_REGISTER_PLAYER_BASE_QUALITY									"REQUEST_REGISTER_PLAYER_BASE_QUALITY"

#define REQUEST_REGISTER_PLAYER_ANSWER_ADDING_RESULT							"REQUEST_REGISTER_PLAYER_ANSWER_ADDING_RESULT"
#define REQUEST_REGISTER_PLAYER_ANSWER_USERNAME									"REQUEST_REGISTER_PLAYER_ANSWER_USERNAME"
#define REQUEST_REGISTER_PLAYER_ANSWER_PASSWORD									"REQUEST_REGISTER_PLAYER_ANSWER_PASSWORD"

// #################################

#define PROTOCOL_ERROR_MESSAGE_FORTRESS_NOT_CONTROLLABLE							"PROTOCOL_ERROR_MESSAGE_FORTRESS_NOT_CONTROLLABLE"

// #################################

#define REQUEST_GAME_SECONDS_PER_ACTUAL_SECOND									"REQUEST_GAME_SECONDS_PER_ACTUAL_SECOND"
#define REQUEST_GAME_SECONDS_PER_ACTUAL_SECOND_ANSWER_SECONDS					"REQUEST_GAME_SECONDS_PER_ACTUAL_SECOND_ANSWER_SECONDS"

// #################################

#define REQUEST_RENAME_FORTRESS													"REQUEST_RENAME_FORTRESS"
#define REQUEST_RENAME_FORTRESS_FORTRESS_ID										"REQUEST_RENAME_FORTRESS_FORTRESS_ID"
#define REQUEST_RENAME_FORTRESS_NEW_NAME										"REQUEST_RENAME_FORTRESS_NEW_NAME"

#define REQUEST_RENAME_FORTRESS_ANSWER_FAIL								"REQUEST_RENAME_FORTRESS_ANSWER_FAIL"
#define REQUEST_RENAME_FORTRESS_ANSWER_FAIL_FORTRESSNE					"REQUEST_RENAME_FORTRESS_ANSWER_FAIL_FORTRESSNE"
#define REQUEST_RENAME_FORTRESS_ANSWER_FAIL_FORTRESSNO					"REQUEST_RENAME_FORTRESS_ANSWER_FAIL_FORTRESSNE"
#define	REQUEST_RENAME_FORTRESS_ANSWER_FAIL_EMPTY_NAME					"REQUEST_RENAME_FORTRESS_ANSWER_FAIL_EMPTY_NAME"

// #################################

// ################################

struct fortress_attack_information {
	fortress_detailed_fight_data fortressFightData;
	unsigned long fortressInWeaponsTargetId;
	std::string fortressInWeaponsTargetName;
	std::string fortressInWeaponsRangeTargetRealmName;
	unsigned long fortressInWeaponsRangeTargetType;
	std::list<unsigned long> attackers;
};

#define REQUEST_PLAYER_FORTRESSES_ATTACK_INFORMATION												"REQUEST_PLAYER_FORTRESSES_ATTACK_INFORMATION"

#define REQUEST_PLAYER_FORTRESSES_ATTACK_INFORMATION_ANSWER_FORTRESS_IN_WEAPONS_TARGET_ID			"REQUEST_PLAYER_FORTRESSES_ATTACK_INFORMATION_ANSWER_FORTRESS_IN_WEAPONS_TARGET_ID"
#define REQUEST_PLAYER_FORTRESSES_ATTACK_INFORMATION_ANSWER_FORTRESS_IN_WEAPONS_TARGET_NAME			"REQUEST_PLAYER_FORTRESSES_ATTACK_INFORMATION_ANSWER_FORTRESS_IN_WEAPONS_TARGET_NAME"
#define REQUEST_PLAYER_FORTRESSES_ATTACK_INFORMATION_ANSWER_FORTRESS_COUNT							"REQUEST_PLAYER_FORTRESSES_ATTACK_INFORMATION_ANSWER_FORTRESS_COUNT"
#define REQUEST_PLAYER_FORTRESSES_ATTACK_INFORMATION_ANSWER_FORTRESS_IN_WEAPONS_TARGET_REALM_NAME	"REQUEST_PLAYER_FORTRESSES_ATTACK_INFORMATION_ANSWER_FORTRESS_IN_WEAPONS_TARGET_REALM_NAM"
#define REQUEST_PLAYER_FORTRESSES_ATTACK_INFORMATION_ANSWER_FORTRESS_IN_WEAPONS_TARGET_TYPE			"REQUEST_PLAYER_FORTRESSES_ATTACK_INFORMATION_ANSWER_FORTRESS_IN_WEAPONS_TARGET_TYP"

#define REQUEST_PLAYER_FORTRESSES_ATTACK_INFORMATION_ANSWER_FORTRESS_ATTACKER_ID					"REQUEST_PLAYER_FORTRESSES_ATTACK_INFORMATION_ANSWER_FORTRESS_ATTACKER_ID"
#define REQUEST_PLAYER_FORTRESSES_ATTACK_INFORMATION_ANSWER_FORTRESS_ATTACKER_COUNT					"REQUEST_PLAYER_FORTRESSES_ATTACK_INFORMATION_ANSWER_FORTRESS_ATTACKER_COUNT"

// #################################

struct sensors_data 
{
	double range;
	unsigned long level;
	double consumption;
	double status;
	bool available;
	unsigned long weight;
};

#define REQUEST_FORTRESS_SENSORS_INFORMATION													"REQUEST_FORTRESS_SENSORS_INFORMATION"
#define REQUEST_FORTRESS_SENSORS_INFORMATION_SELF_FORTRESS_ID									"REQUEST_FORTRESS_SENSORS_INFORMATION_SELF_FORTRESS_ID"
#define REQUEST_FORTRESS_SENSORS_INFORMATION_HR_PREFIX											"REQUEST_FORTRESS_SENSORS_INFORMATION_HR_PREFIX"
#define REQUEST_FORTRESS_SENSORS_INFORMATION_LR_PREFIX											"REQUEST_FORTRESS_SENSORS_INFORMATION_LR_PREFIX"

#define REQUEST_FORTRESS_SENSORS_INFORMATION_ANSWER_FAIL										"REQUEST_FORTRESS_SENSORS_INFORMATION_SELF_FORTRESS_ID_ANSWER_FAIL"
#define REQUEST_FORTRESS_SENSORS_INFORMATION_ANSWER_FORTRESSNE									"REQUEST_FORTRESS_SENSORS_INFORMATION_SELF_FORTRESS_ID_ANSWER_FORTRESSNE"
#define REQUEST_FORTRESS_SENSORS_INFORMATION_ANSWER_FORTRESSNO									"REQUEST_FORTRESS_SENSORS_INFORMATION_SELF_FORTRESS_ID_ANSWER_FORTRESSNO"

#define REQUEST_FORTRESS_SENSORS_INFORMATION_ANSWER_RANGE											"REQUEST_FORTRESS_SENSORS_INFORMATION_ANSWER_RANGE"
#define REQUEST_FORTRESS_SENSORS_INFORMATION_ANSWER_LEVEL											"REQUEST_FORTRESS_SENSORS_INFORMATION_ANSWER_LEVEL"
#define REQUEST_FORTRESS_SENSORS_INFORMATION_ANSWER_CONSUMPTION										"REQUEST_FORTRESS_SENSORS_INFORMATION_ANSWER_CONSUMPTION"
#define REQUEST_FORTRESS_SENSORS_INFORMATION_ANSWER_STATUS											"REQUEST_FORTRESS_SENSORS_INFORMATION_ANSWER_STATUS"
#define REQUEST_FORTRESS_SENSORS_INFORMATION_ANSWER_AVAILABLE										"REQUEST_FORTRESS_SENSORS_INFORMATION_ANSWER_AVAILABLE"
#define REQUEST_FORTRESS_SENSORS_INFORMATION_ANSWER_WEIGHT											"REQUEST_FORTRESS_SENSORS_INFORMATION_ANSWER_WEIGHT"

// #################################

struct cloaking_data 
{
	unsigned long level;
	double consumption;
	double status;
	bool available;
	unsigned long long weight;
};

#define REQUEST_FORTRESS_CLOAKING_INFORMATION														"REQUEST_FORTRESS_CLOAKING_INFORMATION"
#define REQUEST_FORTRESS_CLOAKING_INFORMATION_SELF_FORTRESS_ID										"REQUEST_FORTRESS_CLOAKING_INFORMATION_SELF_FORTRESS_ID"

#define REQUEST_FORTRESS_CLOAKING_INFORMATION_ANSWER_FAIL											"REQUEST_FORTRESS_CLOAKING_INFORMATION_ANSWER_FAIL"
#define REQUEST_FORTRESS_CLOAKING_INFORMATION_ANSWER_FORTRESSNE										"REQUEST_FORTRESS_CLOAKING_INFORMATION_ANSWER_FORTRESSNE"
#define REQUEST_FORTRESS_CLOAKING_INFORMATION_ANSWER_FORTRESSNO										"REQUEST_FORTRESS_CLOAKING_INFORMATION_ANSWER_FORTRESSNO"

#define REQUEST_FORTRESS_CLOAKING_INFORMATION_ANSWER_LEVEL											"REQUEST_FORTRESS_CLOAKING_INFORMATION_ANSWER_LEVEL"
#define REQUEST_FORTRESS_CLOAKING_INFORMATION_ANSWER_CONSUMPTION									"REQUEST_FORTRESS_CLOAKING_INFORMATION_ANSWER_CONSUMPTION"
#define REQUEST_FORTRESS_CLOAKING_INFORMATION_ANSWER_STATUS											"REQUEST_FORTRESS_CLOAKING_INFORMATION_ANSWER_STATUS"
#define REQUEST_FORTRESS_CLOAKING_INFORMATION_ANSWER_AVAILABLE										"REQUEST_FORTRESS_CLOAKING_INFORMATION_ANSWER_AVAILABLE"
#define REQUEST_FORTRESS_CLOAKING_INFORMATION_ANSWER_WEIGHT											"REQUEST_FORTRESS_CLOAKING_INFORMATION_ANSWER_WEIGHT"

// #################################

struct fight_progress_report {
	unsigned long      attackResult;
	bool               disruptiveBreakdown;
	unsigned long long deflectorShieldsEnergyLoss;
	double             deflectorShieldsEnergyLossPerc;
	unsigned long long structuralIntegrityLoss;
	double             structuralIntegrityLossPerc;

	bool isAttacker;
	bool isDefender;

	unsigned long attackerFortressId;
	std::string attackerFortressName;
	std::string attackerRealmName;
	bool isAttackerShip;
	bool attackerExists;

	unsigned long defenderFortressId;
	std::string defenderFortressName;
	std::string defenderRealmName;
	bool isDefenderShip;
	bool defenderExists;

	fortress_detailed_fight_data fortressFightData;
};

#define FIGHT_PROGRESS_REPORT												"FIGHT_PROGRESS_REPORT"
#define FIGHT_PROGRESS_REPORT_DEFLECTOR_SHIELDS_ENERGY_LOSS					"FIGHT_PROGRESS_REPORT_DEFLECTOR_SHIELDS_ENERGY_LOSS"
#define FIGHT_PROGRESS_REPORT_DEFLECTOR_SHIELDS_ENERGY_LOSS_PERC			"FIGHT_PROGRESS_REPORT_DEFLECTOR_SHIELDS_ENERGY_LOSS_PERC"
#define FIGHT_PROGRESS_REPORT_DISRUPTIVE_BREAKDOWN							"FIGHT_PROGRESS_REPORT_DISRUPTIVE_BREAKDOWN"
#define FIGHT_PROGRESS_REPORT_ATTACK_RESULT									"FIGHT_PROGRESS_REPORT_ATTACK_RESULT"
#define FIGHT_PROGRESS_REPORT_INTEGRITY_ENERGY_LOSS							"FIGHT_PROGRESS_REPORT_INTEGRITY_ENERGY_LOSS"
#define FIGHT_PROGRESS_REPORT_INTEGRITY_ENERGY_LOSS_PERC					"FIGHT_PROGRESS_REPORT_INTEGRITY_ENERGY_LOSS_PERC"
#define FIGHT_PROGRESS_REPORT_IS_ATTACKER									"FIGHT_PROGRESS_REPORT_IS_ATTACKER"
#define FIGHT_PROGRESS_REPORT_IS_DEFENDER									"FIGHT_PROGRESS_REPORT_IS_DEFENDER"

#define FIGHT_PROGRESS_REPORT_ATTACKER_FORTRESS_ID							"FIGHT_PROGRESS_REPORT_ATTACKER_FORTRESS_ID"
#define FIGHT_PROGRESS_REPORT_ATTACKER_FORTRESS_NAME						"FIGHT_PROGRESS_REPORT_ATTACKER_FORTRESS_NAME"
#define FIGHT_PROGRESS_REPORT_ATTACKER_FORTRESS_REALM_NAME					"FIGHT_PROGRESS_REPORT_ATTACKER_FORTRESS_REALM_NAME"
#define FIGHT_PROGRESS_REPORT_ATTACKER_SHIP									"FIGHT_PROGRESS_REPORT_ATTACKER_SHIP"
#define FIGHT_PROGRESS_REPORT_ATTACKER_EXISTS								"FIGHT_PROGRESS_REPORT_ATTACKER_EXISTS"

#define FIGHT_PROGRESS_REPORT_DEFENDER_FORTRESS_ID							"FIGHT_PROGRESS_REPORT_DEFENDER_FORTRESS_ID"
#define FIGHT_PROGRESS_REPORT_DEFENDER_FORTRESS_NAME						"FIGHT_PROGRESS_REPORT_DEFENDER_FORTRESS_NAME"
#define FIGHT_PROGRESS_REPORT_DEFENDER_FORTRESS_REALM_NAME					"FIGHT_PROGRESS_REPORT_DEFENDER_FORTRESS_REALM_NAME"
#define FIGHT_PROGRESS_REPORT_DEFENDER_SHIP									"FIGHT_PROGRESS_REPORT_DEFENDER_SHIP"
#define FIGHT_PROGRESS_REPORT_DEFENDER_EXISTS								"FIGHT_PROGRESS_REPORT_DEFENDER_EXISTS"

// #################################

// ---------------------------------------

typedef std :: pair<unsigned long, unsigned long long> idx_and_energy_lvl;

// ################################

std :: string create_param_name(const std :: string & item, int topindex, int subindex);

/** Vytvori nazev pro hodnotu ve zprave, ktera odpovida prvku na zadane pozici v kolekci, ukladane pod zadanym nazvem.
Prvek na zadanem indexu predstavuje pouze primitivni datovy typ, nejedna se o strukturu ci tridu.
@param listname Nazev hodnoty pro kolekci ukladanou do zpravy
@param index Pozice prvku v kolekci
@return Nazev hodnoty popisujici prvek v kolekci na zadane pozici
*/
std :: string create_param_name(const std :: string & item, int index);

/** Vytvori nazev pro hodnotu ve zprave, ktera odpovida prvku na zadane pozici v kolekci, ukladane pod zadanym nazvem.
Prvek na zadanem indexu predstavuje dalsi vnorenou polozku pod zadanym jmenem, napriklad strukturu ci tridu, nejedna se pouze
primitivni datovy typ.
@param listname Nazev hodnoty pro kolekci ukladanou do zpravy
@param itemname Nazev hodnoty pro prvek z kolekce na zadanem indexu
@param index Pozice prvku v kolekci
@return Nazev hodnoty popisujici prvek v kolekci na zadane pozici
*/
std :: string create_param_name(const std :: string & listname, const std :: string & itemname, int index);

/** Vytvori nazev pro hodnotu ve zprave, ktera odpovida poctu prvku v kolekci, ukladane pod zadanym nazvem
@param listname Nazev hodnoty pro kolekci ukladanou do zpravy
@return Nazev hodnoty popisujici pocet prvku v ukladane kolekci
*/
std :: string create_count_name(const std :: string & listname);

/** Vytvori nazev pro hodnotu ve zprave, ktera odpovida prvku v rodicovske tride, ukladane pod zadanym nazvem
@param parentname Nazev hodnoty pro rodicovskou tridu
@param itemname Nazev hodnoty pro ukladany prvek rodicovske tridy
@return Nazev pro hodnotu ve zprave popisujici prvek nadrazene tridy
*/
std :: string create_param_name(const std :: string & parentname, const std :: string & itemname);

std :: string create_param_name(const std :: string & listname, const std :: string & itemname, int topindex, int subindex);

class requestWriter
{
public:
    static char* login(const std :: string& login, const std :: string& password);
    static char* chat(unsigned long recipient, const std :: string& message);
    static char* planets(unsigned long area);
    static char* buddy(void);
    static char* ships(void);
    static char* bases(void);
    static char* shipsinarea(unsigned long ship);
    static char* navigation_planets(unsigned long ship, unsigned long area);
    static char* navigation_status(unsigned long ship);
    static char* navigation_stop(unsigned long ship);
    static char* navigation_warp(unsigned long ship, signed long long posx, signed long long posy);
    static char* navigation_move_to(unsigned long ship, signed long long posx, signed long long posy, dv_time:: datetime limit);
    static char* navigation_orbit(unsigned long ship);
    static char* navigation_pursuit(unsigned long ship, unsigned long target, dv_time:: datetime limit);
    static char* navigation_move_to_spobj(unsigned long ship, unsigned long spaceObject, dv_time:: datetime limit);
    static char* navigation_move_to(unsigned long ship, signed long long posx, signed long long posy, unsigned long long limitSeconds);
    static char* navigation_pursuit(unsigned long ship, unsigned long target, unsigned long long limitSeconds);
    static char* navigation_move_to_spobj(unsigned long ship, unsigned long spaceObject, unsigned long long limitSeconds);
	static char* navigation_move_to_spobj_by_warp(unsigned long ship, unsigned long spaceObject);
    static char* navigation_break_warp(unsigned long ship);
	static char* navigation_dock_down(unsigned long shipId, unsigned long baseId);
	static char* navigation_unbound(unsigned long shipId);
    static char* ship_journey_details(unsigned long ship);
    static char* device_energy_state(unsigned long ship);
    static char* change_device_energy_state(unsigned long ship, const requestDeviceEnergy& rde);
    static char* science(void);
    static char* change_science(sciencetree_raw_data& data);

    static char* ship_central_information(unsigned long ship);
    static char* ship_subspace_drive_information(unsigned long ship);
    static char* ship_impulse_drive_information(unsigned long ship);
    static char* ship_location_information(unsigned long ship);

    static char* fortress_weapons_information(unsigned long fortress);
    static char* fortress_shields_information(unsigned long fortress);
    static char* fortress_mainframe_information(unsigned long fortress);
    static char* fortress_crew_information(unsigned long fortress);

    static char* fortress_set_weapons(unsigned long fortress, std :: list<idx_and_energy_lvl>& drone_launchers,
        std :: list<idx_and_energy_lvl>& laser_guns);
    static char* fortress_quarry_info(unsigned long fortress);
    static char* fortress_quarry_change_state(unsigned long fortress, const protQuarryType pt, bool newState);
	static char* fortress_accommodations_information(unsigned long fortress);
	static char* fortress_other_equipment_information(unsigned long fortress);
	static char* base_factories_information(unsigned long base);
	static char* fortress_warehouses_information(unsigned long fortress);	
	static char* ship_androids_information(unsigned long fortress);
	static char* base_androids_information(unsigned long fortress);

	static char* change_ship_androids_state(unsigned long fortressId, const ship_androids_request_status & sds);
	static char* change_base_androids_state(unsigned long fortressId, const base_androids_request_status & sds);

	static char* base_hangar_information(unsigned long fortressId, unsigned long hangarId, const std::string & patternName);
	static char* base_hangar_item_information(const std::string & itemPattenId);

	static char* base_hangar_build_item(unsigned long fortressId, const HangarServerInputData & data);	
	static char* base_hangar_cancel_item(unsigned long fortressId, unsigned long hangarId);
	static char* unmount_fortress_device(const unmount_device_info & data);
	static char* mount_fortress_device(const mount_device_info & data);
	
	static char* send_trade_invitation(unsigned long ownedFortressId, unsigned long partnerFortressId);
	static char* cancel_trade_with_partner();
	static char* trade_partner_fortresses(unsigned long fortressId);
	static char* decide_trade_invitation(unsigned long hostFortressId, unsigned long invitedFortressId, bool accepted);
	static char* move_trade_item(const trade_client_movement_data & tradeData);
	static char* move_trade_resource(const trade_resource_movement_data & tradeData);
	static char* commit_trade(unsigned long selfFortressId, unsigned long partnerFortressId, const client_trade_data & selfOffer, const client_trade_data & partnerOffer);
	static char* cancel_trade_commit(unsigned long selfFortressId, unsigned long partnerFortressId);

	static char* fortresses_in_weapons_range(unsigned long fortressId);
	static char* attack_fortress(unsigned long selfFortressId, unsigned long enemyFortressId);
	static char* stop_attack_fortress(unsigned long selfFortressId);

	static char* discoveredStarsRequest();
	static char* fortresses_in_conquer_range(unsigned long fortressId);
	static char* build_new_base_shell(unsigned long fortressId, unsigned long fortressClassId, unsigned long long buildingTitanium);
	static char* available_fortress_classes(unsigned long selfFortressId);
	static char* fortress_class_data(unsigned long fortressClassId);
	static char* player_fortresses_build_information();
	static char* conquer_fortress(unsigned long selfFortressId, unsigned long enemyFortressId);
	static char* fortress_add_accommodations(unsigned long fortressId, unsigned long count, accommodation_type accommodationType);
	static char* fortress_add_crew(unsigned long fortressId, unsigned long able, unsigned long wounded, crew_type crewType);
	static char* fortress_remove_crew(unsigned long fortressId, unsigned long able, unsigned long wounded, crew_type crewType);
	static char* player_fortresses();
	static char* game_seconds_per_actual_second();
	static char* rename_fortress(unsigned long fortressId, const std::string & newName);
	static char* player_fortresses_attack_information();
	static char* base_hangar_build_ship(unsigned long fortressId, unsigned long hangarId, unsigned long fortressClassId, unsigned long long buildingTitanium);

	// Pouzivane take pri failed odpovedi misto duplikovani do answerWriteru
	static void write_trade_movement_data(protocolWriter & w, const trade_client_movement_data & tradeData);

	static char* fortress_sensors_information(unsigned long fortressId);
	static char* fortress_cloaking_information(unsigned long fortressId);
private:
	static void write_androids_request_state(protocolWriter& w, const androids_request_status & sds);
	static void write_androids_assignment(protocolWriter& w, const std::string & section, const androids_assignment & assignment);	
};

void write_client_trade_data(protocolWriter & w, const std::string & prefix, const client_trade_data & tradeData);
void write_trade_resource_movement_data(protocolWriter & w, const trade_resource_movement_data & tradeData);
game_resource_type stringToResourceType(std::string resourceType); 
std::string resourceTypeToString(game_resource_type resourceType); 
bool fight_action_type_to_string(fight_action_type action, std::string & actionString);
bool string_to_fight_action_type(const std::string & actionString, fight_action_type & action);

// ################################

#endif