diff --git a/Bin/Content/Shaders/DebugVertex.cso b/Bin/Content/Shaders/DebugVertex.cso
new file mode 100644
index 00000000..4783f8a6
Binary files /dev/null and b/Bin/Content/Shaders/DebugVertex.cso differ
diff --git a/Bin/Content/Shaders/TextureDebug.cso b/Bin/Content/Shaders/TextureDebug.cso
new file mode 100644
index 00000000..6a324d8d
Binary files /dev/null and b/Bin/Content/Shaders/TextureDebug.cso differ
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..6173afe2
Binary files /dev/null and b/Bin/DLL/NetworkAPI_x86D.pdb differ
diff --git a/Bin/Settings/PLACEHOLDER b/Bin/Settings/PLACEHOLDER
deleted file mode 100644
index e69de29b..00000000
diff --git a/Bin/Settings/ServerInit.ini b/Bin/Settings/ServerInit.ini
new file mode 100644
index 00000000..a3b8f420
--- /dev/null
+++ b/Bin/Settings/ServerInit.ini
@@ -0,0 +1,2 @@
+port 15151
+clients 200
\ No newline at end of file
diff --git a/Bin/Settings/serversearchpath.ini b/Bin/Settings/serversearchpath.ini
new file mode 100644
index 00000000..6dc44cff
--- /dev/null
+++ b/Bin/Settings/serversearchpath.ini
@@ -0,0 +1,4 @@
+ServerInit ..\Settings\ServerInit.ini
+More a
+more b
+more c
\ No newline at end of file
diff --git a/Code/DanBias.sln b/Code/DanBias.sln
index 32915f21..315bd416 100644
--- a/Code/DanBias.sln
+++ b/Code/DanBias.sln
@@ -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
@@ -101,6 +105,7 @@ Global
{35AEA3C0-E0A7-4E1E-88CD-514AA5A442B1}.Debug|Mixed Platforms.ActiveCfg = Release|x64
{35AEA3C0-E0A7-4E1E-88CD-514AA5A442B1}.Debug|Mixed Platforms.Build.0 = Release|x64
{35AEA3C0-E0A7-4E1E-88CD-514AA5A442B1}.Debug|Win32.ActiveCfg = Debug|Win32
+ {35AEA3C0-E0A7-4E1E-88CD-514AA5A442B1}.Debug|Win32.Build.0 = Debug|Win32
{35AEA3C0-E0A7-4E1E-88CD-514AA5A442B1}.Debug|x64.ActiveCfg = Debug|x64
{35AEA3C0-E0A7-4E1E-88CD-514AA5A442B1}.Debug|x64.Build.0 = Debug|x64
{35AEA3C0-E0A7-4E1E-88CD-514AA5A442B1}.Release|Mixed Platforms.ActiveCfg = Release|x64
@@ -124,6 +129,7 @@ Global
{2EC4DDED-8F75-4C86-A10B-E1E8EB29F3EE}.Debug|Mixed Platforms.ActiveCfg = Release|x64
{2EC4DDED-8F75-4C86-A10B-E1E8EB29F3EE}.Debug|Mixed Platforms.Build.0 = Release|x64
{2EC4DDED-8F75-4C86-A10B-E1E8EB29F3EE}.Debug|Win32.ActiveCfg = Debug|Win32
+ {2EC4DDED-8F75-4C86-A10B-E1E8EB29F3EE}.Debug|Win32.Build.0 = Debug|Win32
{2EC4DDED-8F75-4C86-A10B-E1E8EB29F3EE}.Debug|x64.ActiveCfg = Debug|x64
{2EC4DDED-8F75-4C86-A10B-E1E8EB29F3EE}.Debug|x64.Build.0 = Debug|x64
{2EC4DDED-8F75-4C86-A10B-E1E8EB29F3EE}.Release|Mixed Platforms.ActiveCfg = Release|x64
@@ -135,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
@@ -146,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
@@ -157,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
@@ -168,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
@@ -178,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
@@ -196,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
@@ -207,6 +219,7 @@ Global
{52380DAA-0F4A-4D97-8E57-98DF39319CAF}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
{52380DAA-0F4A-4D97-8E57-98DF39319CAF}.Debug|Mixed Platforms.Build.0 = Debug|Win32
{52380DAA-0F4A-4D97-8E57-98DF39319CAF}.Debug|Win32.ActiveCfg = Debug|Win32
+ {52380DAA-0F4A-4D97-8E57-98DF39319CAF}.Debug|Win32.Build.0 = Debug|Win32
{52380DAA-0F4A-4D97-8E57-98DF39319CAF}.Debug|x64.ActiveCfg = Debug|x64
{52380DAA-0F4A-4D97-8E57-98DF39319CAF}.Debug|x64.Build.0 = Debug|x64
{52380DAA-0F4A-4D97-8E57-98DF39319CAF}.Release|Mixed Platforms.ActiveCfg = Release|Win32
@@ -218,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
@@ -229,6 +243,7 @@ Global
{460D625F-2AC9-4559-B809-0BA89CEAEDF4}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
{460D625F-2AC9-4559-B809-0BA89CEAEDF4}.Debug|Mixed Platforms.Build.0 = Debug|Win32
{460D625F-2AC9-4559-B809-0BA89CEAEDF4}.Debug|Win32.ActiveCfg = Debug|Win32
+ {460D625F-2AC9-4559-B809-0BA89CEAEDF4}.Debug|Win32.Build.0 = Debug|Win32
{460D625F-2AC9-4559-B809-0BA89CEAEDF4}.Debug|x64.ActiveCfg = Debug|x64
{460D625F-2AC9-4559-B809-0BA89CEAEDF4}.Debug|x64.Build.0 = Debug|x64
{460D625F-2AC9-4559-B809-0BA89CEAEDF4}.Release|Mixed Platforms.ActiveCfg = Release|Win32
@@ -240,6 +255,7 @@ Global
{DA2AA800-ED64-4649-8B3B-E7F1E3968B78}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
{DA2AA800-ED64-4649-8B3B-E7F1E3968B78}.Debug|Mixed Platforms.Build.0 = Debug|Win32
{DA2AA800-ED64-4649-8B3B-E7F1E3968B78}.Debug|Win32.ActiveCfg = Debug|Win32
+ {DA2AA800-ED64-4649-8B3B-E7F1E3968B78}.Debug|Win32.Build.0 = Debug|Win32
{DA2AA800-ED64-4649-8B3B-E7F1E3968B78}.Debug|x64.ActiveCfg = Debug|x64
{DA2AA800-ED64-4649-8B3B-E7F1E3968B78}.Debug|x64.Build.0 = Debug|x64
{DA2AA800-ED64-4649-8B3B-E7F1E3968B78}.Release|Mixed Platforms.ActiveCfg = Release|Win32
diff --git a/Code/Game/DanBiasGame/DanBiasGame.vcxproj b/Code/Game/DanBiasGame/DanBiasGame.vcxproj
index 1784ca35..c4ad8f96 100644
--- a/Code/Game/DanBiasGame/DanBiasGame.vcxproj
+++ b/Code/Game/DanBiasGame/DanBiasGame.vcxproj
@@ -72,7 +72,7 @@
$(SolutionDir)..\Obj\$(ProjectName)\$(PlatformShortName)\$(Configuration)\
$(ProjectName)_$(PlatformShortName)D
$(SolutionDir)..\External\Lib\Input;$(SolutionDir)..\Bin\DLL;$(LibraryPath)
- $(SolutionDir)..\External\Include\;$(IncludePath)
+ $(SolutionDir)..\External\Include\;$(SolutionDir)Game\GameProtocols\;$(SolutionDir)Network/NetworkAPI;$(IncludePath)
true
@@ -104,15 +104,15 @@
Level3
Disabled
- DANBIAS_CLIENT;DANBIAS_GAME_DLL_EXPORT;WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)
+ DANBIAS_GAME_DLL_EXPORT;WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)
true
- $(SolutionDir)OysterMath;$(SolutionDir)Input;$(SolutionDir)OysterGraphics;$(SolutionDir)Misc;$(SolutionDir)OysterMath;%(AdditionalIncludeDirectories)
+ $(SolutionDir)OysterMath;$(SolutionDir)Input;$(SolutionDir)OysterGraphics;$(SolutionDir)Misc;%(AdditionalIncludeDirectories)
Windows
true
OysterGraphics_$(PlatformShortName)D.lib;Input_$(PlatformShortName)D.lib;%(AdditionalDependencies)
- OysterGraphics_$(PlatformShortName)D.dll;%(DelayLoadDLLs)
+ NetworkAPI_$(PlatformShortName)D.dll;OysterGraphics_$(PlatformShortName)D.dll;%(DelayLoadDLLs)
@@ -121,14 +121,14 @@
Level3
Disabled
- DANBIAS_CLIENT;DANBIAS_GAME_DLL_EXPORT;WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)
+ DANBIAS_GAME_DLL_EXPORT;WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)
true
- $(SolutionDir)OysterMath;$(SolutionDir)Input;$(SolutionDir)OysterGraphics;$(SolutionDir)Misc;$(SolutionDir)OysterMath;%(AdditionalIncludeDirectories)
+ $(SolutionDir)GameProtocols;$(SolutionDir)OysterMath;$(SolutionDir)Input;$(SolutionDir)OysterGraphics;$(SolutionDir)Misc;$(SolutionDir)OysterMath;%(AdditionalIncludeDirectories)
Windows
true
- OysterGraphics_$(PlatformShortName)D.lib;Input_$(PlatformShortName)D.lib;%(AdditionalDependencies)
+ GameProtocols_$(PlatformShortName)D.lib;OysterGraphics_$(PlatformShortName)D.lib;Input_$(PlatformShortName)D.lib;%(AdditionalDependencies)
OysterGraphics_$(PlatformShortName)D.dll;%(DelayLoadDLLs)
@@ -140,16 +140,16 @@
MaxSpeed
true
true
- DANBIAS_CLIENT;DANBIAS_GAME_DLL_EXPORT;WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)
+ DANBIAS_GAME_DLL_EXPORT;WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)
true
- $(SolutionDir)OysterMath;$(SolutionDir)Input;$(SolutionDir)OysterGraphics;$(SolutionDir)Misc;$(SolutionDir)OysterMath;%(AdditionalIncludeDirectories)
+ $(SolutionDir)GameProtocols;$(SolutionDir)OysterMath;$(SolutionDir)Input;$(SolutionDir)OysterGraphics;$(SolutionDir)Misc;$(SolutionDir)OysterMath;%(AdditionalIncludeDirectories)
Windows
true
true
true
- OysterGraphics_$(PlatformShortName).lib;Input_$(PlatformShortName).lib;%(AdditionalDependencies)
+ GameProtocols_$(PlatformShortName).lib;OysterGraphics_$(PlatformShortName).lib;Input_$(PlatformShortName).lib;%(AdditionalDependencies)
OysterGraphics_x86.dll;%(DelayLoadDLLs)
@@ -161,16 +161,16 @@
MaxSpeed
true
true
- DANBIAS_CLIENT;DANBIAS_GAME_DLL_EXPORT;WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)
+ DANBIAS_GAME_DLL_EXPORT;WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)
true
- $(SolutionDir)OysterMath;$(SolutionDir)Input;$(SolutionDir)OysterGraphics;$(SolutionDir)Misc;$(SolutionDir)OysterMath;%(AdditionalIncludeDirectories)
+ $(SolutionDir)GameProtocols;$(SolutionDir)OysterMath;$(SolutionDir)Input;$(SolutionDir)OysterGraphics;$(SolutionDir)Misc;$(SolutionDir)OysterMath;%(AdditionalIncludeDirectories)
Windows
true
true
true
- OysterGraphics_$(PlatformShortName).lib;Input_$(PlatformShortName).lib;%(AdditionalDependencies)
+ GameProtocols_$(PlatformShortName).lib;OysterGraphics_$(PlatformShortName).lib;Input_$(PlatformShortName).lib;%(AdditionalDependencies)
OysterGraphics_x86.dll;%(DelayLoadDLLs)
@@ -181,6 +181,9 @@
{2ec4dded-8f75-4c86-a10b-e1e8eb29f3ee}
+
+ {460d625f-2ac9-4559-b809-0ba89ceaedf4}
+
{0ec83e64-230e-48ef-b08c-6ac9651b4f82}
diff --git a/Code/Game/DanBiasGame/DanBiasGame_Impl.cpp b/Code/Game/DanBiasGame/DanBiasGame_Impl.cpp
index 535256f9..1729708d 100644
--- a/Code/Game/DanBiasGame/DanBiasGame_Impl.cpp
+++ b/Code/Game/DanBiasGame/DanBiasGame_Impl.cpp
@@ -5,6 +5,10 @@
#include "GameClientState/GameClientState.h"
#include "GameClientState\GameState.h"
#include "GameClientState\LobbyState.h"
+#include "PlayerProtocols.h"
+#include "NetworkClient.h"
+
+#include "L_inputClass.h"
#include "vld.h"
namespace DanBias
@@ -12,11 +16,57 @@ namespace DanBias
__int64 DanBiasGame::cntsPerSec = 0;
__int64 DanBiasGame::prevTimeStamp = 0;
float DanBiasGame::secsPerCnt = 0;
- InputClass* DanBiasGame::inputObj = NULL;
HINSTANCE DanBiasGame::g_hInst = NULL;
HWND DanBiasGame::g_hWnd = NULL;
#pragma region Game Data
+
+
+ struct MyRecieverObject :public Oyster::Network::ProtocolRecieverObject
+ {
+ Oyster::Network::NetworkClient* nwClient;
+ Client::GameClientState* gameClientState;
+
+ void ProtocolRecievedCallback(Oyster::Network::CustomNetProtocol& p) override
+ {
+
+ int pType = p[0].value.netInt;
+ Client::GameClientState::ProtocolStruct* protocol;
+ switch (pType)
+ {
+ case protocol_PlayerNavigation:
+
+ break;
+ case protocol_PlayerPosition:
+ protocol = new Client::GameClientState::PlayerPos;
+ for(int i = 0; i< 3; i++)
+ {
+ ((Client::GameClientState::PlayerPos*)protocol)->playerPos[i] = p[i].value.netFloat;
+ }
+ gameClientState->Protocol(protocol);
+ delete protocol;
+ protocol = NULL;
+ break;
+
+
+ case protocol_ObjectPosition:
+ protocol = new Client::GameClientState::ObjPos;
+ for(int i = 0; i< 16; i++)
+ {
+ ((Client::GameClientState::ObjPos*)protocol)->worldPos[i] = p[i].value.netFloat;
+ }
+ gameClientState->Protocol(protocol);
+ delete protocol;
+ protocol = NULL;
+ break;
+
+ default:
+ break;
+ }
+
+
+ }
+ };
class DanBiasGamePrivateData
{
@@ -30,12 +80,15 @@ namespace DanBias
}
- public:
- Client::GameClientState* gameClientState;
- // gameClient;
+ public:
+ Client::GameClientState* gameClientState;
+ InputClass* inputObj;
+ MyRecieverObject* r;
} data;
#pragma endregion
+
+
DanBiasGamePrivateData* DanBiasGame::m_data = new DanBiasGamePrivateData();
//--------------------------------------------------------------------------------------
@@ -63,6 +116,9 @@ namespace DanBias
// Start in lobby state
m_data->gameClientState = new Client::LobbyState();
m_data->gameClientState->Init();
+ m_data->r = new MyRecieverObject;
+ m_data->r->nwClient = new Oyster::Network::NetworkClient();
+
return DanBiasClientReturn_Sucess;
}
@@ -163,8 +219,8 @@ namespace DanBias
//-------------------------------------------------------------------------------------
HRESULT DanBiasGame::InitInput()
{
- inputObj = new InputClass;
- if(!inputObj->Initialize(g_hInst, g_hWnd, 1024, 768))
+ m_data->inputObj = new InputClass;
+ if(!m_data->inputObj->Initialize(g_hInst, g_hWnd, 1024, 768))
{
MessageBox(0, L"Could not initialize the input object.", L"Error", MB_OK);
return E_FAIL;
@@ -174,10 +230,10 @@ namespace DanBias
HRESULT DanBiasGame::Update(float deltaTime)
{
- inputObj->Update();
+ m_data->inputObj->Update();
DanBias::Client::GameClientState::ClientState state = DanBias::Client::GameClientState::ClientState_Same;
- state = m_data->gameClientState->Update(deltaTime, inputObj);
+ state = m_data->gameClientState->Update(deltaTime, m_data->inputObj);
if(state != Client::GameClientState::ClientState_Same)
{
@@ -206,7 +262,7 @@ namespace DanBias
HRESULT DanBiasGame::Render(float deltaTime)
{
int isPressed = 0;
- if(inputObj->IsKeyPressed(DIK_A))
+ if(m_data->inputObj->IsKeyPressed(DIK_A))
{
isPressed = 1;
}
@@ -224,8 +280,9 @@ namespace DanBias
{
m_data->gameClientState->Release();
delete m_data->gameClientState;
+ delete m_data->inputObj;
delete m_data;
- delete inputObj;
+
Oyster::Graphics::API::Clean();
return S_OK;
diff --git a/Code/Game/DanBiasGame/GameClientState/GameClientState.h b/Code/Game/DanBiasGame/GameClientState/GameClientState.h
index 5277996d..4e0d723b 100644
--- a/Code/Game/DanBiasGame/GameClientState/GameClientState.h
+++ b/Code/Game/DanBiasGame/GameClientState/GameClientState.h
@@ -12,6 +12,26 @@ namespace Client
class GameClientState
{
public:
+ struct ProtocolStruct
+ {
+
+ };
+ struct ObjPos :public ProtocolStruct
+ {
+ float worldPos[16];
+ };
+ struct PlayerPos :public ProtocolStruct
+ {
+ float playerPos[3];
+ };
+ struct PlayerMove :public ProtocolStruct
+ {
+ float playerPos[3];
+ };
+ struct PlayerName :public ProtocolStruct
+ {
+ char name[255];
+ };
enum ClientState
{
ClientState_Lobby,
@@ -26,6 +46,8 @@ public:
virtual ClientState Update(float deltaTime, InputClass* KeyInput) = 0;
virtual bool Render() = 0;
virtual bool Release() = 0;
+ virtual void Protocol(ProtocolStruct* protocolStruct) = 0;
+
};
};
};
diff --git a/Code/Game/DanBiasGame/GameClientState/GameState.cpp b/Code/Game/DanBiasGame/GameClientState/GameState.cpp
index fb81e23a..64b1babb 100644
--- a/Code/Game/DanBiasGame/GameClientState/GameState.cpp
+++ b/Code/Game/DanBiasGame/GameClientState/GameState.cpp
@@ -2,6 +2,8 @@
#include "DllInterfaces/GFXAPI.h"
#include "Obj/C_Player.h"
#include "Obj/C_DynamicObj.h"
+#include "NetworkClient.h"
+#include "PlayerProtocols.h"
using namespace DanBias::Client;
@@ -12,7 +14,9 @@ struct GameState::myData
Oyster::Math3D::Float4x4 proj;
C_Object* object[3];
int modelCount;
+ Oyster::Network::NetworkClient* nwClient;
gameStateState state;
+
}privData;
GameState::GameState(void)
@@ -32,7 +36,7 @@ bool GameState::Init()
privData->state = LoadGame();
return true;
}
-GameState::gameStateState GameState::LoadGame()
+GameState::gameStateState GameState::LoadGame()
{
LoadModels(L"map");
InitCamera(Oyster::Math::Float3(0,0,5.4f));
@@ -86,8 +90,15 @@ GameClientState::ClientState GameState::Update(float deltaTime, InputClass* KeyI
case gameStateState_playing:
// read server data
// update objects
+ // Client.send(obj);
+ {
+ GameLogic::Protocol_PlayerMovement movePlayer;
+
+ //privData->nwClient->Send(movePlayer);
+
if(KeyInput->IsKeyPressed(DIK_L))
privData->state = GameState::gameStateState_end;
+ }
break;
case gameStateState_end:
return ClientState_Lobby;
@@ -123,4 +134,21 @@ bool GameState::Release()
delete privData;
privData = NULL;
return true;
-}
\ No newline at end of file
+}
+
+void GameState::Protocol(ProtocolStruct* pos)
+{
+ if((ObjPos*)pos)
+ ObjectPosProtocol((ObjPos*)pos);
+ else if((PlayerPos*)pos)
+ PlayerPosProtocol((PlayerPos*)pos);
+}
+void GameState::PlayerPosProtocol(PlayerPos* pos)
+{
+
+}
+void GameState::ObjectPosProtocol(ObjPos* pos)
+{
+
+}
+//void GameState::Protocol(LightPos pos);
\ No newline at end of file
diff --git a/Code/Game/DanBiasGame/GameClientState/GameState.h b/Code/Game/DanBiasGame/GameClientState/GameState.h
index 5ae6aa49..26ec0caa 100644
--- a/Code/Game/DanBiasGame/GameClientState/GameState.h
+++ b/Code/Game/DanBiasGame/GameClientState/GameState.h
@@ -23,13 +23,18 @@ public:
GameState(void);
~GameState(void);
bool Init();
- GameClientState::ClientState Update(float deltaTime, InputClass* KeyInput);
- bool LoadModels(std::wstring mapFile);
- bool InitCamera(Oyster::Math::Float3 startPos);
+ GameClientState::ClientState Update(float deltaTime, InputClass* KeyInput) override;
+ bool LoadModels(std::wstring mapFile) ;
+ bool InitCamera(Oyster::Math::Float3 startPos) ;
gameStateState LoadGame();
- bool Render();
- bool Release();
+ bool Render()override;
+ bool Release()override;
+
+ void Protocol(ProtocolStruct* pos)override;
+ void PlayerPosProtocol(PlayerPos* pos);
+ void ObjectPosProtocol(ObjPos* pos);
+ //void Protocol(LightPos pos);
};
};
};
diff --git a/Code/Game/DanBiasGame/GameClientState/LobbyState.cpp b/Code/Game/DanBiasGame/GameClientState/LobbyState.cpp
index b107883f..8d54bd24 100644
--- a/Code/Game/DanBiasGame/GameClientState/LobbyState.cpp
+++ b/Code/Game/DanBiasGame/GameClientState/LobbyState.cpp
@@ -118,4 +118,14 @@ bool LobbyState::Release()
delete privData;
privData = NULL;
return true;
+}
+void LobbyState::Protocol(ProtocolStruct* protocol)
+{
+ if((PlayerName*)protocol)
+ PlayerJoinProtocol((PlayerName*)protocol);
+
+}
+void LobbyState::PlayerJoinProtocol(PlayerName* name)
+{
+
}
\ No newline at end of file
diff --git a/Code/Game/DanBiasGame/GameClientState/LobbyState.h b/Code/Game/DanBiasGame/GameClientState/LobbyState.h
index 7498d448..c00a3b8f 100644
--- a/Code/Game/DanBiasGame/GameClientState/LobbyState.h
+++ b/Code/Game/DanBiasGame/GameClientState/LobbyState.h
@@ -32,5 +32,8 @@ public:
bool Render();
bool Release();
+ void Protocol(ProtocolStruct* protocol)override;
+ void PlayerJoinProtocol(PlayerName* name);
+
};};};
#endif // ! DANBIAS_CLIENT_GAMECLIENTSTATE_H
diff --git a/Code/Game/DanBiasGame/Include/DanBiasGame.h b/Code/Game/DanBiasGame/Include/DanBiasGame.h
index 0f9b83eb..a8d1a96f 100644
--- a/Code/Game/DanBiasGame/Include/DanBiasGame.h
+++ b/Code/Game/DanBiasGame/Include/DanBiasGame.h
@@ -1,6 +1,8 @@
#ifndef DANBIASGAME_DANBIASGAME_H
#define DANBIASGAME_DANBIASGAME_H
+#define DANBIAS_CLIENT_L
+
#if defined (DANBIAS_GAME_DLL_EXPORT)
#define DANBIAS_GAME_DLL __declspec(dllexport)
#else
@@ -11,8 +13,6 @@
#include
-#include "L_inputClass.h"
-
namespace DanBias
{
@@ -25,8 +25,6 @@ namespace DanBias
DanBiasClientReturn_Sucess,
};
-
-
struct DanBiasGameDesc
{
//Stuff goes here...
@@ -56,11 +54,12 @@ namespace DanBias
static HRESULT Update(float deltaTime);
static HRESULT Render(float deltaTime);
static HRESULT CleanUp();
+
private:
static __int64 cntsPerSec;
static __int64 prevTimeStamp;
static float secsPerCnt;
- static InputClass* inputObj;
+
static HINSTANCE g_hInst;
static HWND g_hWnd;
static DanBiasGamePrivateData* m_data;
diff --git a/Code/Game/DanBiasLauncher/DanBiasLauncher.vcxproj b/Code/Game/DanBiasLauncher/DanBiasLauncher.vcxproj
index 6e5f099c..3650d06a 100644
--- a/Code/Game/DanBiasLauncher/DanBiasLauncher.vcxproj
+++ b/Code/Game/DanBiasLauncher/DanBiasLauncher.vcxproj
@@ -71,32 +71,32 @@
$(SolutionDir)..\Bin\Executable\
$(SolutionDir)..\Obj\$(ProjectName)\$(PlatformShortName)\$(Configuration)\
$(ProjectName)_$(PlatformShortName)D
- $(SolutionDir)..\External\Include\;$(IncludePath);$(IncludePath)
- $(OutDir)..\DLL\;$(LibraryPath);$(SolutionDir)..\External\Lib\Input;$(SolutionDir)..\Bin\DLL;
+ $(SolutionDir)..\External\Include\;C:\Program Files %28x86%29\Visual Leak Detector\include;$(IncludePath)
+ $(OutDir)..\DLL\;C:\Program Files %28x86%29\Visual Leak Detector\lib\Win32;$(LibraryPath)
true
$(SolutionDir)..\Bin\Executable\
$(SolutionDir)..\Obj\$(ProjectName)\$(PlatformShortName)\$(Configuration)\
$(ProjectName)_$(PlatformShortName)D
- $(SolutionDir)..\External\Include\;$(IncludePath);$(IncludePath)
- $(OutDir)..\DLL\;$(LibraryPath);$(SolutionDir)..\External\Lib\Input;$(SolutionDir)..\Bin\DLL;
+ $(SolutionDir)..\External\Include\;C:\Program Files %28x86%29\Visual Leak Detector\include;$(IncludePath)
+ $(OutDir)..\DLL\;C:\Program Files %28x86%29\Visual Leak Detector\lib\Win64;$(LibraryPath)
false
$(SolutionDir)..\Bin\Executable\
$(SolutionDir)..\Obj\$(ProjectName)\$(PlatformShortName)\$(Configuration)\
$(ProjectName)_$(PlatformShortName)
- $(SolutionDir)..\External\Include\;$(IncludePath);$(IncludePath)
- $(OutDir)..\DLL\;$(LibraryPath);$(SolutionDir)..\External\Lib\Input;$(SolutionDir)..\Bin\DLL;
+ $(SolutionDir)..\External\Include\;C:\Program Files %28x86%29\Visual Leak Detector\include;$(IncludePath)
+ $(OutDir)..\DLL\;C:\Program Files %28x86%29\Visual Leak Detector\lib\Win32;$(LibraryPath)
false
$(SolutionDir)..\Bin\Executable\
$(SolutionDir)..\Obj\$(ProjectName)\$(PlatformShortName)\$(Configuration)\
$(ProjectName)_$(PlatformShortName)
- $(SolutionDir)..\External\Include\;$(IncludePath);$(IncludePath)
- $(OutDir)..\DLL\;$(LibraryPath);$(SolutionDir)..\External\Lib\Input;$(SolutionDir)..\Bin\DLL;
+ $(SolutionDir)..\External\Include\;C:\Program Files %28x86%29\Visual Leak Detector\include;$(IncludePath)
+ $(OutDir)..\DLL\;C:\Program Files %28x86%29\Visual Leak Detector\lib\Win64;$(LibraryPath)
@@ -105,13 +105,13 @@
Level3
Disabled
WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)
- $(SolutionDir)Input;$(SolutionDir)Include;$(SolutionDir)Misc;$(SolutionDir)OysterMath;$(SolutionDir)OysterGraphics\;$(SolutionDir)Game\DanBiasServer\Include;$(SolutionDir)Game\DanBiasGame\Include
+ $(SolutionDir)Game\DanBiasServer\Include;$(SolutionDir)Game\DanBiasGame\Include
Windows
true
- DanBiasServer_$(PlatformShortName)D.dll;DanBiasGame_$(PlatformShortName)D.dll;%(DelayLoadDLLs)
- Input_$(PlatformShortName)D.lib;DanBiasGame_$(PlatformShortName)D.lib;%(AdditionalDependencies)
+ DanBiasGame_$(PlatformShortName)D.dll;DanBiasServer_$(PlatformShortName)D.dll;%(DelayLoadDLLs)
+ DanBiasGame_$(PlatformShortName)D.lib;DanBiasServer_$(PlatformShortName)D.lib;%(AdditionalDependencies)
@@ -121,13 +121,13 @@
Level3
Disabled
WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)
- $(SolutionDir)Input;$(SolutionDir)Include;$(SolutionDir)Misc;$(SolutionDir)OysterMath;$(SolutionDir)OysterGraphics\;$(SolutionDir)Game\DanBiasServer\Include;$(SolutionDir)Game\DanBiasGame\Include
+ $(SolutionDir)Game\DanBiasServer\Include;$(SolutionDir)Game\DanBiasGame\Include
Windows
true
DanBiasServer_$(PlatformShortName)D.dll;DanBiasGame_$(PlatformShortName)D.dll;%(DelayLoadDLLs)
- Input_$(PlatformShortName)D.lib;DanBiasGame_$(PlatformShortName)D.lib;%(AdditionalDependencies)
+ DanBiasGame_$(PlatformShortName)D.lib;DanBiasServer_$(PlatformShortName)D.lib;%(AdditionalDependencies)
@@ -139,7 +139,7 @@
true
true
WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)
- $(SolutionDir)Input;$(SolutionDir)Include;$(SolutionDir)Misc;$(SolutionDir)OysterMath;$(SolutionDir)OysterGraphics\;$(SolutionDir)Game\DanBiasServer\Include;$(SolutionDir)Game\DanBiasGame\Include
+ $(SolutionDir)Game\DanBiasServer\Include;$(SolutionDir)Game\DanBiasGame\Include
Windows
@@ -147,7 +147,7 @@
true
true
DanBiasServer_$(PlatformShortName).dll;DanBiasGame_$(PlatformShortName).dll;%(DelayLoadDLLs)
- Input_$(PlatformShortName).lib;DanBiasServer_$(PlatformShortName).lib;DanBiasGame_$(PlatformShortName).lib;%(AdditionalDependencies)
+ DanBiasServer_$(PlatformShortName).lib;DanBiasGame_$(PlatformShortName).lib;%(AdditionalDependencies)
@@ -159,7 +159,7 @@
true
true
WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)
- $(SolutionDir)Input;$(SolutionDir)Include;$(SolutionDir)Misc;$(SolutionDir)OysterMath;$(SolutionDir)OysterGraphics\;$(SolutionDir)Game\DanBiasServer\Include;$(SolutionDir)Game\DanBiasGame\Include
+ $(SolutionDir)Game\DanBiasServer\Include;$(SolutionDir)Game\DanBiasGame\Include
Windows
@@ -167,34 +167,16 @@
true
true
DanBiasServer_$(PlatformShortName).dll;DanBiasGame_$(PlatformShortName).dll;%(DelayLoadDLLs)
- Input_$(PlatformShortName).lib;DanBiasServer_$(PlatformShortName).lib;DanBiasGame_$(PlatformShortName).lib;%(AdditionalDependencies)
+ DanBiasServer_$(PlatformShortName).lib;DanBiasGame_$(PlatformShortName).lib;%(AdditionalDependencies)
-
- {104fa3e9-94d9-4e1d-a941-28a03bc8a095}
-
-
- {7e3990d2-3d94-465c-b58d-64a74b3ecf9b}
-
-
- {2ec4dded-8f75-4c86-a10b-e1e8eb29f3ee}
-
-
- {0ec83e64-230e-48ef-b08c-6ac9651b4f82}
-
-
- {f10cbc03-9809-4cba-95d8-327c287b18ee}
-
{2a1bc987-af42-4500-802d-89cd32fc1309}
-
- {52380daa-0f4a-4d97-8e57-98df39319caf}
-
diff --git a/Code/Game/DanBiasLauncher/Launcher.cpp b/Code/Game/DanBiasLauncher/Launcher.cpp
index 0440d973..0efd5e2e 100644
--- a/Code/Game/DanBiasLauncher/Launcher.cpp
+++ b/Code/Game/DanBiasLauncher/Launcher.cpp
@@ -3,16 +3,12 @@
/////////////////////////////////////////////////
#define NOMINMAX
#include
-
-//#define DANBIAS_SERVER
-#define DANBIAS_CLIENT
+#include
-#if defined(DANBIAS_SERVER)
-#include "IDanBiasServer.h"
-#elif defined(DANBIAS_CLIENT)
-#include "DanBiasGame.h"
-#endif
+#include "DanBiasServerAPI.h"
+//#include "DanBiasGame.h"
+
int WINAPI WinMain( HINSTANCE hinst, HINSTANCE prevInst, PSTR cmdLine, int cmdShow)
{
@@ -21,16 +17,12 @@ int WINAPI WinMain( HINSTANCE hinst, HINSTANCE prevInst, PSTR cmdLine, int cmdSh
{
return cmdShow;
}
- // Server starter code goes here
- DanBias::DanBiasServerDesc desc;
- desc.port = 0;
-
- if( DanBias::DanBiasServer::Initiate(desc) == DanBias::DanBiasServerReturn_Sucess)
+ if( DanBias::DanBiasServerAPI::Initiate() == DanBias::DanBiasServerReturn_Sucess)
{
- DanBias::DanBiasServer::Run();
- DanBias::DanBiasServer::Release();
+ DanBias::DanBiasServerAPI::Run();
+ DanBias::DanBiasServerAPI::Release();
}
-#elif defined(DANBIAS_CLIENT)
+#elif defined(DANBIAS_CLIENT_L)
if(SetDllDirectory(L"..\\DLL") == FALSE)
{
return cmdShow;
diff --git a/Code/Game/DanBiasServer/DBServer.cpp b/Code/Game/DanBiasServer/DBServer.cpp
deleted file mode 100644
index db81f4da..00000000
--- a/Code/Game/DanBiasServer/DBServer.cpp
+++ /dev/null
@@ -1,56 +0,0 @@
-/////////////////////////////////////////////////////////////////////
-// Created by [Dennis Andersen] [2013]
-/////////////////////////////////////////////////////////////////////
-#include
-#include "DBServer.h"
-//#include "GameLogic\?"
-#include "Utilities.h"
-
-using namespace DanBias;
-
-DBServer::DBServer()
- : initiated(0)
- , running(0)
- , released(0)
-{
-}
-DBServer::~DBServer()
-{
-
-}
-DanBiasServerReturn DBServer::Create(const DanBias::DanBiasServerDesc& desc)
-{
- this->initiated = true;
- return DanBiasServerReturn_Sucess;
-}
-DanBiasServerReturn DBServer::Run()
-{
-
- if(this->running)
- {
- return DanBiasServerReturn_Error;
- }
- if(this->released)
- {
- return DanBiasServerReturn_Error;
- }
- if(!this->initiated)
- {
- return DanBiasServerReturn_Error;
- }
- this->running = true;
- while (this->running)
- {
- MessageBox(0, L"What to do here...", L"TYPELESS", 0);
-
- this->running = false;
- }
- return DanBiasServerReturn_Sucess;
-}
-DanBiasServerReturn DBServer::Release()
-{
- this->released = true;
- return DanBiasServerReturn_Sucess;
-}
-
-
diff --git a/Code/Game/DanBiasServer/DBServer.h b/Code/Game/DanBiasServer/DBServer.h
deleted file mode 100644
index 261e62d5..00000000
--- a/Code/Game/DanBiasServer/DBServer.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/////////////////////////////////////////////////////////////////////
-// Created by [Dennis Andersen] [2013]
-/////////////////////////////////////////////////////////////////////
-#ifndef DANBIASSERVER_DBSERVER_H
-#define DANBIASSERVER_DBSERVER_H
-
-#include "Include\IDanBiasServer.h"
-
-namespace DanBias
-{
- class DBServer
- {
- public:
- DBServer();
- ~DBServer();
-
- DanBiasServerReturn Create(const DanBias::DanBiasServerDesc& desc);
- DanBiasServerReturn Run();
- DanBiasServerReturn Release();
-
- private:
- bool initiated;
- bool running;
- bool released;
- };
-}// End namspace DanBias
-#endif // !DANBIASSERVER_DBSERVER_H
diff --git a/Code/Game/DanBiasServer/DLLMain.cpp b/Code/Game/DanBiasServer/DLLMain.cpp
index 93409304..41d71e2e 100644
--- a/Code/Game/DanBiasServer/DLLMain.cpp
+++ b/Code/Game/DanBiasServer/DLLMain.cpp
@@ -1,8 +1,8 @@
-
+#define NOMINMAX
#include
BOOL WINAPI DllMain( _In_ HINSTANCE hinstDLL, _In_ DWORD fdwReason, _In_ LPVOID lpvReserved )
{
- MessageBox(0, L"DanBiasServer Loaded", 0, 0);
+
return TRUE;
}
\ No newline at end of file
diff --git a/Code/Game/DanBiasServer/DanBiasServer.vcxproj b/Code/Game/DanBiasServer/DanBiasServer.vcxproj
index ba85aaa5..af26345b 100644
--- a/Code/Game/DanBiasServer/DanBiasServer.vcxproj
+++ b/Code/Game/DanBiasServer/DanBiasServer.vcxproj
@@ -73,28 +73,32 @@
$(SolutionDir)..\Bin\DLL\
$(SolutionDir)..\Obj\$(ProjectName)\$(PlatformShortName)\$(Configuration)\
$(ProjectName)_$(PlatformShortName)D
- $(SolutionDir)..\External\Include\;$(IncludePath)
+ $(SolutionDir)..\External\Include\;$(SolutionDir)Game\GameProtocols\;$(SolutionDir)Game\GameLogic\;$(SolutionDir)Network\NetworkAPI\;$(SolutionDir)OysterMath\;$(SolutionDir)GamePhysics\;$(SolutionDir)Misc\;$(SolutionDir)WindowManager\;C:\Program Files %28x86%29\Visual Leak Detector\include;$(SolutionDir)OysterPhysics3D\;$(IncludePath)
+ $(OutDir);$(SolutionDir)..\External\Lib\WindowManager\;C:\Program Files %28x86%29\Visual Leak Detector\lib\Win32;$(LibraryPath)
true
$(SolutionDir)..\Bin\DLL\
$(SolutionDir)..\Obj\$(ProjectName)\$(PlatformShortName)\$(Configuration)\
$(ProjectName)_$(PlatformShortName)D
- $(SolutionDir)..\External\Include\;$(IncludePath)
+ $(SolutionDir)..\External\Include\;$(SolutionDir)Game\GameProtocols\;$(SolutionDir)Game\GameLogic\;$(SolutionDir)Network\NetworkAPI\;$(SolutionDir)OysterMath\;$(SolutionDir)GamePhysics\;$(SolutionDir)Misc\;$(SolutionDir)WindowManager\;C:\Program Files %28x86%29\Visual Leak Detector\include;$(SolutionDir)OysterPhysics3D\;$(IncludePath)
+ $(OutDir);$(SolutionDir)..\External\Lib\WindowManager\;C:\Program Files %28x86%29\Visual Leak Detector\lib\Win32;$(LibraryPath)
false
$(SolutionDir)..\Bin\DLL\
$(SolutionDir)..\Obj\$(ProjectName)\$(PlatformShortName)\$(Configuration)\
$(ProjectName)_$(PlatformShortName)
- $(SolutionDir)..\External\Include\;$(IncludePath)
+ $(SolutionDir)..\External\Include\;$(SolutionDir)Game\GameProtocols\;$(SolutionDir)Game\GameLogic\;$(SolutionDir)Network\NetworkAPI\;$(SolutionDir)OysterMath\;$(SolutionDir)GamePhysics\;$(SolutionDir)Misc\;$(SolutionDir)WindowManager\;C:\Program Files %28x86%29\Visual Leak Detector\include;$(SolutionDir)OysterPhysics3D\;$(IncludePath)
+ $(OutDir);$(SolutionDir)..\External\Lib\WindowManager\;C:\Program Files %28x86%29\Visual Leak Detector\lib\Win32;$(LibraryPath)
false
$(SolutionDir)..\Bin\DLL\
$(SolutionDir)..\Obj\$(ProjectName)\$(PlatformShortName)\$(Configuration)\
$(ProjectName)_$(PlatformShortName)
- $(SolutionDir)..\External\Include\;$(IncludePath)
+ $(SolutionDir)..\External\Include\;$(SolutionDir)Game\GameProtocols\;$(SolutionDir)Game\GameLogic\;$(SolutionDir)Network\NetworkAPI\;$(SolutionDir)OysterMath\;$(SolutionDir)GamePhysics\;$(SolutionDir)Misc\;$(SolutionDir)WindowManager\;C:\Program Files %28x86%29\Visual Leak Detector\include;$(SolutionDir)OysterPhysics3D\;$(IncludePath)
+ $(OutDir);$(SolutionDir)..\External\Lib\WindowManager\;C:\Program Files %28x86%29\Visual Leak Detector\lib\Win32;$(LibraryPath)
@@ -102,13 +106,15 @@
Level3
Disabled
- DANBIAS_SERVER;DANBIAS_SERVER_DLL_EXPORT;WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)
- $(SolutionDir)Misc\;$(SolutionDir)Game\
+ DANBIAS_SERVER_DLL_EXPORT;WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)
+
+
Windows
true
- GameLogic_$(PlatformShortName)D.dll;%(DelayLoadDLLs)
+ GameLogic_$(PlatformShortName)D.dll;%(DelayLoadDLLs);NetworkAPI_$(PlatformShortName)D.dll
+ NetworkAPI_$(PlatformShortName)D.lib;WindowManager_$(PlatformShortName)D.lib;GameLogic_$(PlatformShortName)D.lib;%(AdditionalDependencies)
@@ -117,13 +123,15 @@
Level3
Disabled
- DANBIAS_SERVER;DANBIAS_SERVER_DLL_EXPORT;WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)
- $(SolutionDir)Misc\;$(SolutionDir)Game\
+ DANBIAS_SERVER_DLL_EXPORT;WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)
+
+
Windows
true
- GameLogic_$(PlatformShortName)D.dll;%(DelayLoadDLLs)
+ GameLogic_$(PlatformShortName)D.dll;%(DelayLoadDLLs);NetworkAPI_$(PlatformShortName)D.dll
+ NetworkAPI_$(PlatformShortName)D.lib;WindowManager_$(PlatformShortName)D.lib;GameLogic_$(PlatformShortName)D.lib;%(AdditionalDependencies)
@@ -134,15 +142,17 @@
MaxSpeed
true
true
- DANBIAS_SERVER;DANBIAS_SERVER_DLL_EXPORT;WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)
- $(SolutionDir)Misc\;$(SolutionDir)Game\
+ DANBIAS_SERVER_DLL_EXPORT;WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)
+
+
Windows
true
true
true
- GameLogic_$(PlatformShortName).dll;%(DelayLoadDLLs)
+ GameLogic_$(PlatformShortName).dll;%(DelayLoadDLLs);NetworkAPI_$(PlatformShortName).dll
+ NetworkAPI_$(PlatformShortName).lib;WindowManager_$(PlatformShortName).lib;GameLogic_$(PlatformShortName).lib;%(AdditionalDependencies)
@@ -153,32 +163,50 @@
MaxSpeed
true
true
- DANBIAS_SERVER;DANBIAS_SERVER_DLL_EXPORT;WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)
- $(SolutionDir)Misc\;$(SolutionDir)Game\
+ DANBIAS_SERVER_DLL_EXPORT;WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)
+
+
Windows
true
true
true
- GameLogic_$(PlatformShortName).dll;%(DelayLoadDLLs)
+ GameLogic_$(PlatformShortName).dll;%(DelayLoadDLLs);NetworkAPI_$(PlatformShortName).dll
+ NetworkAPI_$(PlatformShortName).lib;WindowManager_$(PlatformShortName).lib;GameLogic_$(PlatformShortName).lib;%(AdditionalDependencies)
-
+
-
+
+
+
+
+
+
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+ {104fa3e9-94d9-4e1d-a941-28a03bc8a095}
+
{2ec4dded-8f75-4c86-a10b-e1e8eb29f3ee}
+
+ {f10cbc03-9809-4cba-95d8-327c287b18ee}
+
diff --git a/Code/Game/DanBiasServer/GameServer.cpp b/Code/Game/DanBiasServer/GameServer.cpp
new file mode 100644
index 00000000..c0601b30
--- /dev/null
+++ b/Code/Game/DanBiasServer/GameServer.cpp
@@ -0,0 +1,113 @@
+/////////////////////////////////////////////////////////////////////
+// Created by [Dennis Andersen] [2013]
+/////////////////////////////////////////////////////////////////////
+#define NOMINMAX
+#include
+#include
+#include
+
+#include "GameServer.h"
+#include "Utilities.h"
+#include "ServerInitReader.h"
+#include
+#include
+#include "ServerObjects\ClientObject.h"
+
+namespace DanBias
+{
+ using namespace Oyster::Network;
+
+
+ void GameServer::ClientConnectCallback(NetworkClient& client)
+ {
+ printf("Client connected!\n");
+
+ Utility::DynamicMemory::SmartPointer c = new ClientObject(client);
+ this->mainLobby->AttachClient(c);
+ }
+ GameServer::GameServer()
+ : initiated(0)
+ , running(0)
+ , released(0)
+ , maxClients(0)
+ , mainLobby(0)
+ , server(0)
+ {
+ }
+ GameServer::~GameServer()
+ {
+
+ }
+ DanBiasServerReturn GameServer::Create()
+ {
+ this->server = new NetworkServer();
+ this->mainLobby = new MainLobby();
+
+ InitData data;
+ if(!LoadIniFile(data)) return DanBiasServerReturn_Error;
+
+ NetworkServer::INIT_DESC serverDesc;
+ this->maxClients = data.clients;
+ 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;
+
+ this->initiated = true;
+ return DanBiasServerReturn_Sucess;
+ }
+ DanBiasServerReturn GameServer::Run()
+ {
+ 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;
+
+ while (true)
+ {
+ if(!WindowShell::Frame()) break;
+
+ this->mainLobby->Frame();
+ }
+
+ return DanBiasServerReturn_Sucess;
+ }
+ DanBiasServerReturn GameServer::Release()
+ {
+ this->server->Shutdown();
+ delete this->server;
+ delete this->mainLobby;
+ this->released = true;
+ return DanBiasServerReturn_Sucess;
+ }
+
+ bool GameServer::LoadIniFile(InitData& ini)
+ {
+ std::ifstream in;
+ std::string f = GetInitPath(InitPath_ServerIni);
+ in.open(f, std::ios::in);
+ if(!in.is_open()) return false;
+
+ std::string buffer;
+ while (!in.eof())
+ {
+ in >> buffer;
+
+ if(buffer == "port")
+ {
+ in >> ini.port;
+ }
+ else if(buffer == "clients")
+ {
+ in >> ini.clients;
+ }
+
+ }
+
+ in.close();
+ return true;
+ }
+}//End namespace DanBias
diff --git a/Code/Game/DanBiasServer/GameServer.h b/Code/Game/DanBiasServer/GameServer.h
new file mode 100644
index 00000000..4045295f
--- /dev/null
+++ b/Code/Game/DanBiasServer/GameServer.h
@@ -0,0 +1,44 @@
+/////////////////////////////////////////////////////////////////////
+// Created by [Dennis Andersen] [2013]
+/////////////////////////////////////////////////////////////////////
+#ifndef DANBIASSERVER_GAME_SERVER_H
+#define DANBIASSERVER_GAME_SERVER_H
+
+#include "Include\DanBiasServerAPI.h"
+#include "ServerObjects\Lobby\MainLobby.h"
+#include
+#include
+
+namespace DanBias
+{
+ class GameServer :public Oyster::Network::ClientConnectedObject
+ {
+ public:
+ GameServer();
+ ~GameServer();
+
+ DanBiasServerReturn Create();
+ DanBiasServerReturn Run();
+ DanBiasServerReturn Release();
+
+ private:
+ //static void ClientConnectCallbackFunction(Oyster::Network::NetworkClient& connectedClient);
+ void ClientConnectCallback(Oyster::Network::NetworkClient& client) override;
+
+ bool initiated;
+ bool running;
+ bool released;
+ int maxClients;
+ MainLobby *mainLobby;
+ Oyster::Network::NetworkServer *server;
+
+ private:
+ struct InitData
+ {
+ int port;
+ int clients;
+ };
+ bool LoadIniFile(InitData&);
+ };
+}// End namspace DanBias
+#endif // !DANBIASSERVER_DBSERVER_H
diff --git a/Code/Game/DanBiasServer/IDanBiasServer.cpp b/Code/Game/DanBiasServer/Include/DanBiasServerAPI.cpp
similarity index 51%
rename from Code/Game/DanBiasServer/IDanBiasServer.cpp
rename to Code/Game/DanBiasServer/Include/DanBiasServerAPI.cpp
index bf0b52de..e897a6dd 100644
--- a/Code/Game/DanBiasServer/IDanBiasServer.cpp
+++ b/Code/Game/DanBiasServer/Include/DanBiasServerAPI.cpp
@@ -1,26 +1,26 @@
/////////////////////////////////////////////////////////////////////
// Created by [Dennis Andersen] [2013]
/////////////////////////////////////////////////////////////////////
-#include "Include\IDanBiasServer.h"
-#include "DBServer.h"
+#include "DanBiasServerAPI.h"
+#include "..\GameServer.h"
namespace DanBias
{
#pragma region Server Data
- static DBServer server;
+ static GameServer server;
#pragma endregion
- DanBiasServerReturn DanBiasServer::Initiate(DanBiasServerDesc& desc)
+ DanBiasServerReturn DanBiasServerAPI::Initiate()
{
- return server.Create(desc);
+ return server.Create();
}
- DanBiasServerReturn DanBiasServer::Run()
+ DanBiasServerReturn DanBiasServerAPI::Run()
{
return server.Run();
}
- DanBiasServerReturn DanBiasServer::Release()
+ DanBiasServerReturn DanBiasServerAPI::Release()
{
return server.Release();
}
diff --git a/Code/Game/DanBiasServer/Include/IDanBiasServer.h b/Code/Game/DanBiasServer/Include/DanBiasServerAPI.h
similarity index 64%
rename from Code/Game/DanBiasServer/Include/IDanBiasServer.h
rename to Code/Game/DanBiasServer/Include/DanBiasServerAPI.h
index 681ea348..1165ba48 100644
--- a/Code/Game/DanBiasServer/Include/IDanBiasServer.h
+++ b/Code/Game/DanBiasServer/Include/DanBiasServerAPI.h
@@ -4,8 +4,11 @@
#ifndef DANBIAS_SERVER_DANBIAS_SERVER_H
#define DANBIAS_SERVER_DANBIAS_SERVER_H
+#include
-#if defined (DANBIAS_SERVER_DLL_EXPORT)
+#define DANBIAS_SERVER
+
+#ifdef DANBIAS_SERVER_DLL_EXPORT
#define DANBIAS_SERVER_DLL __declspec(dllexport)
#else
#define DANBIAS_SERVER_DLL __declspec(dllimport)
@@ -13,28 +16,21 @@
namespace DanBias
{
+ enum DanBiasServerReturn
+ {
+ DanBiasServerReturn_Error,
+ DanBiasServerReturn_Sucess,
+ };
+
extern "C"
{
- enum DanBiasServerReturn
- {
- DanBiasServerReturn_Error,
- DanBiasServerReturn_Sucess,
- };
-
- struct DanBiasServerDesc
- {
- //Stuff goes here...
- int port;
- };
-
- class DANBIAS_SERVER_DLL DanBiasServer
+ class DANBIAS_SERVER_DLL DanBiasServerAPI
{
public:
- static DanBiasServerReturn Initiate(DanBiasServerDesc& desc);
+ static DanBiasServerReturn Initiate();
static DanBiasServerReturn Run();
static DanBiasServerReturn Release();
- };
-
+ };//End class DanBiasServer
}//End Extern "C"
} //End namspace DanBias
diff --git a/Code/Game/DanBiasServer/Include/ServerWrapper.h b/Code/Game/DanBiasServer/Include/ServerWrapper.h
deleted file mode 100644
index 29829c17..00000000
--- a/Code/Game/DanBiasServer/Include/ServerWrapper.h
+++ /dev/null
@@ -1,23 +0,0 @@
-#ifndef NETWORK_SERVER_WRAPPER_H
-#define NETWORK_SERVER_WRAPPER_H
-
-
-class SingletonServer
-{
-public:
-
- struct INIT_DESC
- {
- bool l;
- };
- void CreateServer(/*DATA*/);
- void StartServer(/*DATA*/);
- void StopServer(/*DATA*/);
- void TerminateServer(/*DATA*/);
-
- void AttachLobby(/*LOBBY*/);
- void DetachLobby(/*LOBBY*/);
- void KickClient(/*CLIENT*/);
-};
-
-#endif // !NETWORK_SERVER_WRAPPER_H
diff --git a/Code/Game/DanBiasServer/MainLobby.h b/Code/Game/DanBiasServer/MainLobby.h
deleted file mode 100644
index 5807ab9c..00000000
--- a/Code/Game/DanBiasServer/MainLobby.h
+++ /dev/null
@@ -1,17 +0,0 @@
-#ifndef DANBIASGAME_GAMELOBBY_H
-#define DANBIASGAME_GAMELOBBY_H
-
-#include "Include\ServerWrapper.h"
-
-class MainLobby :public SingletonServer
-{
-public:
- MainLobby();
- ~MainLobby();
-
-private:
-
-
-};
-
-#endif // !DANBIASGAME_GAMELOBBY_H
diff --git a/Code/Game/DanBiasServer/ServerInitReader.h b/Code/Game/DanBiasServer/ServerInitReader.h
new file mode 100644
index 00000000..cf7cc4c7
--- /dev/null
+++ b/Code/Game/DanBiasServer/ServerInitReader.h
@@ -0,0 +1,41 @@
+#ifndef DANBIASSERVER_SERVER_INIT_READER_H
+#define DANBIASSERVER_SERVER_INIT_READER_H
+
+#include
+#include
+
+namespace DanBias
+{
+ enum InitPath
+ {
+ InitPath_ServerIni,
+ };
+ std::string GetInitPath(InitPath file)
+ {
+ std::string type = "";
+ std::string path = "";
+ std::string flag = "";
+
+ switch (file)
+ {
+ case DanBias::InitPath_ServerIni:
+ flag = "ServerInit";
+ break;
+ }
+
+ std::fstream in;
+ in.open("..\\Settings\\serversearchpath.ini", std::ios::in);
+ if(!in.is_open()) return "";
+
+ while (!in.eof() && type != flag)
+ {
+ in >> type;
+ in >> path;
+ }
+
+ in.close();
+ return path;
+ }
+}
+
+#endif // !DANBIASSERVER_SERVER_INIT_READER_H
diff --git a/Code/Game/DanBiasServer/ServerObjects/ClientObject.cpp b/Code/Game/DanBiasServer/ServerObjects/ClientObject.cpp
new file mode 100644
index 00000000..907b68c8
--- /dev/null
+++ b/Code/Game/DanBiasServer/ServerObjects/ClientObject.cpp
@@ -0,0 +1,39 @@
+#include "ClientObject.h"
+
+using namespace DanBias;
+
+ClientObject::ClientObject(const Oyster::Network::NetworkClient& client)
+{
+ this->client = client;
+ this->client.SetRecieverObject(this, Oyster::Network::NetworkProtocolCallbackType_Object);
+ this->box = 0;
+}
+ClientObject::~ClientObject()
+{
+ this->client.Disconnect();
+}
+
+void ClientObject::SetPostbox(Oyster::PostBox* box)
+{
+ this->box = box;
+}
+GameLogic::Player* ClientObject::Logic_Object()
+{
+ return &this->logicPlayer;
+}
+Oyster::Network::NetworkClient* ClientObject::NetClient_Object()
+{
+ return &this->client;
+}
+
+void ClientObject::ProtocolRecievedCallback(Oyster::Network::CustomNetProtocol& protocol)
+{
+ if(!this->box) return;
+
+ NetworkSession::ClientEvent _event;
+ _event.protocol = protocol;
+ _event.reciever = this;
+
+ this->box->Post(_event);
+}
+
diff --git a/Code/Game/DanBiasServer/ServerObjects/ClientObject.h b/Code/Game/DanBiasServer/ServerObjects/ClientObject.h
new file mode 100644
index 00000000..83327d1b
--- /dev/null
+++ b/Code/Game/DanBiasServer/ServerObjects/ClientObject.h
@@ -0,0 +1,34 @@
+#ifndef DANBIASSERVER_CLIENT_OBJECT_H
+#define DANBIASSERVER_CLIENT_OBJECT_H
+
+
+#include "NetworkSession.h"
+#include "NetworkClient.h"
+#include
+#include
+
+namespace DanBias
+{
+ class ClientObject
+ :public Oyster::Network::ProtocolRecieverObject
+ {
+ public:
+ ClientObject(const Oyster::Network::NetworkClient& client);
+ ~ClientObject();
+
+ void SetPostbox(Oyster::PostBox* box);
+
+ GameLogic::Player* Logic_Object();
+ Oyster::Network::NetworkClient* NetClient_Object();
+
+ /** This method is NOT threadsafe. */
+ virtual void ProtocolRecievedCallback(Oyster::Network::CustomNetProtocol& protocol) override;
+
+ private:
+ GameLogic::Player logicPlayer;
+ Oyster::Network::NetworkClient client;
+ Oyster::IPostBox* box;
+ };
+
+}//End namespace DanBias
+#endif // !DANBIASSERVER_CLIENT_OBJECT_H
diff --git a/Code/Game/DanBiasServer/ServerObjects/GameSession.cpp b/Code/Game/DanBiasServer/ServerObjects/GameSession.cpp
new file mode 100644
index 00000000..fced4e45
--- /dev/null
+++ b/Code/Game/DanBiasServer/ServerObjects/GameSession.cpp
@@ -0,0 +1,9 @@
+
+
+
+
+namespace DanBias
+{
+
+
+}//End namespace DanBias
\ No newline at end of file
diff --git a/Code/Game/DanBiasServer/ServerObjects/GameSession.h b/Code/Game/DanBiasServer/ServerObjects/GameSession.h
new file mode 100644
index 00000000..26ad5ec2
--- /dev/null
+++ b/Code/Game/DanBiasServer/ServerObjects/GameSession.h
@@ -0,0 +1,19 @@
+#ifndef DANBIASSERVER_GAME_SESSION_H
+#define DANBIASSERVER_GAME_SESSION_H
+
+#include "NetworkSession.h"
+
+namespace DanBias
+{
+ class GameSession :public NetworkSession
+ {
+ public:
+ GameSession();
+ ~GameSession();
+
+ private:
+
+
+ };//End GameSession
+}//End namespace DanBias
+#endif // !DANBIASSERVER_GAME_SESSION_H
\ No newline at end of file
diff --git a/Code/Game/DanBiasServer/ServerObjects/Lobby/GameLobby.cpp b/Code/Game/DanBiasServer/ServerObjects/Lobby/GameLobby.cpp
new file mode 100644
index 00000000..06efcb96
--- /dev/null
+++ b/Code/Game/DanBiasServer/ServerObjects/Lobby/GameLobby.cpp
@@ -0,0 +1,18 @@
+#include "GameLobby.h"
+
+
+namespace DanBias
+{
+ GameLobby::GameLobby()
+ {
+
+ }
+ GameLobby::~GameLobby()
+ {
+
+ }
+ void GameLobby::Release()
+ {
+
+ }
+}//End namespace DanBias
\ No newline at end of file
diff --git a/Code/Game/DanBiasServer/ServerObjects/Lobby/GameLobby.h b/Code/Game/DanBiasServer/ServerObjects/Lobby/GameLobby.h
new file mode 100644
index 00000000..c4a0718c
--- /dev/null
+++ b/Code/Game/DanBiasServer/ServerObjects/Lobby/GameLobby.h
@@ -0,0 +1,21 @@
+#ifndef DANBIASSERVER_GAMELOBBY_H
+#define DANBIASSERVER_GAMELOBBY_H
+
+#include "..\NetworkSession.h"
+
+namespace DanBias
+{
+ class GameLobby :public NetworkSession
+ {
+ public:
+ GameLobby();
+ ~GameLobby();
+ void Release();
+
+ private:
+
+
+ };
+}//End namespace DanBias
+
+#endif // !DANBIASSERVER_GAME_LOBBY_H
\ No newline at end of file
diff --git a/Code/Game/DanBiasServer/ServerObjects/Lobby/MainLobby.cpp b/Code/Game/DanBiasServer/ServerObjects/Lobby/MainLobby.cpp
new file mode 100644
index 00000000..e7edddd4
--- /dev/null
+++ b/Code/Game/DanBiasServer/ServerObjects/Lobby/MainLobby.cpp
@@ -0,0 +1,43 @@
+#include "MainLobby.h"
+#include
+
+namespace DanBias
+{
+ MainLobby::MainLobby()
+ {
+
+ }
+ MainLobby::~MainLobby()
+ {
+
+ }
+ void MainLobby::Release()
+ {
+ this->DetachClient();
+ }
+
+ void MainLobby::Frame()
+ {
+ if(!this->box.IsEmpty())
+ {
+ NetEvent &e = this->box.Fetch();
+ ParseEvent(e);
+ }
+ }
+
+//////// Private
+ void MainLobby::ParseEvent(NetEvent& e)
+ {
+ static const short i = MAXSHORT;
+ if(e.protocol[0].type != Oyster::Network::NetAttributeType_Short) return;
+
+ short f = e.protocol[0].value.netShort;
+
+ switch (f)
+ {
+ default:
+ break;
+ }
+ }
+
+}//End namespace DanBias
\ No newline at end of file
diff --git a/Code/Game/DanBiasServer/ServerObjects/Lobby/MainLobby.h b/Code/Game/DanBiasServer/ServerObjects/Lobby/MainLobby.h
new file mode 100644
index 00000000..8e8b520a
--- /dev/null
+++ b/Code/Game/DanBiasServer/ServerObjects/Lobby/MainLobby.h
@@ -0,0 +1,22 @@
+#ifndef DANBIASSERVER_MAINLOBBY_H
+#define DANBIASSERVER_MAINLOBBY_H
+
+#include "..\NetworkSession.h"
+
+namespace DanBias
+{
+ class MainLobby :public NetworkSession
+ {
+ public:
+ MainLobby();
+ ~MainLobby();
+ void Release();
+
+ void Frame();
+
+ private:
+ void ParseEvent(NetEvent& e);
+
+ };
+}//End namespace DanBias
+#endif // !DANBIASGAME_GAMELOBBY_H
diff --git a/Code/Game/DanBiasServer/ServerObjects/NetworkSession.cpp b/Code/Game/DanBiasServer/ServerObjects/NetworkSession.cpp
new file mode 100644
index 00000000..c33af5e0
--- /dev/null
+++ b/Code/Game/DanBiasServer/ServerObjects/NetworkSession.cpp
@@ -0,0 +1,73 @@
+
+#include "ClientObject.h"
+#include "NetworkSession.h"
+#include
+
+namespace DanBias
+{
+ NetworkSession::NetworkSession()
+ {
+
+ }
+ NetworkSession::~NetworkSession()
+ {
+
+ }
+
+ void NetworkSession::AttachClient(Utility::DynamicMemory::SmartPointer client)
+ {
+ for (unsigned int i = 0; i < this->clients.size(); i++)
+ {
+ if(!this->clients[i])
+ {
+ this->clients[i] = client;
+ this->clients[i]->SetPostbox(&this->box);
+ return;
+ }
+ }
+ this->clients.push_back(client);
+ }
+
+ void NetworkSession::DetachClient(Oyster::Network::NetworkClient* client)
+ {
+ for (unsigned int i = 0; i < this->clients.size(); i++)
+ {
+ if(this->clients[0]->NetClient_Object()->Id() == client->Id())
+ this->clients[i] = 0;
+ }
+ }
+ void NetworkSession::DetachClient(ClientObject* client)
+ {
+ for (unsigned int i = 0; i < this->clients.size(); i++)
+ {
+ if(this->clients[0]->NetClient_Object()->Id() == client->NetClient_Object()->Id())
+ this->clients[i] = 0;
+ }
+
+ }
+ void NetworkSession::DetachClient(short ID)
+ {
+ for (unsigned int i = 0; i < this->clients.size(); i++)
+ {
+ if(this->clients[0]->NetClient_Object()->Id() == ID)
+ this->clients[i] = 0;
+ }
+
+ }
+ void NetworkSession::DetachClient()
+ {
+ for (unsigned int i = 0; i < this->clients.size(); i++)
+ {
+ this->clients[i] = 0;
+ }
+ }
+
+ void NetworkSession::Kick()
+ {
+ for (unsigned int i = 0; i < this->clients.size(); i++)
+ {
+ this->clients[i]->NetClient_Object()->Disconnect();
+ this->clients[i] = 0;
+ }
+ }
+}//End namespace DanBias
\ No newline at end of file
diff --git a/Code/Game/DanBiasServer/ServerObjects/NetworkSession.h b/Code/Game/DanBiasServer/ServerObjects/NetworkSession.h
new file mode 100644
index 00000000..9ff9b016
--- /dev/null
+++ b/Code/Game/DanBiasServer/ServerObjects/NetworkSession.h
@@ -0,0 +1,50 @@
+/////////////////////////////////////////////////////////////////////
+// Created by [Dennis Andersen] [2013]
+/////////////////////////////////////////////////////////////////////
+#ifndef DANBIASSERVER_NETWORK_SESSION_H
+#define DANBIASSERVER_NETWORK_SESSION_H
+
+#define NOMINMAX
+#include "Utilities.h"
+#include
+#include
+#include
+#include
+
+namespace DanBias
+{
+ class ClientObject;
+ class NetworkSession
+ {
+ public:
+ struct NetEvent
+ {
+ ClientObject* reciever;
+ Oyster::Network::CustomNetProtocol protocol;
+ };
+
+ public:
+ NetworkSession();
+ ~NetworkSession();
+
+ void AttachClient(Utility::DynamicMemory::SmartPointer client);
+
+ void DetachClient(Oyster::Network::NetworkClient* client);
+ void DetachClient(ClientObject* client);
+ void DetachClient(short ID);
+ void DetachClient();
+
+ void Kick();
+
+ void Send(Oyster::Network::CustomNetProtocol& protocol);
+ void Send(Oyster::Network::CustomNetProtocol& protocol, int ID);
+
+ //TODO: Do more lobby features
+ //virtual void
+
+ protected:
+ std::vector> clients;
+ Oyster::PostBox box;
+ };
+}//End namespace DanBias
+#endif // !DANBIASSERVER_NETWORK_SESSION_H
diff --git a/Code/Game/GameLogic/AttatchmentMassDriver.cpp b/Code/Game/GameLogic/AttatchmentMassDriver.cpp
index 18324149..b7687acb 100644
--- a/Code/Game/GameLogic/AttatchmentMassDriver.cpp
+++ b/Code/Game/GameLogic/AttatchmentMassDriver.cpp
@@ -1,4 +1,5 @@
#include "AttatchmentMassDriver.h"
+#include "PhysicsAPI.h"
using namespace GameLogic;
@@ -19,11 +20,20 @@ struct AttatchmentMassDriver::PrivateData
AttatchmentMassDriver::AttatchmentMassDriver(void)
{
+ myData = new PrivateData();
+ this->owner = 0;
+}
+
+AttatchmentMassDriver::AttatchmentMassDriver(Player &owner)
+{
+ myData = new PrivateData();
+ this->owner = &owner;
}
AttatchmentMassDriver::~AttatchmentMassDriver(void)
{
+ delete myData;
}
/********************************************************
@@ -31,15 +41,33 @@ AttatchmentMassDriver::~AttatchmentMassDriver(void)
********************************************************/
void AttatchmentMassDriver::UseAttatchment(const GameLogic::WEAPON_FIRE &fireInput)
{
- ForcePush(fireInput);
-}
-
-/********************************************************
-* This is a specific functionallity of the weapon
-********************************************************/
-void AttatchmentMassDriver::ForcePush(const GameLogic::WEAPON_FIRE &fireInput)
-{
+ //switch case to determin what functionallity to use in the attatchment
+ switch (fireInput)
+ {
+ case WEAPON_FIRE::WEAPON_USE_PRIMARY_PRESS:
+ ForcePush(fireInput);
+ break;
+ case WEAPON_FIRE::WEAPON_USE_SECONDARY_PRESS:
+ ForcePull(fireInput);
+ break;
+ }
}
+/********************************************************
+* Pushes objects in a cone in front of the weapon when fired
+********************************************************/
+void AttatchmentMassDriver::ForcePush(const GameLogic::WEAPON_FIRE &fireInput)
+{
+ //create coneRigidBody that will then collide with object and push them in the aimed direction
+}
+
+/********************************************************
+* Pulls the player in the direction he is looking, used for fast movement(kinda like a jetpack)
+********************************************************/
+void AttatchmentMassDriver::ForcePull(const WEAPON_FIRE &fireInput)
+{
+ Oyster::Physics::API::Instance().ApplyForceAt(owner->GetRigidBody(), owner->GetRigidBody()->GetCenter(), owner->GetLookDir() * 100);
+}
+
diff --git a/Code/Game/GameLogic/AttatchmentMassDriver.h b/Code/Game/GameLogic/AttatchmentMassDriver.h
index bc95c327..2fac7be4 100644
--- a/Code/Game/GameLogic/AttatchmentMassDriver.h
+++ b/Code/Game/GameLogic/AttatchmentMassDriver.h
@@ -1,3 +1,6 @@
+//////////////////////////////////////////////////
+//Created by Erik of the GameLogic team
+//////////////////////////////////////////////////
#ifndef ATTATCHMENTMASSDRIVER_H
#define ATTATCHMENTMASSDRIVER_H
#include "IAttatchment.h"
@@ -8,6 +11,7 @@ namespace GameLogic
{
public:
AttatchmentMassDriver(void);
+ AttatchmentMassDriver(Player &owner);
~AttatchmentMassDriver(void);
@@ -15,6 +19,7 @@ namespace GameLogic
private:
void ForcePush(const WEAPON_FIRE &fireInput);
+ void ForcePull(const WEAPON_FIRE &fireInput);
private:
struct PrivateData;
diff --git a/Code/Game/GameLogic/AttatchmentSocket.cpp b/Code/Game/GameLogic/AttatchmentSocket.cpp
index 86e0850b..288a1a4e 100644
--- a/Code/Game/GameLogic/AttatchmentSocket.cpp
+++ b/Code/Game/GameLogic/AttatchmentSocket.cpp
@@ -14,7 +14,7 @@ struct AttatchmentSocket::PrivateData
}
- IAttatchment *Attatchment;
+ IAttatchment *attatchment;
}myData;
@@ -30,5 +30,23 @@ AttatchmentSocket::~AttatchmentSocket(void)
IAttatchment* AttatchmentSocket::GetAttatchment()
{
- return myData->Attatchment;
+ return myData->attatchment;
+}
+
+void AttatchmentSocket::SetAttatchment(IAttatchment *attatchment)
+{
+ if (myData->attatchment)
+ {
+ delete myData->attatchment;
+ }
+
+ myData->attatchment = attatchment;
+}
+
+void AttatchmentSocket::RemoveAttatchment()
+{
+ if (myData->attatchment)
+ {
+ delete myData->attatchment;
+ }
}
diff --git a/Code/Game/GameLogic/AttatchmentSocket.h b/Code/Game/GameLogic/AttatchmentSocket.h
index 1067e339..2257dd7a 100644
--- a/Code/Game/GameLogic/AttatchmentSocket.h
+++ b/Code/Game/GameLogic/AttatchmentSocket.h
@@ -1,3 +1,7 @@
+//////////////////////////////////////////////////
+//Created by Erik of the GameLogic team
+//////////////////////////////////////////////////
+
#ifndef ATTATCHMENTSOCKET_H
#define ATTATCHMENTSOCKET_H
#include "IAttatchment.h"
@@ -11,6 +15,8 @@ namespace GameLogic
~AttatchmentSocket(void);
IAttatchment* GetAttatchment();
+ void SetAttatchment(IAttatchment *attatchment);
+ void RemoveAttatchment();
private:
struct PrivateData;
diff --git a/Code/Game/GameLogic/CollisionManager.cpp b/Code/Game/GameLogic/CollisionManager.cpp
index 52eaa4f3..3d1af2a1 100644
--- a/Code/Game/GameLogic/CollisionManager.cpp
+++ b/Code/Game/GameLogic/CollisionManager.cpp
@@ -1,4 +1,8 @@
#include "CollisionManager.h"
+#include "PhysicsAPI.h"
+#include "Object.h"
+#include "DynamicObject.h"
+#include "Player.h"
using namespace Oyster;
@@ -8,42 +12,44 @@ namespace GameLogic
namespace CollisionManager
{
+ void PlayerVBox(Player &player, DynamicObject &box);
+
+
Physics::ICustomBody::SubscriptMessage PlayerCollision(const Oyster::Physics::ICustomBody *rigidBodyPlayer, const Oyster::Physics::ICustomBody *obj)
{
- Player *player = ((Player*)GameLogic::RefManager::getInstance()->GetMap(*rigidBodyPlayer));
- Object *realObj = GameLogic::RefManager::getInstance()->GetMap(*obj);
+ Player *player = ((Player*)(rigidBodyPlayer->gameObjectRef));
+ Object *realObj = (Object*)obj->gameObjectRef;
switch (realObj->GetType())
{
- case Object::OBJECT_TYPE_BOX:
+ case OBJECT_TYPE_BOX:
PlayerVBox(*player,(*(DynamicObject*) realObj));
break;
- case Object::OBJECT_TYPE_PLAYER:
+ case OBJECT_TYPE_PLAYER:
break;
}
- //spela ljud? ta skada? etc etc
return Physics::ICustomBody::SubscriptMessage_none;
}
void PlayerVBox(Player &player, DynamicObject &box)
{
- //spela ljud? ta skada? etc etc
+ player.DamageLife(20);
}
Physics::ICustomBody::SubscriptMessage BoxCollision(const Oyster::Physics::ICustomBody *rigidBodyBox, const Oyster::Physics::ICustomBody *obj)
{
- DynamicObject *box = ((DynamicObject*)GameLogic::RefManager::getInstance()->GetMap(*rigidBodyBox));
- Object *realObj = GameLogic::RefManager::getInstance()->GetMap(*obj);
+ DynamicObject *box = (DynamicObject*)rigidBodyBox->gameObjectRef;
+ Object *realObj = (Object*)obj->gameObjectRef;
switch (realObj->GetType())
{
- case Object::OBJECT_TYPE_BOX:
+ case OBJECT_TYPE_BOX:
break;
- case Object::OBJECT_TYPE_PLAYER:
- PlayerVBox(*(Player*)realObj,*box);
+ case OBJECT_TYPE_PLAYER:
+ //PlayerVBox(*(Player*)realObj,*box);
break;
}
diff --git a/Code/Game/GameLogic/CollisionManager.h b/Code/Game/GameLogic/CollisionManager.h
index f88404cc..d19ce8e3 100644
--- a/Code/Game/GameLogic/CollisionManager.h
+++ b/Code/Game/GameLogic/CollisionManager.h
@@ -3,9 +3,6 @@
#include "Object.h"
#include "PhysicsAPI.h"
-#include "RefManager.h"
-#include "DynamicObject.h"
-#include "Player.h"
namespace GameLogic
{
@@ -18,8 +15,8 @@ namespace GameLogic
Oyster::Physics::ICustomBody::SubscriptMessage BoxCollision(const Oyster::Physics::ICustomBody *rigidBodyBox, const Oyster::Physics::ICustomBody *obj);
//these are the specific collision case functions
- void PlayerVBox(Player &player, DynamicObject &box);
- void BoxVBox(DynamicObject &box1, DynamicObject &box2);
+ //void PlayerVBox(Player &player, DynamicObject &box);
+ //void BoxVBox(DynamicObject &box1, DynamicObject &box2);
};
diff --git a/Code/Game/GameLogic/DynamicObject.cpp b/Code/Game/GameLogic/DynamicObject.cpp
index 8786255c..a8ea1ab4 100644
--- a/Code/Game/GameLogic/DynamicObject.cpp
+++ b/Code/Game/GameLogic/DynamicObject.cpp
@@ -1,29 +1,23 @@
#include "DynamicObject.h"
+#include "CollisionManager.h"
using namespace GameLogic;
-struct DynamicObject::PrivateData
-{
- PrivateData()
- {
-
- }
-
- ~PrivateData()
- {
-
- }
-
-}myData;
-
DynamicObject::DynamicObject()
+ :Object()
{
- myData = new PrivateData();
+
+}
+
+DynamicObject::DynamicObject(void* collisionFunc, OBJECT_TYPE type)
+ :Object(collisionFunc, type)
+{
+
}
DynamicObject::~DynamicObject(void)
{
- delete myData;
+
}
\ No newline at end of file
diff --git a/Code/Game/GameLogic/DynamicObject.h b/Code/Game/GameLogic/DynamicObject.h
index ecf1e905..70bb8c11 100644
--- a/Code/Game/GameLogic/DynamicObject.h
+++ b/Code/Game/GameLogic/DynamicObject.h
@@ -1,27 +1,24 @@
//////////////////////////////////////////////////
//Created by Erik and Linda of the GameLogic team
//////////////////////////////////////////////////
-
-
#ifndef DYNAMICOBJECT_H
#define DYNAMICOBJECT_H
+#include "Object.h"
namespace GameLogic
{
- class DynamicObject
+ class DynamicObject : public Object
{
public:
DynamicObject();
+ DynamicObject(void* collisionFunc, OBJECT_TYPE type);
~DynamicObject(void);
- void Update();
-
private:
- struct PrivateData;
- PrivateData *myData;
+
};
}
diff --git a/Code/Game/GameLogic/GameLogic.vcxproj b/Code/Game/GameLogic/GameLogic.vcxproj
index 03430feb..e0614e29 100644
--- a/Code/Game/GameLogic/GameLogic.vcxproj
+++ b/Code/Game/GameLogic/GameLogic.vcxproj
@@ -69,39 +69,39 @@
$(SolutionDir)..\Bin\DLL\
$(SolutionDir)..\Obj\$(ProjectName)\$(PlatformShortName)\$(Configuration)\
$(ProjectName)_$(PlatformShortName)D
- $(SolutionDir)..\External\Lib\Input;$(SolutionDir)..\Bin\DLL;$(LibraryPath)
+ $(SolutionDir)..\Bin\DLL;$(LibraryPath)
.dll
$(SolutionDir)..\Bin\DLL\
$(SolutionDir)..\Obj\$(ProjectName)\$(PlatformShortName)\$(Configuration)\
$(ProjectName)_$(PlatformShortName)
- $(SolutionDir)..\External\Lib\Input;$(SolutionDir)..\Bin\DLL;$(LibraryPath)
+ $(SolutionDir)..\Bin\DLL;$(LibraryPath)
$(SolutionDir)..\Bin\DLL\
$(SolutionDir)..\Obj\$(ProjectName)\$(PlatformShortName)\$(Configuration)\
$(ProjectName)_$(PlatformShortName)D
- $(SolutionDir)..\External\Lib\Input;$(SolutionDir)..\Bin\DLL;$(LibraryPath)
+ $(SolutionDir)..\Bin\DLL;$(LibraryPath)
$(SolutionDir)..\Bin\DLL\
$(SolutionDir)..\Obj\$(ProjectName)\$(PlatformShortName)\$(Configuration)\
$(ProjectName)_$(PlatformShortName)
- $(SolutionDir)..\External\Lib\Input;$(SolutionDir)..\Bin\DLL;$(LibraryPath)
+ $(SolutionDir)..\Bin\DLL;$(LibraryPath)
Level3
Disabled
true
- $(SolutionDir)Input;$(SolutionDir)OysterGraphics;$(SolutionDir)Misc;$(SolutionDir)OysterMath;$(SolutionDir)OysterPhysics3D;$(SolutionDir)GamePhysics;%(AdditionalIncludeDirectories)
- GAME_DLL_EXPORT;_WINDLL;%(PreprocessorDefinitions)
+ $(SolutionDir)Misc;$(SolutionDir)OysterMath;$(SolutionDir)OysterPhysics3D;$(SolutionDir)GamePhysics;%(AdditionalIncludeDirectories)
+ DANBIAS_GAMELOGIC_DLL_EXPORT;_WINDLL;%(PreprocessorDefinitions)
true
- OysterGraphics_$(PlatformShortName)D.lib;Input_$(PlatformShortName)D.lib;GamePhysics_$(PlatformShortName)D.lib;%(AdditionalDependencies)
- GamePhysics_$(PlatformShortName)D.dll
+ GamePhysics_$(PlatformShortName)D.lib;%(AdditionalDependencies)
+ GamePhysics_$(PlatformShortName)D.dll;%(DelayLoadDLLs)
@@ -109,12 +109,13 @@
Level3
Disabled
true
- $(SolutionDir)Input;$(SolutionDir)OysterGraphics;$(SolutionDir)Misc;$(SolutionDir)OysterMath;$(SolutionDir)OysterPhysics3D;$(SolutionDir)GamePhysics;%(AdditionalIncludeDirectories)
- GAME_DLL_EXPORT;_WINDLL;%(PreprocessorDefinitions)
+ $(SolutionDir)Misc;$(SolutionDir)OysterMath;$(SolutionDir)OysterPhysics3D;$(SolutionDir)GamePhysics;%(AdditionalIncludeDirectories)
+ DANBIAS_GAMELOGIC_DLL_EXPORT;_WINDLL;%(PreprocessorDefinitions)
true
- OysterGraphics_$(PlatformShortName)D.lib;Input_$(PlatformShortName)D.lib;GamePhysics_$(PlatformShortName)D.lib;%(AdditionalDependencies)
+ GamePhysics_$(PlatformShortName)D.lib;%(AdditionalDependencies)
+ GamePhysics_$(PlatformShortName)D.dll;%(DelayLoadDLLs)
@@ -124,14 +125,15 @@
true
true
true
- $(SolutionDir)Input;$(SolutionDir)OysterGraphics;$(SolutionDir)Misc;$(SolutionDir)OysterMath;$(SolutionDir)OysterPhysics3D;$(SolutionDir)GamePhysics;%(AdditionalIncludeDirectories)
- GAME_DLL_EXPORT;_WINDLL;%(PreprocessorDefinitions)
+ $(SolutionDir)Misc;$(SolutionDir)OysterMath;$(SolutionDir)OysterPhysics3D;$(SolutionDir)GamePhysics;%(AdditionalIncludeDirectories)
+ DANBIAS_GAMELOGIC_DLL_EXPORT;_WINDLL;%(PreprocessorDefinitions)
true
true
true
- OysterGraphics_$(PlatformShortName).lib;Input_$(PlatformShortName).lib;GamePhysics_$(PlatformShortName).lib;%(AdditionalDependencies)
+ GamePhysics_$(PlatformShortName).lib;%(AdditionalDependencies)
+ GamePhysics_$(PlatformShortName).dll;%(DelayLoadDLLs)
@@ -141,14 +143,15 @@
true
true
true
- $(SolutionDir)Input;$(SolutionDir)OysterGraphics;$(SolutionDir)Misc;$(SolutionDir)OysterMath;$(SolutionDir)OysterPhysics3D;$(SolutionDir)GamePhysics;%(AdditionalIncludeDirectories)
- GAME_DLL_EXPORT;_WINDLL;%(PreprocessorDefinitions)
+ $(SolutionDir)Misc;$(SolutionDir)OysterMath;$(SolutionDir)OysterPhysics3D;$(SolutionDir)GamePhysics;%(AdditionalIncludeDirectories)
+ DANBIAS_GAMELOGIC_DLL_EXPORT;_WINDLL;%(PreprocessorDefinitions)
true
true
true
- OysterGraphics_$(PlatformShortName).lib;Input_$(PlatformShortName).lib;GamePhysics_$(PlatformShortName).lib;%(AdditionalDependencies)
+ GamePhysics_$(PlatformShortName).lib;%(AdditionalDependencies)
+ GamePhysics_$(PlatformShortName).dll;%(DelayLoadDLLs)
@@ -168,22 +171,20 @@
-
+
-
-
@@ -191,7 +192,6 @@
-
diff --git a/Code/Game/GameLogic/GameLogicDef.h b/Code/Game/GameLogic/GameLogicDef.h
new file mode 100644
index 00000000..fa6a9a82
--- /dev/null
+++ b/Code/Game/GameLogic/GameLogicDef.h
@@ -0,0 +1,14 @@
+#ifndef GAMELOGIC_GAMELOGICDEF_H
+#define GAMELOGIC_GAMELOGICDEF_H
+
+#ifndef DANBIAS_GAMELOGIC
+ #define DANBIAS_GAMELOGIC
+#endif
+
+#ifdef DANBIAS_GAMELOGIC_DLL_EXPORT
+ #define DANBIAS_GAMELOGIC_DLL __declspec(dllexport)
+#else
+ #define DANBIAS_GAMELOGIC_DLL __declspec(dllimport)
+#endif
+
+#endif // !GAMELOGIC_GAMELOGICDEF_H
diff --git a/Code/Game/GameLogic/GameLogicStates.h b/Code/Game/GameLogic/GameLogicStates.h
index 3c2b9997..3e72647e 100644
--- a/Code/Game/GameLogic/GameLogicStates.h
+++ b/Code/Game/GameLogic/GameLogicStates.h
@@ -36,6 +36,13 @@ namespace GameLogic
WEAPON_STATE_IDLE = 1,
WEAPON_STATE_RELOADING = 2,
};
-}
+
+ enum OBJECT_TYPE
+ {
+ OBJECT_TYPE_PLAYER = 0,
+ OBJECT_TYPE_BOX = 1,
+ OBJECT_TYPE_UNKNOWN = 2,
+ };
+};
#endif
\ No newline at end of file
diff --git a/Code/Game/GameLogic/IAttatchment.cpp b/Code/Game/GameLogic/IAttatchment.cpp
index c1e2a997..4b0b1961 100644
--- a/Code/Game/GameLogic/IAttatchment.cpp
+++ b/Code/Game/GameLogic/IAttatchment.cpp
@@ -3,22 +3,6 @@
using namespace GameLogic;
-struct IAttatchment::PrivateData
-{
- PrivateData()
- {
-
- }
-
- ~PrivateData()
- {
-
- }
-
-
-
-}myData;
-
IAttatchment::IAttatchment(void)
{
}
diff --git a/Code/Game/GameLogic/IAttatchment.h b/Code/Game/GameLogic/IAttatchment.h
index c134026f..2192ffcf 100644
--- a/Code/Game/GameLogic/IAttatchment.h
+++ b/Code/Game/GameLogic/IAttatchment.h
@@ -1,6 +1,11 @@
+//////////////////////////////////////////////////
+//Created by Erik of the GameLogic team
+//////////////////////////////////////////////////
+
#ifndef IATTATCHMENT_H
#define IATTATCHMENT_H
#include "GameLogicStates.h"
+#include "Player.h"
namespace GameLogic
{
@@ -16,9 +21,10 @@ namespace GameLogic
virtual void UseAttatchment(const WEAPON_FIRE &fireInput) = 0;
- private:
- struct PrivateData;
- PrivateData *myData;
+ private:
+
+ protected:
+ Player *owner;
};
}
diff --git a/Code/Game/GameLogic/Level.cpp b/Code/Game/GameLogic/Level.cpp
index c83056c6..835062c1 100644
--- a/Code/Game/GameLogic/Level.cpp
+++ b/Code/Game/GameLogic/Level.cpp
@@ -2,6 +2,7 @@
#include "StaticObject.h"
#include "DynamicObject.h"
#include "GameMode.h"
+#include "Player.h"
using namespace GameLogic;
@@ -9,16 +10,14 @@ struct Level::PrivateData
{
PrivateData()
{
- gameMode = new GameMode();
+
}
~PrivateData()
{
- if (gameMode)
- {
- delete gameMode;
- }
}
+ Player *players;
+ int nrOfPlayers;
StaticObject** staticObjects;
int nrOfStaticObjects;
@@ -40,3 +39,10 @@ Level::~Level(void)
{
delete myData;
}
+
+void Level::InitiateLevel(std::string levelPath)
+{
+
+}
+
+
diff --git a/Code/Game/GameLogic/Level.h b/Code/Game/GameLogic/Level.h
index 217a60e4..7177531b 100644
--- a/Code/Game/GameLogic/Level.h
+++ b/Code/Game/GameLogic/Level.h
@@ -3,6 +3,7 @@
//////////////////////////////////////////////////
#ifndef LEVEL_H
#define LEVEL_H
+#include
namespace GameLogic
{
@@ -14,6 +15,8 @@ namespace GameLogic
Level(void);
~Level(void);
+ void InitiateLevel(std::string levelPath);
+
private:
struct PrivateData;
PrivateData *myData;
diff --git a/Code/Game/GameLogic/Object.cpp b/Code/Game/GameLogic/Object.cpp
index 67385874..dcd32bf1 100644
--- a/Code/Game/GameLogic/Object.cpp
+++ b/Code/Game/GameLogic/Object.cpp
@@ -1,48 +1,55 @@
#include "Object.h"
#include "OysterMath.h"
-#include "DllInterfaces\GFXAPI.h"
#include "CollisionManager.h"
using namespace GameLogic;
using namespace Oyster::Math;
-using namespace Oyster::Graphics::Model;
-
-using namespace Utility::DynamicMemory;
using namespace Oyster::Physics;
-Object::Object(std::wstring objFile)
-{
-
- //model = new Model();
- model = Oyster::Graphics::API::CreateModel(objFile);
-
+Object::Object()
+{
API::SimpleBodyDescription sbDesc;
//sbDesc.centerPosition =
//poi
ICustomBody* temp = rigidBody = API::Instance().CreateRigidBody(sbDesc).Release();
- GameLogic::RefManager::getInstance()->AddMapping(*rigidBody, *this);
+ rigidBody->gameObjectRef = this;
+ this->type = OBJECT_TYPE_UNKNOWN;
+
+}
+
+Object::Object(void* collisionFunc, OBJECT_TYPE type)
+{
+ API::SimpleBodyDescription sbDesc;
+ //sbDesc.centerPosition =
+
+ //poi
+ ICustomBody* temp = rigidBody = API::Instance().CreateRigidBody(sbDesc).Release();
+
+ rigidBody->SetSubscription((Oyster::Physics::ICustomBody::EventAction_Collision)(collisionFunc));
+
+ rigidBody->gameObjectRef = this;
+
+ this->type = type;
}
Object::~Object(void)
{
- Oyster::Graphics::API::DeleteModel(model);
}
-void Object::Render()
-{
- this->rigidBody->GetOrientation(model->WorldMatrix);
- Oyster::Graphics::API::RenderScene(model, 1);
-}
-
-Object::OBJECT_TYPE Object::GetType()
+OBJECT_TYPE Object::GetType()
{
return this->type;
}
+
+Oyster::Physics::ICustomBody* Object::GetRigidBody()
+{
+ return this->rigidBody;
+}
diff --git a/Code/Game/GameLogic/Object.h b/Code/Game/GameLogic/Object.h
index 1c1c2830..01864515 100644
--- a/Code/Game/GameLogic/Object.h
+++ b/Code/Game/GameLogic/Object.h
@@ -7,41 +7,27 @@
#define OBJECT_H
#include "PhysicsAPI.h"
-#include "DllInterfaces/GFXAPI.h"
-
-#include "Model/Model.h"
-#include "Utilities.h"
-
+#include "GameLogicStates.h"
+#include "GameLogicDef.h"
namespace GameLogic
{
- class Object
+ class DANBIAS_GAMELOGIC_DLL Object
{
public:
-
- enum OBJECT_TYPE
- {
- OBJECT_TYPE_PLAYER,
- OBJECT_TYPE_BOX,
- };
- Object(std::wstring objFile );
- virtual ~Object(void);
-
- void Render();
+ Object();
+ Object(void* collisionFunc, OBJECT_TYPE type);
+ ~Object(void);
OBJECT_TYPE GetType();
+ Oyster::Physics::ICustomBody* GetRigidBody();
+
private:
OBJECT_TYPE type;
-
protected:
- //either a model pointer or an ID to an arraypos filled with models that are to be rendered
- //rigidBody
-
Oyster::Physics::ICustomBody *rigidBody;
- Oyster::Graphics::Model::Model *model;
-
};
}
diff --git a/Code/Game/GameLogic/Player.cpp b/Code/Game/GameLogic/Player.cpp
index 9bc9d752..bae54e9a 100644
--- a/Code/Game/GameLogic/Player.cpp
+++ b/Code/Game/GameLogic/Player.cpp
@@ -15,8 +15,7 @@ struct Player::PrivateData
life = 100;
playerState = PLAYER_STATE_IDLE;
- rigidBody->SetSubscription(CollisionManager::PlayerCollision);
-
+ lookDir = Oyster::Math::Float3(1,0,0);
}
~PrivateData()
@@ -30,16 +29,16 @@ struct Player::PrivateData
int life;
Weapon *weapon;
PLAYER_STATE playerState;
-
- ICustomBody *rigidBody;
+ Oyster::Math::Float3 lookDir;
}myData;
Player::Player()
+ :Object(CollisionManager::PlayerCollision, OBJECT_TYPE_PLAYER)
{
myData = new PrivateData();
-
}
+
Player::~Player(void)
{
delete myData;
@@ -61,12 +60,16 @@ void Player::Update()
********************************************************/
void Player::Move(const PLAYER_MOVEMENT &movement)
{
+ Oyster::Math::Float3 currentVelocity = rigidBody->GetRigidLinearVelocity();
+
switch(movement)
{
case PLAYER_MOVEMENT_FORWARD:
+ API::Instance().ApplyForceAt(rigidBody,rigidBody->GetCenter(),myData->lookDir * 100);
break;
case PLAYER_MOVEMENT_BACKWARD:
+ API::Instance().ApplyForceAt(rigidBody,rigidBody->GetCenter(),-myData->lookDir * 100);
break;
case PLAYER_MOVEMENT_LEFT:
@@ -83,9 +86,9 @@ void Player::Move(const PLAYER_MOVEMENT &movement)
/********************************************************
* Uses the players weapon based on user input
********************************************************/
-void Player::Shoot(const WEAPON_FIRE &fireInput)
+void Player::UseWeapon(const WEAPON_FIRE &fireInput)
{
- myData->weapon->UseWeapon(fireInput);
+ myData->weapon->Use(fireInput);
}
/********************************************************
@@ -94,7 +97,7 @@ void Player::Shoot(const WEAPON_FIRE &fireInput)
********************************************************/
void Player::Jump()
{
-
+ API::Instance().ApplyForceAt(rigidBody,rigidBody->GetCenter(),-Oyster::Math::Float3(0,1,0) * 100);
}
bool Player::IsWalking()
@@ -112,7 +115,12 @@ bool Player::IsIdle()
Oyster::Math::Float3 Player::GetPos()
{
- return myData->rigidBody->GetCenter();
+ return rigidBody->GetCenter();
+}
+
+Oyster::Math::Float3 Player::GetLookDir()
+{
+ return myData->lookDir;
}
/********************************************************
@@ -123,3 +131,9 @@ void Player::Respawn()
{
}
+
+
+void Player::DamageLife(int damage)
+{
+ myData->life -= damage;
+}
\ No newline at end of file
diff --git a/Code/Game/GameLogic/Player.h b/Code/Game/GameLogic/Player.h
index 20fc8de6..af0bff50 100644
--- a/Code/Game/GameLogic/Player.h
+++ b/Code/Game/GameLogic/Player.h
@@ -5,10 +5,12 @@
#define PLAYER_H
#include "GameLogicStates.h"
#include "OysterMath.h"
+#include "Object.h"
+#include "GameLogicDef.h"
namespace GameLogic
{
- class Player
+ class DANBIAS_GAMELOGIC_DLL Player : public Object
{
public:
@@ -17,7 +19,7 @@ namespace GameLogic
void Update();
void Move(const PLAYER_MOVEMENT &movement);
- void Shoot(const WEAPON_FIRE &fireInput);
+ void UseWeapon(const WEAPON_FIRE &fireInput);
void Jump();
bool IsWalking();
@@ -25,8 +27,12 @@ namespace GameLogic
bool IsIdle();
Oyster::Math::Float3 GetPos();
+ Oyster::Math::Float3 GetLookDir();
+
void Respawn();
+ void DamageLife(int damage);
+
private:
struct PrivateData;
PrivateData *myData;
diff --git a/Code/Game/GameLogic/RefManager.h b/Code/Game/GameLogic/RefManager.h
index a184e220..fa4080c9 100644
--- a/Code/Game/GameLogic/RefManager.h
+++ b/Code/Game/GameLogic/RefManager.h
@@ -8,7 +8,6 @@
#include