Pre-network merge, (again)

This commit is contained in:
dean11 2013-12-12 10:36:55 +01:00
parent 0adb831f7a
commit af7f0e01a8
8 changed files with 59 additions and 30 deletions

View File

@ -57,6 +57,7 @@ Global
{0EC83E64-230E-48EF-B08C-6AC9651B4F82}.Debug|Mixed Platforms.ActiveCfg = Release|x64
{0EC83E64-230E-48EF-B08C-6AC9651B4F82}.Debug|Mixed Platforms.Build.0 = Release|x64
{0EC83E64-230E-48EF-B08C-6AC9651B4F82}.Debug|Win32.ActiveCfg = Debug|Win32
{0EC83E64-230E-48EF-B08C-6AC9651B4F82}.Debug|Win32.Build.0 = Debug|Win32
{0EC83E64-230E-48EF-B08C-6AC9651B4F82}.Debug|x64.ActiveCfg = Debug|x64
{0EC83E64-230E-48EF-B08C-6AC9651B4F82}.Debug|x64.Build.0 = Debug|x64
{0EC83E64-230E-48EF-B08C-6AC9651B4F82}.Release|Mixed Platforms.ActiveCfg = Release|x64
@ -68,6 +69,7 @@ Global
{F10CBC03-9809-4CBA-95D8-327C287B18EE}.Debug|Mixed Platforms.ActiveCfg = Release|x64
{F10CBC03-9809-4CBA-95D8-327C287B18EE}.Debug|Mixed Platforms.Build.0 = Release|x64
{F10CBC03-9809-4CBA-95D8-327C287B18EE}.Debug|Win32.ActiveCfg = Debug|Win32
{F10CBC03-9809-4CBA-95D8-327C287B18EE}.Debug|Win32.Build.0 = Debug|Win32
{F10CBC03-9809-4CBA-95D8-327C287B18EE}.Debug|x64.ActiveCfg = Debug|x64
{F10CBC03-9809-4CBA-95D8-327C287B18EE}.Debug|x64.Build.0 = Debug|x64
{F10CBC03-9809-4CBA-95D8-327C287B18EE}.Release|Mixed Platforms.ActiveCfg = Release|x64
@ -79,6 +81,7 @@ Global
{4285BD3F-3C6C-4670-B7AF-A29AFEF5F6A8}.Debug|Mixed Platforms.ActiveCfg = Release|x64
{4285BD3F-3C6C-4670-B7AF-A29AFEF5F6A8}.Debug|Mixed Platforms.Build.0 = Release|x64
{4285BD3F-3C6C-4670-B7AF-A29AFEF5F6A8}.Debug|Win32.ActiveCfg = Debug|Win32
{4285BD3F-3C6C-4670-B7AF-A29AFEF5F6A8}.Debug|Win32.Build.0 = Debug|Win32
{4285BD3F-3C6C-4670-B7AF-A29AFEF5F6A8}.Debug|x64.ActiveCfg = Debug|x64
{4285BD3F-3C6C-4670-B7AF-A29AFEF5F6A8}.Debug|x64.Build.0 = Debug|x64
{4285BD3F-3C6C-4670-B7AF-A29AFEF5F6A8}.Release|Mixed Platforms.ActiveCfg = Release|x64
@ -90,6 +93,7 @@ Global
{34D6295A-00DD-4B1A-8258-97DA2818EC26}.Debug|Mixed Platforms.ActiveCfg = Release|x64
{34D6295A-00DD-4B1A-8258-97DA2818EC26}.Debug|Mixed Platforms.Build.0 = Release|x64
{34D6295A-00DD-4B1A-8258-97DA2818EC26}.Debug|Win32.ActiveCfg = Debug|Win32
{34D6295A-00DD-4B1A-8258-97DA2818EC26}.Debug|Win32.Build.0 = Debug|Win32
{34D6295A-00DD-4B1A-8258-97DA2818EC26}.Debug|x64.ActiveCfg = Debug|x64
{34D6295A-00DD-4B1A-8258-97DA2818EC26}.Debug|x64.Build.0 = Debug|x64
{34D6295A-00DD-4B1A-8258-97DA2818EC26}.Release|Mixed Platforms.ActiveCfg = Release|x64
@ -113,6 +117,7 @@ Global
{7E3990D2-3D94-465C-B58D-64A74B3ECF9B}.Debug|Mixed Platforms.ActiveCfg = Release|x64
{7E3990D2-3D94-465C-B58D-64A74B3ECF9B}.Debug|Mixed Platforms.Build.0 = Release|x64
{7E3990D2-3D94-465C-B58D-64A74B3ECF9B}.Debug|Win32.ActiveCfg = Debug|Win32
{7E3990D2-3D94-465C-B58D-64A74B3ECF9B}.Debug|Win32.Build.0 = Debug|Win32
{7E3990D2-3D94-465C-B58D-64A74B3ECF9B}.Debug|x64.ActiveCfg = Debug|x64
{7E3990D2-3D94-465C-B58D-64A74B3ECF9B}.Debug|x64.Build.0 = Debug|x64
{7E3990D2-3D94-465C-B58D-64A74B3ECF9B}.Release|Mixed Platforms.ActiveCfg = Release|x64
@ -136,6 +141,7 @@ Global
{838B25C2-D19E-49FE-8CB0-9A977CA3C7E8}.Debug|Mixed Platforms.ActiveCfg = Release|x64
{838B25C2-D19E-49FE-8CB0-9A977CA3C7E8}.Debug|Mixed Platforms.Build.0 = Release|x64
{838B25C2-D19E-49FE-8CB0-9A977CA3C7E8}.Debug|Win32.ActiveCfg = Debug|Win32
{838B25C2-D19E-49FE-8CB0-9A977CA3C7E8}.Debug|Win32.Build.0 = Debug|Win32
{838B25C2-D19E-49FE-8CB0-9A977CA3C7E8}.Debug|x64.ActiveCfg = Debug|x64
{838B25C2-D19E-49FE-8CB0-9A977CA3C7E8}.Debug|x64.Build.0 = Debug|x64
{838B25C2-D19E-49FE-8CB0-9A977CA3C7E8}.Release|Mixed Platforms.ActiveCfg = Release|x64
@ -147,6 +153,7 @@ Global
{6A066806-F43F-4B31-A4E3-57179674F460}.Debug|Mixed Platforms.ActiveCfg = Release|x64
{6A066806-F43F-4B31-A4E3-57179674F460}.Debug|Mixed Platforms.Build.0 = Release|x64
{6A066806-F43F-4B31-A4E3-57179674F460}.Debug|Win32.ActiveCfg = Debug|Win32
{6A066806-F43F-4B31-A4E3-57179674F460}.Debug|Win32.Build.0 = Debug|Win32
{6A066806-F43F-4B31-A4E3-57179674F460}.Debug|x64.ActiveCfg = Debug|x64
{6A066806-F43F-4B31-A4E3-57179674F460}.Debug|x64.Build.0 = Debug|x64
{6A066806-F43F-4B31-A4E3-57179674F460}.Release|Mixed Platforms.ActiveCfg = Release|x64
@ -158,6 +165,7 @@ Global
{C5AA09D0-6594-4CD3-BD92-1D380C7B3B50}.Debug|Mixed Platforms.ActiveCfg = Release|x64
{C5AA09D0-6594-4CD3-BD92-1D380C7B3B50}.Debug|Mixed Platforms.Build.0 = Release|x64
{C5AA09D0-6594-4CD3-BD92-1D380C7B3B50}.Debug|Win32.ActiveCfg = Debug|Win32
{C5AA09D0-6594-4CD3-BD92-1D380C7B3B50}.Debug|Win32.Build.0 = Debug|Win32
{C5AA09D0-6594-4CD3-BD92-1D380C7B3B50}.Debug|x64.ActiveCfg = Debug|x64
{C5AA09D0-6594-4CD3-BD92-1D380C7B3B50}.Debug|x64.Build.0 = Debug|x64
{C5AA09D0-6594-4CD3-BD92-1D380C7B3B50}.Release|Mixed Platforms.ActiveCfg = Release|x64
@ -169,6 +177,7 @@ Global
{104FA3E9-94D9-4E1D-A941-28A03BC8A095}.Debug|Mixed Platforms.ActiveCfg = Release|Win32
{104FA3E9-94D9-4E1D-A941-28A03BC8A095}.Debug|Mixed Platforms.Build.0 = Release|Win32
{104FA3E9-94D9-4E1D-A941-28A03BC8A095}.Debug|Win32.ActiveCfg = Debug|Win32
{104FA3E9-94D9-4E1D-A941-28A03BC8A095}.Debug|Win32.Build.0 = Debug|Win32
{104FA3E9-94D9-4E1D-A941-28A03BC8A095}.Debug|x64.ActiveCfg = Debug|x64
{104FA3E9-94D9-4E1D-A941-28A03BC8A095}.Debug|x64.Build.0 = Debug|x64
{104FA3E9-94D9-4E1D-A941-28A03BC8A095}.Release|Mixed Platforms.ActiveCfg = Release|Win32
@ -179,6 +188,7 @@ Global
{104FA3E9-94D9-4E1D-A941-28A03BC8A095}.Release|x64.Build.0 = Release|x64
{1B3BEA4C-CF75-438A-9693-60FB8444BBF3}.Debug|Mixed Platforms.ActiveCfg = Release|Win32
{1B3BEA4C-CF75-438A-9693-60FB8444BBF3}.Debug|Win32.ActiveCfg = Debug|Win32
{1B3BEA4C-CF75-438A-9693-60FB8444BBF3}.Debug|Win32.Build.0 = Debug|Win32
{1B3BEA4C-CF75-438A-9693-60FB8444BBF3}.Debug|x64.ActiveCfg = Debug|Win32
{1B3BEA4C-CF75-438A-9693-60FB8444BBF3}.Release|Mixed Platforms.ActiveCfg = Release|Win32
{1B3BEA4C-CF75-438A-9693-60FB8444BBF3}.Release|Win32.ActiveCfg = Release|Win32
@ -197,6 +207,7 @@ Global
{B1195BB9-B3A5-47F0-906C-8DEA384D1520}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
{B1195BB9-B3A5-47F0-906C-8DEA384D1520}.Debug|Mixed Platforms.Build.0 = Debug|Win32
{B1195BB9-B3A5-47F0-906C-8DEA384D1520}.Debug|Win32.ActiveCfg = Debug|Win32
{B1195BB9-B3A5-47F0-906C-8DEA384D1520}.Debug|Win32.Build.0 = Debug|Win32
{B1195BB9-B3A5-47F0-906C-8DEA384D1520}.Debug|x64.ActiveCfg = Debug|x64
{B1195BB9-B3A5-47F0-906C-8DEA384D1520}.Debug|x64.Build.0 = Debug|x64
{B1195BB9-B3A5-47F0-906C-8DEA384D1520}.Release|Mixed Platforms.ActiveCfg = Release|Win32
@ -220,6 +231,7 @@ Global
{8690FDDF-C5B7-4C42-A337-BD5243F29B85}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
{8690FDDF-C5B7-4C42-A337-BD5243F29B85}.Debug|Mixed Platforms.Build.0 = Debug|Win32
{8690FDDF-C5B7-4C42-A337-BD5243F29B85}.Debug|Win32.ActiveCfg = Debug|Win32
{8690FDDF-C5B7-4C42-A337-BD5243F29B85}.Debug|Win32.Build.0 = Debug|Win32
{8690FDDF-C5B7-4C42-A337-BD5243F29B85}.Debug|x64.ActiveCfg = Debug|x64
{8690FDDF-C5B7-4C42-A337-BD5243F29B85}.Debug|x64.Build.0 = Debug|x64
{8690FDDF-C5B7-4C42-A337-BD5243F29B85}.Release|Mixed Platforms.ActiveCfg = Release|Win32

