Merge branch 'GameLogic' of https://github.com/dean11/Danbias into GameLogic

This commit is contained in:
Erik Persson 2013-12-18 08:32:20 +01:00
commit 4d7be753c5
43 changed files with 451 additions and 236 deletions

Binary file not shown.

Binary file not shown.

View File

@ -54,122 +54,122 @@ 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 = Release|Win32
{0EC83E64-230E-48EF-B08C-6AC9651B4F82}.Debug|Mixed Platforms.Build.0 = Release|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 = Debug|x64
{0EC83E64-230E-48EF-B08C-6AC9651B4F82}.Debug|x64.Build.0 = Debug|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}.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 = Release|Win32
{F10CBC03-9809-4CBA-95D8-327C287B18EE}.Debug|Mixed Platforms.Build.0 = Release|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 = Debug|x64
{F10CBC03-9809-4CBA-95D8-327C287B18EE}.Debug|x64.Build.0 = Debug|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}.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
{F10CBC03-9809-4CBA-95D8-327C287B18EE}.Release|x64.Build.0 = Release|x64
{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|Mixed Platforms.ActiveCfg = Release|Win32
{4285BD3F-3C6C-4670-B7AF-A29AFEF5F6A8}.Debug|Mixed Platforms.Build.0 = Release|Win32
{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
{4285BD3F-3C6C-4670-B7AF-A29AFEF5F6A8}.Release|Mixed Platforms.Build.0 = Release|x64
{4285BD3F-3C6C-4670-B7AF-A29AFEF5F6A8}.Release|Mixed Platforms.ActiveCfg = Release|Win32
{4285BD3F-3C6C-4670-B7AF-A29AFEF5F6A8}.Release|Mixed Platforms.Build.0 = Release|Win32
{4285BD3F-3C6C-4670-B7AF-A29AFEF5F6A8}.Release|Win32.ActiveCfg = Release|Win32
{4285BD3F-3C6C-4670-B7AF-A29AFEF5F6A8}.Release|Win32.Build.0 = Release|Win32
{4285BD3F-3C6C-4670-B7AF-A29AFEF5F6A8}.Release|x64.ActiveCfg = Release|x64
{4285BD3F-3C6C-4670-B7AF-A29AFEF5F6A8}.Release|x64.Build.0 = Release|x64
{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|Mixed Platforms.ActiveCfg = Release|Win32
{34D6295A-00DD-4B1A-8258-97DA2818EC26}.Debug|Mixed Platforms.Build.0 = Release|Win32
{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
{34D6295A-00DD-4B1A-8258-97DA2818EC26}.Release|Mixed Platforms.Build.0 = Release|x64
{34D6295A-00DD-4B1A-8258-97DA2818EC26}.Release|Mixed Platforms.ActiveCfg = Release|Win32
{34D6295A-00DD-4B1A-8258-97DA2818EC26}.Release|Mixed Platforms.Build.0 = Release|Win32
{34D6295A-00DD-4B1A-8258-97DA2818EC26}.Release|Win32.ActiveCfg = Release|Win32
{34D6295A-00DD-4B1A-8258-97DA2818EC26}.Release|Win32.Build.0 = Release|Win32
{34D6295A-00DD-4B1A-8258-97DA2818EC26}.Release|x64.ActiveCfg = Release|x64
{34D6295A-00DD-4B1A-8258-97DA2818EC26}.Release|x64.Build.0 = Release|x64
{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|Mixed Platforms.ActiveCfg = Release|Win32
{35AEA3C0-E0A7-4E1E-88CD-514AA5A442B1}.Debug|Mixed Platforms.Build.0 = Release|Win32
{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
{35AEA3C0-E0A7-4E1E-88CD-514AA5A442B1}.Release|Mixed Platforms.Build.0 = Release|x64
{35AEA3C0-E0A7-4E1E-88CD-514AA5A442B1}.Release|Mixed Platforms.ActiveCfg = Release|Win32
{35AEA3C0-E0A7-4E1E-88CD-514AA5A442B1}.Release|Mixed Platforms.Build.0 = Release|Win32
{35AEA3C0-E0A7-4E1E-88CD-514AA5A442B1}.Release|Win32.ActiveCfg = Release|Win32
{35AEA3C0-E0A7-4E1E-88CD-514AA5A442B1}.Release|Win32.Build.0 = Release|Win32
{35AEA3C0-E0A7-4E1E-88CD-514AA5A442B1}.Release|x64.ActiveCfg = Release|x64
{35AEA3C0-E0A7-4E1E-88CD-514AA5A442B1}.Release|x64.Build.0 = Release|x64
{7E3990D2-3D94-465C-B58D-64A74B3ECF9B}.Debug|Mixed Platforms.ActiveCfg = Release|x64
{7E3990D2-3D94-465C-B58D-64A74B3ECF9B}.Debug|Mixed Platforms.Build.0 = Release|x64
{7E3990D2-3D94-465C-B58D-64A74B3ECF9B}.Debug|Mixed Platforms.ActiveCfg = Release|Win32
{7E3990D2-3D94-465C-B58D-64A74B3ECF9B}.Debug|Mixed Platforms.Build.0 = Release|Win32
{7E3990D2-3D94-465C-B58D-64A74B3ECF9B}.Debug|Win32.ActiveCfg = Debug|Win32
{7E3990D2-3D94-465C-B58D-64A74B3ECF9B}.Debug|Win32.Build.0 = Debug|Win32
{7E3990D2-3D94-465C-B58D-64A74B3ECF9B}.Debug|x64.ActiveCfg = Debug|x64
{7E3990D2-3D94-465C-B58D-64A74B3ECF9B}.Debug|x64.Build.0 = Debug|x64
{7E3990D2-3D94-465C-B58D-64A74B3ECF9B}.Release|Mixed Platforms.ActiveCfg = Release|x64
{7E3990D2-3D94-465C-B58D-64A74B3ECF9B}.Release|Mixed Platforms.Build.0 = Release|x64
{7E3990D2-3D94-465C-B58D-64A74B3ECF9B}.Release|Mixed Platforms.ActiveCfg = Release|Win32
{7E3990D2-3D94-465C-B58D-64A74B3ECF9B}.Release|Mixed Platforms.Build.0 = Release|Win32
{7E3990D2-3D94-465C-B58D-64A74B3ECF9B}.Release|Win32.ActiveCfg = Release|Win32
{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 = Release|Win32
{2EC4DDED-8F75-4C86-A10B-E1E8EB29F3EE}.Debug|Mixed Platforms.Build.0 = Release|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 = Debug|x64
{2EC4DDED-8F75-4C86-A10B-E1E8EB29F3EE}.Debug|x64.Build.0 = Debug|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}.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 = Release|Win32
{838B25C2-D19E-49FE-8CB0-9A977CA3C7E8}.Debug|Mixed Platforms.Build.0 = Release|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 = Debug|x64
{838B25C2-D19E-49FE-8CB0-9A977CA3C7E8}.Debug|x64.Build.0 = Debug|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}.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 = Release|Win32
{6A066806-F43F-4B31-A4E3-57179674F460}.Debug|Mixed Platforms.Build.0 = Release|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 = Debug|x64
{6A066806-F43F-4B31-A4E3-57179674F460}.Debug|x64.Build.0 = Debug|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}.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 = Release|Win32
{C5AA09D0-6594-4CD3-BD92-1D380C7B3B50}.Debug|Mixed Platforms.Build.0 = Release|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 = Debug|x64
{C5AA09D0-6594-4CD3-BD92-1D380C7B3B50}.Debug|x64.Build.0 = Debug|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}.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
@ -263,7 +263,8 @@ Global
{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|Win32
{DA2AA800-ED64-4649-8B3B-E7F1E3968B78}.Release|x64.ActiveCfg = Release|x64
{DA2AA800-ED64-4649-8B3B-E7F1E3968B78}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

View File

@ -71,32 +71,32 @@
<OutDir>$(SolutionDir)..\Bin\DLL\</OutDir>
<IntDir>$(SolutionDir)..\Obj\$(ProjectName)\$(PlatformShortName)\$(Configuration)\</IntDir>
<TargetName>$(ProjectName)_$(PlatformShortName)D</TargetName>
<LibraryPath>$(SolutionDir)..\External\Lib\Input;$(SolutionDir)..\Bin\DLL;$(LibraryPath)</LibraryPath>
<IncludePath>$(SolutionDir)..\External\Include\;$(SolutionDir)Game\GameProtocols\;$(SolutionDir)Network/NetworkAPI;$(IncludePath)</IncludePath>
<LibraryPath>$(SolutionDir)..\External\Lib\Input;$(SolutionDir)..\Bin\DLL;C:\Program Files %28x86%29\Visual Leak Detector\lib\Win32;$(LibraryPath)</LibraryPath>
<IncludePath>$(SolutionDir)..\External\Include\;$(SolutionDir)Game\GameProtocols\;$(SolutionDir)Network/NetworkAPI;$(IncludePath);C:\Program Files %28x86%29\Visual Leak Detector\include</IncludePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
<OutDir>$(SolutionDir)..\Bin\DLL\</OutDir>
<IntDir>$(SolutionDir)..\Obj\$(ProjectName)\$(PlatformShortName)\$(Configuration)\</IntDir>
<TargetName>$(ProjectName)_$(PlatformShortName)D</TargetName>
<LibraryPath>$(SolutionDir)..\External\Lib\Input;$(SolutionDir)..\Bin\DLL;$(LibraryPath)</LibraryPath>
<IncludePath>$(SolutionDir)..\External\Include\;$(IncludePath)</IncludePath>
<LibraryPath>$(SolutionDir)..\External\Lib\Input;$(SolutionDir)..\Bin\DLL;C:\Program Files %28x86%29\Visual Leak Detector\lib\Win64;$(LibraryPath)</LibraryPath>
<IncludePath>$(SolutionDir)..\External\Include\;$(IncludePath);C:\Program Files %28x86%29\Visual Leak Detector\include</IncludePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
<OutDir>$(SolutionDir)..\Bin\DLL\</OutDir>
<IntDir>$(SolutionDir)..\Obj\$(ProjectName)\$(PlatformShortName)\$(Configuration)\</IntDir>
<TargetName>$(ProjectName)_$(PlatformShortName)</TargetName>
<LibraryPath>$(SolutionDir)..\External\Lib\Input;$(SolutionDir)..\Bin\DLL;$(LibraryPath)</LibraryPath>
<IncludePath>$(SolutionDir)..\External\Include\;$(IncludePath)</IncludePath>
<LibraryPath>$(SolutionDir)..\External\Lib\Input;$(SolutionDir)..\Bin\DLL;C:\Program Files %28x86%29\Visual Leak Detector\lib\Win32;$(LibraryPath)</LibraryPath>
<IncludePath>$(SolutionDir)..\External\Include\;$(IncludePath);C:\Program Files %28x86%29\Visual Leak Detector\include</IncludePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
<OutDir>$(SolutionDir)..\Bin\DLL\</OutDir>
<IntDir>$(SolutionDir)..\Obj\$(ProjectName)\$(PlatformShortName)\$(Configuration)\</IntDir>
<TargetName>$(ProjectName)_$(PlatformShortName)</TargetName>
<LibraryPath>$(SolutionDir)..\External\Lib\Input;$(SolutionDir)..\Bin\DLL;$(LibraryPath)</LibraryPath>
<IncludePath>$(SolutionDir)..\External\Include\;$(IncludePath)</IncludePath>
<LibraryPath>$(SolutionDir)..\External\Lib\Input;$(SolutionDir)..\Bin\DLL;C:\Program Files %28x86%29\Visual Leak Detector\lib\Win64;$(LibraryPath)</LibraryPath>
<IncludePath>$(SolutionDir)..\External\Include\;$(IncludePath);C:\Program Files %28x86%29\Visual Leak Detector\include</IncludePath>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>

View File

@ -31,33 +31,55 @@ namespace DanBias
{
int pType = p[0].value.netInt;
Client::GameClientState::ProtocolStruct* protocolData;
//Client::GameClientState::ProtocolStruct* protocolData;
switch (pType)
{
case protocol_PlayerNavigation:
break;
case protocol_PlayerPosition:
protocolData = new Client::GameClientState::PlayerPos;
for(int i = 0; i< 3; i++)
case protocol_Gamplay_PlayerNavigation:
{
((Client::GameClientState::PlayerPos*)protocolData)->playerPos[i] = p[i].value.netFloat;
Client::GameClientState::KeyInput* protocolData = new Client::GameClientState::KeyInput;
for(int i = 0; i< 6; i++)
{
protocolData->key[i] = p[i+1].value.netBool;
}
((Client::GameState*)gameClientState)->Protocol(protocolData);
delete protocolData;
protocolData = NULL;
}
break;
case protocol_Gamplay_PlayerPosition:
{
Client::GameClientState::PlayerPos* protocolData = new Client::GameClientState::PlayerPos;
for(int i = 0; i< 3; i++)
{
protocolData->playerPos[i] = p[i].value.netFloat;
}
//if(dynamic_cast<Client::GameState*>(gameClientState))
gameClientState->Protocol(protocolData);
delete protocolData;
protocolData = NULL;
}
gameClientState->Protocol(protocolData);
delete protocolData;
protocolData = NULL;
break;
case protocol_ObjectPosition:
protocolData = new Client::GameClientState::ObjPos;
for(int i = 0; i< 16; i++)
case protocol_Gamplay_ObjectPosition:
{
((Client::GameClientState::ObjPos*)protocolData)->worldPos[i] = p[i].value.netFloat;
Client::GameClientState::ObjPos* protocolData = new Client::GameClientState::ObjPos;
protocolData->object_ID = p[1].value.netInt;
for(int i = 0; i< 16; i++)
{
protocolData->worldPos[i] = p[i+2].value.netFloat;
}
gameClientState->Protocol(protocolData);
delete protocolData;
protocolData = NULL;
}
gameClientState->Protocol(protocolData);
delete protocolData;
protocolData = NULL;
break;
default:
@ -79,9 +101,9 @@ namespace DanBias
}
public:
Client::GameClientState* gameClientState;
//Client::GameClientState* gameClientState;
InputClass* inputObj;
MyRecieverObject* r;
MyRecieverObject* recieverObj;
} data;
#pragma endregion
@ -110,17 +132,19 @@ namespace DanBias
prevTimeStamp = 0;
QueryPerformanceCounter((LARGE_INTEGER*)&prevTimeStamp);
m_data->r = new MyRecieverObject;
m_data->r->nwClient = new Oyster::Network::NetworkClient();
m_data->r->nwClient->Connect(desc.port, desc.IP);
if (!m_data->r->nwClient->IsConnected())
m_data->recieverObj = new MyRecieverObject;
m_data->recieverObj->nwClient = new Oyster::Network::NetworkClient(m_data->recieverObj, Oyster::Network::NetworkProtocolCallbackType_Object);
m_data->recieverObj->nwClient->Connect(desc.port, desc.IP);
if (!m_data->recieverObj->nwClient->IsConnected())
{
// failed to connect
return DanBiasClientReturn_Error;
}
// Start in lobby state
m_data->gameClientState = new Client::LobbyState();
m_data->gameClientState->Init(m_data->r->nwClient);
m_data->recieverObj->gameClientState = new Client::LobbyState();
m_data->recieverObj->gameClientState->Init(m_data->recieverObj->nwClient);
return DanBiasClientReturn_Sucess;
@ -237,27 +261,27 @@ namespace DanBias
m_data->inputObj->Update();
DanBias::Client::GameClientState::ClientState state = DanBias::Client::GameClientState::ClientState_Same;
state = m_data->gameClientState->Update(deltaTime, m_data->inputObj);
state = m_data->recieverObj->gameClientState->Update(deltaTime, m_data->inputObj);
if(state != Client::GameClientState::ClientState_Same)
{
m_data->gameClientState->Release();
delete m_data->gameClientState;
m_data->gameClientState = NULL;
m_data->recieverObj->gameClientState->Release();
delete m_data->recieverObj->gameClientState;
m_data->recieverObj->gameClientState = NULL;
switch (state)
{
case Client::GameClientState::ClientState_Lobby:
m_data->gameClientState = new Client::LobbyState();
m_data->recieverObj->gameClientState = new Client::LobbyState();
break;
case Client::GameClientState::ClientState_Game:
m_data->gameClientState = new Client::GameState();
m_data->recieverObj->gameClientState = new Client::GameState();
break;
default:
return E_FAIL;
break;
}
m_data->gameClientState->Init(m_data->r->nwClient); // send game client
m_data->recieverObj->gameClientState->Init(m_data->recieverObj->nwClient); // send game client
}
return S_OK;
@ -275,15 +299,18 @@ namespace DanBias
swprintf(title, sizeof(title), L"| Pressing A: %d | \n", (int)(isPressed));
SetWindowText(g_hWnd, title);
m_data->gameClientState->Render();
m_data->recieverObj->gameClientState->Render();
return S_OK;
}
HRESULT DanBiasGame::CleanUp()
{
m_data->gameClientState->Release();
delete m_data->gameClientState;
m_data->recieverObj->gameClientState->Release();
delete m_data->recieverObj->gameClientState;
m_data->recieverObj->nwClient->Disconnect();
delete m_data->recieverObj->nwClient;
delete m_data->recieverObj;
delete m_data->inputObj;
delete m_data;

View File

@ -20,7 +20,7 @@ private:
public:
virtual void Init(ModelInitData modelInit) = 0;
virtual void setPos() = 0;
virtual void setPos(Oyster::Math::Float4x4 world) = 0;
virtual void Render() = 0;
virtual void Release() = 0;

View File

@ -26,9 +26,9 @@ void C_DynamicObj::Init(ModelInitData modelInit)
privData->model->WorldMatrix = modelInit.world;
privData->model->Visible = modelInit.visible;
}
void C_DynamicObj::setPos()
void C_DynamicObj::setPos(Oyster::Math::Float4x4 world)
{
privData->model->WorldMatrix = world;
}
void C_DynamicObj::Render()

View File

@ -14,7 +14,7 @@ public:
C_DynamicObj(void);
virtual ~C_DynamicObj(void);
void Init(ModelInitData modelInit);
void setPos();
void setPos(Oyster::Math::Float4x4 world);
void Render();
void Release();

View File

@ -30,9 +30,9 @@ void C_Player::Init(ModelInitData modelInit)
}
void C_Player::setPos()
void C_Player::setPos(Oyster::Math::Float4x4 world)
{
privData->model->WorldMatrix = world;
}
void C_Player::Render()

View File

@ -15,7 +15,7 @@ public:
C_Player(void);
~C_Player(void);
void Init(ModelInitData modelInit);
void setPos();
void setPos(Oyster::Math::Float4x4 world);
void Render();
void Release();

View File

@ -29,9 +29,9 @@ void C_StaticObj::Init(ModelInitData modelInit)
privData->model->Visible = modelInit.visible;
}
void C_StaticObj::setPos()
void C_StaticObj::setPos(Oyster::Math::Float4x4 world)
{
privData->model->WorldMatrix = world;
}
void C_StaticObj::Render()

View File

@ -14,7 +14,7 @@ public:
C_StaticObj(void);
virtual ~C_StaticObj(void);
void Init(ModelInitData modelInit);
void setPos();
void setPos(Oyster::Math::Float4x4 world);
void Render();
void Release();

View File

@ -27,9 +27,9 @@ void C_UIobject::Init(ModelInitData modelInit)
privData->model->Visible = modelInit.visible;
}
void C_UIobject::setPos()
void C_UIobject::setPos(Oyster::Math::Float4x4 world)
{
privData->model->WorldMatrix = world;
}
void C_UIobject::Render()

