GameServer - Fixed bugg where threads touched same data, n players should now be able to connect

This commit is contained in:
Dennis Andersen 2014-02-04 16:07:10 +01:00
parent 61178e2803
commit de8c76f051
39 changed files with 1062 additions and 278 deletions

View File

@ -23,13 +23,27 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "OysterNetworkServer", "Netw
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "NetworkDependencies", "Network\NetworkDependencies\NetworkDependencies.vcxproj", "{C5AA09D0-6594-4CD3-BD92-1D380C7B3B50}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GameLogic", "GameLogic\GameLogic.vcxproj", "{B1195BB9-B3A5-47F0-906C-8DEA384D1520}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GamePhysics", "GamePhysics\GamePhysics.vcxproj", "{104FA3E9-94D9-4E1D-A941-28A03BC8A095}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Tester", "Tester\Tester.vcxproj", "{1B3BEA4C-CF75-438A-9693-60FB8444BBF3}"
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DanBiasGame", "Game\DanBiasGame\DanBiasGame.vcxproj", "{2A1BC987-AF42-4500-802D-89CD32FC1309}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DanBiasGame", "DanBiasGame\DanBiasGame.vcxproj", "{2A1BC987-AF42-4500-802D-89CD32FC1309}"
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Game", "Game", "{20720CA7-795C-45AD-A302-9383A6DD503A}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GameLogic", "Game\GameLogic\GameLogic.vcxproj", "{B1195BB9-B3A5-47F0-906C-8DEA384D1520}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DanBiasLauncher", "Game\DanBiasLauncher\DanBiasLauncher.vcxproj", "{8690FDDF-C5B7-4C42-A337-BD5243F29B85}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "NetworkAPI", "Network\NetworkAPI\NetworkAPI.vcxproj", "{460D625F-2AC9-4559-B809-0BA89CEAEDF4}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GameProtocols", "Game\GameProtocols\GameProtocols.vcxproj", "{DA2AA800-ED64-4649-8B3B-E7F1E3968B78}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DanBiasServerLauncher", "Game\DanBiasServerLauncher\DanBiasServerLauncher.vcxproj", "{060B1890-CBF3-4808-BA99-A4776222093B}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Physics lab", "Physics lab\Physics lab.vcxproj", "{5128BD77-6472-4C4A-BE6F-724AD0E589C2}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GameServer", "Game\GameServer\GameServer.vcxproj", "{143BD516-20A1-4890-A3E4-F8BFD02220E7}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "aDanBiasGameLauncher", "Game\aDanBiasGameLauncher\aDanBiasGameLauncher.vcxproj", "{666FEA52-975F-41CD-B224-B19AF3C0ABBA}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@ -41,26 +55,26 @@ Global
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{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|Mixed Platforms.ActiveCfg = Debug|Win32
{0EC83E64-230E-48EF-B08C-6AC9651B4F82}.Debug|Mixed Platforms.Build.0 = Debug|Win32
{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 = Release|x64
{0EC83E64-230E-48EF-B08C-6AC9651B4F82}.Debug|x64.Build.0 = Release|x64
{0EC83E64-230E-48EF-B08C-6AC9651B4F82}.Release|Mixed Platforms.ActiveCfg = Release|x64
{0EC83E64-230E-48EF-B08C-6AC9651B4F82}.Release|Mixed Platforms.Build.0 = Release|x64
{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|Win32
{0EC83E64-230E-48EF-B08C-6AC9651B4F82}.Release|Mixed Platforms.Build.0 = Release|Win32
{0EC83E64-230E-48EF-B08C-6AC9651B4F82}.Release|Win32.ActiveCfg = Release|Win32
{0EC83E64-230E-48EF-B08C-6AC9651B4F82}.Release|Win32.Build.0 = Release|Win32
{0EC83E64-230E-48EF-B08C-6AC9651B4F82}.Release|x64.ActiveCfg = Release|x64
{0EC83E64-230E-48EF-B08C-6AC9651B4F82}.Release|x64.Build.0 = Release|x64
{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|Mixed Platforms.ActiveCfg = Debug|Win32
{F10CBC03-9809-4CBA-95D8-327C287B18EE}.Debug|Mixed Platforms.Build.0 = Debug|Win32
{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 = Release|x64
{F10CBC03-9809-4CBA-95D8-327C287B18EE}.Debug|x64.Build.0 = Release|x64
{F10CBC03-9809-4CBA-95D8-327C287B18EE}.Release|Mixed Platforms.ActiveCfg = Release|x64
{F10CBC03-9809-4CBA-95D8-327C287B18EE}.Release|Mixed Platforms.Build.0 = Release|x64
{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|Win32
{F10CBC03-9809-4CBA-95D8-327C287B18EE}.Release|Mixed Platforms.Build.0 = Release|Win32
{F10CBC03-9809-4CBA-95D8-327C287B18EE}.Release|Win32.ActiveCfg = Release|Win32
{F10CBC03-9809-4CBA-95D8-327C287B18EE}.Release|Win32.Build.0 = Release|Win32
{F10CBC03-9809-4CBA-95D8-327C287B18EE}.Release|x64.ActiveCfg = Release|x64
@ -113,65 +127,54 @@ Global
{7E3990D2-3D94-465C-B58D-64A74B3ECF9B}.Release|Win32.Build.0 = Release|Win32
{7E3990D2-3D94-465C-B58D-64A74B3ECF9B}.Release|x64.ActiveCfg = Release|x64
{7E3990D2-3D94-465C-B58D-64A74B3ECF9B}.Release|x64.Build.0 = Release|x64
{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|Mixed Platforms.ActiveCfg = Debug|Win32
{2EC4DDED-8F75-4C86-A10B-E1E8EB29F3EE}.Debug|Mixed Platforms.Build.0 = Debug|Win32
{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 = Release|x64
{2EC4DDED-8F75-4C86-A10B-E1E8EB29F3EE}.Debug|x64.Build.0 = Release|x64
{2EC4DDED-8F75-4C86-A10B-E1E8EB29F3EE}.Release|Mixed Platforms.ActiveCfg = Release|x64
{2EC4DDED-8F75-4C86-A10B-E1E8EB29F3EE}.Release|Mixed Platforms.Build.0 = Release|x64
{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|Win32
{2EC4DDED-8F75-4C86-A10B-E1E8EB29F3EE}.Release|Mixed Platforms.Build.0 = Release|Win32
{2EC4DDED-8F75-4C86-A10B-E1E8EB29F3EE}.Release|Win32.ActiveCfg = Release|Win32
{2EC4DDED-8F75-4C86-A10B-E1E8EB29F3EE}.Release|Win32.Build.0 = Release|Win32
{2EC4DDED-8F75-4C86-A10B-E1E8EB29F3EE}.Release|x64.ActiveCfg = Release|x64
{2EC4DDED-8F75-4C86-A10B-E1E8EB29F3EE}.Release|x64.Build.0 = Release|x64
{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|Mixed Platforms.ActiveCfg = Debug|Win32
{838B25C2-D19E-49FE-8CB0-9A977CA3C7E8}.Debug|Mixed Platforms.Build.0 = Debug|Win32
{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 = Release|x64
{838B25C2-D19E-49FE-8CB0-9A977CA3C7E8}.Debug|x64.Build.0 = Release|x64
{838B25C2-D19E-49FE-8CB0-9A977CA3C7E8}.Release|Mixed Platforms.ActiveCfg = Release|x64
{838B25C2-D19E-49FE-8CB0-9A977CA3C7E8}.Release|Mixed Platforms.Build.0 = Release|x64
{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|Win32
{838B25C2-D19E-49FE-8CB0-9A977CA3C7E8}.Release|Mixed Platforms.Build.0 = Release|Win32
{838B25C2-D19E-49FE-8CB0-9A977CA3C7E8}.Release|Win32.ActiveCfg = Release|Win32
{838B25C2-D19E-49FE-8CB0-9A977CA3C7E8}.Release|Win32.Build.0 = Release|Win32
{838B25C2-D19E-49FE-8CB0-9A977CA3C7E8}.Release|x64.ActiveCfg = Release|x64
{838B25C2-D19E-49FE-8CB0-9A977CA3C7E8}.Release|x64.Build.0 = Release|x64
{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|Mixed Platforms.ActiveCfg = Debug|Win32
{6A066806-F43F-4B31-A4E3-57179674F460}.Debug|Mixed Platforms.Build.0 = Debug|Win32
{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 = Release|x64
{6A066806-F43F-4B31-A4E3-57179674F460}.Debug|x64.Build.0 = Release|x64
{6A066806-F43F-4B31-A4E3-57179674F460}.Release|Mixed Platforms.ActiveCfg = Release|x64
{6A066806-F43F-4B31-A4E3-57179674F460}.Release|Mixed Platforms.Build.0 = Release|x64
{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|Win32
{6A066806-F43F-4B31-A4E3-57179674F460}.Release|Mixed Platforms.Build.0 = Release|Win32
{6A066806-F43F-4B31-A4E3-57179674F460}.Release|Win32.ActiveCfg = Release|Win32
{6A066806-F43F-4B31-A4E3-57179674F460}.Release|Win32.Build.0 = Release|Win32
{6A066806-F43F-4B31-A4E3-57179674F460}.Release|x64.ActiveCfg = Release|x64
{6A066806-F43F-4B31-A4E3-57179674F460}.Release|x64.Build.0 = Release|x64
{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|Mixed Platforms.ActiveCfg = Debug|Win32
{C5AA09D0-6594-4CD3-BD92-1D380C7B3B50}.Debug|Mixed Platforms.Build.0 = Debug|Win32
{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 = Release|x64
{C5AA09D0-6594-4CD3-BD92-1D380C7B3B50}.Debug|x64.Build.0 = Release|x64
{C5AA09D0-6594-4CD3-BD92-1D380C7B3B50}.Release|Mixed Platforms.ActiveCfg = Release|x64
{C5AA09D0-6594-4CD3-BD92-1D380C7B3B50}.Release|Mixed Platforms.Build.0 = Release|x64
{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|Win32
{C5AA09D0-6594-4CD3-BD92-1D380C7B3B50}.Release|Mixed Platforms.Build.0 = Release|Win32
{C5AA09D0-6594-4CD3-BD92-1D380C7B3B50}.Release|Win32.ActiveCfg = Release|Win32
{C5AA09D0-6594-4CD3-BD92-1D380C7B3B50}.Release|Win32.Build.0 = Release|Win32
{C5AA09D0-6594-4CD3-BD92-1D380C7B3B50}.Release|x64.ActiveCfg = Release|x64
{C5AA09D0-6594-4CD3-BD92-1D380C7B3B50}.Release|x64.Build.0 = Release|x64
{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
{B1195BB9-B3A5-47F0-906C-8DEA384D1520}.Release|Mixed Platforms.Build.0 = Release|Win32
{B1195BB9-B3A5-47F0-906C-8DEA384D1520}.Release|Win32.ActiveCfg = Release|Win32
{B1195BB9-B3A5-47F0-906C-8DEA384D1520}.Release|Win32.Build.0 = Release|Win32
{B1195BB9-B3A5-47F0-906C-8DEA384D1520}.Release|x64.ActiveCfg = Release|Win32
{104FA3E9-94D9-4E1D-A941-28A03BC8A095}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
{104FA3E9-94D9-4E1D-A941-28A03BC8A095}.Debug|Mixed Platforms.Build.0 = Debug|Win32
{104FA3E9-94D9-4E1D-A941-28A03BC8A095}.Debug|Win32.ActiveCfg = Debug|Win32
@ -182,19 +185,8 @@ Global
{104FA3E9-94D9-4E1D-A941-28A03BC8A095}.Release|Mixed Platforms.Build.0 = Release|Win32
{104FA3E9-94D9-4E1D-A941-28A03BC8A095}.Release|Win32.ActiveCfg = Release|Win32
{104FA3E9-94D9-4E1D-A941-28A03BC8A095}.Release|Win32.Build.0 = Release|Win32
{104FA3E9-94D9-4E1D-A941-28A03BC8A095}.Release|x64.ActiveCfg = Release|Win32
{1B3BEA4C-CF75-438A-9693-60FB8444BBF3}.Debug|Mixed Platforms.ActiveCfg = Release|Win32
{1B3BEA4C-CF75-438A-9693-60FB8444BBF3}.Debug|Mixed Platforms.Build.0 = 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 = Release|Win32
{1B3BEA4C-CF75-438A-9693-60FB8444BBF3}.Debug|x64.Build.0 = Release|Win32
{1B3BEA4C-CF75-438A-9693-60FB8444BBF3}.Release|Mixed Platforms.ActiveCfg = Release|Win32
{1B3BEA4C-CF75-438A-9693-60FB8444BBF3}.Release|Mixed Platforms.Build.0 = Release|Win32
{1B3BEA4C-CF75-438A-9693-60FB8444BBF3}.Release|Win32.ActiveCfg = Release|Win32
{1B3BEA4C-CF75-438A-9693-60FB8444BBF3}.Release|Win32.Build.0 = Release|Win32
{1B3BEA4C-CF75-438A-9693-60FB8444BBF3}.Release|x64.ActiveCfg = Release|Win32
{1B3BEA4C-CF75-438A-9693-60FB8444BBF3}.Release|x64.Build.0 = Release|Win32
{104FA3E9-94D9-4E1D-A941-28A03BC8A095}.Release|x64.ActiveCfg = Release|x64
{104FA3E9-94D9-4E1D-A941-28A03BC8A095}.Release|x64.Build.0 = Release|x64
{2A1BC987-AF42-4500-802D-89CD32FC1309}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
{2A1BC987-AF42-4500-802D-89CD32FC1309}.Debug|Mixed Platforms.Build.0 = Debug|Win32
{2A1BC987-AF42-4500-802D-89CD32FC1309}.Debug|Win32.ActiveCfg = Debug|Win32
@ -207,6 +199,102 @@ Global
{2A1BC987-AF42-4500-802D-89CD32FC1309}.Release|Win32.Build.0 = Release|Win32
{2A1BC987-AF42-4500-802D-89CD32FC1309}.Release|x64.ActiveCfg = Release|x64
{2A1BC987-AF42-4500-802D-89CD32FC1309}.Release|x64.Build.0 = Release|x64
{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
{B1195BB9-B3A5-47F0-906C-8DEA384D1520}.Release|Mixed Platforms.Build.0 = Release|Win32
{B1195BB9-B3A5-47F0-906C-8DEA384D1520}.Release|Win32.ActiveCfg = Release|Win32
{B1195BB9-B3A5-47F0-906C-8DEA384D1520}.Release|Win32.Build.0 = Release|Win32
{B1195BB9-B3A5-47F0-906C-8DEA384D1520}.Release|x64.ActiveCfg = Release|x64
{B1195BB9-B3A5-47F0-906C-8DEA384D1520}.Release|x64.Build.0 = Release|x64
{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
{8690FDDF-C5B7-4C42-A337-BD5243F29B85}.Release|Mixed Platforms.Build.0 = Release|Win32
{8690FDDF-C5B7-4C42-A337-BD5243F29B85}.Release|Win32.ActiveCfg = Release|Win32
{8690FDDF-C5B7-4C42-A337-BD5243F29B85}.Release|Win32.Build.0 = Release|Win32
{8690FDDF-C5B7-4C42-A337-BD5243F29B85}.Release|x64.ActiveCfg = Release|x64
{8690FDDF-C5B7-4C42-A337-BD5243F29B85}.Release|x64.Build.0 = Release|x64
{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
{460D625F-2AC9-4559-B809-0BA89CEAEDF4}.Release|Mixed Platforms.Build.0 = Release|Win32
{460D625F-2AC9-4559-B809-0BA89CEAEDF4}.Release|Win32.ActiveCfg = Release|Win32
{460D625F-2AC9-4559-B809-0BA89CEAEDF4}.Release|Win32.Build.0 = Release|Win32
{460D625F-2AC9-4559-B809-0BA89CEAEDF4}.Release|x64.ActiveCfg = Release|x64
{460D625F-2AC9-4559-B809-0BA89CEAEDF4}.Release|x64.Build.0 = Release|x64
{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
{DA2AA800-ED64-4649-8B3B-E7F1E3968B78}.Release|Mixed Platforms.Build.0 = Release|Win32
{DA2AA800-ED64-4649-8B3B-E7F1E3968B78}.Release|Win32.ActiveCfg = Release|Win32
{DA2AA800-ED64-4649-8B3B-E7F1E3968B78}.Release|Win32.Build.0 = Release|Win32
{DA2AA800-ED64-4649-8B3B-E7F1E3968B78}.Release|x64.ActiveCfg = Release|x64
{DA2AA800-ED64-4649-8B3B-E7F1E3968B78}.Release|x64.Build.0 = Release|x64
{060B1890-CBF3-4808-BA99-A4776222093B}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
{060B1890-CBF3-4808-BA99-A4776222093B}.Debug|Mixed Platforms.Build.0 = Debug|Win32
{060B1890-CBF3-4808-BA99-A4776222093B}.Debug|Win32.ActiveCfg = Debug|Win32
{060B1890-CBF3-4808-BA99-A4776222093B}.Debug|Win32.Build.0 = Debug|Win32
{060B1890-CBF3-4808-BA99-A4776222093B}.Debug|x64.ActiveCfg = Debug|x64
{060B1890-CBF3-4808-BA99-A4776222093B}.Debug|x64.Build.0 = Debug|x64
{060B1890-CBF3-4808-BA99-A4776222093B}.Release|Mixed Platforms.ActiveCfg = Release|Win32
{060B1890-CBF3-4808-BA99-A4776222093B}.Release|Mixed Platforms.Build.0 = Release|Win32
{060B1890-CBF3-4808-BA99-A4776222093B}.Release|Win32.ActiveCfg = Release|Win32
{060B1890-CBF3-4808-BA99-A4776222093B}.Release|Win32.Build.0 = Release|Win32
{060B1890-CBF3-4808-BA99-A4776222093B}.Release|x64.ActiveCfg = Release|x64
{060B1890-CBF3-4808-BA99-A4776222093B}.Release|x64.Build.0 = Release|x64
{5128BD77-6472-4C4A-BE6F-724AD0E589C2}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
{5128BD77-6472-4C4A-BE6F-724AD0E589C2}.Debug|Mixed Platforms.Build.0 = Debug|Win32
{5128BD77-6472-4C4A-BE6F-724AD0E589C2}.Debug|Win32.ActiveCfg = Debug|Win32
{5128BD77-6472-4C4A-BE6F-724AD0E589C2}.Debug|Win32.Build.0 = Debug|Win32
{5128BD77-6472-4C4A-BE6F-724AD0E589C2}.Debug|x64.ActiveCfg = Debug|x64
{5128BD77-6472-4C4A-BE6F-724AD0E589C2}.Debug|x64.Build.0 = Debug|x64
{5128BD77-6472-4C4A-BE6F-724AD0E589C2}.Release|Mixed Platforms.ActiveCfg = Release|Win32
{5128BD77-6472-4C4A-BE6F-724AD0E589C2}.Release|Mixed Platforms.Build.0 = Release|Win32
{5128BD77-6472-4C4A-BE6F-724AD0E589C2}.Release|Win32.ActiveCfg = Release|Win32
{5128BD77-6472-4C4A-BE6F-724AD0E589C2}.Release|Win32.Build.0 = Release|Win32
{5128BD77-6472-4C4A-BE6F-724AD0E589C2}.Release|x64.ActiveCfg = Release|x64
{5128BD77-6472-4C4A-BE6F-724AD0E589C2}.Release|x64.Build.0 = Release|x64
{143BD516-20A1-4890-A3E4-F8BFD02220E7}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
{143BD516-20A1-4890-A3E4-F8BFD02220E7}.Debug|Mixed Platforms.Build.0 = Debug|Win32
{143BD516-20A1-4890-A3E4-F8BFD02220E7}.Debug|Win32.ActiveCfg = Debug|Win32
{143BD516-20A1-4890-A3E4-F8BFD02220E7}.Debug|Win32.Build.0 = Debug|Win32
{143BD516-20A1-4890-A3E4-F8BFD02220E7}.Debug|x64.ActiveCfg = Debug|x64
{143BD516-20A1-4890-A3E4-F8BFD02220E7}.Debug|x64.Build.0 = Debug|x64
{143BD516-20A1-4890-A3E4-F8BFD02220E7}.Release|Mixed Platforms.ActiveCfg = Release|Win32
{143BD516-20A1-4890-A3E4-F8BFD02220E7}.Release|Mixed Platforms.Build.0 = Release|Win32
{143BD516-20A1-4890-A3E4-F8BFD02220E7}.Release|Win32.ActiveCfg = Release|Win32
{143BD516-20A1-4890-A3E4-F8BFD02220E7}.Release|Win32.Build.0 = Release|Win32
{143BD516-20A1-4890-A3E4-F8BFD02220E7}.Release|x64.ActiveCfg = Release|x64
{143BD516-20A1-4890-A3E4-F8BFD02220E7}.Release|x64.Build.0 = Release|x64
{666FEA52-975F-41CD-B224-B19AF3C0ABBA}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
{666FEA52-975F-41CD-B224-B19AF3C0ABBA}.Debug|Mixed Platforms.Build.0 = Debug|Win32
{666FEA52-975F-41CD-B224-B19AF3C0ABBA}.Debug|Win32.ActiveCfg = Debug|Win32
{666FEA52-975F-41CD-B224-B19AF3C0ABBA}.Debug|Win32.Build.0 = Debug|Win32
{666FEA52-975F-41CD-B224-B19AF3C0ABBA}.Debug|x64.ActiveCfg = Debug|x64
{666FEA52-975F-41CD-B224-B19AF3C0ABBA}.Debug|x64.Build.0 = Debug|x64
{666FEA52-975F-41CD-B224-B19AF3C0ABBA}.Release|Mixed Platforms.ActiveCfg = Release|Win32
{666FEA52-975F-41CD-B224-B19AF3C0ABBA}.Release|Mixed Platforms.Build.0 = Release|Win32
{666FEA52-975F-41CD-B224-B19AF3C0ABBA}.Release|Win32.ActiveCfg = Release|Win32
{666FEA52-975F-41CD-B224-B19AF3C0ABBA}.Release|Win32.Build.0 = Release|Win32
{666FEA52-975F-41CD-B224-B19AF3C0ABBA}.Release|x64.ActiveCfg = Release|x64
{666FEA52-975F-41CD-B224-B19AF3C0ABBA}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@ -215,5 +303,13 @@ Global
{838B25C2-D19E-49FE-8CB0-9A977CA3C7E8} = {C27B926E-B3EF-4990-8822-47580E43A0BE}
{6A066806-F43F-4B31-A4E3-57179674F460} = {C27B926E-B3EF-4990-8822-47580E43A0BE}
{C5AA09D0-6594-4CD3-BD92-1D380C7B3B50} = {C27B926E-B3EF-4990-8822-47580E43A0BE}
{460D625F-2AC9-4559-B809-0BA89CEAEDF4} = {C27B926E-B3EF-4990-8822-47580E43A0BE}
{2A1BC987-AF42-4500-802D-89CD32FC1309} = {20720CA7-795C-45AD-A302-9383A6DD503A}
{B1195BB9-B3A5-47F0-906C-8DEA384D1520} = {20720CA7-795C-45AD-A302-9383A6DD503A}
{8690FDDF-C5B7-4C42-A337-BD5243F29B85} = {20720CA7-795C-45AD-A302-9383A6DD503A}
{DA2AA800-ED64-4649-8B3B-E7F1E3968B78} = {20720CA7-795C-45AD-A302-9383A6DD503A}
{060B1890-CBF3-4808-BA99-A4776222093B} = {20720CA7-795C-45AD-A302-9383A6DD503A}
{143BD516-20A1-4890-A3E4-F8BFD02220E7} = {20720CA7-795C-45AD-A302-9383A6DD503A}
{666FEA52-975F-41CD-B224-B19AF3C0ABBA} = {20720CA7-795C-45AD-A302-9383A6DD503A}
EndGlobalSection
EndGlobal

View File

@ -112,6 +112,10 @@ namespace DanBias
{
if(Oyster::Graphics::API::Init(m_data->window->GetHWND(), false, false, Oyster::Math::Float2( 1024, 768)) != Oyster::Graphics::API::Sucsess)
return E_FAIL;
Oyster::Graphics::API::Option p;
p.modelPath = L"..\\Content\\Models\\";
p.texturePath = L"..\\Content\\Textures\\";
Oyster::Graphics::API::SetOptions(p);
return S_OK;
}
@ -146,6 +150,7 @@ namespace DanBias
if(state != Client::GameClientState::ClientState_Same)
{
bool stateVal = false;
m_data->recieverObj->gameClientState->Release();
delete m_data->recieverObj->gameClientState;
m_data->recieverObj->gameClientState = NULL;
@ -154,23 +159,36 @@ namespace DanBias
{
case Client::GameClientState::ClientState_LobbyCreated:
m_data->serverOwner = true;
stateVal = true;
case Client::GameClientState::ClientState_Lobby:
m_data->recieverObj->gameClientState = new Client::LobbyState();
stateVal = true;
break;
case Client::GameClientState::ClientState_Game:
if(m_data->serverOwner)
DanBias::GameServerAPI::GameStart();
m_data->recieverObj->gameClientState = new Client::GameState();
if(m_data->serverOwner)
((Client::GameState*)m_data->recieverObj->gameClientState)->setClientId(2);
else
((Client::GameState*)m_data->recieverObj->gameClientState)->setClientId(3);
//if(m_data->serverOwner)
//Initiate the game server through the server API
//if(m_data->serverOwner)
//{
// ((Client::GameState*)m_data->recieverObj->gameClientState)->setClientId(2);
//}
//else
// ((Client::GameState*)m_data->recieverObj->gameClientState)->setClientId(3);
break;
default:
return E_FAIL;
break;
}
if(stateVal)
{
m_data->recieverObj->gameClientState->Init(m_data->recieverObj); // send game client
}
else
{
}
}
return S_OK;
@ -202,10 +220,10 @@ namespace DanBias
delete m_data->inputObj;
delete m_data;
Oyster::Graphics::API::Clean();
GameServerAPI::ServerStop();
Oyster::Graphics::API::Clean();
return S_OK;
}

View File

@ -4,6 +4,7 @@
//WTF!? No headers included???
#include "../DanBiasGame/Include/DanBiasGame.h"
#include "../GameProtocols/GeneralProtocols.h"
#include "..\GameProtocols\Protocols.h"
namespace DanBias
{
@ -14,9 +15,15 @@ namespace DanBias
// receiver function for server messages
// parsing protocols and sending it to the gameState
void NetworkCallback(Oyster::Network::CustomNetProtocol& p) override
//void NetworkCallback(Oyster::Network::CustomNetProtocol& p) override
void GameRecieverObject::DataRecieved(Oyster::Network::NetEvent<Oyster::Network::NetworkClient*, Oyster::Network::NetworkClient::ClientEventArgs> e) override
{
Oyster::Network::CustomNetProtocol p = e.args.data.protocol;
int pType = p[0].value.netInt;
//printf("Message(%i) arrived at client(%i)\n", pType, this->GetID());
switch (pType)
{
case protocol_General_Status:
@ -60,20 +67,20 @@ namespace DanBias
case protocol_Gameplay_ObjectCreate:
{
Client::GameClientState::NewObj* protocolData = new Client::GameClientState::NewObj;
protocolData->object_ID = p[1].value.netInt;
protocolData->path = p[2].value.netCharPtr;
Client::GameClientState::NewObj protocolData;// = new Client::GameClientState::NewObj;
protocolData.object_ID = p[1].value.netInt;
protocolData.path = p[2].value.netCharPtr;
for(int i = 0; i< 16; i++)
{
protocolData->worldPos[i] = p[i+3].value.netFloat;
protocolData.worldPos[i] = p[i+3].value.netFloat;
}
if(dynamic_cast<Client::GameState*>(gameClientState))
((Client::GameState*)gameClientState)->Protocol(protocolData);
((Client::GameState*)gameClientState)->Protocol(&protocolData);
delete p[2].value.netCharPtr; //delete char array
delete protocolData;
protocolData = NULL;
//delete p[2].value.netCharPtr; //delete char array
//delete protocolData;
//protocolData = NULL;
}
break;
case protocol_Gameplay_ObjectDisabled:
@ -104,14 +111,16 @@ namespace DanBias
break;
case protocol_Lobby_Start:
{
/*
if(dynamic_cast<Client::LobbyState*>(gameClientState))
{
GameLogic::Protocol_LobbyStartGame pt(p);
gameClientState->Release();
delete gameClientState;
gameClientState = new Client::GameState();
gameClientState->Init(m_data->recieverObj);
}*/
gameClientState->Init(this);
((Client::GameState*)gameClientState)->setClientId(pt.clientID);
}
}
break;

View File

@ -45,6 +45,9 @@ bool GameState::Init(Oyster::Network::NetworkClient* nwClient)
privData->nwClient = nwClient;
privData->state = LoadGame();
//tELL SERver ready
nwClient->Send(GameLogic::Protocol_General_Status(GameLogic::Protocol_General_Status::States_ready));
return true;
}
GameState::gameStateState GameState::LoadGame()
@ -83,7 +86,7 @@ bool GameState::LoadModels(std::wstring mapFile)
C_Object* obj;
translate = Oyster::Math3D::TranslationMatrix(Oyster::Math::Float3(0,0,0));
modelData.world = translate ;//modelData.world * translate
modelData.modelPath = L"..\\Content\\Models\\world_earth.dan";
modelData.modelPath = L"world_earth.dan";
modelData.id = 0;
obj = new C_Player();
@ -94,7 +97,7 @@ bool GameState::LoadModels(std::wstring mapFile)
modelData.world = Oyster::Math3D::Float4x4::identity;
translate = Oyster::Math3D::TranslationMatrix(Oyster::Math::Float3(4,320,0));
modelData.world = modelData.world * translate;
modelData.modelPath = L"..\\Content\\Models\\box.dan";
modelData.modelPath = L"box.dan";
modelData.id = 1;
obj = new C_Player();
@ -108,7 +111,7 @@ bool GameState::LoadModels(std::wstring mapFile)
modelData.world = modelData.world * translate;
modelData.visible = true;
modelData.modelPath = L"..\\Content\\Models\\char_white.dan";
modelData.modelPath = L"char_white.dan";
modelData.id = 2;
// load models
obj = new C_Player();
@ -121,7 +124,7 @@ bool GameState::LoadModels(std::wstring mapFile)
modelData.world = modelData.world * translate;
modelData.visible = true;
modelData.modelPath = L"..\\Content\\Models\\char_white.dan";
modelData.modelPath = L"char_white.dan";
modelData.id = 3;
// load models
obj = new C_Player();
@ -158,7 +161,7 @@ GameClientState::ClientState GameState::Update(float deltaTime, InputClass* KeyI
{
switch (privData->state)
{
case gameStateState_loading:
case gameStateState_loading: //Will this ever happen in this scope??
{
// load map
// wait for all players

View File

@ -5,6 +5,7 @@
#include "C_obj/C_StaticObj.h"
#include "C_obj/C_DynamicObj.h"
#include <GameServerAPI.h>
#include <Protocols.h>
using namespace DanBias::Client;
@ -55,7 +56,7 @@ bool LobbyState::LoadModels(std::wstring file)
modelData.world = Oyster::Math3D::Float4x4::identity;
modelData.visible = true;
modelData.modelPath = L"..\\Content\\Models\\box_2.dan";
modelData.modelPath = L"box_2.dan";
// load models
privData->object[0] = new C_StaticObj();
privData->object[0]->Init(modelData);
@ -88,9 +89,15 @@ GameClientState::ClientState LobbyState::Update(float deltaTime, InputClass* Key
// send data to server
// check data from server
if(GameServerAPI::ServerIsRunning() && GameServerAPI::ServerIsRunning()) //May be a problem if server is not shut down properly after lan session.
{
if( KeyInput->IsKeyPressed(DIK_G))
{
return ClientState_Game;
if(!DanBias::GameServerAPI::GameStart())
{
//this->nwClient->Send(GameLogic::Protocol_LobbyStartGame());
}
}
}
return ClientState_Same;

View File

@ -55,7 +55,7 @@ bool LoginState::LoadModels(std::wstring file)
modelData.world = Oyster::Math3D::Float4x4::identity;
modelData.visible = true;
modelData.modelPath = L"..\\Content\\Models\\box_2.dan";
modelData.modelPath = L"box_2.dan";
// load models
privData->object[0] = new C_StaticObj();
privData->object[0]->Init(modelData);

View File

@ -14,7 +14,10 @@ AttatchmentSocket::AttatchmentSocket(void)
AttatchmentSocket::~AttatchmentSocket(void)
{
if(this->attatchment)
delete this->attatchment;
this->attatchment = 0;
}
IAttatchment* AttatchmentSocket::GetAttatchment()

View File

@ -59,7 +59,7 @@ using namespace GameLogic;
if(kineticEnergyLoss > forceThreashHold) //should only take damage if the force is high enough
{
damageDone = kineticEnergyLoss * 0.10f;
damageDone = (int)kineticEnergyLoss * 0.10f;
player.DamageLife(damageDone);
}

View File

@ -162,6 +162,6 @@ void Game::PhysicsOnMove(const ICustomBody *object)
}
void Game::PhysicsOnDestroy(::Utility::DynamicMemory::UniquePointer<ICustomBody> proto)
{
if(gameInstance.onDeadFnc) gameInstance.onDeadFnc(0);
}

View File

@ -73,11 +73,9 @@ namespace GameLogic
float GetFrameTime() const;
private:
static void PhysicsOnMove(const Oyster::Physics::ICustomBody *object);
static void PhysicsOnDestroy(::Utility::DynamicMemory::UniquePointer<Oyster::Physics::ICustomBody> proto);
private:
Utility::DynamicMemory::DynamicArray<PlayerData*> players;
LevelData* level;
float frameTime;

View File

@ -7,11 +7,18 @@ using namespace Oyster::Physics;
Level::Level(void)
:levelObj(0)
,testBox(0)
{
}
Level::~Level(void)
{
delete this->levelObj;
this->levelObj = 0;
delete this->testBox;
this->testBox = 0;
}
void Level::InitiateLevel(std::string levelPath)
@ -23,7 +30,7 @@ void Level::InitiateLevel(float radius)
// add level sphere
API::SphericalBodyDescription sbDesc;
sbDesc.centerPosition = Oyster::Math::Float4(0,0,0,1);
sbDesc.centerPosition = Oyster::Math::Float3(0,0,0);
sbDesc.ignoreGravity = true;
sbDesc.radius = 300;
sbDesc.mass = 10e12f;
@ -32,12 +39,18 @@ void Level::InitiateLevel(float radius)
ICustomBody::State state;
rigidBody->GetState(state);
state.SetRestitutionCoeff(0.2);
state.SetRestitutionCoeff(0.2f);
rigidBody->SetState(state);
levelObj = new StaticObject(rigidBody, LevelCollisionBefore, LevelCollisionAfter, OBJECT_TYPE::OBJECT_TYPE_WORLD);
this->levelObj = new StaticObject(rigidBody, LevelCollisionBefore, LevelCollisionAfter, OBJECT_TYPE::OBJECT_TYPE_WORLD);
rigidBody->SetCustomTag(levelObj);
// add gravitation
API::Gravity gravityWell;
gravityWell.gravityType = API::Gravity::GravityType_Well;
gravityWell.well.mass = 1e15f;
gravityWell.well.position = Oyster::Math::Float3(0,0,0);
API::Instance().AddGravity(gravityWell);
// add box
API::SimpleBodyDescription sbDesc_TestBox;
@ -52,16 +65,8 @@ void Level::InitiateLevel(float radius)
testBox = new DynamicObject(rigidBody_TestBox,Object::DefaultCollisionBefore, Object::DefaultCollisionAfter, OBJECT_TYPE::OBJECT_TYPE_BOX);
rigidBody_TestBox->SetCustomTag(testBox);
rigidBody_TestBox->GetState(state);
state.ApplyLinearImpulse(Oyster::Math::Float3(0,0,0));
state.ApplyLinearImpulse(Oyster::Math::Float3(1,0,0));
rigidBody_TestBox->SetState(state);
// add gravitation
API::Gravity gravityWell;
gravityWell.gravityType = API::Gravity::GravityType_Well;
gravityWell.well.mass = 1e15f;
gravityWell.well.position = Oyster::Math::Float4(0,0,0,1);
API::Instance().AddGravity(gravityWell);
}
void Level::AddPlayerToTeam(Player *player, int teamID)

View File

@ -18,9 +18,17 @@ Weapon::Weapon()
Weapon::Weapon(int MaxNrOfSockets,Player *owner)
{
if(MaxNrOfSockets > 1) return;
attatchmentSockets.Resize(MaxNrOfSockets);
attatchmentSockets[0] = new AttatchmentSocket();
for (int i = 0; i < MaxNrOfSockets; i++)
{
this->attatchmentSockets[i] = 0;
}
weaponState = WEAPON_STATE_IDLE;
currentNrOfAttatchments = 0;
selectedAttatchment = 0;
@ -36,7 +44,11 @@ Weapon::Weapon(int MaxNrOfSockets,Player *owner)
Weapon::~Weapon(void)
{
for (unsigned int i = 0; i < this->attatchmentSockets.Size(); i++)
{
delete this->attatchmentSockets[i];
this->attatchmentSockets[i] = 0;
}
}
/********************************************************

View File

@ -24,17 +24,18 @@ namespace GameLogic
this->protocol[1].type = Oyster::Network::NetAttributeType_Short;
}
Protocol_General_Status(Oyster::Network::CustomNetProtocol& p)
{
this->protocol = p;
status = (States)p[1].value.netShort;
}
Protocol_General_Status(States state)
{
this->protocol[0].value = protocol_General_Status;
this->protocol[0].type = Oyster::Network::NetAttributeType_Short;
this->status = state;
this->protocol[1].type = Oyster::Network::NetAttributeType_Short;
this->status = state;
}
Protocol_General_Status(Oyster::Network::CustomNetProtocol& p)
{
status = (States)this->protocol[1].value.netShort;
}
Oyster::Network::CustomNetProtocol GetProtocol() override
{

View File

@ -46,7 +46,7 @@ namespace GameLogic
*/
struct Protocol_LobbyStartGame :public Oyster::Network::CustomProtocolObject
{
short gameId;
short clientID; // The unuiqe id reprsenting a specific client
Protocol_LobbyStartGame()
{
@ -55,13 +55,21 @@ namespace GameLogic
this->protocol[1].type = Oyster::Network::NetAttributeType_Short;
}
Protocol_LobbyStartGame(short _clientID)
{
this->protocol[0].value = protocol_Lobby_Start;
this->protocol[0].type = Oyster::Network::NetAttributeType_Short;
this->protocol[1].type = Oyster::Network::NetAttributeType_Short;
clientID = _clientID;
}
Protocol_LobbyStartGame(Oyster::Network::CustomNetProtocol& o)
{
gameId = o[1].value.netInt;
clientID = o[1].value.netInt;
}
Oyster::Network::CustomNetProtocol GetProtocol() override
{
protocol[1].value = gameId;
protocol[1].value = clientID;
return protocol;
}

View File

@ -235,7 +235,7 @@ namespace GameLogic
struct Protocol_ObjectCreate :public Oyster::Network::CustomProtocolObject
{
int object_ID;
char *name;
std::string name;
float worldMatrix[16];
Protocol_ObjectCreate()
@ -276,7 +276,7 @@ namespace GameLogic
{
this->protocol[1].value = object_ID;
this->protocol[2].value = name;
this->protocol.Set(2, name);
this->protocol[3].value = worldMatrix[0];
this->protocol[4].value = worldMatrix[1];
this->protocol[5].value = worldMatrix[2];

View File

@ -25,13 +25,19 @@ namespace DanBias
Utility::DynamicMemory::SmartPointer<Oyster::Network::NetworkClient> GetClient();
Utility::DynamicMemory::SmartPointer<Oyster::Network::NetworkClient> ReleaseClient();
int GetID() const;
float GetSinceLastResponse() const;
bool IsReady() const;
bool Equals(const Oyster::Network::NetworkClient* c);
void SetReadyState(bool isReady);
void SetSinceLastResponse(float seconds);
private:
GameLogic::IPlayerData* player;
Utility::DynamicMemory::SmartPointer<Oyster::Network::NetworkClient> client;
int id;
bool isReady;
float secondsSinceLastResponse;
};
}//End namespace DanBias

View File

@ -55,6 +55,7 @@ namespace DanBias
GameSession gameSession;
LobbyLevelData description;
Utility::DynamicMemory::SmartPointer<DanBias::GameClient> sessionOwner;
};
}//End namespace DanBias
#endif // !DANBIASGAME_GAMELOBBY_H

View File

@ -32,9 +32,11 @@ namespace DanBias
{
char* serverName;
int listenPort;
bool broadcast; //Not fully implemented!
ServerInitDesc()
: serverName("Game Server")
, listenPort(15151)
, broadcast(true)
{};
};
struct GameServerInfo
@ -49,6 +51,7 @@ namespace DanBias
static void ServerStop();
static void ServerUpdate();
static GameServerInfo ServerGetInfo();
static bool ServerIsRunning();
static void GameSetMapId(const int& val);
static void GameSetMaxClients(const int& val);

View File

@ -52,6 +52,7 @@ namespace DanBias
* @param client The client to attach to the session
*/
bool Attach(Oyster::Network::NetClient client) override;
void CloseSession( bool dissconnectClients ) override;
inline bool IsCreated() const { return this->isCreated; }
inline bool IsRunning() const { return this->isRunning; }
@ -66,11 +67,13 @@ namespace DanBias
//Sends a client to the owner, if obj is NULL then all clients is sent
void SendToOwner(DanBias::GameClient* obj);
//Frame function, derived from IThreadObject
//Derived from IThreadObject
void ThreadEntry() override;
bool DoWork ( ) override;
private:
void ParseProtocol (Oyster::Network::CustomNetProtocol& p, DanBias::GameClient* c);
void ParseProtocol ( Oyster::Network::CustomNetProtocol& p, DanBias::GameClient* c );
void Gameplay_PlayerMovement ( GameLogic::Protocol_PlayerMovement& p, DanBias::GameClient* c );
void Gameplay_PlayerLookDir ( GameLogic::Protocol_PlayerLook& p, DanBias::GameClient* c );
@ -87,11 +90,12 @@ namespace DanBias
void General_Text ( GameLogic::Protocol_General_Text& p, DanBias::GameClient* c );
//Callback method recieving from gamelogic
static void ObjectMove(GameLogic::IObjectData* movedObject);
static void ObjectMove ( GameLogic::IObjectData* movedObject );
//Private member variables
private:
Utility::DynamicMemory::DynamicArray<Utility::DynamicMemory::SmartPointer<GameClient>> clients;
Utility::DynamicMemory::SmartPointer<DanBias::GameClient> sessionOwner;
Oyster::Thread::OysterThread worker;
GameLogic::GameAPI& gameInstance;
GameLogic::ILevelData *levelData;

View File

@ -18,12 +18,14 @@ GameClient::GameClient(SmartPointer<NetworkClient> client, GameLogic::IPlayerDat
this->client = client;
this->id = gameClientIDCount++;
this->player = player;
isReady = false;
}
GameClient::~GameClient()
{
this->client->Disconnect();
this->player = 0;
this->id = -1;
isReady = false;
}
GameLogic::IPlayerData* GameClient::GetPlayer()
@ -50,9 +52,25 @@ int GameClient::GetID() const
{
return this->id;
}
float GameClient::GetSinceLastResponse() const
{
return this->secondsSinceLastResponse;
}
bool GameClient::IsReady() const
{
return this->isReady;
}
bool GameClient::Equals(const NetworkClient* c)
{
return (c->GetID() == this->client->GetID());
}
void GameClient::SetReadyState(bool r)
{
this->isReady = r;
}
void GameClient::SetSinceLastResponse(float s)
{
this->secondsSinceLastResponse = s;
}

View File

@ -24,13 +24,11 @@ namespace DanBias
void GameLobby::Release()
{
NetworkSession::CloseSession(true);
this->gameSession.CloseSession(true);
}
void GameLobby::Update()
{
if(GetAsyncKeyState(VK_DOWN)) //TODO: Dont forget to remove this...
this->Send(GameLogic::Protocol_General_Status().GetProtocol());
this->ProcessClients();
}
void GameLobby::SetGameDesc(const LobbyLevelData& desc)
@ -47,7 +45,7 @@ namespace DanBias
desc.mapNumber = this->description.mapNumber;
desc.maxClients = this->description.maxClients;
}
bool GameLobby::StartGameSession()
bool GameLobby::StartGameSession( )
{
GameSession::GameDescription desc;
desc.gameMode = this->description.gameMode;
@ -56,11 +54,12 @@ namespace DanBias
desc.owner = this;
desc.clients = this->clients;
this->clients.Clear();
this->clients.Clear(); //Remove clients from lobby list
if(this->gameSession.Create(desc))
{
this->gameSession.Run();
return true;
}
return false;

View File

@ -62,7 +62,14 @@ void GameLobby::GeneralText(GameLogic::Protocol_General_Text& p, Oyster::Network
//}
void GameLobby::LobbyStartGame(GameLogic::Protocol_LobbyStartGame& p, Oyster::Network::NetworkClient* c)
{
//TODO: Prio 1
if(this->sessionOwner->GetClient()->GetID() == c->GetID())
{
}
else
{
//Someone else tried to start the server..
}
}
//void GameLobby::LobbyJoin(GameLogic::Protocol_LobbyJoin& p, Oyster::Network::NetworkClient* c)
//{

View File

@ -53,7 +53,7 @@ void GameServerAPI::ServerStart()
}
void GameServerAPI::ServerStop()
{
if(!server.IsStarted()) return;
if(!server.IsRunning()) return;
lobby.Release();
server.Shutdown();
@ -62,19 +62,19 @@ void GameServerAPI::ServerStop()
int time = (int)total;
int hour, min, sec;
hour=time / 3600;
time=time % 3600;
min=time / 60;
time=time % 60;
hour = time / 3600;
time = time % 3600;
min = time / 60;
time = time % 60;
sec = time;
printf( "Server has been running for: %i:%i:%i - [hh:mm:ss] \n\n", hour, min, sec );
printf( "Terminating in : ");
for (int i = 0; i < 3; i++)
{
printf( "%i ", 3-i );
Sleep(1000);
}
//printf( "Terminating in : ");
//for (int i = 0; i < 3; i++)
//{
// printf( "%i ", 3-i );
// Sleep(1000);
//}
printf( "\nServer terminated!" );
}
void GameServerAPI::ServerUpdate()
@ -83,7 +83,6 @@ void GameServerAPI::ServerUpdate()
lobby.Update();
}
GameServerAPI::GameServerInfo GameServerAPI::ServerGetInfo()
{
GameServerAPI::GameServerInfo i;
@ -91,6 +90,11 @@ GameServerAPI::GameServerInfo GameServerAPI::ServerGetInfo()
i.listenPort = server.GetPort();
return i;
}
bool GameServerAPI::ServerIsRunning()
{
return server.IsRunning();
}
void GameServerAPI::GameSetMapId(const int& val)
{
LobbyLevelData d;
@ -151,6 +155,11 @@ const char* GameServerAPI::GameGetGameName()
}
bool GameServerAPI::GameStart()
{
return lobby.StartGameSession();
if(lobby.StartGameSession())
{
return true;
}
return false;
}

View File

@ -88,10 +88,8 @@ namespace DanBias
if(dynamic_cast<IPlayerData*> (movedObject))
{
IPlayerData* temp = (IPlayerData*)movedObject;
int id = temp->GetID();
Oyster::Math::Float4x4 world = temp->GetOrientation();
int id = movedObject->GetID();
Oyster::Math::Float4x4 world = movedObject->GetOrientation();
Protocol_ObjectPosition p(world, id);
GameSession::gameSession->Send(p.GetProtocol());
@ -136,6 +134,8 @@ namespace DanBias
void GameSession::ParseProtocol(Oyster::Network::CustomNetProtocol& p, DanBias::GameClient* c)
{
//TODO: Update response timer
switch (p[0].value.netShort)
{
case protocol_Gameplay_PlayerMovement: this->Gameplay_PlayerMovement ( Protocol_PlayerMovement (p), c );
@ -224,6 +224,8 @@ namespace DanBias
{
case GameLogic::Protocol_General_Status::States_disconected:
printf("Client with ID [%i] dissconnected\n", c->GetClient()->GetID());
//TODO: Tell other clients
//Protocol_
this->Detach(c->GetClient()->GetID());
break;
@ -232,7 +234,7 @@ namespace DanBias
break;
case GameLogic::Protocol_General_Status::States_ready:
c->SetReadyState(true);
break;
case GameLogic::Protocol_General_Status::States_leave:

View File

@ -9,6 +9,7 @@
#define NOMINMAX
#include <Windows.h>
#include <Queue.h>
using namespace Utility::DynamicMemory;
@ -92,6 +93,9 @@ namespace DanBias
/* Set some game instance data options */
this->gameInstance.SetSubscription(GameLogic::GameEvent::ObjectEventFunctionType_OnMove, GameSession::ObjectMove);
//this->gameInstance.SetSubscription(GameLogic::GameEvent::ObjectEventFunctionType_OnDead, GameSession::ObjectDead);
this->description.clients.Clear();
this->isCreated = true;
return this->isCreated;
@ -109,7 +113,53 @@ namespace DanBias
}
}
void GameSession::ThreadEntry( )
{
//A timer so we dont lock because 1 client disconnected..
Utility::WinTimer t;
DynamicArray<SmartPointer<GameClient>> readyList = this->clients;
//First we need to clean invalid clients, if any, and tell them to start loading game data
for (unsigned int i = 0; i < readyList.Size(); i++)
{
if(!readyList[i])
{
readyList.Remove(i);
}
else
{
Protocol_LobbyStartGame p(readyList[i]->GetPlayer()->GetID());
readyList[i]->GetClient()->Send(p);
}
}
unsigned int readyCounter = readyList.Size();
//Sync with clients
while (readyCounter != 0)
{
this->ProcessClients();
for (unsigned int i = 0; i < readyList.Size(); i++)
{
if(readyList[i] && readyList[i]->IsReady())
{
//Need to send information about other players to all players
for (unsigned int k = 0; k < readyList.Size(); k++)
{
if(k != i && this->clients[k])
{
Protocol_ObjectCreate p(this->clients[k]->GetPlayer()->GetOrientation(), this->clients[k]->GetPlayer()->GetID(), "char_white.dan"); //The model name will be custom later..
readyList[i]->GetClient()->Send(p);
}
}
readyCounter-- ;
readyList[i] = 0;
}
}
Sleep(5); //TODO: This might not be needed here.
}
}
bool GameSession::Attach(Utility::DynamicMemory::SmartPointer<NetworkClient> client)
{
@ -132,6 +182,12 @@ namespace DanBias
return true;
}
void GameSession::CloseSession( bool dissconnectClients )
{
NetworkSession::CloseSession(true);
this->clients.Clear();
}
}//End namespace DanBias

View File

@ -44,6 +44,11 @@ namespace Utility
unsigned int Size() const;
unsigned int Capacity() const;
bool IsEmpty() const;
T* begin();
T* end();
private:
void Expand(int elements = 0);
@ -165,7 +170,7 @@ namespace Utility
template <typename T> void DynamicArray<T>::Remove(unsigned int index)
{
assert(index > this->size);
assert(index > (unsigned int) this->size);
T* temp = new T[this->capacity - 1];
@ -181,6 +186,7 @@ namespace Utility
template <typename T> void DynamicArray<T>::Clear()
{
if(this->data)
delete [] this->data;
this->data = 0;
@ -227,6 +233,11 @@ namespace Utility
return (unsigned int)this->capacity;
}
template <typename T> bool DynamicArray<T>::IsEmpty() const
{
return (this->size == 0);
}
template <typename T> void DynamicArray<T>::Expand(int elements)
{
if(elements < 1) return;
@ -248,6 +259,18 @@ namespace Utility
}
}
template <typename T> T* DynamicArray<T>::begin()
{
if(this->size == 0) return 0;
return &this->data[0];
}
template <typename T> T* DynamicArray<T>::end()
{
if(this->size == 0) return 0;
return ((&this->data[this->size - 1]) + 1);
}
#pragma endregion
}
}

View File

@ -44,13 +44,8 @@ using namespace Utility::DynamicMemory;
{
OYSTER_THREAD_STATE state; //<! The current thread state.
OYSTER_THREAD_PRIORITY prio; //<! The thread priority
//IThreadObject *owner; //<! The worker object.
//Oyster::Callback::OysterCallback<bool, void> ownerObj; //
OwnerContainer ownerObj; //
std::atomic<int> msec; //<! A timer in miliseconds.
//std::timed_mutex threadFunctionLock;
std::mutex threadStopMutex;
int msec; //<! A timer in miliseconds.
};
/** A typical Oyster thread function */
@ -58,7 +53,6 @@ using namespace Utility::DynamicMemory;
struct RefData
{
std::mutex threadWaitFunctionLock;
bool isCreated;
bool isAlive;
ThreadData *threadData;
@ -79,11 +73,30 @@ using namespace Utility::DynamicMemory;
{
if(!threadData) return OYSTER_THREAD_ERROR_SUCCESS;
if(std::this_thread::get_id() != this->workerThread.get_id())
{
//this->threadData->threadDataAcces.lock();
//{
this->threadData->state = OYSTER_THREAD_STATE_DEAD;
if(this->workerThread.joinable())
{
this->workerThread.join();
}
this->isCreated = false;
delete this->threadData;
this->threadData = 0;
//} this->threadData->threadDataAcces.unlock();
}
else
{
this->threadData->state = OYSTER_THREAD_STATE_DEAD;
if(this->workerThread.joinable())
{
this->workerThread.join();
}
this->isCreated = false;
delete this->threadData;
this->threadData = 0;
@ -102,12 +115,10 @@ using namespace Utility::DynamicMemory;
this->threadData->state = OYSTER_THREAD_STATE_IDLE;
threadData->ownerObj = worker;
threadData->prio = OYSTER_THREAD_PRIORITY_2;
threadData->msec = 0;
workerThread = std::thread(fnc, this->threadData);
//if(detach)
// this->workerThread.detach();
isCreated = true;
return OYSTER_THREAD_ERROR_SUCCESS;
@ -145,6 +156,9 @@ using namespace Utility::DynamicMemory;
public:
static void CheckPriority(ThreadData* w)
{
Oyster::Thread::OYSTER_THREAD_PRIORITY temp = w->prio;
switch (w->prio)
{
case Oyster::Thread::OYSTER_THREAD_PRIORITY_1:
@ -190,16 +204,18 @@ using namespace Utility::DynamicMemory;
while (w->state == OYSTER_THREAD_STATE_NORMAL)
{
//while (!w->threadDataAcces.try_lock());
CheckPriority(w);
if(!DoWork(w)) break;
CheckStatus(w);
//w->threadDataAcces.unlock();
}
if(w->ownerObj.value.obj) w->ownerObj.value.obj->ThreadExit();
w->state = OYSTER_THREAD_STATE_DEAD;
//delete w;
}
};
@ -247,79 +263,114 @@ OYSTER_THREAD_ERROR OysterThread::Create(ThreadFnc worker, bool start, bool deta
OYSTER_THREAD_ERROR OysterThread::Start()
{
OYSTER_THREAD_ERROR val = OYSTER_THREAD_ERROR_SUCCESS;
//this->privateData->data->threadData->threadDataAcces.lock();{
if(!this->privateData->data->threadData->ownerObj)
return OYSTER_THREAD_ERROR_ThreadHasNoWorker;
val = OYSTER_THREAD_ERROR_ThreadHasNoWorker;
if(this->privateData->data->threadData->state == OYSTER_THREAD_STATE_DEAD)
return OYSTER_THREAD_ERROR_ThreadIsDead;
val = OYSTER_THREAD_ERROR_ThreadIsDead;
this->privateData->data->threadData->state = OYSTER_THREAD_STATE_NORMAL;
return OYSTER_THREAD_ERROR_SUCCESS;
//} this->privateData->data->threadData->threadDataAcces.unlock();
return val;
}
OYSTER_THREAD_ERROR OysterThread::Stop()
{
OYSTER_THREAD_ERROR val = OYSTER_THREAD_ERROR_SUCCESS;
//this->privateData->data->threadData->threadDataAcces.lock(); {
this->privateData->data->threadData->state = OYSTER_THREAD_STATE_IDLE;
return OYSTER_THREAD_ERROR_SUCCESS;
//} this->privateData->data->threadData->threadDataAcces.unlock();
return val;
}
OYSTER_THREAD_ERROR OysterThread::Stop(int msec)
{
OYSTER_THREAD_ERROR val = OYSTER_THREAD_ERROR_SUCCESS;
//this->privateData->data->threadData->threadDataAcces.lock(); {
this->privateData->data->threadData->msec = msec;
return OYSTER_THREAD_ERROR_SUCCESS;
//} this->privateData->data->threadData->threadDataAcces.unlock();
return val;
}
OYSTER_THREAD_ERROR OysterThread::Resume()
{
OYSTER_THREAD_ERROR val = OYSTER_THREAD_ERROR_SUCCESS;
//this->privateData->data->threadData->threadDataAcces.lock(); {
if(this->privateData->data->threadData->state == OYSTER_THREAD_STATE_DEAD)
return OYSTER_THREAD_ERROR_ThreadIsDead;
val = OYSTER_THREAD_ERROR_ThreadIsDead;
this->privateData->data->threadData->state = OYSTER_THREAD_STATE_NORMAL;
//} this->privateData->data->threadData->threadDataAcces.unlock();
return OYSTER_THREAD_ERROR_SUCCESS;
return val;
}
OYSTER_THREAD_ERROR OysterThread::SetWorker(IThreadObject* worker)
{
OYSTER_THREAD_ERROR val = OYSTER_THREAD_ERROR_SUCCESS;
//this->privateData->data->threadData->threadDataAcces.lock();{
this->privateData->data->threadData->ownerObj.value = worker;
this->privateData->data->threadData->ownerObj.type = Oyster::Callback::CallbackType_Object;
this->privateData->data->threadData->msec = 0;
//} this->privateData->data->threadData->threadDataAcces.unlock();
return OYSTER_THREAD_ERROR_SUCCESS;;
return val;;
}
OYSTER_THREAD_ERROR OysterThread::SetWorker(ThreadFnc worker)
{
OYSTER_THREAD_ERROR val = OYSTER_THREAD_ERROR_SUCCESS;
//this->privateData->data->threadData->threadDataAcces.lock();{
this->privateData->data->threadData->ownerObj.value = worker;
this->privateData->data->threadData->ownerObj.type = Oyster::Callback::CallbackType_Function;
this->privateData->data->threadData->msec = 0;
//} this->privateData->data->threadData->threadDataAcces.unlock();
return OYSTER_THREAD_ERROR_SUCCESS;;
return val;;
}
OYSTER_THREAD_ERROR OysterThread::Terminate()
{
if(this->privateData)
return this->privateData->Terminate();
return OYSTER_THREAD_ERROR_SUCCESS;
}
OYSTER_THREAD_ERROR OysterThread::Wait()
{
OYSTER_THREAD_ERROR val = OYSTER_THREAD_ERROR_SUCCESS;
//this->privateData->data->threadData->threadDataAcces.lock();{
if(this->privateData->data->threadData->state == OYSTER_THREAD_STATE_DEAD)
return OYSTER_THREAD_ERROR_ThreadIsDead;
val = OYSTER_THREAD_ERROR_ThreadIsDead;
if( this->privateData->data->workerThread.get_id() == std::this_thread::get_id())
return OYSTER_THREAD_ERROR_ThreadCannotWaintOnItselfe;
val = OYSTER_THREAD_ERROR_ThreadCannotWaintOnItselfe;
return OYSTER_THREAD_ERROR_SUCCESS;
//} this->privateData->data->threadData->threadDataAcces.unlock();
return val;
}
OYSTER_THREAD_ERROR OysterThread::Wait(int msec)
{
if(this->privateData->data->workerThread.get_id() == std::this_thread::get_id())
return OYSTER_THREAD_ERROR_ThreadCannotWaintOnItselfe;
OYSTER_THREAD_ERROR val = OYSTER_THREAD_ERROR_SUCCESS;
return OYSTER_THREAD_ERROR_SUCCESS;
//this->privateData->data->threadData->threadDataAcces.lock();{
if(this->privateData->data->workerThread.get_id() == std::this_thread::get_id())
val = OYSTER_THREAD_ERROR_ThreadCannotWaintOnItselfe;
//} this->privateData->data->threadData->threadDataAcces.unlock();
return val;
}
OYSTER_THREAD_ERROR OysterThread::Swap(const OysterThread* other)
{
//this->privateData->data->threadData->threadDataAcces.lock();{
this->privateData->data->workerThread.swap(other->privateData->data->workerThread);
//} this->privateData->data->threadData->threadDataAcces.unlock();
return OYSTER_THREAD_ERROR_SUCCESS;
}

View File

@ -376,6 +376,190 @@ namespace Utility
#pragma endregion
}
namespace Thread
{
#pragma region ThreadSafeSmartPointer
template<typename T> void ThreadSafeSmartPointer<T>::Destroy()
{
delete this->_rc.load();
this->_rc = NULL;
//Use default function for memory deallocation.
SafeDeleteInstance<T>(this->_ptr.load());
this->_ptr = NULL;
}
template<typename T> ThreadSafeSmartPointer<T>::ThreadSafeSmartPointer()
:_rc(0), _ptr(0)
{ }
template<typename T> ThreadSafeSmartPointer<T>::ThreadSafeSmartPointer(UniquePointer<T>& p)
:_ptr(p.Release())
{
this->_rc = new ReferenceCount();
this->_rc->Incref();
}
template<typename T> ThreadSafeSmartPointer<T>::ThreadSafeSmartPointer(T* p)
:_ptr(p)
{
this->_rc.store = new ReferenceCount();
this->_rc->Incref();
}
template<typename T> ThreadSafeSmartPointer<T>::ThreadSafeSmartPointer(const ThreadSafeSmartPointer& d)
:_ptr(d._ptr), _rc(d._rc)
{
if(this->_rc)
this->_rc->Incref();
}
template<typename T> ThreadSafeSmartPointer<T>::~ThreadSafeSmartPointer()
{
this->Release();
}
template<typename T> ThreadSafeSmartPointer<T>& ThreadSafeSmartPointer<T>::operator= (const ThreadSafeSmartPointer<T>& p)
{
if (this != &p)
{
//Last to go?
if(this->_rc.load() && this->_rc.load()->Decref() == 0)
{
//Call child specific
Destroy();
}
this->_ptr.store(p._ptr.load());
this->_rc.store(p._rc.load());
if(this->_rc.load()) this->_rc.load()->Incref();
}
return *this;
}
template<typename T> ThreadSafeSmartPointer<T>& ThreadSafeSmartPointer<T>::operator= (UniquePointer<T>& p)
{
//Last to go?
if(this->_rc)
{
if(this->_rc->Decref() == 0)
{
//Call child specific
Destroy();
this->_rc = new ReferenceCount();
}
}
else
{
if(p) this->_rc = new ReferenceCount();
}
if(this->_rc)
this->_rc->Incref();
this->_ptr = p.Release();
return *this;
}
template<typename T> ThreadSafeSmartPointer<T>& ThreadSafeSmartPointer<T>::operator= (T* p)
{
if (this->_ptr != p)
{
//Last to go?
if(this->_rc.load())
{
if(this->_rc.load()->Decref() == 0)
{
//Call child specific
Destroy();
if(p) this->_rc = new ReferenceCount();
}
}
else if(p)
{
this->_rc = new ReferenceCount();
}
this->_ptr = p;
if(p) this->_rc.load()->Incref();
else this->_rc = 0;
}
return *this;
}
template<typename T> inline bool ThreadSafeSmartPointer<T>::operator== (const ThreadSafeSmartPointer<T>& d) const
{
return d._ptr == this->_ptr;
}
template<typename T> inline bool ThreadSafeSmartPointer<T>::operator== (const T& p) const
{
return &p == this->_ptr;
}
template<typename T> inline bool ThreadSafeSmartPointer<T>::operator!= (const ThreadSafeSmartPointer<T>& d) const
{
return d._ptr != this->_ptr;
}
template<typename T> inline bool ThreadSafeSmartPointer<T>::operator!= (const T& p) const
{
return &p != this->_ptr;
}
template<typename T> inline T& ThreadSafeSmartPointer<T>::operator* ()
{
return *this->_ptr;
}
template<typename T> inline const T& ThreadSafeSmartPointer<T>::operator* () const
{
return *this->_ptr;
}
template<typename T> inline T* ThreadSafeSmartPointer<T>::operator-> ()
{
return this->_ptr;
}
template<typename T> inline const T* ThreadSafeSmartPointer<T>::operator-> () const
{
return this->_ptr;
}
template<typename T> inline ThreadSafeSmartPointer<T>::operator T* () const
{
return this->_ptr;
}
template<typename T> inline ThreadSafeSmartPointer<T>::operator const T* () const
{
return this->_ptr;
}
template<typename T> inline ThreadSafeSmartPointer<T>::operator T& () const
{
return *this->_ptr;
}
template<typename T> inline ThreadSafeSmartPointer<T>::operator bool() const
{
return (this->_ptr != 0);
}
template<typename T> inline T* ThreadSafeSmartPointer<T>::Get()
{
return this->_ptr;
}
template<typename T> inline T* ThreadSafeSmartPointer<T>::Get() const
{
return this->_ptr;
}
template<typename T> int ThreadSafeSmartPointer<T>::Release()
{
int returnVal = 0;
if(this->_rc.load() && ((returnVal = this->_rc.load()->Decref()) == 0))
{
Destroy();
}
return returnVal;
}
template<typename T> int ThreadSafeSmartPointer<T>::ReleaseDummy()
{
int val = this->_rc->Decref();
this->_rc->Incref();
return val;
}
template<typename T> inline bool ThreadSafeSmartPointer<T>::IsValid() const
{
return (this->_ptr != NULL) ? true : false;
}
#pragma endregion
}
}
#endif

View File

@ -400,7 +400,59 @@ namespace Utility
namespace Thread
{
//Utilities for threading
using namespace DynamicMemory;
//! Wrapper to manage references on a pointer.
template<typename T> struct ThreadSafeSmartPointer
{
private:
std::atomic<ReferenceCount*> _rc;
std::atomic<T*> _ptr;
/** Destroys the pointer and returns the memory allocated. */
void Destroy();
public:
ThreadSafeSmartPointer();
ThreadSafeSmartPointer(UniquePointer<T>& up);
ThreadSafeSmartPointer(T* p);
ThreadSafeSmartPointer(const ThreadSafeSmartPointer& d);
virtual~ThreadSafeSmartPointer();
ThreadSafeSmartPointer<T>& operator= (const ThreadSafeSmartPointer<T>& p);
ThreadSafeSmartPointer<T>& operator= (UniquePointer<T>& p);
ThreadSafeSmartPointer<T>& operator= (T* p);
bool operator== (const ThreadSafeSmartPointer<T>& d) const;
bool operator== (const T& p) const;
bool operator!= (const ThreadSafeSmartPointer<T>& d) const;
bool operator!= (const T& p) const;
T& operator* ();
const T& operator* () const;
T* operator-> ();
const T* operator-> () const;
operator T* () const;
operator const T* () const;
operator T& () const;
operator bool() const;
/**
* Returns the connected pointer
*/
T* Get();
T* Get() const;
/**
* Releases one reference of the pointer and set value to null, making the current ThreadSafeSmartPointer invalid.
*/
int Release();
/**
* Only test to release to check reference count.
*/
int ReleaseDummy();
/** Checks if the pointer is valid (not NULL)
* Returns true for valid, else false.
*/
bool IsValid() const;
};
}
}

View File

@ -4,13 +4,15 @@
#include "CustomNetProtocol.h"
#include <map>
#include "Translator.h"
#include <DynamicArray.h>
using namespace Oyster::Network;
using namespace Utility::DynamicMemory;
struct CustomNetProtocol::PrivateData
{
std::map<int, NetAttributeContainer> attributes; //...Im an idiot
//std::map<int, NetAttributeContainer> attributes; //...Im an idiot
DynamicArray<NetAttributeContainer> attributes; //...Im an idiot
PrivateData()
{ }
@ -19,20 +21,19 @@ struct CustomNetProtocol::PrivateData
{
for (auto i = attributes.begin(); i != attributes.end(); i++)
{
RemoveAttribute(i->first);
//RemoveAttribute(i);
}
attributes.clear();
attributes.Clear();
}
void RemoveAttribute(int ID)
void RemoveAttribute(NetAttributeContainer* i)
{
auto i = attributes.find(ID);
if(i == attributes.end()) return;
if(!i) return;
switch (i->second.type)
switch (i->type)
{
case NetAttributeType_CharArray:
delete [] i->second.value.netCharPtr;
delete [] i->value.netCharPtr;
break;
}
}
@ -40,30 +41,49 @@ struct CustomNetProtocol::PrivateData
//Do network stuff
};
static int ia = 0;
static int ib = 0;
CustomNetProtocol::CustomNetProtocol()
{
ia++;
this->privateData = new PrivateData();
}
CustomNetProtocol::CustomNetProtocol(const CustomNetProtocol& o)
CustomNetProtocol::CustomNetProtocol(CustomNetProtocol& o)
{
this->privateData = o.privateData;
ib ++;
this->privateData = new PrivateData();
this->privateData->attributes = o.privateData->attributes;
}
const CustomNetProtocol& CustomNetProtocol::operator=(const CustomNetProtocol& o)
const CustomNetProtocol& CustomNetProtocol::operator=(CustomNetProtocol& o)
{
this->privateData = o.privateData;
if(this->privateData)
{
delete this->privateData;
this->privateData = 0;
}
ib ++;
this->privateData = new PrivateData();
this->privateData->attributes = o.privateData->attributes;
return *this;
}
CustomNetProtocol::~CustomNetProtocol()
{
//ia--;
delete this->privateData;
this->privateData = 0;
}
NetAttributeContainer& CustomNetProtocol::operator[](int ID)
{
if(this->privateData->attributes.find(ID) == this->privateData->attributes.end())
//if(!this->privateData) this->privateData = new PrivateData();
if((unsigned int)ID >= this->privateData->attributes.Size())
{
this->privateData->attributes[ID];
this->privateData->attributes[ID].type = NetAttributeType_UNKNOWN;
memset(&this->privateData->attributes[ID].value, 0, sizeof(NetAttributeValue));
NetAttributeContainer temp;
temp.type = NetAttributeType_UNKNOWN;
memset(&temp.value, 0, sizeof(NetAttributeValue));
this->privateData->attributes.Push(ID, temp);
}
return this->privateData->attributes[ID];
@ -103,3 +123,114 @@ const NetAttributeContainer& CustomNetProtocol::Get(int id)
{
return this->privateData->attributes[id];
}
///////////////////////////////////////////////////////////////////////
//// Created by [Dennis Andersen] [2013]
///////////////////////////////////////////////////////////////////////
//#include "CustomNetProtocol.h"
//#include <map>
//#include "Translator.h"
//#include <DynamicArray.h>
//using namespace Oyster::Network;
//using namespace Utility::DynamicMemory;
//
//
//
//struct CustomNetProtocol::PrivateData
//{
// Utility::DynamicMemory::DynamicArray<NetAttributeContainer> attributes; //...Im an idiot
//
// PrivateData()
// { }
//
// ~PrivateData()
// {
// for (unsigned int i = 0; i < attributes.Size(); i++)
// {
// RemoveAttribute(i);
// }
//
// attributes.Clear();
// }
// void RemoveAttribute(int i)
// {
// switch (attributes[i].type)
// {
// case NetAttributeType_CharArray:
// delete [] attributes[i].value.netCharPtr;
// break;
// }
// }
//
// //Do network stuff
//};
//
//
//CustomNetProtocol::CustomNetProtocol()
//{
// this->privateData = new PrivateData();
//}
//CustomNetProtocol::CustomNetProtocol(const CustomNetProtocol& o)
//{
// this->privateData = o.privateData;
//}
//const CustomNetProtocol& CustomNetProtocol::operator=(const CustomNetProtocol& o)
//{
// this->privateData = o.privateData;
// return *this;
//}
//CustomNetProtocol::~CustomNetProtocol()
//{
//}
//NetAttributeContainer& CustomNetProtocol::operator[](int ID)
//{
// if(ID >= this->privateData->attributes.Size())
// this->privateData->attributes.Resize(
// if(this->privateData->attributes.find(ID) == this->privateData->attributes.end())
// {
// this->privateData->attributes[ID];
// this->privateData->attributes[ID].type = NetAttributeType_UNKNOWN;
// memset(&this->privateData->attributes[ID].value, 0, sizeof(NetAttributeValue));
// }
//
// return this->privateData->attributes[ID];
//}
//
//void CustomNetProtocol::Set(int ID, Oyster::Network::NetAttributeValue val, Oyster::Network::NetAttributeType type)
//{
// this->privateData->attributes[ID].type = type;
//
// switch (type)
// {
// case Oyster::Network::NetAttributeType_Bool:
// case Oyster::Network::NetAttributeType_Char:
// case Oyster::Network::NetAttributeType_UnsignedChar:
// case Oyster::Network::NetAttributeType_Short:
// case Oyster::Network::NetAttributeType_UnsignedShort:
// case Oyster::Network::NetAttributeType_Int:
// case Oyster::Network::NetAttributeType_UnsignedInt:
// case Oyster::Network::NetAttributeType_Int64:
// case Oyster::Network::NetAttributeType_UnsignedInt64:
// case Oyster::Network::NetAttributeType_Float:
// case Oyster::Network::NetAttributeType_Double:
// this->privateData->attributes[ID].value = val;
// break;
// }
//}
//void CustomNetProtocol::Set(int ID, std::string s)
//{
// if(s.size() == 0) return;
//
// this->privateData->attributes[ID].type = Oyster::Network::NetAttributeType_CharArray;
//
// this->privateData->attributes[ID].value.netCharPtr = new char[s.size() + 1];
// memcpy(&this->privateData->attributes[ID].value.netCharPtr[0], &s[0], s.size() + 1);
//}
//const NetAttributeContainer& CustomNetProtocol::Get(int id)
//{
// return this->privateData->attributes[id];
//}

View File

@ -69,7 +69,55 @@ namespace Oyster
{
NetAttributeType type;
NetAttributeValue value;
NetAttributeContainer() { type = NetAttributeType_UNKNOWN; }
NetAttributeContainer()
{ type = NetAttributeType_UNKNOWN; }
~NetAttributeContainer()
{
if (this->type == NetAttributeType_CharArray)
{
delete this->value.netCharPtr;
this->value.netCharPtr = 0;
}
}
NetAttributeContainer(NetAttributeContainer& p)
{
type = p.type;
if(type == NetAttributeType_CharArray && p.value.netCharPtr)
{
int len = 0;
if((len = strlen(p.value.netCharPtr)) == 0) return;
len++;
value.netCharPtr = new char[len];
memcpy(&value.netCharPtr[0], &p.value.netCharPtr[0], sizeof(p.value.netCharPtr[0]) * len);
}
else
{
value = p.value;
}
}
const NetAttributeContainer& operator=(const NetAttributeContainer& p)
{
if(this->type == NetAttributeType_CharArray)
{
delete this->value.netCharPtr;
this->value.netCharPtr = 0;
}
type = p.type;
if(type == NetAttributeType_CharArray && p.value.netCharPtr)
{
int len = 0;
if((len = strlen(p.value.netCharPtr)) == 0) return *this;
len++;
value.netCharPtr = new char[len];
memcpy(&value.netCharPtr[0], &p.value.netCharPtr[0], sizeof(p.value.netCharPtr[0]) * len);
}
else
{
value = p.value;
}
return *this;
}
};
class CustomNetProtocol;
struct CustomProtocolObject
@ -82,8 +130,8 @@ namespace Oyster
public:
CustomNetProtocol();
~CustomNetProtocol();
CustomNetProtocol(const CustomNetProtocol& o);
const CustomNetProtocol& operator=(const CustomNetProtocol& o);
CustomNetProtocol(CustomNetProtocol& o);
const CustomNetProtocol& operator=(CustomNetProtocol& o);
NetAttributeContainer& operator[](int ID);
void Set(int id, Oyster::Network::NetAttributeValue val, Oyster::Network::NetAttributeType type);
@ -92,7 +140,9 @@ namespace Oyster
private:
struct PrivateData;
Utility::DynamicMemory::SmartPointer<PrivateData> privateData;
//Utility::DynamicMemory::SmartPointer<PrivateData> privateData;
//Utility::Thread::ThreadSafeSmartPointer<PrivateData> privateData;
PrivateData* privateData;
friend class Translator;
};

View File

@ -84,6 +84,7 @@ struct NetworkClient::PrivateData : public IThreadObject
if(!this->sendQueue.IsEmpty())
{
//printf("\t(%i)\n", this->sendQueue.Size());
OysterByte temp;
CustomNetProtocol p = this->sendQueue.Pop();
this->translator.Pack(temp, p);
@ -205,7 +206,11 @@ struct NetworkClient::PrivateData : public IThreadObject
CEA parg;
parg.type = CEA::EventType_ProtocolRecieved;
parg.data.protocol = protocol;
NetEvent<NetworkClient*, NetworkClient::ClientEventArgs> e = { this->parent, parg };
NetEvent<NetworkClient*, NetworkClient::ClientEventArgs> e;
e.sender = this->parent;
e.args.data.protocol = parg.data.protocol;
e.args.type = parg.type;
this->recieveQueue.Push(e);
}
}
@ -248,9 +253,6 @@ void NetworkClient::Update()
this->DataRecieved(temp);
//--------- Deprecate ---------
this->NetworkCallback(temp.args.data.protocol);
//------------------------------
}
}
@ -303,7 +305,7 @@ void NetworkClient::Send(CustomProtocolObject& protocol)
this->privateData->sendQueue.Push(protocol.GetProtocol());
}
void NetworkClient::Send(CustomNetProtocol protocol)
void NetworkClient::Send(CustomNetProtocol& protocol)
{
this->privateData->sendQueue.Push(protocol);
}
@ -332,8 +334,8 @@ void NetworkClient::DataRecieved(NetEvent<NetworkClient*, ClientEventArgs> e)
}
}
void NetworkClient::NetworkCallback(Oyster::Network::CustomNetProtocol& p)
{}
//void NetworkClient::NetworkCallback(Oyster::Network::CustomNetProtocol& p)
//{}
std::string NetworkClient::GetIpAddress()
{

View File

@ -36,7 +36,33 @@ namespace Oyster
{
struct { Oyster::Network::CustomNetProtocol protocol; };
void * nothing;
EventData(){}
EventData(Oyster::Network::CustomNetProtocol& o)
{
protocol = o;
}
const EventData& operator=(EventData& o)
{
protocol = o.protocol;
return *this;
}
const EventData& operator=(Oyster::Network::CustomNetProtocol& o)
{
protocol = o; return *this;
}
} data;
ClientEventArgs(){}
ClientEventArgs(ClientEventArgs& o)
{
type = o.type;
data = o.data;
}
const ClientEventArgs& operator=(ClientEventArgs& o)
{
type = o.type;
data = o.data;
return *this;
}
};
typedef void(*ClientEventFunction)(NetEvent<NetworkClient*, ClientEventArgs> e);
@ -75,7 +101,7 @@ namespace Oyster
/**
*
*/
void Send(CustomNetProtocol protocol);
void Send(CustomNetProtocol& protocol);
/**
*
@ -101,7 +127,7 @@ namespace Oyster
* Do not use this furthermore, instead use void DataRecieved(NetEvent<NetworkClient*, ClientEventArgs> e);
* @see DataRecieved
*/
virtual void NetworkCallback(Oyster::Network::CustomNetProtocol& p);
//virtual void NetworkCallback(Oyster::Network::CustomNetProtocol& p);
virtual std::string GetIpAddress();

View File

@ -261,7 +261,7 @@ NetworkSession const* NetworkServer::ReleaseMainSession()
return temp;
}
bool NetworkServer::IsStarted() const
bool NetworkServer::IsRunning() const
{
return this->privateData->isRunning;
}

View File

@ -77,7 +77,7 @@ namespace Oyster
/**
*
*/
bool IsStarted() const;
bool IsRunning() const;
/**
*

View File

@ -133,7 +133,7 @@ NetClient NetworkSession::Detach(const NetworkClient* client)
for (unsigned int i = 0; i < this->clients.Size(); i++)
{
if(this->clients[i] && this->clients[0]->GetID() == client->GetID())
if(this->clients[i] && this->clients[i]->GetID() == client->GetID())
{
val = this->clients[i];
this->clients[i] = 0;

View File

@ -8,7 +8,7 @@
#include "../../Misc/Utilities.h"
#include "../NetworkDependencies/Messages/MessageHeader.h"
#include "../NetworkDependencies/OysterByte.h"
#include <DynamicArray.h>
using namespace Oyster::Network;
using namespace ::Messages;
@ -19,7 +19,7 @@ using namespace std;
//TODO: Fix this uggly hack
struct MyCastingStruct
{
std::map<int, NetAttributeContainer> attributes;
Utility::DynamicMemory::DynamicArray<NetAttributeContainer> attributes;
};
// TODO: Check if the package has been packed correctly.
@ -34,8 +34,8 @@ struct Translator::PrivateData
//Packages a header with a size(int) and a string of characters(char)
void PackHeader(OysterByte &bytes, CustomNetProtocol& protocol)
{
auto it = ((MyCastingStruct*)protocol.privateData.Get())->attributes.begin();
auto end = ((MyCastingStruct*)protocol.privateData.Get())->attributes.end();
auto it = ((MyCastingStruct*)protocol.privateData)->attributes.begin();
auto end = ((MyCastingStruct*)protocol.privateData)->attributes.end();
size = 4; //size(int)
message.SetSize(0);
@ -44,7 +44,7 @@ struct Translator::PrivateData
//Find all the data types
for(; it != end; it++)
{
headerString.push_back(it->second.type);
headerString.push_back(it->type);
}
message.PackShort(headerString.size(), bytes);
@ -61,48 +61,48 @@ struct Translator::PrivateData
void PackMessage(OysterByte &bytes, CustomNetProtocol& protocol)
{
auto it = ((MyCastingStruct*)protocol.privateData.Get())->attributes.begin();
auto end = ((MyCastingStruct*)protocol.privateData.Get())->attributes.end();
auto it = ((MyCastingStruct*)protocol.privateData)->attributes.begin();
auto end = ((MyCastingStruct*)protocol.privateData)->attributes.end();
for(int i = 0; i < (int)headerString.size(); i++, it++)
{
switch((int)headerString.at(i))
{
case NetAttributeType_Bool:
message.PackBool(it->second.value.netBool, bytes);
message.PackBool(it->value.netBool, bytes);
break;
case NetAttributeType_Char:
message.PackChar(it->second.value.netChar, bytes);
message.PackChar(it->value.netChar, bytes);
break;
case NetAttributeType_UnsignedChar:
message.PackUnsignedChar(it->second.value.netUChar, bytes);
message.PackUnsignedChar(it->value.netUChar, bytes);
break;
case NetAttributeType_Short:
message.PackShort(it->second.value.netShort, bytes);
message.PackShort(it->value.netShort, bytes);
break;
case NetAttributeType_UnsignedShort:
message.PackUnsignedShort(it->second.value.netUShort, bytes);
message.PackUnsignedShort(it->value.netUShort, bytes);
break;
case NetAttributeType_Int:
message.PackInt(it->second.value.netInt, bytes);
message.PackInt(it->value.netInt, bytes);
break;
case NetAttributeType_UnsignedInt:
message.PackUnsignedInt(it->second.value.netUInt, bytes);
message.PackUnsignedInt(it->value.netUInt, bytes);
break;
case NetAttributeType_Int64:
message.PackInt64(it->second.value.netInt64, bytes);
message.PackInt64(it->value.netInt64, bytes);
break;
case NetAttributeType_UnsignedInt64:
message.PackUnsignedInt64(it->second.value.netUInt64, bytes);
message.PackUnsignedInt64(it->value.netUInt64, bytes);
break;
case NetAttributeType_Float:
message.PackFloat(it->second.value.netFloat, bytes);
message.PackFloat(it->value.netFloat, bytes);
break;
case NetAttributeType_Double:
message.PackDouble(it->second.value.netDouble, bytes);
message.PackDouble(it->value.netDouble, bytes);
break;
case NetAttributeType_CharArray:
message.PackStr(it->second.value.netCharPtr, bytes);
message.PackStr(it->value.netCharPtr, bytes);
break;
default:
numberOfUnknownTypes++;
@ -216,6 +216,7 @@ const Translator& Translator::operator=(const Translator& obj)
void Translator::Pack(OysterByte &bytes, CustomNetProtocol& protocol)
{
privateData->headerString.clear();
privateData->PackHeader(bytes, protocol);

View File

@ -143,8 +143,7 @@ namespace Oyster
}
else
{
memset(&out,0,sizeof(out));
return;
return NULL;
}
#endif
return Core::PipelineManager::CreateShader(data, Core::PipelineManager::ShaderType(type));

View File

@ -8,6 +8,6 @@ RWTexture2D<float4> Output;
void main( uint3 DTid : SV_DispatchThreadID )
{
//Output[DTid.xy] = Diffuse[DTid.xy] + Specular[DTid.xy] + Diffuse[DTid.xy] * Ambient[DTid.xy/2].w;// + float4(Ambient[DTid.xy/4].xyz,1); GLOW
Output[DTid.xy] = Ambient[DTid.xy/2];
//Output[DTid.xy] = Diffuse[DTid.xy] + Specular[DTid.xy];
//Output[DTid.xy] = Ambient[DTid.xy/2];
Output[DTid.xy] = Diffuse[DTid.xy] + Specular[DTid.xy];
}