View File

@ -113,7 +113,7 @@
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<DelayLoadDLLs>GameLogic_$(PlatformShortName)D.dll;%(DelayLoadDLLs)</DelayLoadDLLs>
<DelayLoadDLLs>GameLogic_$(PlatformShortName)D.dll;%(DelayLoadDLLs);NetworkAPI_$(PlatformShortName)D.dll</DelayLoadDLLs>
<AdditionalDependencies>NetworkAPI_$(PlatformShortName)D.lib;WindowManager_$(PlatformShortName)D.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
@ -130,7 +130,7 @@
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<DelayLoadDLLs>GameLogic_$(PlatformShortName)D.dll;%(DelayLoadDLLs)</DelayLoadDLLs>
<DelayLoadDLLs>GameLogic_$(PlatformShortName)D.dll;%(DelayLoadDLLs);NetworkAPI_$(PlatformShortName)D.dll</DelayLoadDLLs>
<AdditionalDependencies>NetworkAPI_$(PlatformShortName)D.lib;WindowManager_$(PlatformShortName)D.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
@ -151,7 +151,7 @@
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<DelayLoadDLLs>GameLogic_$(PlatformShortName).dll;%(DelayLoadDLLs)</DelayLoadDLLs>
<DelayLoadDLLs>GameLogic_$(PlatformShortName).dll;%(DelayLoadDLLs);NetworkAPI_$(PlatformShortName).dll</DelayLoadDLLs>
<AdditionalDependencies>NetworkAPI_$(PlatformShortName).lib;WindowManager_$(PlatformShortName).lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
@ -172,7 +172,7 @@
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<DelayLoadDLLs>GameLogic_$(PlatformShortName).dll;%(DelayLoadDLLs)</DelayLoadDLLs>
<DelayLoadDLLs>GameLogic_$(PlatformShortName).dll;%(DelayLoadDLLs);NetworkAPI_$(PlatformShortName).dll</DelayLoadDLLs>
<AdditionalDependencies>NetworkAPI_$(PlatformShortName).lib;WindowManager_$(PlatformShortName).lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>