View File

@ -14,7 +14,7 @@ namespace DanBias
C_UIobject(void);
virtual ~C_UIobject(void);
void Init(ModelInitData modelInit);
void setPos();
void setPos(Oyster::Math::Float4x4 world);
void Render();
void Release();

View File

@ -19,8 +19,13 @@ public:
};
struct ObjPos :public ProtocolStruct
{
int object_ID;
float worldPos[16];
};
struct KeyInput :public ProtocolStruct
{
bool key[6];
};
struct PlayerPos :public ProtocolStruct
{
float playerPos[3];

View File

@ -91,8 +91,8 @@ GameClientState::ClientState GameState::Update(float deltaTime, InputClass* KeyI
case gameStateState_playing:
// read server data
// update objects
// Client.send(obj);
{
bool send = false;
GameLogic::Protocol_PlayerMovement movePlayer;
movePlayer.bForward = false;
movePlayer.bBackward = false;
@ -105,23 +105,31 @@ GameClientState::ClientState GameState::Update(float deltaTime, InputClass* KeyI
if(KeyInput->IsKeyPressed(DIK_W))
{
movePlayer.bForward = true;
send = true;
}
if(KeyInput->IsKeyPressed(DIK_S))
{
movePlayer.bBackward = true;
send = true;
}
if(KeyInput->IsKeyPressed(DIK_A))
{
movePlayer.bStrafeLeft = true;
send = true;
}
if(KeyInput->IsKeyPressed(DIK_D))
{
movePlayer.bStrafeRight = true;
send = true;
}
if (privData->nwClient->IsConnected() && send)
{
privData->nwClient->Send(movePlayer);
}
privData->nwClient->Send(movePlayer);
// send event data
//
if(KeyInput->IsKeyPressed(DIK_L))
privData->state = GameState::gameStateState_end;
}
@ -164,17 +172,64 @@ bool GameState::Release()
void GameState::Protocol(ProtocolStruct* pos)
{
// move message
/*
if ((KeyInput*)pos)
{
}
if((ObjPos*)pos)
ObjectPosProtocol((ObjPos*)pos);
else if((PlayerPos*)pos)
PlayerPosProtocol((PlayerPos*)pos);
PlayerPosProtocol((PlayerPos*)pos);*/
}
void GameState::Protocol( PlayerPos* pos )
{
Oyster::Math::Float4x4 world, translate;
world = Oyster::Math::Float4x4::identity;
translate = Oyster::Math::Float4x4::identity;
translate = Oyster::Math3D::TranslationMatrix(Oyster::Math::Float3(pos->playerPos[0],pos->playerPos[1],pos->playerPos[2]));
world = world * translate;
privData->object[0]->setPos( world );
}
void GameState::Protocol( ObjPos* pos )
{
Oyster::Math::Float4x4 world;
for(int i = 0; i<16; i++)
{
world[i] = pos->worldPos[i];
}
privData->object[pos->object_ID]->setPos(world);
}
void GameState::Protocol( KeyInput* pos )
{
bool key = false;
for (int i = 0; i < 6; i++)
{
key = pos->key[i];
}
}
void GameState::PlayerPosProtocol(PlayerPos* pos)
{
Oyster::Math::Float4x4 world, translate;
world = Oyster::Math::Float4x4::identity;
translate = Oyster::Math::Float4x4::identity;
translate = Oyster::Math3D::TranslationMatrix(Oyster::Math::Float3(pos->playerPos[0],pos->playerPos[1],pos->playerPos[2] ));
world = translate;
privData->object[0]->setPos( world );
}
void GameState::ObjectPosProtocol(ObjPos* pos)
{
Oyster::Math::Float4x4 world;
for(int i = 0; i<16; i++)
{
world[i] = pos->worldPos[i];
}
privData->object[1]->setPos(world);
}
//void GameState::Protocol(LightPos pos);

View File

@ -32,6 +32,9 @@ public:
bool Release()override;
void Protocol(ProtocolStruct* pos)override;
void Protocol(PlayerPos* pos);
void Protocol(ObjPos* pos);
void Protocol(KeyInput* pos);
void PlayerPosProtocol(PlayerPos* pos);
void ObjectPosProtocol(ObjPos* pos);
//void Protocol(LightPos pos);

View File

@ -5,7 +5,6 @@
#include <Windows.h>
#include <vld.h>
//#include "DanBiasServerAPI.h"
#include "DanBiasGame.h"
@ -29,8 +28,8 @@ int WINAPI WinMain( HINSTANCE hinst, HINSTANCE prevInst, PSTR cmdLine, int cmdSh
}
// Game client starter code goes here
DanBias::DanBiasGameDesc gameDesc;
gameDesc.port = 1;
gameDesc.IP = "10.1010.303";
gameDesc.port = 15151;
gameDesc.IP = "193.11.186.101";
gameDesc.hinst = hinst;
gameDesc.nCmdShow = cmdShow;

View File

@ -18,7 +18,7 @@ namespace DanBias
using namespace Oyster::Network;
void GameServer::ClientConnectCallback(NetworkClient& client)
void GameServer::ClientConnectCallback(NetworkClient* client)
{
printf("Client connected!\n");

View File

@ -23,7 +23,7 @@ namespace DanBias
private:
//static void ClientConnectCallbackFunction(Oyster::Network::NetworkClient& connectedClient);
void ClientConnectCallback(Oyster::Network::NetworkClient& client) override;
void ClientConnectCallback(Oyster::Network::NetworkClient* client) override;
bool initiated;
bool running;

View File

@ -2,15 +2,15 @@
using namespace DanBias;
ClientObject::ClientObject(const Oyster::Network::NetworkClient& client)
ClientObject::ClientObject(Oyster::Network::NetworkClient* client)
{
this->client = client;
this->client.SetRecieverObject(this, Oyster::Network::NetworkProtocolCallbackType_Object);
this->client->SetRecieverObject(this, Oyster::Network::NetworkProtocolCallbackType_Object);
this->box = 0;
}
ClientObject::~ClientObject()
{
this->client.Disconnect();
this->client->Disconnect();
}
void ClientObject::SetPostbox(Oyster::PostBox<NetworkSession::NetEvent>* box)
@ -23,11 +23,12 @@ GameLogic::Player* ClientObject::Logic_Object()
}
Oyster::Network::NetworkClient* ClientObject::NetClient_Object()
{
return &this->client;
return this->client;
}
void ClientObject::ProtocolRecievedCallback(Oyster::Network::CustomNetProtocol& protocol)
{
//this->client->Send(&protocol);
if(!this->box) return;
NetworkSession::NetEvent _event;

View File

@ -13,7 +13,7 @@ namespace DanBias
:public Oyster::Network::ProtocolRecieverObject
{
public:
ClientObject(const Oyster::Network::NetworkClient& client);
ClientObject(Oyster::Network::NetworkClient* client);
~ClientObject();
void SetPostbox(Oyster::PostBox<NetworkSession::NetEvent>* box);
@ -26,7 +26,7 @@ namespace DanBias
private:
GameLogic::Player logicPlayer;
Oyster::Network::NetworkClient client;
Utility::DynamicMemory::SmartPointer<Oyster::Network::NetworkClient> client;
Oyster::IPostBox<DanBias::NetworkSession::NetEvent>* box;
};

View File

@ -3,6 +3,8 @@
#include "NetworkSession.h"
#include <mutex>
static std::mutex ClientListLock;
namespace DanBias
{
NetworkSession::NetworkSession()
@ -16,16 +18,27 @@ namespace DanBias
void NetworkSession::AttachClient(Utility::DynamicMemory::SmartPointer<ClientObject> client)
{
for (unsigned int i = 0; i < this->clients.size(); i++)
while (!ClientListLock.try_lock()); //Possible Deadlock
int k = -1;
for (unsigned int i = 0; (k == -1) && i < this->clients.size(); i++)
{
if(!this->clients[i])
{
this->clients[i] = client;
this->clients[i]->SetPostbox(&this->box);
return;
}
k = i;
}
this->clients.push_back(client);
if(k == -1)
{
this->clients.push_back(client);
this->clients[this->clients.size() - 1]->SetPostbox(&this->box);
}
else
{
this->clients[k]->SetPostbox(&this->box);
}
ClientListLock.unlock();
}
void NetworkSession::DetachClient(Oyster::Network::NetworkClient* client)

View File

@ -154,7 +154,6 @@
</Lib>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="LobbyProtocols.h" />
<ClInclude Include="ObjectProtocols.h" />
<ClInclude Include="PlayerProtocols.h" />
<ClInclude Include="ProtocolIdentificationID.h" />

View File

@ -10,15 +10,17 @@ namespace GameLogic
{
struct Protocol_ObjectPosition :public Oyster::Network::CustomProtocolObject
{
int object_ID;
float worldMatrix[16];
// look at dir
Protocol_ObjectPosition()
{
this->protocol[0].value = protocol_PlayerPosition;
this->protocol[0].value = protocol_Gamplay_ObjectPosition;
this->protocol[0].type = Oyster::Network::NetAttributeType_Int;
this->protocol[1].type = Oyster::Network::NetAttributeType_Float;
this->protocol[1].type = Oyster::Network::NetAttributeType_Int;
this->protocol[2].type = Oyster::Network::NetAttributeType_Float;
this->protocol[3].type = Oyster::Network::NetAttributeType_Float;
this->protocol[4].type = Oyster::Network::NetAttributeType_Float;
@ -34,27 +36,29 @@ namespace GameLogic
this->protocol[14].type = Oyster::Network::NetAttributeType_Float;
this->protocol[15].type = Oyster::Network::NetAttributeType_Float;
this->protocol[16].type = Oyster::Network::NetAttributeType_Float;
this->protocol[17].type = Oyster::Network::NetAttributeType_Float;
}
Oyster::Network::CustomNetProtocol* GetProtocol() override
{
this->protocol[1].value = worldMatrix[0];
this->protocol[1].value = object_ID;
this->protocol[2].value = worldMatrix[1];
this->protocol[3].value = worldMatrix[2]; //Forgot?
this->protocol[4].value = worldMatrix[4]; //Forgot?
this->protocol[5].value = worldMatrix[5];
this->protocol[6].value = worldMatrix[6];
this->protocol[7].value = worldMatrix[7];
this->protocol[8].value = worldMatrix[8];
this->protocol[9].value = worldMatrix[9];
this->protocol[10].value = worldMatrix[10];
this->protocol[11].value = worldMatrix[11];
this->protocol[12].value = worldMatrix[12];
this->protocol[13].value = worldMatrix[13];
this->protocol[14].value = worldMatrix[14];
this->protocol[15].value = worldMatrix[15];
this->protocol[16].value = worldMatrix[16];
this->protocol[3].value = worldMatrix[2];
this->protocol[4].value = worldMatrix[3];
this->protocol[5].value = worldMatrix[4];
this->protocol[6].value = worldMatrix[5];
this->protocol[7].value = worldMatrix[6];
this->protocol[8].value = worldMatrix[7];
this->protocol[9].value = worldMatrix[8];
this->protocol[10].value = worldMatrix[9];
this->protocol[11].value = worldMatrix[10];
this->protocol[12].value = worldMatrix[11];
this->protocol[13].value = worldMatrix[12];
this->protocol[14].value = worldMatrix[13];
this->protocol[15].value = worldMatrix[14];
this->protocol[16].value = worldMatrix[15];
this->protocol[17].value = worldMatrix[16];
return &protocol;
}

View File

@ -15,7 +15,7 @@ namespace GameLogic
{
struct Protocol_PlayerMovement :public Oyster::Network::CustomProtocolObject
{
int ProtocolID;
bool bForward;
bool bBackward;
bool bTurnLeft;
@ -25,9 +25,9 @@ namespace GameLogic
Protocol_PlayerMovement()
{
this->protocol[0].value = ProtocolID = protocol_Gamplay_PlayerNavigation;
this->protocol[0].value = protocol_Gamplay_PlayerNavigation;
this->protocol[0].type = Oyster::Network::NetAttributeType_Short;
this->protocol[0].type = Oyster::Network::NetAttributeType_Int;
this->protocol[1].type = Oyster::Network::NetAttributeType_Bool;
this->protocol[2].type = Oyster::Network::NetAttributeType_Bool;
this->protocol[3].type = Oyster::Network::NetAttributeType_Bool;
@ -53,13 +53,14 @@ namespace GameLogic
struct Protocol_PlayerPosition :public Oyster::Network::CustomProtocolObject
{
float position[3];
// look at dir
Protocol_PlayerPosition()
{
this->protocol[0].value = protocol_Gamplay_PlayerPosition;
this->protocol[0].type = Oyster::Network::NetAttributeType_Int;
this->protocol[0].type = Oyster::Network::NetAttributeType_Short;
this->protocol[1].type = Oyster::Network::NetAttributeType_Float;
this->protocol[2].type = Oyster::Network::NetAttributeType_Float;
@ -68,7 +69,6 @@ namespace GameLogic
}
Oyster::Network::CustomNetProtocol* GetProtocol() override
{
this->protocol[1].value = position[0];
this->protocol[2].value = position[1];
this->protocol[3].value = position[2];

View File

@ -47,6 +47,8 @@ namespace Oyster
OYSTER_THREAD_ERROR Swap(const OysterThread* other);
bool IsActive();
void SetPriority(OYSTER_THREAD_PRIORITY priority);
bool IsCreated() const;
};
}
}

View File

@ -59,10 +59,12 @@ using namespace Utility::DynamicMemory;
};
struct OysterThread::PrivateData
{
bool isCreated;
SmartPointer<ThreadData> threadData;
PrivateData()
{
isCreated = false;
threadData = new ThreadData();
threadData->first = true;
threadData->owner = 0;
@ -73,6 +75,7 @@ using namespace Utility::DynamicMemory;
}
PrivateData(const PrivateData& o)
{
isCreated = o.isCreated;
threadData = o.threadData;
}
const PrivateData& operator=(const PrivateData& o)
@ -81,7 +84,13 @@ using namespace Utility::DynamicMemory;
}
~PrivateData()
{
threadData.Release();
//if(threadData.Release() == 0)
//{
// if(this->threadData->workerThread->joinable())
// {
// this->threadData->workerThread->join();
// }
//}
}
};
@ -109,10 +118,12 @@ theBegining:
std::this_thread::sleep_for(std::chrono::milliseconds(1));
break;
case Oyster::Thread::OYSTER_THREAD_PRIORITY_3:
std::this_thread::yield();
std::this_thread::sleep_for(std::chrono::milliseconds(10));
//std::this_thread::yield();
break;
}
if(w->owner) shouldContinue = w->owner->DoWork();
if(w->owner)
shouldContinue = w->owner->DoWork();
if(w->state == OYSTER_THREAD_STATE_RESET) goto theBegining;
else if(w->msec > 0) std::this_thread::sleep_for(std::chrono::milliseconds(w->msec));
@ -122,7 +133,8 @@ theBegining:
if(w->state == OYSTER_THREAD_STATE_DEAD)
{
if(w->workerThread->joinable()) w->workerThread->detach();
if(w->workerThread->joinable())
w->workerThread->detach();
return;
}
@ -156,6 +168,7 @@ OysterThread::~OysterThread()
OYSTER_THREAD_ERROR OysterThread::Create(IThreadObject* worker, bool start)
{
if(!this->privateData) return OYSTER_THREAD_ERROR_FAILED;
if(this->IsCreated()) return OYSTER_THREAD_ERROR_FAILED;
if(this->privateData->threadData->workerThread) return OYSTER_THREAD_ERROR_FAILED;
this->privateData->threadData->owner = worker;
@ -172,6 +185,8 @@ OYSTER_THREAD_ERROR OysterThread::Create(IThreadObject* worker, bool start)
{
this->privateData->threadData->state = OYSTER_THREAD_STATE_RUNNING;
}
this->privateData->isCreated = true;
return OYSTER_THREAD_ERROR_SUCCESS;
}
OYSTER_THREAD_ERROR OysterThread::Start()
@ -276,4 +291,7 @@ void OysterThread::SetPriority(OYSTER_THREAD_PRIORITY priority)
{
this->privateData->threadData->prio = priority;
}
bool OysterThread::IsCreated() const
{
return privateData->isCreated;
}

View File

@ -32,7 +32,6 @@ struct CustomNetProtocol::PrivateData
attributes[i->first] = i->second;
}
}
attributes = o.attributes;
}
~PrivateData()
{

View File

@ -78,7 +78,7 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
<IncludePath>C:\Program Files %28x86%29\Visual Leak Detector\include;$(IncludePath)</IncludePath>
<LibraryPath>C:\Program Files %28x86%29\Visual Leak Detector\lib\Win32;$(LibraryPath)</LibraryPath>
<LibraryPath>C:\Program Files %28x86%29\Visual Leak Detector\lib\Win64;$(LibraryPath)</LibraryPath>
<IntDir>$(SolutionDir)..\Obj\$(ProjectName)\$(PlatformShortName)\$(Configuration)\</IntDir>
<OutDir>$(SolutionDir)..\Bin\DLL\</OutDir>
<TargetName>$(ProjectName)_$(PlatformShortName)D</TargetName>
@ -88,12 +88,16 @@
<IntDir>$(SolutionDir)..\Obj\$(ProjectName)\$(PlatformShortName)\$(Configuration)\</IntDir>
<OutDir>$(SolutionDir)..\Bin\DLL\</OutDir>
<TargetName>$(ProjectName)_$(PlatformShortName)</TargetName>
<IncludePath>C:\Program Files %28x86%29\Visual Leak Detector\include;$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(WindowsSDK_IncludePath);</IncludePath>
<LibraryPath>C:\Program Files %28x86%29\Visual Leak Detector\lib\Win32;$(VCInstallDir)lib;$(VCInstallDir)atlmfc\lib;$(WindowsSDK_LibraryPath_x86);</LibraryPath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
<IntDir>$(SolutionDir)..\Obj\$(ProjectName)\$(PlatformShortName)\$(Configuration)\</IntDir>
<OutDir>$(SolutionDir)..\Bin\DLL\</OutDir>
<TargetName>$(ProjectName)_$(PlatformShortName)</TargetName>
<LibraryPath>C:\Program Files %28x86%29\Visual Leak Detector\lib\Win64;$(VCInstallDir)lib\amd64;$(VCInstallDir)atlmfc\lib\amd64;$(WindowsSDK_LibraryPath_x64);</LibraryPath>
<IncludePath>C:\Program Files %28x86%29\Visual Leak Detector\include;$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(WindowsSDK_IncludePath);</IncludePath>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>

View File

@ -26,15 +26,16 @@ namespace Oyster
class NetworkClient;
class CustomNetProtocol;
typedef void (*ClientConnectCallbackMethod)(NetworkClient);
typedef void (*ClientConnectCallbackMethod)(NetworkClient*);
typedef void(*ProtocolRecieverFunction)(CustomNetProtocol& protocol);
struct ClientConnectedObject
{
virtual void ClientConnectCallback(NetworkClient& client) = 0;
virtual void ClientConnectCallback(NetworkClient* client) = 0;
};
struct ProtocolRecieverObject
{
virtual void ProtocolRecievedCallback(CustomNetProtocol& protocol) = 0;
virtual void DisconnectedCallback(CustomNetProtocol& protocol) { };
};
union RecieverObject

View File

@ -48,8 +48,9 @@ struct ClientDataContainer
InitWinSock();
callbackType = NetworkProtocolCallbackType_Unknown;
sendPostBox = new PostBox<CustomNetProtocol>();
connection.SetBlockingMode(false);
connection.InitiateClient();
connection.SetBlockingMode(false);
}
ClientDataContainer(IThreadObject* o, unsigned int socket )
:connection(socket), ID(currID++)
@ -85,10 +86,10 @@ struct NetworkClient::PrivateData : public IThreadObject
{
if(!this->data)return true;
if(!this->data->connection.IsConnected()) return true;
Send();
Recv();
return true;
}
@ -122,32 +123,30 @@ struct NetworkClient::PrivateData : public IThreadObject
{
int errorCode = -1;
if(this->data->callbackType == NetworkProtocolCallbackType_Function)
{
OysterByte temp = OysterByte();
errorCode = this->data->connection.Recieve(temp);
if(errorCode == 0)
{
CustomNetProtocol protocol;
bool ok = this->data->translator.Unpack(protocol, temp);
OysterByte temp = OysterByte();
errorCode = this->data->connection.Recieve(temp);
//Check if the protocol was unpacked correctly
if(ok)
if(errorCode == 0 && temp.GetSize())
{
CustomNetProtocol protocol;
bool ok = this->data->translator.Unpack(protocol, temp);
//Check if the protocol was unpacked correctly
if(ok)
{
this->data->recvObjMutex.lock();
if(this->data->callbackType == NetworkProtocolCallbackType_Function)
{
this->data->recvObjMutex.lock();
if(this->data->callbackType == NetworkProtocolCallbackType_Function)
{
this->data->recvObj.protocolRecieverFnc(protocol);
}
else if(this->data->callbackType == NetworkProtocolCallbackType_Object)
{
this->data->recvObj.protocolRecievedObject->ProtocolRecievedCallback(protocol);
}
this->data->recvObjMutex.unlock();
this->data->recvObj.protocolRecieverFnc(protocol);
}
else if(this->data->callbackType == NetworkProtocolCallbackType_Object)
{
this->data->recvObj.protocolRecievedObject->ProtocolRecievedCallback(protocol);
}
this->data->recvObjMutex.unlock();
}
}
return errorCode;
}
@ -166,19 +165,22 @@ NetworkClient::NetworkClient()
NetworkClient::NetworkClient(unsigned int socket)
{
privateData = new PrivateData(socket);
this->privateData->data->thread.Create(this->privateData, true);
}
NetworkClient::NetworkClient(RecieverObject recvObj, NetworkProtocolCallbackType type)
{
privateData = new PrivateData();
this->privateData->data->recvObj = SmartPointer<RecieverObject>(&recvObj);;
this->privateData->data->callbackType = type;
this->privateData->data->recvObj = recvObj;
}
NetworkClient::NetworkClient(RecieverObject recvObj, NetworkProtocolCallbackType type, unsigned int socket)
{
privateData = new PrivateData(socket);
this->privateData->data->recvObj = SmartPointer<RecieverObject>(&recvObj);
this->privateData->data->recvObj = recvObj;
this->privateData->data->callbackType = type;
this->privateData->data->thread.Create(this->privateData, true);
}
NetworkClient::NetworkClient(const NetworkClient& obj)
@ -204,16 +206,20 @@ NetworkClient::~NetworkClient()
bool NetworkClient::Connect(unsigned short port, const char serverIP[])
{
privateData->data->connection.SetBlockingMode(true);
int result = this->privateData->data->connection.Connect(port, serverIP);
//Connect has succeeded
if(result == 0)
{
privateData->data->thread.Start();
if(this->privateData->data->thread.IsCreated()) return false;
this->privateData->data->thread.Create(this->privateData, true);
privateData->data->connection.SetBlockingMode(false);
return true;
}
privateData->data->connection.SetBlockingMode(false);
//Connect has failed
return false;
@ -234,9 +240,14 @@ void NetworkClient::Send(CustomProtocolObject& protocol)
this->privateData->Send(protocol.GetProtocol());
}
void NetworkClient::Send(CustomNetProtocol* protocol)
{
this->privateData->Send(protocol);
}
void NetworkClient::SetRecieverObject(RecieverObject recvObj, NetworkProtocolCallbackType type)
{
if (type == NetworkProtocolCallbackType_Unknown) return;
if (type == NetworkProtocolCallbackType_Unknown) return; //It should probably still be set even if it is unknown.
privateData->data->recvObjMutex.lock();
privateData->data->recvObj = recvObj;

View File

@ -40,6 +40,7 @@ namespace Oyster
//Adds the protocol to the queue of protocols to be sent.
void Send(CustomProtocolObject& protocol);
void Send(CustomNetProtocol* protocol);
void SetRecieverObject(RecieverObject recvObj, NetworkProtocolCallbackType type);

View File

@ -156,12 +156,12 @@ void NetworkServer::PrivateData::CheckForNewClient()
//Create client and Proc function if the pointer is not NULL
if(initDesc.callbackType == NetworkClientCallbackType_Function)
{
Oyster::Network::NetworkClient client(clientSocketNum);
Oyster::Network::NetworkClient *client = new Oyster::Network::NetworkClient(clientSocketNum);
initDesc.recvObj.clientConnectFnc(client);
}
else if(initDesc.callbackType == NetworkClientCallbackType_Object)
{
Oyster::Network::NetworkClient client(clientSocketNum);
Oyster::Network::NetworkClient *client = new Oyster::Network::NetworkClient(clientSocketNum);
initDesc.recvObj.clientConnectObject->ClientConnectCallback(client);
}
}

View File

@ -35,6 +35,7 @@ struct Translator::PrivateData
auto end = ((MyCastingStruct*)protocol.privateData)->attributes.end();
size = 4; //size(int)
message.SetSize(0);
message.PackInt(size, bytes);
//Find all the data types
@ -43,7 +44,7 @@ struct Translator::PrivateData
headerString.push_back(it->second.type);
}
message.PackShort(size, bytes);
message.PackShort(headerString.size(), bytes);
size += 2;
for(int i = 0; i < (int)headerString.size(); i++)
@ -220,6 +221,8 @@ void Translator::Pack(OysterByte &bytes, CustomNetProtocol& protocol)
bool Translator::Unpack(CustomNetProtocol& protocol, OysterByte &bytes)
{
this->privateData->headerString.clear();
if(!privateData->UnpackHeader(protocol, bytes))
{
return false;

View File

@ -7,23 +7,37 @@
using namespace Oyster::Network;
int CloseSocket(int &socket)
{
if(socket == -1) return 0;
if(closesocket( socket ) == SOCKET_ERROR)
{
return WSAGetLastError();
}
socket = -1;
return 0;
}
Connection::Connection()
{
this->socket = -1;
bool stillSending = false;
bool closed = true;
this->stillSending = false;
this->closed = true;
}
Connection::Connection(int socket)
{
this->socket = socket;
bool stillSending = false;
bool closed = true;
this->stillSending = true;
this->closed = false;
}
Connection::~Connection()
{
closesocket( this->socket );
CloseSocket( this->socket );
}
int Connection::Connect(unsigned short port , const char serverName[])
@ -68,7 +82,7 @@ int Connection::InitiateServer(unsigned short port)
if(bind(this->socket, (sockaddr*)&server, sizeof(server)) == SOCKET_ERROR)
{
errorCode = WSAGetLastError();
closesocket(this->socket);
CloseSocket(this->socket);
return errorCode;
}
@ -76,7 +90,7 @@ int Connection::InitiateServer(unsigned short port)
if(listen(this->socket, 5) == SOCKET_ERROR)
{
errorCode = WSAGetLastError();
closesocket(this->socket);
CloseSocket(this->socket);
return errorCode;
}
@ -94,14 +108,7 @@ int Connection::InitiateClient()
int Connection::Disconnect()
{
int result = closesocket(this->socket);
if(result == SOCKET_ERROR)
{
return WSAGetLastError();
}
return 0;
return CloseSocket(this->socket);
}
int Connection::Send(OysterByte &bytes)
@ -186,6 +193,8 @@ int Connection::SetBlockingMode(bool blocking)
///////////////////////////////////////
int Connection::InitiateSocket()
{
if(this->socket != -1) return 0;
this->socket = (int)::socket(AF_INET, SOCK_STREAM, 0);
if(this->socket == SOCKET_ERROR)
{

View File

@ -44,6 +44,7 @@ void OysterByte::Resize(unsigned int cap)
{
delete[] byteArray;
byteArray = new unsigned char[cap];
capacity = cap;
}
}
@ -59,13 +60,14 @@ unsigned char* OysterByte::GetByteArray()
void OysterByte::AddSize(unsigned int size)
{
int oldSize = this->size;
this->size += size;
int newCapacity = this->size + size;
if(this->size >= capacity)
if(newCapacity >= capacity)
{
IncreaseCapacity(oldSize);
IncreaseCapacity(newCapacity);
}
this->size += size;
}
void OysterByte::SetBytes(unsigned char* bytes)
@ -109,16 +111,35 @@ OysterByte::operator unsigned char*()
return byteArray;
}
OysterByte& OysterByte::operator +=(const OysterByte& obj)
{
int newSize = this->size + obj.size;
if(newSize >= (int)capacity)
{
IncreaseCapacity(newSize);
}
for(int i = size, j = 0; i < newSize; i++, j++)
{
this->byteArray[i] = obj.byteArray[j];
}
this->size = newSize;
return *this;
}
/////////////
// Private //
/////////////
void OysterByte::IncreaseCapacity(unsigned int oldSize)
void OysterByte::IncreaseCapacity(unsigned int newCapacity)
{
capacity = size * 2;
capacity = newCapacity * 2;
unsigned char* temp = new unsigned char[capacity];
for(int i = 0; i < (int)oldSize; i++)
for(int i = 0; i < (int)this->size; i++)
{
temp[i] = byteArray[i];
}

View File

@ -40,6 +40,8 @@ namespace Oyster
operator const char*();
operator unsigned char*();
OysterByte& operator +=(const OysterByte& obj);
private:
//Expands the byteArray
void IncreaseCapacity(unsigned int cap);

View File

@ -169,7 +169,7 @@ namespace Oyster
//bool (1-bit)
bool Unpackb(unsigned char buffer[])
{
return buffer;
return *buffer;
}
//char (8-bit)
@ -282,7 +282,7 @@ namespace Oyster
char* UnpackCStr(unsigned char buffer[])
{
short len = UnpackS(buffer);
char* str = new char[len];
char* str = new char[len+1];
buffer += 2;
for(int i = 0; i < len; i++)
@ -290,6 +290,8 @@ namespace Oyster
str[i] = buffer[i];
}
str[len] = '\0';
return str;
}

View File

@ -1,22 +1,16 @@
#include <iostream>
#include <WinSock2.h>
#include <vld.h>
#include "../NetworkDependencies/WinsockFunctions.h"
#include "..\NetworkDependencies\Protocols.h"
#include "../NetworkDependencies/OysterByte.h"
#include "../../Misc/ThreadSafeQueue.h"
#include "../NetworkDependencies/ThreadedClient.h"
#include "../../Misc/WinTimer.h"
#include "../../Misc/Utilities.h"
#include "../NetworkAPI/NetworkClient.h"
#pragma comment(lib, "ws2_32.lib")
#include "..\..\Game\GameProtocols\PlayerProtocols.h"
using namespace std;
using namespace Oyster::Network::Protocols;
using namespace Oyster::Network;
using namespace Utility;
using namespace Utility::DynamicMemory;
void proc(CustomNetProtocol& protocol)
{
@ -25,6 +19,7 @@ void proc(CustomNetProtocol& protocol)
int main()
{
SetDllDirectory("..\\DLL\\");
int errorCode;
char msgRecv[255] = "\0";
@ -41,6 +36,8 @@ int main()
errorCode = client.Connect(15151, "127.0.0.1");
client.SetRecieverObject(proc, NetworkProtocolCallbackType_Function);
if(errorCode != 1)
{
printf("%d", errorCode);
@ -48,11 +45,14 @@ int main()
}
//client.SetRecieverObject(proc, NetworkProtocolCallbackType_Function);
cout << "Done" << endl;
std::cout << "Done" << endl;
GameLogic::Protocol_PlayerMovement p;
while(1)
{
std::cout << ". ";
client.Send(p);
Sleep(100000);
}
ShutdownWinSock();

View File

@ -69,28 +69,28 @@
<OutDir>$(SolutionDir)..\Bin\Executable\</OutDir>
<IntDir>$(SolutionDir)..\Obj\$(ProjectName)\$(PlatformShortName)\$(Configuration)\</IntDir>
<TargetName>$(ProjectName)_$(PlatformShortName)D</TargetName>
<IncludePath>$(SolutionDir)..\External\Include\;$(IncludePath);$(IncludePath);C:\Program Files %28x86%29\Visual Leak Detector\include;$(IncludePath)</IncludePath>
<LibraryPath>$(OutDir)..\DLL\;$(LibraryPath);$(SolutionDir)..\External\Lib\NetworkAPI;$(SolutionDir)..\Bin\DLL;C:\Program Files (x86)\Visual Leak Detector\lib\Win32;$(OutDir)..\DLL\</LibraryPath>
<IncludePath>C:\Program Files %28x86%29\Visual Leak Detector\include;$(SolutionDir)Network\NetworkAPI\;$(IncludePath)</IncludePath>
<LibraryPath>$(LibraryPath);$(SolutionDir)..\External\Lib\NetworkAPI;C:\Program Files (x86)\Visual Leak Detector\lib\Win32;C:\Program Files %28x86%29\Visual Leak Detector\lib\Win32;$(OutDir)..\DLL\</LibraryPath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<OutDir>$(SolutionDir)..\Bin\Executable\</OutDir>
<IntDir>$(SolutionDir)..\Obj\$(ProjectName)\$(PlatformShortName)\$(Configuration)\</IntDir>
<TargetName>$(ProjectName)_$(PlatformShortName)</TargetName>
<IncludePath>C:\Program Files %28x86%29\Visual Leak Detector\include;$(IncludePath)</IncludePath>
<LibraryPath>C:\Program Files (x86)\Visual Leak Detector\lib\Win32;$(LibraryPath);$(OutDir)..\DLL\</LibraryPath>
<IncludePath>C:\Program Files %28x86%29\Visual Leak Detector\include;$(SolutionDir)Network\NetworkAPI\;$(IncludePath)</IncludePath>
<LibraryPath>C:\Program Files (x86)\Visual Leak Detector\lib\Win32;$(LibraryPath);$(OutDir)..\DLL\;C:\Program Files %28x86%29\Visual Leak Detector\lib\Win32</LibraryPath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<OutDir>$(SolutionDir)..\Bin\Executable\</OutDir>
<IntDir>$(SolutionDir)..\Obj\$(ProjectName)\$(PlatformShortName)\$(Configuration)\</IntDir>
<TargetName>$(ProjectName)_$(PlatformShortName)D</TargetName>
<IncludePath>C:\Program Files %28x86%29\Visual Leak Detector\include;$(IncludePath)</IncludePath>
<IncludePath>C:\Program Files %28x86%29\Visual Leak Detector\include;$(SolutionDir)Network\NetworkAPI\;$(IncludePath)</IncludePath>
<LibraryPath>C:\Program Files (x86)\Visual Leak Detector\lib\Win64;$(LibraryPath);$(OutDir)..\DLL\</LibraryPath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<OutDir>$(SolutionDir)..\Bin\Executable\</OutDir>
<IntDir>$(SolutionDir)..\Obj\$(ProjectName)\$(PlatformShortName)\$(Configuration)\</IntDir>
<TargetName>$(ProjectName)_$(PlatformShortName)</TargetName>
<IncludePath>C:\Program Files %28x86%29\Visual Leak Detector\include;$(IncludePath)</IncludePath>
<IncludePath>C:\Program Files %28x86%29\Visual Leak Detector\include;$(SolutionDir)Network\NetworkAPI\;$(IncludePath)</IncludePath>
<LibraryPath>C:\Program Files (x86)\Visual Leak Detector\lib\Win64;$(LibraryPath);$(OutDir)..\DLL\</LibraryPath>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
@ -99,12 +99,13 @@
<Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck>
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_MBCS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<DelayLoadDLLs>
</DelayLoadDLLs>
<AdditionalDependencies>NetworkAPI_$(PlatformShortName)D.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<DelayLoadDLLs>NetworkAPI_$(PlatformShortName)D.dll;%(DelayLoadDLLs)</DelayLoadDLLs>
<AdditionalDependencies>NetworkAPI_$(PlatformShortName)D.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;delayimp.lib;%(AdditionalDependencies)</AdditionalDependencies>
<SubSystem>Console</SubSystem>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
@ -116,7 +117,9 @@
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>NetworkAPI_$(PlatformShortName)D.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>NetworkAPI_$(PlatformShortName)D.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies);delayimp.lib</AdditionalDependencies>
<DelayLoadDLLs>NetworkAPI_$(PlatformShortName)D.dll;%(DelayLoadDLLs)</DelayLoadDLLs>
<SubSystem>Console</SubSystem>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
@ -132,7 +135,9 @@
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<AdditionalDependencies>NetworkAPI_$(PlatformShortName)D.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>NetworkAPI_$(PlatformShortName).lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies);delayimp.lib</AdditionalDependencies>
<DelayLoadDLLs>NetworkAPI_$(PlatformShortName).dll;%(DelayLoadDLLs)</DelayLoadDLLs>
<SubSystem>Console</SubSystem>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
@ -148,10 +153,20 @@
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<AdditionalDependencies>NetworkAPI_$(PlatformShortName)D.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>NetworkAPI_$(PlatformShortName).lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies);delayimp.lib</AdditionalDependencies>
<DelayLoadDLLs>NetworkAPI_$(PlatformShortName).dll;%(DelayLoadDLLs)</DelayLoadDLLs>
<SubSystem>Console</SubSystem>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ProjectReference Include="..\..\Game\GameProtocols\GameProtocols.vcxproj">
<Project>{da2aa800-ed64-4649-8b3b-e7f1e3968b78}</Project>
<Private>false</Private>
<ReferenceOutputAssembly>true</ReferenceOutputAssembly>
<CopyLocalSatelliteAssemblies>false</CopyLocalSatelliteAssemblies>
<LinkLibraryDependencies>true</LinkLibraryDependencies>
<UseLibraryDependencyInputs>true</UseLibraryDependencyInputs>
</ProjectReference>
<ProjectReference Include="..\..\Misc\Misc.vcxproj">
<Project>{2ec4dded-8f75-4c86-a10b-e1e8eb29f3ee}</Project>
</ProjectReference>

View File

@ -102,8 +102,7 @@
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<DelayLoadDLLs>
</DelayLoadDLLs>
<DelayLoadDLLs>NetworkAPI_$(PlatformShortName)D.dll</DelayLoadDLLs>
<AdditionalDependencies>NetworkAPI_$(PlatformShortName)D.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
@ -116,6 +115,8 @@
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>NetworkAPI_$(PlatformShortName)D.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<DelayLoadDLLs>NetworkAPI_$(PlatformShortName)D.dll</DelayLoadDLLs>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
@ -131,6 +132,8 @@
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<DelayLoadDLLs>NetworkAPI_$(PlatformShortName).dll</DelayLoadDLLs>
<AdditionalDependencies>NetworkAPI_$(PlatformShortName).lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
@ -146,6 +149,8 @@
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<AdditionalDependencies>NetworkAPI_$(PlatformShortName).lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<DelayLoadDLLs>NetworkAPI_$(PlatformShortName).dll</DelayLoadDLLs>
</Link>
</ItemDefinitionGroup>
<ItemGroup>

View File

@ -1,24 +1,35 @@
#include <iostream>
#include <vector>
#include <vld.h>
#include <mutex>
#include "../NetworkDependencies/WinsockFunctions.h"
#include "../NetworkAPI/NetworkServer.h"
#include "../NetworkAPI/CustomNetProtocol.h"
#include "../NetworkAPI/NetworkCallbackHelper.h"
using namespace Oyster::Network;
using namespace std;
std::mutex m;
vector<NetworkClient> clients;
void proc(NetworkClient client)
{
cout << "Hej" << endl;
m.lock();
clients.push_back(client);
m.unlock();
}
int main()
{
SetDllDirectory("..\\DLL\\");
NetworkServer server;
Oyster::Network::NetworkServer::INIT_DESC desc;
desc.port = 15151;
desc.callbackType = NetworkClientCallbackType_Function;
desc.recvObj = proc;
//desc.recvObj = proc;
if(!server.Init(desc))
{
@ -36,9 +47,13 @@ int main()
while(1)
{
Sleep(1000);
m.lock();
cout << clients.size() << endl;
m.unlock();
}
server.Stop();
system("pause");