GL - started using network and protocols for sending/recieveing
This commit is contained in:
parent
bb789faa67
commit
22665bc44b
|
@ -163,6 +163,7 @@ Global
|
||||||
{C5AA09D0-6594-4CD3-BD92-1D380C7B3B50}.Debug|Mixed Platforms.ActiveCfg = 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.Build.0 = Release|x64
|
||||||
{C5AA09D0-6594-4CD3-BD92-1D380C7B3B50}.Debug|Win32.ActiveCfg = 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 = Debug|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}.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.ActiveCfg = Release|x64
|
||||||
|
@ -240,6 +241,7 @@ Global
|
||||||
{460D625F-2AC9-4559-B809-0BA89CEAEDF4}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
|
{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|Mixed Platforms.Build.0 = Debug|Win32
|
||||||
{460D625F-2AC9-4559-B809-0BA89CEAEDF4}.Debug|Win32.ActiveCfg = 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.ActiveCfg = Debug|x64
|
||||||
{460D625F-2AC9-4559-B809-0BA89CEAEDF4}.Debug|x64.Build.0 = 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.ActiveCfg = Release|Win32
|
||||||
|
|
|
@ -72,7 +72,7 @@
|
||||||
<IntDir>$(SolutionDir)..\Obj\$(ProjectName)\$(PlatformShortName)\$(Configuration)\</IntDir>
|
<IntDir>$(SolutionDir)..\Obj\$(ProjectName)\$(PlatformShortName)\$(Configuration)\</IntDir>
|
||||||
<TargetName>$(ProjectName)_$(PlatformShortName)D</TargetName>
|
<TargetName>$(ProjectName)_$(PlatformShortName)D</TargetName>
|
||||||
<LibraryPath>$(SolutionDir)..\External\Lib\Input;$(SolutionDir)..\Bin\DLL;$(LibraryPath)</LibraryPath>
|
<LibraryPath>$(SolutionDir)..\External\Lib\Input;$(SolutionDir)..\Bin\DLL;$(LibraryPath)</LibraryPath>
|
||||||
<IncludePath>$(SolutionDir)..\External\Include\;$(IncludePath)</IncludePath>
|
<IncludePath>$(SolutionDir)Network/NetworkAPI;$(IncludePath)</IncludePath>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||||
<LinkIncremental>true</LinkIncremental>
|
<LinkIncremental>true</LinkIncremental>
|
||||||
|
@ -106,7 +106,7 @@
|
||||||
<Optimization>Disabled</Optimization>
|
<Optimization>Disabled</Optimization>
|
||||||
<PreprocessorDefinitions>DANBIAS_CLIENT;DANBIAS_GAME_DLL_EXPORT;WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
<PreprocessorDefinitions>DANBIAS_CLIENT;DANBIAS_GAME_DLL_EXPORT;WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
<SDLCheck>true</SDLCheck>
|
<SDLCheck>true</SDLCheck>
|
||||||
<AdditionalIncludeDirectories>$(SolutionDir)OysterMath;$(SolutionDir)Input;$(SolutionDir)OysterGraphics;$(SolutionDir)Misc;$(SolutionDir)OysterMath;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
<AdditionalIncludeDirectories>$(SolutionDir)Game/GameProtocols;$(SolutionDir)OysterMath;$(SolutionDir)Input;$(SolutionDir)OysterGraphics;$(SolutionDir)Misc;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Link>
|
<Link>
|
||||||
<SubSystem>Windows</SubSystem>
|
<SubSystem>Windows</SubSystem>
|
||||||
|
@ -123,12 +123,12 @@
|
||||||
<Optimization>Disabled</Optimization>
|
<Optimization>Disabled</Optimization>
|
||||||
<PreprocessorDefinitions>DANBIAS_CLIENT;DANBIAS_GAME_DLL_EXPORT;WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
<PreprocessorDefinitions>DANBIAS_CLIENT;DANBIAS_GAME_DLL_EXPORT;WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
<SDLCheck>true</SDLCheck>
|
<SDLCheck>true</SDLCheck>
|
||||||
<AdditionalIncludeDirectories>$(SolutionDir)OysterMath;$(SolutionDir)Input;$(SolutionDir)OysterGraphics;$(SolutionDir)Misc;$(SolutionDir)OysterMath;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
<AdditionalIncludeDirectories>$(SolutionDir)GameProtocols;$(SolutionDir)OysterMath;$(SolutionDir)Input;$(SolutionDir)OysterGraphics;$(SolutionDir)Misc;$(SolutionDir)OysterMath;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Link>
|
<Link>
|
||||||
<SubSystem>Windows</SubSystem>
|
<SubSystem>Windows</SubSystem>
|
||||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
<AdditionalDependencies>OysterGraphics_$(PlatformShortName)D.lib;Input_$(PlatformShortName)D.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
<AdditionalDependencies>GameProtocols_$(PlatformShortName)D.lib;OysterGraphics_$(PlatformShortName)D.lib;Input_$(PlatformShortName)D.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
<DelayLoadDLLs>OysterGraphics_$(PlatformShortName)D.dll;%(DelayLoadDLLs)</DelayLoadDLLs>
|
<DelayLoadDLLs>OysterGraphics_$(PlatformShortName)D.dll;%(DelayLoadDLLs)</DelayLoadDLLs>
|
||||||
</Link>
|
</Link>
|
||||||
</ItemDefinitionGroup>
|
</ItemDefinitionGroup>
|
||||||
|
@ -142,14 +142,14 @@
|
||||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||||
<PreprocessorDefinitions>DANBIAS_CLIENT;DANBIAS_GAME_DLL_EXPORT;WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
<PreprocessorDefinitions>DANBIAS_CLIENT;DANBIAS_GAME_DLL_EXPORT;WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
<SDLCheck>true</SDLCheck>
|
<SDLCheck>true</SDLCheck>
|
||||||
<AdditionalIncludeDirectories>$(SolutionDir)OysterMath;$(SolutionDir)Input;$(SolutionDir)OysterGraphics;$(SolutionDir)Misc;$(SolutionDir)OysterMath;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
<AdditionalIncludeDirectories>$(SolutionDir)GameProtocols;$(SolutionDir)OysterMath;$(SolutionDir)Input;$(SolutionDir)OysterGraphics;$(SolutionDir)Misc;$(SolutionDir)OysterMath;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Link>
|
<Link>
|
||||||
<SubSystem>Windows</SubSystem>
|
<SubSystem>Windows</SubSystem>
|
||||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||||
<OptimizeReferences>true</OptimizeReferences>
|
<OptimizeReferences>true</OptimizeReferences>
|
||||||
<AdditionalDependencies>OysterGraphics_$(PlatformShortName).lib;Input_$(PlatformShortName).lib;%(AdditionalDependencies)</AdditionalDependencies>
|
<AdditionalDependencies>GameProtocols_$(PlatformShortName).lib;OysterGraphics_$(PlatformShortName).lib;Input_$(PlatformShortName).lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
<DelayLoadDLLs>OysterGraphics_x86.dll;%(DelayLoadDLLs)</DelayLoadDLLs>
|
<DelayLoadDLLs>OysterGraphics_x86.dll;%(DelayLoadDLLs)</DelayLoadDLLs>
|
||||||
</Link>
|
</Link>
|
||||||
</ItemDefinitionGroup>
|
</ItemDefinitionGroup>
|
||||||
|
@ -163,14 +163,14 @@
|
||||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||||
<PreprocessorDefinitions>DANBIAS_CLIENT;DANBIAS_GAME_DLL_EXPORT;WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
<PreprocessorDefinitions>DANBIAS_CLIENT;DANBIAS_GAME_DLL_EXPORT;WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
<SDLCheck>true</SDLCheck>
|
<SDLCheck>true</SDLCheck>
|
||||||
<AdditionalIncludeDirectories>$(SolutionDir)OysterMath;$(SolutionDir)Input;$(SolutionDir)OysterGraphics;$(SolutionDir)Misc;$(SolutionDir)OysterMath;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
<AdditionalIncludeDirectories>$(SolutionDir)GameProtocols;$(SolutionDir)OysterMath;$(SolutionDir)Input;$(SolutionDir)OysterGraphics;$(SolutionDir)Misc;$(SolutionDir)OysterMath;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Link>
|
<Link>
|
||||||
<SubSystem>Windows</SubSystem>
|
<SubSystem>Windows</SubSystem>
|
||||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||||
<OptimizeReferences>true</OptimizeReferences>
|
<OptimizeReferences>true</OptimizeReferences>
|
||||||
<AdditionalDependencies>OysterGraphics_$(PlatformShortName).lib;Input_$(PlatformShortName).lib;%(AdditionalDependencies)</AdditionalDependencies>
|
<AdditionalDependencies>GameProtocols_$(PlatformShortName).lib;OysterGraphics_$(PlatformShortName).lib;Input_$(PlatformShortName).lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
<DelayLoadDLLs>OysterGraphics_x86.dll;%(DelayLoadDLLs)</DelayLoadDLLs>
|
<DelayLoadDLLs>OysterGraphics_x86.dll;%(DelayLoadDLLs)</DelayLoadDLLs>
|
||||||
</Link>
|
</Link>
|
||||||
</ItemDefinitionGroup>
|
</ItemDefinitionGroup>
|
||||||
|
@ -181,6 +181,9 @@
|
||||||
<ProjectReference Include="..\..\Misc\Misc.vcxproj">
|
<ProjectReference Include="..\..\Misc\Misc.vcxproj">
|
||||||
<Project>{2ec4dded-8f75-4c86-a10b-e1e8eb29f3ee}</Project>
|
<Project>{2ec4dded-8f75-4c86-a10b-e1e8eb29f3ee}</Project>
|
||||||
</ProjectReference>
|
</ProjectReference>
|
||||||
|
<ProjectReference Include="..\..\Network\NetworkAPI\NetworkAPI.vcxproj">
|
||||||
|
<Project>{460d625f-2ac9-4559-b809-0ba89ceaedf4}</Project>
|
||||||
|
</ProjectReference>
|
||||||
<ProjectReference Include="..\..\OysterGraphics\OysterGraphics.vcxproj">
|
<ProjectReference Include="..\..\OysterGraphics\OysterGraphics.vcxproj">
|
||||||
<Project>{0ec83e64-230e-48ef-b08c-6ac9651b4f82}</Project>
|
<Project>{0ec83e64-230e-48ef-b08c-6ac9651b4f82}</Project>
|
||||||
</ProjectReference>
|
</ProjectReference>
|
||||||
|
|
|
@ -5,7 +5,8 @@
|
||||||
#include "GameClientState/GameClientState.h"
|
#include "GameClientState/GameClientState.h"
|
||||||
#include "GameClientState\GameState.h"
|
#include "GameClientState\GameState.h"
|
||||||
#include "GameClientState\LobbyState.h"
|
#include "GameClientState\LobbyState.h"
|
||||||
|
#include "PlayerProtocols.h"
|
||||||
|
#include "NetworkClient.h"
|
||||||
|
|
||||||
#include "L_inputClass.h"
|
#include "L_inputClass.h"
|
||||||
#include "vld.h"
|
#include "vld.h"
|
||||||
|
@ -19,6 +20,36 @@ namespace DanBias
|
||||||
HWND DanBiasGame::g_hWnd = NULL;
|
HWND DanBiasGame::g_hWnd = NULL;
|
||||||
|
|
||||||
#pragma region Game Data
|
#pragma region Game Data
|
||||||
|
|
||||||
|
|
||||||
|
struct MyRecieverObject // :public PontusRecieverObject
|
||||||
|
{
|
||||||
|
Oyster::Network::NetworkClient nwClient;
|
||||||
|
|
||||||
|
static void ProtocolRecieved(Network::CustomNetProtocol* p)
|
||||||
|
{
|
||||||
|
int pType = ((*p)[0]).value.netInt;
|
||||||
|
switch (pType)
|
||||||
|
{
|
||||||
|
case protocol_PlayerNavigation:
|
||||||
|
|
||||||
|
break;
|
||||||
|
case protocol_PlayerPosition:
|
||||||
|
//int x = ((*p)[1]).value.netInt;
|
||||||
|
//int y = ((*p)[2]).value.netInt;
|
||||||
|
//int z = ((*p)[3]).value.netInt;
|
||||||
|
break;
|
||||||
|
|
||||||
|
|
||||||
|
case protocol_ObjectPosition:
|
||||||
|
// DanBiasGame::protocolRecived();
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
class DanBiasGamePrivateData
|
class DanBiasGamePrivateData
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -35,12 +66,21 @@ namespace DanBias
|
||||||
public:
|
public:
|
||||||
Client::GameClientState* gameClientState;
|
Client::GameClientState* gameClientState;
|
||||||
InputClass* inputObj;
|
InputClass* inputObj;
|
||||||
|
GameLogic::Protocol_PlayerMovement player_move;
|
||||||
|
//Oyster::Network::NetworkClient nwClient;
|
||||||
|
MyRecieverObject r;
|
||||||
|
|
||||||
// gameClient;
|
// gameClient;
|
||||||
|
|
||||||
} data;
|
} data;
|
||||||
#pragma endregion
|
#pragma endregion
|
||||||
DanBiasGamePrivateData* DanBiasGame::m_data = new DanBiasGamePrivateData();
|
|
||||||
|
|
||||||
|
|
||||||
|
DanBiasGamePrivateData* DanBiasGame::m_data = new DanBiasGamePrivateData();
|
||||||
|
void DanBiasGame::protocolRecived()
|
||||||
|
{
|
||||||
|
//m_data->gameClientState.setPos()
|
||||||
|
}
|
||||||
//--------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------
|
||||||
// Interface API functions
|
// Interface API functions
|
||||||
//--------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------
|
||||||
|
|
|
@ -12,6 +12,7 @@ struct GameState::myData
|
||||||
Oyster::Math3D::Float4x4 proj;
|
Oyster::Math3D::Float4x4 proj;
|
||||||
C_Object* object[3];
|
C_Object* object[3];
|
||||||
int modelCount;
|
int modelCount;
|
||||||
|
//Oyster::Network::NetworkClient* nwClient;
|
||||||
gameStateState state;
|
gameStateState state;
|
||||||
}privData;
|
}privData;
|
||||||
|
|
||||||
|
@ -86,6 +87,8 @@ GameClientState::ClientState GameState::Update(float deltaTime, InputClass* KeyI
|
||||||
case gameStateState_playing:
|
case gameStateState_playing:
|
||||||
// read server data
|
// read server data
|
||||||
// update objects
|
// update objects
|
||||||
|
// Client.send(obj);
|
||||||
|
|
||||||
if(KeyInput->IsKeyPressed(DIK_L))
|
if(KeyInput->IsKeyPressed(DIK_L))
|
||||||
privData->state = GameState::gameStateState_end;
|
privData->state = GameState::gameStateState_end;
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -54,6 +54,8 @@ namespace DanBias
|
||||||
static HRESULT Update(float deltaTime);
|
static HRESULT Update(float deltaTime);
|
||||||
static HRESULT Render(float deltaTime);
|
static HRESULT Render(float deltaTime);
|
||||||
static HRESULT CleanUp();
|
static HRESULT CleanUp();
|
||||||
|
|
||||||
|
static void protocolRecived();
|
||||||
private:
|
private:
|
||||||
static __int64 cntsPerSec;
|
static __int64 cntsPerSec;
|
||||||
static __int64 prevTimeStamp;
|
static __int64 prevTimeStamp;
|
||||||
|
|
|
@ -4,8 +4,8 @@
|
||||||
#define NOMINMAX
|
#define NOMINMAX
|
||||||
#include <Windows.h>
|
#include <Windows.h>
|
||||||
|
|
||||||
#define DANBIAS_SERVER
|
//#define DANBIAS_SERVER
|
||||||
//#define DANBIAS_CLIENT
|
#define DANBIAS_CLIENT
|
||||||
|
|
||||||
|
|
||||||
#if defined(DANBIAS_SERVER)
|
#if defined(DANBIAS_SERVER)
|
||||||
|
|
|
@ -154,6 +154,7 @@
|
||||||
</Lib>
|
</Lib>
|
||||||
</ItemDefinitionGroup>
|
</ItemDefinitionGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<ClInclude Include="ObjectProtocols.h" />
|
||||||
<ClInclude Include="PlayerProtocols.h" />
|
<ClInclude Include="PlayerProtocols.h" />
|
||||||
<ClInclude Include="ProtocolIdentificationID.h" />
|
<ClInclude Include="ProtocolIdentificationID.h" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
|
@ -0,0 +1,67 @@
|
||||||
|
#ifndef GAMELOGIC_PLAYER_PROTOCOLS_H
|
||||||
|
#define GAMELOGIC_PLAYER_PROTOCOLS_H
|
||||||
|
|
||||||
|
#include <CustomNetProtocol.h>
|
||||||
|
#include "ProtocolIdentificationID.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
namespace GameLogic
|
||||||
|
{
|
||||||
|
struct Protocol_ObjectPosition :public Network::CustomProtocolObject
|
||||||
|
{
|
||||||
|
float worldMatrix[16];
|
||||||
|
// look at dir
|
||||||
|
|
||||||
|
Protocol_ObjectPosition()
|
||||||
|
{
|
||||||
|
this->protocol[0].value = protocol_PlayerPosition;
|
||||||
|
this->protocol[0].type = Network::NetAttributeType_Int;
|
||||||
|
|
||||||
|
this->protocol[1].type = Network::NetAttributeType_Float;
|
||||||
|
this->protocol[2].type = Network::NetAttributeType_Float;
|
||||||
|
this->protocol[3].type = Network::NetAttributeType_Float;
|
||||||
|
this->protocol[4].type = Network::NetAttributeType_Float;
|
||||||
|
this->protocol[5].type = Network::NetAttributeType_Float;
|
||||||
|
this->protocol[6].type = Network::NetAttributeType_Float;
|
||||||
|
this->protocol[7].type = Network::NetAttributeType_Float;
|
||||||
|
this->protocol[8].type = Network::NetAttributeType_Float;
|
||||||
|
this->protocol[9].type = Network::NetAttributeType_Float;
|
||||||
|
this->protocol[10].type = Network::NetAttributeType_Float;
|
||||||
|
this->protocol[11].type = Network::NetAttributeType_Float;
|
||||||
|
this->protocol[12].type = Network::NetAttributeType_Float;
|
||||||
|
this->protocol[13].type = Network::NetAttributeType_Float;
|
||||||
|
this->protocol[14].type = Network::NetAttributeType_Float;
|
||||||
|
this->protocol[15].type = Network::NetAttributeType_Float;
|
||||||
|
this->protocol[16].type = Network::NetAttributeType_Float;
|
||||||
|
|
||||||
|
}
|
||||||
|
Network::CustomNetProtocol* GetProtocol() override
|
||||||
|
{
|
||||||
|
|
||||||
|
this->protocol[1].value = worldMatrix[0];
|
||||||
|
this->protocol[2].value = worldMatrix[1];
|
||||||
|
this->protocol[3].value = worldMatrix[2];
|
||||||
|
this->protocol[4].value = worldMatrix[4];
|
||||||
|
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];
|
||||||
|
return &protocol;
|
||||||
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
Network::CustomNetProtocol protocol;
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif // !GAMELOGIC_PLAYER_PROTOCOLS_H
|
|
@ -1,7 +1,7 @@
|
||||||
#ifndef GAMELOGIC_PLAYER_PROTOCOLS_H
|
#ifndef GAMELOGIC_PLAYER_PROTOCOLS_H
|
||||||
#define GAMELOGIC_PLAYER_PROTOCOLS_H
|
#define GAMELOGIC_PLAYER_PROTOCOLS_H
|
||||||
|
|
||||||
#include "CustomNetProtocol.h"
|
#include <CustomNetProtocol.h>
|
||||||
#include "ProtocolIdentificationID.h"
|
#include "ProtocolIdentificationID.h"
|
||||||
|
|
||||||
|
|
||||||
|
@ -20,24 +20,24 @@ namespace GameLogic
|
||||||
|
|
||||||
Protocol_PlayerMovement()
|
Protocol_PlayerMovement()
|
||||||
{
|
{
|
||||||
protocol[0]->value = ProtocolID = protocol_PlayerNavigation;
|
this->protocol[0].value = ProtocolID = protocol_PlayerNavigation;
|
||||||
|
|
||||||
protocol[0]->type = Network::NetAttributeType_Int;
|
this->protocol[0].type = Network::NetAttributeType_Int;
|
||||||
protocol[1]->type = Network::NetAttributeType_Bool;
|
this->protocol[1].type = Network::NetAttributeType_Bool;
|
||||||
protocol[2]->type = Network::NetAttributeType_Bool;
|
this->protocol[2].type = Network::NetAttributeType_Bool;
|
||||||
protocol[3]->type = Network::NetAttributeType_Bool;
|
this->protocol[3].type = Network::NetAttributeType_Bool;
|
||||||
protocol[4]->type = Network::NetAttributeType_Bool;
|
this->protocol[4].type = Network::NetAttributeType_Bool;
|
||||||
protocol[5]->type = Network::NetAttributeType_Bool;
|
this->protocol[5].type = Network::NetAttributeType_Bool;
|
||||||
protocol[6]->type = Network::NetAttributeType_Bool;
|
this->protocol[6].type = Network::NetAttributeType_Bool;
|
||||||
}
|
}
|
||||||
Network::CustomNetProtocol* GetProtocol() override
|
Network::CustomNetProtocol* GetProtocol() override
|
||||||
{
|
{
|
||||||
protocol[1]->value = bForward;
|
this->protocol[1].value = bForward;
|
||||||
protocol[2]->value = bBackward;
|
this->protocol[2].value = bBackward;
|
||||||
protocol[3]->value = bTurnLeft;
|
this->protocol[3].value = bTurnLeft;
|
||||||
protocol[4]->value = bTurnRight;
|
this->protocol[4].value = bTurnRight;
|
||||||
protocol[5]->value = bStrafeRight;
|
this->protocol[5].value = bStrafeRight;
|
||||||
protocol[6]->value = bStrafeRight;
|
this->protocol[6].value = bStrafeRight;
|
||||||
|
|
||||||
return &protocol;
|
return &protocol;
|
||||||
}
|
}
|
||||||
|
@ -45,6 +45,35 @@ namespace GameLogic
|
||||||
private:
|
private:
|
||||||
Network::CustomNetProtocol protocol;
|
Network::CustomNetProtocol protocol;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct Protocol_PlayerPosition :public Network::CustomProtocolObject
|
||||||
|
{
|
||||||
|
float position[3];
|
||||||
|
// look at dir
|
||||||
|
|
||||||
|
Protocol_PlayerPosition()
|
||||||
|
{
|
||||||
|
this->protocol[0].value = protocol_PlayerPosition;
|
||||||
|
this->protocol[0].type = Network::NetAttributeType_Int;
|
||||||
|
|
||||||
|
this->protocol[1].type = Network::NetAttributeType_Float;
|
||||||
|
this->protocol[2].type = Network::NetAttributeType_Float;
|
||||||
|
this->protocol[3].type = Network::NetAttributeType_Float;
|
||||||
|
|
||||||
|
}
|
||||||
|
Network::CustomNetProtocol* GetProtocol() override
|
||||||
|
{
|
||||||
|
|
||||||
|
this->protocol[1].value = position[0];
|
||||||
|
this->protocol[2].value = position[1];
|
||||||
|
this->protocol[3].value = position[2];
|
||||||
|
return &protocol;
|
||||||
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
Network::CustomNetProtocol protocol;
|
||||||
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // !GAMELOGIC_PLAYER_PROTOCOLS_H
|
#endif // !GAMELOGIC_PLAYER_PROTOCOLS_H
|
||||||
|
|
|
@ -3,6 +3,8 @@
|
||||||
|
|
||||||
/* THERE CAN ABSOLUTLEY NOT BE TWO DEFINITIONS WITH THE SAME ID!! */
|
/* THERE CAN ABSOLUTLEY NOT BE TWO DEFINITIONS WITH THE SAME ID!! */
|
||||||
|
|
||||||
#define protocol_PlayerNavigation 0;
|
#define protocol_PlayerNavigation 0
|
||||||
|
#define protocol_PlayerPosition 1
|
||||||
|
#define protocol_ObjectPosition 2
|
||||||
|
|
||||||
#endif // !GAMEPROTOCOL_PROTOCOL_DEFINITION_ID_H
|
#endif // !GAMEPROTOCOL_PROTOCOL_DEFINITION_ID_H
|
||||||
|
|
Loading…
Reference in New Issue