View File

@ -7,18 +7,18 @@
#include "GameServer.h"
#include "Utilities.h"
#include "ServerInitReader.h"
#include <TEST_PROTOCOLS.h>
namespace DanBias
{
using namespace Oyster::Network;
//void GameServer::ClientConnectCallbackFunction(Oyster::Network::NetworkClient& connectedClient)
//{
// if(
//}
void GameServer::ClientConnectCallback(NetworkClient &client)
{
printf("Client connected!\n");
GameLogic::Protocol_TEST t;
t.text = "Hello";
client.Send(t);
}
GameServer::GameServer()
: initiated(0)
@ -42,9 +42,10 @@ namespace DanBias
if(!LoadIniFile(data)) return DanBiasServerReturn_Error;
NetworkServer::INIT_DESC serverDesc;
serverDesc.port = data.port;
this->maxClients = data.clients;
serverDesc.callback = this;
serverDesc.port = data.port;
serverDesc.recvObj = this;
serverDesc.callbackType = Oyster::Network::NetworkClientCallbackType_Object;
if(!this->server->Init(serverDesc)) return DanBiasServerReturn_Error;
if(!WindowShell::CreateConsoleWindow()) return DanBiasServerReturn_Error;
@ -55,9 +56,11 @@ namespace DanBias
}
DanBiasServerReturn GameServer::Run()
{
if(this->running) return DanBiasServerReturn_Error;
if(this->released) return DanBiasServerReturn_Error;
if(!this->initiated) return DanBiasServerReturn_Error;
if(this->running) return DanBiasServerReturn_Error;
if(this->released) return DanBiasServerReturn_Error;
if(!this->initiated) return DanBiasServerReturn_Error;
if(!this->server->Start()) return DanBiasServerReturn_Error;
this->running = true;
while (this->running)
@ -70,6 +73,9 @@ namespace DanBias
}
DanBiasServerReturn GameServer::Release()
{
this->server->Shutdown();
delete this->server;
delete this->mainLobby;
this->released = true;
return DanBiasServerReturn_Sucess;
}

