diff --git a/Bin/DLL/DanBiasServer_x64.pdb b/Bin/DLL/DanBiasServer_x64.pdb new file mode 100644 index 00000000..4a457347 Binary files /dev/null and b/Bin/DLL/DanBiasServer_x64.pdb differ diff --git a/Bin/DLL/NetworkAPI_x64.pdb b/Bin/DLL/NetworkAPI_x64.pdb new file mode 100644 index 00000000..2aa321fb Binary files /dev/null and b/Bin/DLL/NetworkAPI_x64.pdb differ diff --git a/Bin/DLL/NetworkAPI_x64D.pdb b/Bin/DLL/NetworkAPI_x64D.pdb new file mode 100644 index 00000000..39a6662a Binary files /dev/null and b/Bin/DLL/NetworkAPI_x64D.pdb differ diff --git a/Bin/DLL/NetworkAPI_x86.pdb b/Bin/DLL/NetworkAPI_x86.pdb new file mode 100644 index 00000000..aacce35f Binary files /dev/null and b/Bin/DLL/NetworkAPI_x86.pdb differ diff --git a/Bin/DLL/NetworkAPI_x86D.pdb b/Bin/DLL/NetworkAPI_x86D.pdb new file mode 100644 index 00000000..39d11475 Binary files /dev/null and b/Bin/DLL/NetworkAPI_x86D.pdb differ diff --git a/Code/Network/NetworkAPI/NetworkClient.cpp b/Code/Network/NetworkAPI/NetworkClient.cpp index aed1046f..e99ab502 100644 --- a/Code/Network/NetworkAPI/NetworkClient.cpp +++ b/Code/Network/NetworkAPI/NetworkClient.cpp @@ -49,6 +49,7 @@ struct ClientDataContainer callbackType = NetworkProtocolCallbackType_Unknown; sendPostBox = new PostBox(); connection.SetBlockingMode(false); + connection.InitiateClient(); } ClientDataContainer(IThreadObject* o, unsigned int socket ) :connection(socket), ID(currID++) @@ -56,6 +57,7 @@ struct ClientDataContainer InitWinSock(); callbackType = NetworkProtocolCallbackType_Unknown; sendPostBox = new PostBox(); + connection.InitiateClient(); connection.SetBlockingMode(false); } ~ClientDataContainer() diff --git a/Code/Network/NetworkDependencies/Connection.cpp b/Code/Network/NetworkDependencies/Connection.cpp index 567cd894..84a0cbcc 100644 --- a/Code/Network/NetworkDependencies/Connection.cpp +++ b/Code/Network/NetworkDependencies/Connection.cpp @@ -177,6 +177,7 @@ int Connection::SetBlockingMode(bool blocking) return WSAGetLastError(); } + //Success return 0; } diff --git a/Code/Network/NetworkDependencies/ThreadedClient.cpp b/Code/Network/NetworkDependencies/ThreadedClient.cpp index 204b26c3..fc652f7f 100644 --- a/Code/Network/NetworkDependencies/ThreadedClient.cpp +++ b/Code/Network/NetworkDependencies/ThreadedClient.cpp @@ -84,7 +84,7 @@ int ThreadedClient::Recv() { int errorCode = -1; - SmartPointer temp = new OysterByte; + OysterByte temp; errorCode = this->connection->Recieve(temp); if(errorCode == 0) diff --git a/Code/Network/OysterNetworkClient/ClientMain.cpp b/Code/Network/OysterNetworkClient/ClientMain.cpp index 2274fb5e..31e499cc 100644 --- a/Code/Network/OysterNetworkClient/ClientMain.cpp +++ b/Code/Network/OysterNetworkClient/ClientMain.cpp @@ -18,9 +18,6 @@ using namespace Oyster::Network; using namespace Utility; using namespace Utility::DynamicMemory; -void chat(ThreadedClient &client); -void PrintOutMessage(ProtocolSet* set); - void proc(CustomNetProtocol& protocol) { @@ -44,11 +41,14 @@ int main() errorCode = client.Connect(15151, "127.0.0.1"); client.SetRecieverObject(proc, NetworkProtocolCallbackType_Function); - if(errorCode != 0) + if(errorCode != 1) { - wstring errorTest = GetErrorMessage(errorCode); - wcout << "errorMessage: " << errorTest << endl; + printf("%d", errorCode); + cout << "FAILED" << endl; } + //client.SetRecieverObject(proc, NetworkProtocolCallbackType_Function); + + cout << "Done" << endl; while(1) { diff --git a/Code/Network/OysterNetworkClient/OysterNetworkClient.vcxproj b/Code/Network/OysterNetworkClient/OysterNetworkClient.vcxproj index f4a69e17..bc491966 100644 --- a/Code/Network/OysterNetworkClient/OysterNetworkClient.vcxproj +++ b/Code/Network/OysterNetworkClient/OysterNetworkClient.vcxproj @@ -70,28 +70,28 @@ $(SolutionDir)..\Obj\$(ProjectName)\$(PlatformShortName)\$(Configuration)\ $(ProjectName)_$(PlatformShortName)D $(SolutionDir)..\External\Include\;$(IncludePath);$(IncludePath);C:\Program Files %28x86%29\Visual Leak Detector\include;$(IncludePath) - $(OutDir)..\DLL\;$(LibraryPath);$(SolutionDir)..\External\Lib\NetworkAPI;$(SolutionDir)..\Bin\DLL;C:\Program Files (x86)\Visual Leak Detector\lib\Win32 + $(OutDir)..\DLL\;$(LibraryPath);$(SolutionDir)..\External\Lib\NetworkAPI;$(SolutionDir)..\Bin\DLL;C:\Program Files (x86)\Visual Leak Detector\lib\Win32;$(OutDir)..\DLL\ $(SolutionDir)..\Bin\Executable\ $(SolutionDir)..\Obj\$(ProjectName)\$(PlatformShortName)\$(Configuration)\ $(ProjectName)_$(PlatformShortName) C:\Program Files %28x86%29\Visual Leak Detector\include;$(IncludePath) - C:\Program Files (x86)\Visual Leak Detector\lib\Win32;$(LibraryPath) + C:\Program Files (x86)\Visual Leak Detector\lib\Win32;$(LibraryPath);$(OutDir)..\DLL\ $(SolutionDir)..\Bin\Executable\ $(SolutionDir)..\Obj\$(ProjectName)\$(PlatformShortName)\$(Configuration)\ $(ProjectName)_$(PlatformShortName)D C:\Program Files %28x86%29\Visual Leak Detector\include;$(IncludePath) - C:\Program Files (x86)\Visual Leak Detector\lib\Win64;$(LibraryPath) + C:\Program Files (x86)\Visual Leak Detector\lib\Win64;$(LibraryPath);$(OutDir)..\DLL\ $(SolutionDir)..\Bin\Executable\ $(SolutionDir)..\Obj\$(ProjectName)\$(PlatformShortName)\$(Configuration)\ $(ProjectName)_$(PlatformShortName) C:\Program Files %28x86%29\Visual Leak Detector\include;$(IncludePath) - C:\Program Files (x86)\Visual Leak Detector\lib\Win64;$(LibraryPath) + C:\Program Files (x86)\Visual Leak Detector\lib\Win64;$(LibraryPath);$(OutDir)..\DLL\ @@ -116,6 +116,7 @@ true + NetworkAPI_$(PlatformShortName)D.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) @@ -131,6 +132,7 @@ true true true + NetworkAPI_$(PlatformShortName)D.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) @@ -146,6 +148,7 @@ true true true + NetworkAPI_$(PlatformShortName)D.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) diff --git a/Code/Network/OysterNetworkServer/OysterNetworkServer.vcxproj b/Code/Network/OysterNetworkServer/OysterNetworkServer.vcxproj index 335b889c..089427f7 100644 --- a/Code/Network/OysterNetworkServer/OysterNetworkServer.vcxproj +++ b/Code/Network/OysterNetworkServer/OysterNetworkServer.vcxproj @@ -66,32 +66,32 @@ - $(SolutionDir)..\External\Lib\$(ProjectName)\ + $(SolutionDir)..\Bin\Executable\ $(SolutionDir)..\Obj\$(ProjectName)\$(PlatformShortName)\$(Configuration)\ $(ProjectName)_$(PlatformShortName)D C:\Program Files %28x86%29\Visual Leak Detector\include;$(IncludePath) - C:\Program Files (x86)\Visual Leak Detector\lib\Win32;$(LibraryPath) + C:\Program Files (x86)\Visual Leak Detector\lib\Win32;$(LibraryPath);$(OutDir)..\DLL\ - $(SolutionDir)..\External\Lib\$(ProjectName)\ + $(SolutionDir)..\Bin\Executable\ $(SolutionDir)..\Obj\$(ProjectName)\$(PlatformShortName)\$(Configuration)\ $(ProjectName)_$(PlatformShortName) C:\Program Files %28x86%29\Visual Leak Detector\include;$(IncludePath) - C:\Program Files (x86)\Visual Leak Detector\lib\Win32;$(LibraryPath) + C:\Program Files (x86)\Visual Leak Detector\lib\Win32;$(LibraryPath);$(OutDir)..\DLL\ - $(SolutionDir)..\External\Lib\$(ProjectName)\ + $(SolutionDir)..\Bin\Executable\ $(SolutionDir)..\Obj\$(ProjectName)\$(PlatformShortName)\$(Configuration)\ $(ProjectName)_$(PlatformShortName)D C:\Program Files %28x86%29\Visual Leak Detector\include;$(IncludePath) - C:\Program Files (x86)\Visual Leak Detector\lib\Win64;$(LibraryPath) + C:\Program Files (x86)\Visual Leak Detector\lib\Win64;$(LibraryPath);$(OutDir)..\DLL\ - $(SolutionDir)..\External\Lib\$(ProjectName)\ + $(SolutionDir)..\Bin\Executable\ $(SolutionDir)..\Obj\$(ProjectName)\$(PlatformShortName)\$(Configuration)\ $(ProjectName)_$(PlatformShortName) C:\Program Files %28x86%29\Visual Leak Detector\include;$(IncludePath) - C:\Program Files (x86)\Visual Leak Detector\lib\Win64;$(LibraryPath) + C:\Program Files (x86)\Visual Leak Detector\lib\Win64;$(LibraryPath);$(OutDir)..\DLL\ @@ -104,6 +104,7 @@ true + NetworkAPI_$(PlatformShortName)D.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) diff --git a/Code/Network/OysterNetworkServer/ServerMain.cpp b/Code/Network/OysterNetworkServer/ServerMain.cpp index 52624ca6..7f78bc78 100644 --- a/Code/Network/OysterNetworkServer/ServerMain.cpp +++ b/Code/Network/OysterNetworkServer/ServerMain.cpp @@ -2,16 +2,44 @@ #include #include #include "../NetworkDependencies/WinsockFunctions.h" +#include "../NetworkAPI/NetworkServer.h" +using namespace Oyster::Network; using namespace std; +void proc(NetworkClient client) +{ + cout << "Hej" << endl; +} + int main() { - if(!InitWinSock()) + NetworkServer server; + Oyster::Network::NetworkServer::INIT_DESC desc; + desc.port = 15151; + desc.callbackType = NetworkClientCallbackType_Function; + desc.recvObj = proc; + + if(!server.Init(desc)) { - cout << "errorMessage: unable to start winsock" << endl; + cout << "Init failed" << endl; + return 0; } + if(!server.Start()) + { + cout << "Start failed" << endl; + return 0; + } + + cout << "Server started" << endl; + + while(1) + { + + } + + system("pause"); return 0;