diff --git a/Android_Salmon_Engine.mk b/Android_Salmon_Engine.mk
index 2c996af..45a2804 100644
--- a/Android_Salmon_Engine.mk
+++ b/Android_Salmon_Engine.mk
@@ -308,6 +308,7 @@ LOCAL_SRC_FILES += src/Utils/JniApi/JniApi.cpp
LOCAL_SRC_FILES += src/Utils/JniApi/JniApplication.cpp
LOCAL_SRC_FILES += src/Utils/Console/Console.cpp
LOCAL_SRC_FILES += src/Utils/SerializeInterface/SerializeInterface.cpp
+LOCAL_SRC_FILES += src/Utils/Network/Network.cpp
LOCAL_SRC_FILES += src/Utils/PngHelper.cpp
LOCAL_SRC_FILES += src/Utils/SimpleTimer.cpp
LOCAL_SRC_FILES += src/Utils/ThreadUtils.cpp
diff --git a/UtilsEngine/UtilsEngine.vcxproj b/UtilsEngine/UtilsEngine.vcxproj
index b60ec6f..6e0552e 100644
--- a/UtilsEngine/UtilsEngine.vcxproj
+++ b/UtilsEngine/UtilsEngine.vcxproj
@@ -36,7 +36,12 @@
-
+
+ $(SalmonEnginePath)$(Configuration)\
+
+
+ $(SalmonEnginePath)$(Configuration)\
+
Level3
@@ -69,6 +74,7 @@
+
@@ -83,6 +89,7 @@
+
diff --git a/include/ModelManager/ModelManager.h b/include/ModelManager/ModelManager.h
index c6ed24f..2939328 100644
--- a/include/ModelManager/ModelManager.h
+++ b/include/ModelManager/ModelManager.h
@@ -37,7 +37,7 @@ public:
TLiteModelResource() : TriangleCount(0), PathToResource("") { }
~TLiteModelResource();
- bool LoadModel(boost::shared_array filePointer, cardinal fileSize);
+ bool LoadModel(boost::shared_array filePointer, cardinal fileSize);
void FreeModel();
diff --git a/include/Utils/DataTypes/DataTypes.h b/include/Utils/DataTypes/DataTypes.h
index f9ea8e5..cfec80e 100644
--- a/include/Utils/DataTypes/DataTypes.h
+++ b/include/Utils/DataTypes/DataTypes.h
@@ -18,7 +18,7 @@ namespace SE
typedef unsigned int cardinal;
typedef unsigned short int word;
-typedef unsigned char byte;
+//typedef unsigned char byte;
typedef cardinal* pcardinal;
diff --git a/include/Utils/Network/Network.h b/include/Utils/Network/Network.h
index 86e260e..ba0d62e 100644
--- a/include/Utils/Network/Network.h
+++ b/include/Utils/Network/Network.h
@@ -25,24 +25,50 @@ const int CONST_CONNECTION_TIMEOUT_SECONDS = 300;
void SendPropertyTree(boost::asio::io_service& ioService, boost::asio::ip::tcp::socket& socket, boost::property_tree::ptree pTree);
-//Must be stored in shared_ptr only
-struct TDataReader : public boost::enable_shared_from_this
+class TDataReadSignalMap
{
+protected:
+ std::map>> SignalMap;
+public:
+
+ void AddSlot(const std::string& nodeName, boost::function f);
+
+ bool SignalExists(const std::string& signalName);
+
+ void EmitSignal(const std::string& signalName, const boost::property_tree::ptree& pt);
+
+ void Clear();
+
+};
+
+
+//Must be stored in shared_ptr only
+class TDataReader : public boost::enable_shared_from_this
+{
+protected:
+ bool Nonstop;
+
+ void InnerStartRead();
+public:
+
boost::asio::ip::tcp::socket& Socket;
int DataSize;
std::vector Data;
+ TDataReadSignalMap DataReadSignalMap;
+
TDataReader(boost::asio::ip::tcp::socket& socket);
- void StartRead();
+ void StartReadOnce();
+
+ void StartReadNonstop();
void HandleReadDataSize(const boost::system::error_code& error);
void HandleReadData(const boost::system::error_code& error);
-
- boost::signal DataReadSignal;
+
boost::signal ErrorSignal;
};
@@ -52,6 +78,8 @@ class TAuthorizationInterface
{
public:
virtual void Authorize() = 0;
+
+ virtual ~TAuthorizationInterface() { }
};
class TSimpleAuthorization : public TAuthorizationInterface
@@ -62,8 +90,6 @@ public:
boost::asio::ip::tcp::socket& Socket;
- //std::shared_ptr DataReader;
-
std::string Login;
std::string Password;
@@ -105,6 +131,8 @@ public:
boost::signal OnConnectedSignal;
boost::signal OnAutorizedSignal;
boost::signal OnDisconnectedSignal;
+
+ boost::shared_ptr ClientDataReader;
TAuthorizationVariant Authorization;
@@ -122,16 +150,11 @@ public:
void HandleAuthorized();
void HandleAuthorizationError();
-};
-class TServerSocket
-{
-protected:
-public:
+ void SendPropertyTree(boost::property_tree::ptree pTree);
};
-
} //namespace SE
diff --git a/include/Utils/Network/Server.h b/include/Utils/Network/Server.h
new file mode 100644
index 0000000..13641e4
--- /dev/null
+++ b/include/Utils/Network/Server.h
@@ -0,0 +1,127 @@
+#ifndef SERVER_H_INCLUDED
+#define SERVER_H_INCLUDED
+
+#include
+#include