View File

@ -22,8 +22,8 @@ namespace DanBias
void Kick(Utility::DynamicMemory::SmartPointer<Oyster::Network::NetworkClient> client);
void Kick();
void Send(Network::CustomNetProtocol& protocol);
void Send(Network::CustomNetProtocol& protocol, int ID);
void Send(Oyster::Network::CustomNetProtocol& protocol);
void Send(Oyster::Network::CustomNetProtocol& protocol, int ID);
//TODO: Do more lobby features

View File

@ -156,6 +156,7 @@
<ItemGroup>
<ClInclude Include="PlayerProtocols.h" />
<ClInclude Include="ProtocolIdentificationID.h" />
<ClInclude Include="TEST_PROTOCOLS.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">

View File

@ -13,7 +13,7 @@
namespace GameLogic
{
struct Protocol_PlayerMovement :public Network::CustomProtocolObject
struct Protocol_PlayerMovement :public Oyster::Network::CustomProtocolObject
{
int ProtocolID;
bool bForward;
@ -27,15 +27,15 @@ namespace GameLogic
{
this->protocol[0].value = ProtocolID = protocol_PlayerNavigation;
this->protocol[0].type = Network::NetAttributeType_Int;
this->protocol[1].type = Network::NetAttributeType_Bool;
this->protocol[2].type = Network::NetAttributeType_Bool;
this->protocol[3].type = Network::NetAttributeType_Bool;
this->protocol[4].type = Network::NetAttributeType_Bool;
this->protocol[5].type = Network::NetAttributeType_Bool;
this->protocol[6].type = Network::NetAttributeType_Bool;
this->protocol[0].type = Oyster::Network::NetAttributeType_Int;
this->protocol[1].type = Oyster::Network::NetAttributeType_Bool;
this->protocol[2].type = Oyster::Network::NetAttributeType_Bool;
this->protocol[3].type = Oyster::Network::NetAttributeType_Bool;
this->protocol[4].type = Oyster::Network::NetAttributeType_Bool;
this->protocol[5].type = Oyster::Network::NetAttributeType_Bool;
this->protocol[6].type = Oyster::Network::NetAttributeType_Bool;
}
Network::CustomNetProtocol* GetProtocol() override
Oyster::Network::CustomNetProtocol* GetProtocol() override
{
this->protocol[1].value = bForward;
this->protocol[2].value = bBackward;
@ -48,7 +48,7 @@ namespace GameLogic
}
private:
Network::CustomNetProtocol protocol;
Oyster::Network::CustomNetProtocol protocol;
};
}

View File

@ -5,4 +5,6 @@
#define protocol_PlayerNavigation 0
#define PROTOCOL_TEST 2
#endif // !GAMEPROTOCOL_PROTOCOL_DEFINITION_ID_H

View File

@ -5,6 +5,8 @@
// Created by Dennis Andersen 2013 //
/////////////////////////////////////
#include <memory>
namespace Oyster
{
namespace Network
@ -37,10 +39,16 @@ namespace Oyster
union RecieverObject
{
ClientConnectCallbackMethod clientConnectFnc;
ProtocolRecieverFunction protocolRecieverFnc;
ClientConnectedObject *clientConnectObject;
ProtocolRecieverObject *protocolRecievedObject;
ClientConnectCallbackMethod clientConnectFnc; // !< A function pointer for sending or recieving NetworkClient
ProtocolRecieverFunction protocolRecieverFnc; // !< A function pointer for sending or recieving CustomNetProtocol
ClientConnectedObject *clientConnectObject; // !< An object for sending or recieving NetworkClient
ProtocolRecieverObject *protocolRecievedObject; // !< An object for sending or recieving CustomNetProtocol
RecieverObject() { memset(this, 0, sizeof(RecieverObject)); }
RecieverObject(ClientConnectCallbackMethod o) { clientConnectFnc = o; }
RecieverObject(ProtocolRecieverFunction o) { protocolRecieverFnc = o; }
RecieverObject(ClientConnectedObject* o) { clientConnectObject = o; }
RecieverObject(ProtocolRecieverObject* o) { protocolRecievedObject = o; }
};
}
}