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

This commit is contained in:
dean11 2014-02-19 08:43:05 +01:00
commit 5de66d5d2d
36 changed files with 533 additions and 146 deletions

View File

@ -36,11 +36,15 @@ void Camera_FPSV2::SetPosition( const Float3 &translation )
this->body.translation = translation; this->body.translation = translation;
} }
void Camera_FPSV2::SetRotation( const Quaternion &rotation )
{
this->body.rotation = rotation;
this->head.SetRotation( rotation * Rotation(this->pitchUp, this->GetNormalOf(Float3::standard_unit_x) ) );
}
void Camera_FPSV2::SetAngular( const Float3 &axis ) void Camera_FPSV2::SetAngular( const Float3 &axis )
{ {
this->body.rotation = Rotation( axis ); this->SetRotation( Rotation(axis) );
this->head.SetRotation( this->body.rotation );
this->pitchUp = 0.0f;
} }
void Camera_FPSV2::SetProjection( const Float4x4 &matrix ) void Camera_FPSV2::SetProjection( const Float4x4 &matrix )

View File

@ -14,6 +14,7 @@ public:
void SetHeadOffset( const ::Oyster::Math::Float3 &translation ); void SetHeadOffset( const ::Oyster::Math::Float3 &translation );
void SetPosition( const ::Oyster::Math::Float3 &translation ); void SetPosition( const ::Oyster::Math::Float3 &translation );
void SetRotation( const ::Oyster::Math::Quaternion &rotation );
void SetAngular( const ::Oyster::Math::Float3 &axis ); void SetAngular( const ::Oyster::Math::Float3 &axis );
void SetProjection( const ::Oyster::Math::Float4x4 &matrix ); void SetProjection( const ::Oyster::Math::Float4x4 &matrix );
void SetOrthographicProjection( ::Oyster::Math::Float width, ::Oyster::Math::Float height, ::Oyster::Math::Float nearClip, ::Oyster::Math::Float farClip ); void SetOrthographicProjection( ::Oyster::Math::Float width, ::Oyster::Math::Float height, ::Oyster::Math::Float nearClip, ::Oyster::Math::Float farClip );

View File

@ -3,9 +3,14 @@
using namespace DanBias::Client; using namespace DanBias::Client;
using namespace ::Oyster::Network; using namespace ::Oyster::Network;
const GameClientState::NetEvent GameClientState::event_processed = GameClientState::NetEvent();
GameClientState::GameClientState() {} GameClientState::GameClientState() {}
GameClientState::~GameClientState() {} GameClientState::~GameClientState() {}
void GameClientState::DataRecieved( NetEvent<NetworkClient*, NetworkClient::ClientEventArgs> e ) const GameClientState::NetEvent & GameClientState::DataRecieved( const GameClientState::NetEvent &message )
{ /* do nothing */ } {
/* do nothing */
return message;
}

View File

@ -22,7 +22,9 @@ namespace DanBias { namespace Client
ClientState_Quit ClientState_Quit
}; };
public: typedef ::Oyster::Network::NetEvent<::Oyster::Network::NetworkClient*, ::Oyster::Network::NetworkClient::ClientEventArgs> NetEvent;
static const NetEvent event_processed;
GameClientState(); GameClientState();
virtual ~GameClientState(); virtual ~GameClientState();
virtual bool Init( SharedStateContent &shared ) = 0; virtual bool Init( SharedStateContent &shared ) = 0;
@ -31,7 +33,11 @@ namespace DanBias { namespace Client
virtual bool Release() = 0; virtual bool Release() = 0;
virtual void ChangeState( ClientState next ) = 0; virtual void ChangeState( ClientState next ) = 0;
virtual void DataRecieved( ::Oyster::Network::NetEvent<::Oyster::Network::NetworkClient*, ::Oyster::Network::NetworkClient::ClientEventArgs> e ); /******************************************************************
* @param message of the event
* @return message or GameClientState::event_processed.
******************************************************************/
virtual const NetEvent & DataRecieved( const NetEvent &message );
}; };
} } } }

View File

@ -2,7 +2,7 @@
#include "DllInterfaces/GFXAPI.h" #include "DllInterfaces/GFXAPI.h"
#include <Protocols.h> #include <Protocols.h>
#include "NetworkClient.h" #include "NetworkClient.h"
#include "Camera_FPS.h" #include "Camera_FPSV2.h"
#include <GameServerAPI.h> #include <GameServerAPI.h>
#include "C_obj/C_Player.h" #include "C_obj/C_Player.h"
@ -39,7 +39,7 @@ struct GameState::MyData
bool key_Reload_Shaders; bool key_Reload_Shaders;
C_Player player; C_Player player;
Camera_FPS camera; Camera_FPSV2 camera;
int myId; int myId;
@ -146,7 +146,8 @@ bool GameState::Render()
auto dynamicObject = this->privData->dynamicObjects->begin(); auto dynamicObject = this->privData->dynamicObjects->begin();
for( ; dynamicObject != this->privData->dynamicObjects->end(); ++dynamicObject ) for( ; dynamicObject != this->privData->dynamicObjects->end(); ++dynamicObject )
{ {
dynamicObject->second->Render(); if( dynamicObject->second )
dynamicObject->second->Render();
} }
Oyster::Graphics::API::EndFrame(); Oyster::Graphics::API::EndFrame();
@ -311,13 +312,22 @@ void GameState::ReadKeyInput()
// TODO: implement sub-menu // TODO: implement sub-menu
} }
void GameState::DataRecieved( NetEvent<NetworkClient*, NetworkClient::ClientEventArgs> e ) const GameClientState::NetEvent & GameState::DataRecieved( const GameClientState::NetEvent &message )
{ {
CustomNetProtocol data = e.args.data.protocol; if( message.args.type == NetworkClient::ClientEventArgs::EventType_ProtocolFailedToSend )
short ID = data[0].value.netShort; // fetching the id data. { // TODO: Reconnect
const char *breakpoint = "temp trap";
this->privData->nwClient->Disconnect();
this->ChangeState( GameClientState::ClientState_Main );
}
// fetching the id data.
short ID = message.args.data.protocol[0].value.netShort;
if( ProtocolIsGameplay(ID) ) if( ProtocolIsGameplay(ID) )
{ {
CustomNetProtocol data = message.args.data.protocol;
switch(ID) switch(ID)
{ {
case protocol_Gameplay_ObjectPickup: break; /** @todo TODO: implement */ case protocol_Gameplay_ObjectPickup: break; /** @todo TODO: implement */
@ -333,13 +343,13 @@ void GameState::DataRecieved( NetEvent<NetworkClient*, NetworkClient::ClientEven
(*this->privData->dynamicObjects)[decoded.object_ID]->setPos( decoded.position ); (*this->privData->dynamicObjects)[decoded.object_ID]->setPos( decoded.position );
} }
break; return GameClientState::event_processed;
case protocol_Gameplay_ObjectScale: case protocol_Gameplay_ObjectScale:
{ {
Protocol_ObjectScale decoded(data); Protocol_ObjectScale decoded(data);
(*this->privData->dynamicObjects)[decoded.object_ID]->setScale( decoded.scale ); (*this->privData->dynamicObjects)[decoded.object_ID]->setScale( decoded.scale );
} }
break; return GameClientState::event_processed;
case protocol_Gameplay_ObjectRotation: case protocol_Gameplay_ObjectRotation:
{ {
Protocol_ObjectRotation decoded(data); Protocol_ObjectRotation decoded(data);
@ -347,11 +357,11 @@ void GameState::DataRecieved( NetEvent<NetworkClient*, NetworkClient::ClientEven
// if is this player. Remember to change camera // if is this player. Remember to change camera
if( this->privData->myId == decoded.object_ID ) if( this->privData->myId == decoded.object_ID )
this->privData->camera.SetAngular( AngularAxis(rotation) ); this->privData->camera.SetRotation( rotation );
(*this->privData->dynamicObjects)[decoded.object_ID]->setRot( rotation ); (*this->privData->dynamicObjects)[decoded.object_ID]->setRot( rotation );
} }
break; return GameClientState::event_processed;
case protocol_Gameplay_ObjectPositionRotation: case protocol_Gameplay_ObjectPositionRotation:
{ {
Protocol_ObjectPositionRotation decoded(data); Protocol_ObjectPositionRotation decoded(data);
@ -362,14 +372,17 @@ void GameState::DataRecieved( NetEvent<NetworkClient*, NetworkClient::ClientEven
if( this->privData->myId == decoded.object_ID ) if( this->privData->myId == decoded.object_ID )
{ {
this->privData->camera.SetPosition( position ); this->privData->camera.SetPosition( position );
this->privData->camera.SetAngular( AngularAxis(rotation) ); this->privData->camera.SetRotation( rotation );
} }
C_DynamicObj *object = (*this->privData->dynamicObjects)[decoded.object_ID]; C_DynamicObj *object = (*this->privData->dynamicObjects)[decoded.object_ID];
object->setPos( position ); if( object )
object->setRot( rotation ); {
object->setPos( position );
object->setRot( rotation );
}
} }
break; return GameClientState::event_processed;
case protocol_Gameplay_ObjectEnabled: break; /** @todo TODO: implement */ case protocol_Gameplay_ObjectEnabled: break; /** @todo TODO: implement */
case protocol_Gameplay_ObjectDisabled: case protocol_Gameplay_ObjectDisabled:
{ {
@ -382,7 +395,7 @@ void GameState::DataRecieved( NetEvent<NetworkClient*, NetworkClient::ClientEven
this->privData->dynamicObjects->erase( object ); this->privData->dynamicObjects->erase( object );
} }
} }
break; return GameClientState::event_processed;
case protocol_Gameplay_ObjectCreate: case protocol_Gameplay_ObjectCreate:
{ {
Protocol_ObjectCreate decoded(data); Protocol_ObjectCreate decoded(data);
@ -403,13 +416,13 @@ void GameState::DataRecieved( NetEvent<NetworkClient*, NetworkClient::ClientEven
(*this->privData->dynamicObjects)[decoded.object_ID] = object; (*this->privData->dynamicObjects)[decoded.object_ID] = object;
} }
break; return GameClientState::event_processed;
case protocol_Gameplay_ObjectCreatePlayer: case protocol_Gameplay_ObjectCreatePlayer:
{ {
Protocol_ObjectCreatePlayer decoded(data); Protocol_ObjectCreatePlayer decoded(data);
this->InitiatePlayer( decoded.object_ID, decoded.meshName, decoded.position, decoded.rotationQ, decoded.scale, decoded.owner ); this->InitiatePlayer( decoded.object_ID, decoded.meshName, decoded.position, decoded.rotationQ, decoded.scale, decoded.owner );
} }
break; return GameClientState::event_processed;
case protocol_Gameplay_ObjectJoinTeam: break; /** @todo TODO: implement */ case protocol_Gameplay_ObjectJoinTeam: break; /** @todo TODO: implement */
case protocol_Gameplay_ObjectLeaveTeam: break; /** @todo TODO: implement */ case protocol_Gameplay_ObjectLeaveTeam: break; /** @todo TODO: implement */
case protocol_Gameplay_ObjectWeaponCooldown: break; /** @todo TODO: implement */ case protocol_Gameplay_ObjectWeaponCooldown: break; /** @todo TODO: implement */
@ -428,4 +441,6 @@ void GameState::DataRecieved( NetEvent<NetworkClient*, NetworkClient::ClientEven
default: break; default: break;
} }
} }
return message;
} }

View File

@ -26,7 +26,7 @@ namespace DanBias { namespace Client
bool Release()override; bool Release()override;
void ChangeState( ClientState next ); void ChangeState( ClientState next );
void DataRecieved( ::Oyster::Network::NetEvent<::Oyster::Network::NetworkClient*, ::Oyster::Network::NetworkClient::ClientEventArgs> e ); const NetEvent & DataRecieved( const NetEvent &message );
private: private:
struct MyData; struct MyData;

View File

@ -60,7 +60,8 @@ bool LanMenuState::Init( SharedStateContent &shared )
// create guiElements // create guiElements
this->privData->connectIP = new TextField<LanMenuState*>( L"color_white.png", Float4(1.0f), Float4(0.0f), this, Float3(0.5f, 0.3f, 0.5f), Float2(0.8f, 0.09f), ResizeAspectRatio_None ); this->privData->connectIP = new TextField<LanMenuState*>( L"color_white.png", Float4(1.0f), Float4(0.0f), this, Float3(0.5f, 0.3f, 0.5f), Float2(0.8f, 0.09f), ResizeAspectRatio_None );
this->privData->connectIP->ReserveLines( 1 ); this->privData->connectIP->ReserveLines( 1 );
this->privData->connectIP->AppendText( L"127.0.0.1" ); //this->privData->connectIP->AppendText( L"127.0.0.1" );
this->privData->connectIP->AppendText( L"194.47.150.206" ); // HACK: connecting to Dennis's server
this->privData->connectIP->SetFontHeight( 0.08f ); this->privData->connectIP->SetFontHeight( 0.08f );
this->privData->connectIP->SetLineSpacing( 0.005f ); this->privData->connectIP->SetLineSpacing( 0.005f );
this->privData->connectIP->SetTopAligned(); this->privData->connectIP->SetTopAligned();

View File

@ -112,10 +112,10 @@ void LobbyAdminState::ChangeState( ClientState next )
using namespace ::Oyster::Network; using namespace ::Oyster::Network;
void LobbyAdminState::DataRecieved( NetEvent<NetworkClient*, NetworkClient::ClientEventArgs> e ) const GameClientState::NetEvent & LobbyAdminState::DataRecieved( const GameClientState::NetEvent &message )
{ {
CustomNetProtocol data = e.args.data.protocol; // fetching the id data.
short ID = data[0].value.netShort; // fetching the id data. short ID = message.args.data.protocol[0].value.netShort;
// Block irrelevant messages. // Block irrelevant messages.
if( ProtocolIsLobby(ID) ) if( ProtocolIsLobby(ID) )
@ -141,6 +141,7 @@ void LobbyAdminState::DataRecieved( NetEvent<NetworkClient*, NetworkClient::Clie
default: break; default: break;
} }
} }
return message;
} }
void OnButtonInteract_Ready( Oyster::Event::ButtonEvent<LobbyAdminState*>& e ) void OnButtonInteract_Ready( Oyster::Event::ButtonEvent<LobbyAdminState*>& e )

View File

@ -29,8 +29,8 @@ namespace DanBias
bool Render(); bool Render();
bool Release(); bool Release();
void ChangeState( ClientState next ); void ChangeState( ClientState next );
void DataRecieved( ::Oyster::Network::NetEvent<::Oyster::Network::NetworkClient*, ::Oyster::Network::NetworkClient::ClientEventArgs> e ); const NetEvent & DataRecieved( const NetEvent &message );
private: private:
struct MyData; struct MyData;
::Utility::DynamicMemory::UniquePointer<MyData> privData; ::Utility::DynamicMemory::UniquePointer<MyData> privData;

View File

@ -112,10 +112,10 @@ void LobbyState::ChangeState( ClientState next )
using namespace ::Oyster::Network; using namespace ::Oyster::Network;
void LobbyState::DataRecieved( NetEvent<NetworkClient*, NetworkClient::ClientEventArgs> e ) const GameClientState::NetEvent & LobbyState::DataRecieved( const GameClientState::NetEvent &message )
{ {
CustomNetProtocol data = e.args.data.protocol; // fetching the id data.
short ID = data[0].value.netShort; // fetching the id data. short ID = message.args.data.protocol[0].value.netShort;
// Block irrelevant messages. // Block irrelevant messages.
if( ProtocolIsLobby(ID) ) if( ProtocolIsLobby(ID) )
@ -141,6 +141,8 @@ void LobbyState::DataRecieved( NetEvent<NetworkClient*, NetworkClient::ClientEve
default: break; default: break;
} }
} }
return message;
} }
void OnButtonInteract_Ready( Oyster::Event::ButtonEvent<LobbyState*>& e ) void OnButtonInteract_Ready( Oyster::Event::ButtonEvent<LobbyState*>& e )

View File

@ -31,7 +31,7 @@ namespace DanBias
bool Render(); bool Render();
bool Release(); bool Release();
void ChangeState( ClientState next ); void ChangeState( ClientState next );
void DataRecieved( ::Oyster::Network::NetEvent<::Oyster::Network::NetworkClient*, ::Oyster::Network::NetworkClient::ClientEventArgs> e ); const NetEvent & DataRecieved( const NetEvent &message );
private: private:
struct MyData; struct MyData;

View File

@ -90,16 +90,25 @@ void NetLoadState::ChangeState( ClientState next )
this->privData->nextState = next; this->privData->nextState = next;
} }
void NetLoadState::DataRecieved( NetEvent<NetworkClient*, NetworkClient::ClientEventArgs> e ) const GameClientState::NetEvent & NetLoadState::DataRecieved( const GameClientState::NetEvent &message )
{ {
// fetching the id data. // fetching the id data.
short ID = e.args.data.protocol[0].value.netShort; short ID = message.args.data.protocol[0].value.netShort;
if( ID == protocol_Lobby_CreateGame && !this->privData->loading ) if( ID == protocol_Lobby_CreateGame )
{ {
this->LoadGame( Protocol_LobbyCreateGame(e.args.data.protocol).mapName ); if( !this->privData->loading )
this->ChangeState( ClientState_Game ); {
this->privData->loading = false; this->LoadGame( Protocol_LobbyCreateGame(message.args.data.protocol).mapName );
this->ChangeState( ClientState_Game );
this->privData->loading = false;
}
return GameClientState::event_processed;
}
else
{ // HACK: Debug trap
const char *breakPoint = "Being greedy.";
return message;
} }
} }
@ -107,7 +116,7 @@ void NetLoadState::LoadGame( const ::std::string &fileName )
{ {
this->privData->loading = true; this->privData->loading = true;
LevelLoader loader; LevelLoader loader( "..\\Content\\Worlds\\" );
auto objects = loader.LoadLevel( fileName ); auto objects = loader.LoadLevel( fileName );
auto object = objects.begin(); auto object = objects.begin();
ObjectTypeHeader *oth; ObjectTypeHeader *oth;

View File

@ -21,7 +21,7 @@ namespace DanBias
bool Release(); bool Release();
void ChangeState( ClientState next ); void ChangeState( ClientState next );
void DataRecieved( ::Oyster::Network::NetEvent<::Oyster::Network::NetworkClient*, ::Oyster::Network::NetworkClient::ClientEventArgs> e ); const NetEvent & DataRecieved( const NetEvent &message );
private: private:
struct MyData; struct MyData;

View File

@ -76,14 +76,12 @@ Game::PlayerData* Game::CreatePlayer()
return this->players[i]; return this->players[i];
} }
Game::LevelData* Game::CreateLevel() Game::LevelData* Game::CreateLevel(const wchar_t mapName[255])
{ {
if(this->level) return this->level; if(this->level) return this->level;
this->level = new LevelData(); this->level = new LevelData();
//this->level->level->InitiateLevel(1000); this->level->level->InitiateLevel(mapName);
this->level->level->InitiateLevel("../Content/Worlds/ccc.bias");
return this->level; return this->level;
} }

View File

@ -72,7 +72,7 @@ namespace GameLogic
void GetAllPlayerPositions() const override; void GetAllPlayerPositions() const override;
PlayerData* CreatePlayer() override; PlayerData* CreatePlayer() override;
LevelData* CreateLevel() override; LevelData* CreateLevel(const wchar_t mapName[255] ) override;
void CreateTeam() override; void CreateTeam() override;
bool NewFrame() override; bool NewFrame() override;
void SetFPS( int FPS ) override; void SetFPS( int FPS ) override;

View File

@ -139,7 +139,7 @@ namespace GameLogic
/** Creates a level /** Creates a level
* @return Returns a ILevelData container to use for level manipulation * @return Returns a ILevelData container to use for level manipulation
*/ */
virtual ILevelData* CreateLevel( void ) = 0; virtual ILevelData* CreateLevel( const wchar_t mapName[255] ) = 0;
/** Creates a team /** Creates a team
* @return ? * @return ?

View File

@ -197,12 +197,16 @@ ICustomBody* Level::InitRigidBodySphere( const ObjectHeader* obj)
rigidBody = API::Instance().AddCollisionSphere( rigidBodyRadius , rigidWorldRotation , rigidWorldPos , rigidBodyMass, obj->boundingVolume.sphere.restitutionCoeff , obj->boundingVolume.sphere.frictionCoeffStatic , obj->boundingVolume.sphere.frictionCoeffDynamic); rigidBody = API::Instance().AddCollisionSphere( rigidBodyRadius , rigidWorldRotation , rigidWorldPos , rigidBodyMass, obj->boundingVolume.sphere.restitutionCoeff , obj->boundingVolume.sphere.frictionCoeffStatic , obj->boundingVolume.sphere.frictionCoeffDynamic);
return rigidBody; return rigidBody;
} }
void Level::InitiateLevel(std::string levelPath) bool Level::InitiateLevel(std::wstring levelPath)
{ {
LevelLoader ll; LevelLoader ll;
ll.SetFolderPath(L"..\\Content\\Worlds\\");
std::vector<Utility::DynamicMemory::SmartPointer<ObjectTypeHeader>> objects; std::vector<Utility::DynamicMemory::SmartPointer<ObjectTypeHeader>> objects;
objects = ll.LoadLevel(levelPath); objects = ll.LoadLevel(levelPath);
if(objects.size() == 0)
return false;
API::Instance().SetGravityPoint(Oyster::Math3D::Float3(0,0,0)); API::Instance().SetGravityPoint(Oyster::Math3D::Float3(0,0,0));
API::Instance().SetGravity(200); API::Instance().SetGravity(200);
int objCount = objects.size(); int objCount = objects.size();
@ -332,8 +336,9 @@ void Level::InitiateLevel(std::string levelPath)
break; break;
} }
} }
return true;
} }
void Level::InitiateLevel(float radius) bool Level::InitiateLevel(float radius)
{ {
API::Instance().SetGravityPoint(Oyster::Math3D::Float3(0,0,0)); API::Instance().SetGravityPoint(Oyster::Math3D::Float3(0,0,0));
API::Instance().SetGravity(200); API::Instance().SetGravity(200);
@ -396,6 +401,7 @@ void Level::InitiateLevel(float radius)
ICustomBody* rigidBody_Jumppad = API::Instance().AddCollisionBox(Oyster::Math::Float3(1.0f, 1.0f, 1.0f), Oyster::Math::Float4(0.0f, 0.0f, 0.0f, 1.0f), Oyster::Math::Float3(4.0f, 600.3f, 0.0f), 5.0f, 0.5f, 0.8f, 0.6f); ICustomBody* rigidBody_Jumppad = API::Instance().AddCollisionBox(Oyster::Math::Float3(1.0f, 1.0f, 1.0f), Oyster::Math::Float4(0.0f, 0.0f, 0.0f, 1.0f), Oyster::Math::Float3(4.0f, 600.3f, 0.0f), 5.0f, 0.5f, 0.8f, 0.6f);
this->staticObjects.Push(new JumpPad(rigidBody_Jumppad, ObjectSpecialType_JumpPad,idCount++ ,Oyster::Math::Float3(0,2000,0))); this->staticObjects.Push(new JumpPad(rigidBody_Jumppad, ObjectSpecialType_JumpPad,idCount++ ,Oyster::Math::Float3(0,2000,0)));
return true;
} }
void Level::AddPlayerToTeam(Player *player, int teamID) void Level::AddPlayerToTeam(Player *player, int teamID)

View File

@ -30,8 +30,8 @@ namespace GameLogic
* Initiates a level for players to play on * Initiates a level for players to play on
* @param levelPath: Path to a file that contains all information on the level * @param levelPath: Path to a file that contains all information on the level
********************************************************/ ********************************************************/
void InitiateLevel(std::string levelPath); bool InitiateLevel(std::wstring levelPath);
void InitiateLevel(float radius); bool InitiateLevel(float radius);
Oyster::Physics::ICustomBody* InitRigidBodyCube( const ObjectHeader* obj); Oyster::Physics::ICustomBody* InitRigidBodyCube( const ObjectHeader* obj);
Oyster::Physics::ICustomBody* InitRigidBodySphere( const ObjectHeader* obj); Oyster::Physics::ICustomBody* InitRigidBodySphere( const ObjectHeader* obj);

View File

@ -11,17 +11,17 @@ using namespace GameLogic::LevelFileLoader;
struct LevelLoader::PrivData struct LevelLoader::PrivData
{ {
LevelParser parser; LevelParser parser;
std::string folderPath; std::wstring folderPath;
}; };
LevelLoader::LevelLoader() LevelLoader::LevelLoader()
: pData(new PrivData) : pData(new PrivData)
{ {
//standard path //standard path
pData->folderPath = ""; pData->folderPath = L"";
} }
LevelLoader::LevelLoader(std::string folderPath) LevelLoader::LevelLoader(std::wstring folderPath)
: pData(new PrivData) : pData(new PrivData)
{ {
pData->folderPath = folderPath; pData->folderPath = folderPath;
@ -31,22 +31,22 @@ LevelLoader::~LevelLoader()
{ {
} }
std::vector<Utility::DynamicMemory::SmartPointer<ObjectTypeHeader>> LevelLoader::LoadLevel(std::string fileName) std::vector<Utility::DynamicMemory::SmartPointer<ObjectTypeHeader>> LevelLoader::LoadLevel(std::wstring fileName)
{ {
return pData->parser.Parse(pData->folderPath + fileName); return pData->parser.Parse(pData->folderPath + fileName);
} }
LevelMetaData LevelLoader::LoadLevelHeader(std::string fileName) LevelMetaData LevelLoader::LoadLevelHeader(std::wstring fileName)
{ {
return pData->parser.ParseHeader(pData->folderPath + fileName); return pData->parser.ParseHeader(pData->folderPath + fileName);
} }
std::string LevelLoader::GetFolderPath() std::wstring LevelLoader::GetFolderPath()
{ {
return this->pData->folderPath; return this->pData->folderPath;
} }
void LevelLoader::SetFolderPath(std::string folderPath) void LevelLoader::SetFolderPath(std::wstring folderPath)
{ {
this->pData->folderPath = folderPath;
} }

View File

@ -20,7 +20,7 @@ namespace GameLogic
/*********************************************************** /***********************************************************
* Lets you set the standard folderpath for the levels * Lets you set the standard folderpath for the levels
********************************************************/ ********************************************************/
LevelLoader(std::string folderPath); LevelLoader(std::wstring folderPath);
~LevelLoader(); ~LevelLoader();
/******************************************************** /********************************************************
@ -28,24 +28,24 @@ namespace GameLogic
* @param fileName: Path/name to the level-file that you want to load. * @param fileName: Path/name to the level-file that you want to load.
* @return: Returns all structs with objects and information about the level. * @return: Returns all structs with objects and information about the level.
********************************************************/ ********************************************************/
std::vector<Utility::DynamicMemory::SmartPointer<ObjectTypeHeader>> LoadLevel(std::string fileName); std::vector<Utility::DynamicMemory::SmartPointer<ObjectTypeHeader>> LoadLevel(std::wstring fileName);
/******************************************************** /********************************************************
* Just for fast access for the meta information about the level. * Just for fast access for the meta information about the level.
* @param fileName: Path to the level-file that you want to load. * @param fileName: Path to the level-file that you want to load.
* @return: Returns the meta information about the level. * @return: Returns the meta information about the level.
********************************************************/ ********************************************************/
LevelMetaData LoadLevelHeader(std::string fileName); //. LevelMetaData LoadLevelHeader(std::wstring fileName); //.
/*********************************************************** /***********************************************************
* @return: Returns the current standard folder path * @return: Returns the current standard folder path
********************************************************/ ********************************************************/
std::string GetFolderPath(); std::wstring GetFolderPath();
/*********************************************************** /***********************************************************
* Sets the standard folder path * Sets the standard folder path
********************************************************/ ********************************************************/
void SetFolderPath(std::string folderPath); void SetFolderPath(std::wstring folderPath);
private: private:
struct PrivData; struct PrivData;

View File

@ -20,7 +20,7 @@ LevelParser::~LevelParser()
{ {
} }
std::vector<SmartPointer<ObjectTypeHeader>> LevelParser::Parse(std::string filename) std::vector<SmartPointer<ObjectTypeHeader>> LevelParser::Parse(std::wstring filename)
{ {
int bufferSize = 0; int bufferSize = 0;
int counter = 0; int counter = 0;
@ -32,6 +32,12 @@ std::vector<SmartPointer<ObjectTypeHeader>> LevelParser::Parse(std::string filen
Loader loader; Loader loader;
char* buffer = (char*)loader.LoadFile(filename.c_str(), bufferSize); char* buffer = (char*)loader.LoadFile(filename.c_str(), bufferSize);
// Check if file was loaded, else return empty vector
if(!buffer)
{
return std::vector<SmartPointer<ObjectTypeHeader>>();
}
//Read format version //Read format version
LevelLoaderInternal::FormatVersion levelFormatVersion; LevelLoaderInternal::FormatVersion levelFormatVersion;
ParseObject(&buffer[counter], &levelFormatVersion, sizeof(levelFormatVersion)); ParseObject(&buffer[counter], &levelFormatVersion, sizeof(levelFormatVersion));
@ -215,7 +221,7 @@ std::vector<SmartPointer<ObjectTypeHeader>> LevelParser::Parse(std::string filen
} }
//för meta information om leveln. //för meta information om leveln.
LevelMetaData LevelParser::ParseHeader(std::string filename) LevelMetaData LevelParser::ParseHeader(std::wstring filename)
{ {
int bufferSize = 0; int bufferSize = 0;
int counter = 0; int counter = 0;

View File

@ -17,10 +17,10 @@ namespace GameLogic
~LevelParser(); ~LevelParser();
// //
std::vector<Utility::DynamicMemory::SmartPointer<ObjectTypeHeader>> Parse(std::string filename); std::vector<Utility::DynamicMemory::SmartPointer<ObjectTypeHeader>> Parse(std::wstring filename);
// //
LevelMetaData ParseHeader(std::string filename); LevelMetaData ParseHeader(std::wstring filename);
private: private:
LevelLoaderInternal::FormatVersion formatVersion; LevelLoaderInternal::FormatVersion formatVersion;

View File

@ -9,13 +9,13 @@ using namespace GameLogic::LevelFileLoader;
using namespace Oyster::Resource; using namespace Oyster::Resource;
using namespace std; using namespace std;
char* Loader::LoadFile(std::string fileName, int &size) char* Loader::LoadFile(std::wstring fileName, int &size)
{ {
//convert from string to wstring //convert from string to wstring
std::wstring temp(fileName.begin(), fileName.end()); //std::wstring temp(fileName.begin(), fileName.end());
//convert from wstring to wchar then loads the file //convert from wstring to wchar then loads the file
char* buffer = (char*)OysterResource::LoadResource(temp.c_str(), Oyster::Resource::ResourceType::ResourceType_Byte_Raw, -1 , false); char* buffer = (char*)OysterResource::LoadResource(fileName.c_str(), Oyster::Resource::ResourceType::ResourceType_Byte_Raw, -1 , false);
size = OysterResource::GetResourceSize(buffer); size = OysterResource::GetResourceSize(buffer);
return buffer; return buffer;

View File

@ -17,7 +17,7 @@ namespace GameLogic
public: public:
Loader (){}; Loader (){};
~Loader(){}; ~Loader(){};
char* LoadFile(std::string fileName, int &size); char* LoadFile(std::wstring fileName, int &size);
//TODO: //TODO:
//Add functionality to load physicsObjects (hitboxes) //Add functionality to load physicsObjects (hitboxes)

View File

@ -5,6 +5,7 @@
#include "ParseFunctions.h" #include "ParseFunctions.h"
#include "Packing/Packing.h" #include "Packing/Packing.h"
#include "Loader.h" #include "Loader.h"
#include "Utilities.h"
#include <string> #include <string>
using namespace Oyster::Packing; using namespace Oyster::Packing;
@ -149,7 +150,7 @@ namespace GameLogic
//Läs in filen. //Läs in filen.
int fileLength = 0; int fileLength = 0;
Loader loader; Loader loader;
char* buf = loader.LoadFile("../Content/Worlds/cgf/"+ fileName, fileLength); char* buf = loader.LoadFile(L"../Content/Worlds/cgf/" + Utility::String::StringToWstring(fileName, wstring()), fileLength);
start = 0; start = 0;
LevelLoaderInternal::FormatVersion version; LevelLoaderInternal::FormatVersion version;

View File

@ -99,7 +99,7 @@ bool GameSession::Create(GameDescription& desc, bool forceStart)
} }
/* Create the game level */ /* Create the game level */
if(!(this->levelData = this->gameInstance.CreateLevel())) if(!(this->levelData = this->gameInstance.CreateLevel(this->description.mapName.c_str())))
{ {
printf("Level not created!"); printf("Level not created!");
return false; return false;

View File

@ -1,5 +1,10 @@
<?xml version="1.0" encoding="utf-8" ?> <?xml version="1.0" encoding="utf-8" ?>
<configuration> <configuration>
<configSections>
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
<section name="StandAloneLauncher.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
</sectionGroup>
</configSections>
<startup> <startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" /> <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup> </startup>
@ -8,4 +13,11 @@
<probing privatePath="..\..\Bin\DLL\" /> <probing privatePath="..\..\Bin\DLL\" />
</assemblyBinding> </assemblyBinding>
</runtime> </runtime>
<userSettings>
<StandAloneLauncher.Properties.Settings>
<setting name="Dennis" serializeAs="String">
<value>.\..\Content\</value>
</setting>
</StandAloneLauncher.Properties.Settings>
</userSettings>
</configuration> </configuration>

View File

@ -36,7 +36,6 @@
this.label_listenPort = new System.Windows.Forms.Label(); this.label_listenPort = new System.Windows.Forms.Label();
this.panel_serverOptions = new System.Windows.Forms.Panel(); this.panel_serverOptions = new System.Windows.Forms.Panel();
this.panel_commands = new System.Windows.Forms.Panel(); this.panel_commands = new System.Windows.Forms.Panel();
this.mapName = new System.Windows.Forms.TextBox();
this.timeLimit = new System.Windows.Forms.NumericUpDown(); this.timeLimit = new System.Windows.Forms.NumericUpDown();
this.gameModes = new System.Windows.Forms.ComboBox(); this.gameModes = new System.Windows.Forms.ComboBox();
this.label3 = new System.Windows.Forms.Label(); this.label3 = new System.Windows.Forms.Label();
@ -52,6 +51,22 @@
this.splitter1 = new System.Windows.Forms.Splitter(); this.splitter1 = new System.Windows.Forms.Splitter();
this.clientInfoBox = new System.Windows.Forms.ListBox(); this.clientInfoBox = new System.Windows.Forms.ListBox();
this.panel_CommanArea = new System.Windows.Forms.Panel(); this.panel_CommanArea = new System.Windows.Forms.Panel();
this.label5 = new System.Windows.Forms.Label();
this.mapName = new System.Windows.Forms.ComboBox();
this.panelServerCommands = new System.Windows.Forms.Panel();
this.buttonExecuteSend = new System.Windows.Forms.Button();
this.panel2 = new System.Windows.Forms.Panel();
this.comboBox1 = new System.Windows.Forms.ComboBox();
this.numericUpDown1 = new System.Windows.Forms.NumericUpDown();
this.textBox1 = new System.Windows.Forms.TextBox();
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
this.label6 = new System.Windows.Forms.Label();
this.label7 = new System.Windows.Forms.Label();
this.label8 = new System.Windows.Forms.Label();
this.dataProtocolFields = new System.Windows.Forms.TableLayoutPanel();
this.buttonAddNewDataField = new System.Windows.Forms.Button();
this.button2 = new System.Windows.Forms.Button();
this.buttonsAtBottom = new System.Windows.Forms.TableLayoutPanel();
((System.ComponentModel.ISupportInitialize)(this.listenPort)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.listenPort)).BeginInit();
this.panel_serverOptions.SuspendLayout(); this.panel_serverOptions.SuspendLayout();
this.panel_commands.SuspendLayout(); this.panel_commands.SuspendLayout();
@ -59,13 +74,20 @@
((System.ComponentModel.ISupportInitialize)(this.nrOfClients)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.nrOfClients)).BeginInit();
this.panel_clientArea.SuspendLayout(); this.panel_clientArea.SuspendLayout();
this.panel_CommanArea.SuspendLayout(); this.panel_CommanArea.SuspendLayout();
this.panelServerCommands.SuspendLayout();
this.panel2.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).BeginInit();
this.tableLayoutPanel1.SuspendLayout();
this.dataProtocolFields.SuspendLayout();
this.buttonsAtBottom.SuspendLayout();
this.SuspendLayout(); this.SuspendLayout();
// //
// serverToggle // serverToggle
// //
this.serverToggle.Location = new System.Drawing.Point(9, 106); this.serverToggle.Dock = System.Windows.Forms.DockStyle.Bottom;
this.serverToggle.Location = new System.Drawing.Point(0, 83);
this.serverToggle.Name = "serverToggle"; this.serverToggle.Name = "serverToggle";
this.serverToggle.Size = new System.Drawing.Size(75, 23); this.serverToggle.Size = new System.Drawing.Size(241, 20);
this.serverToggle.TabIndex = 0; this.serverToggle.TabIndex = 0;
this.serverToggle.Text = "Start server"; this.serverToggle.Text = "Start server";
this.serverToggle.UseVisualStyleBackColor = true; this.serverToggle.UseVisualStyleBackColor = true;
@ -140,46 +162,40 @@
this.panel_serverOptions.Dock = System.Windows.Forms.DockStyle.Top; this.panel_serverOptions.Dock = System.Windows.Forms.DockStyle.Top;
this.panel_serverOptions.Location = new System.Drawing.Point(0, 0); this.panel_serverOptions.Location = new System.Drawing.Point(0, 0);
this.panel_serverOptions.Name = "panel_serverOptions"; this.panel_serverOptions.Name = "panel_serverOptions";
this.panel_serverOptions.Size = new System.Drawing.Size(200, 141); this.panel_serverOptions.Size = new System.Drawing.Size(241, 103);
this.panel_serverOptions.TabIndex = 6; this.panel_serverOptions.TabIndex = 6;
// //
// panel_commands // panel_commands
// //
this.panel_commands.Controls.Add(this.mapName);
this.panel_commands.Controls.Add(this.timeLimit); this.panel_commands.Controls.Add(this.timeLimit);
this.panel_commands.Controls.Add(this.mapName);
this.panel_commands.Controls.Add(this.gameModes); this.panel_commands.Controls.Add(this.gameModes);
this.panel_commands.Controls.Add(this.label3); this.panel_commands.Controls.Add(this.label3);
this.panel_commands.Controls.Add(this.forceStart); this.panel_commands.Controls.Add(this.forceStart);
this.panel_commands.Controls.Add(this.label2); this.panel_commands.Controls.Add(this.label2);
this.panel_commands.Controls.Add(this.label4); this.panel_commands.Controls.Add(this.label4);
this.panel_commands.Controls.Add(this.label5);
this.panel_commands.Controls.Add(this.labelClientsConnected); this.panel_commands.Controls.Add(this.labelClientsConnected);
this.panel_commands.Controls.Add(this.label1); this.panel_commands.Controls.Add(this.label1);
this.panel_commands.Controls.Add(this.nrOfClients); this.panel_commands.Controls.Add(this.nrOfClients);
this.panel_commands.Controls.Add(this.buttonStartGame); this.panel_commands.Controls.Add(this.buttonStartGame);
this.panel_commands.Location = new System.Drawing.Point(3, 150); this.panel_commands.Dock = System.Windows.Forms.DockStyle.Top;
this.panel_commands.Location = new System.Drawing.Point(0, 103);
this.panel_commands.Name = "panel_commands"; this.panel_commands.Name = "panel_commands";
this.panel_commands.Size = new System.Drawing.Size(191, 202); this.panel_commands.Size = new System.Drawing.Size(241, 188);
this.panel_commands.TabIndex = 7; this.panel_commands.TabIndex = 7;
this.panel_commands.Visible = false; this.panel_commands.Visible = false;
// //
// mapName
//
this.mapName.Location = new System.Drawing.Point(75, 10);
this.mapName.Name = "mapName";
this.mapName.Size = new System.Drawing.Size(113, 20);
this.mapName.TabIndex = 12;
this.mapName.Text = "2ofAll_updated.bias";
//
// timeLimit // timeLimit
// //
this.timeLimit.Location = new System.Drawing.Point(109, 94); this.timeLimit.Location = new System.Drawing.Point(112, 89);
this.timeLimit.Minimum = new decimal(new int[] { this.timeLimit.Minimum = new decimal(new int[] {
5, 5,
0, 0,
0, 0,
0}); 0});
this.timeLimit.Name = "timeLimit"; this.timeLimit.Name = "timeLimit";
this.timeLimit.Size = new System.Drawing.Size(68, 20); this.timeLimit.Size = new System.Drawing.Size(123, 20);
this.timeLimit.TabIndex = 11; this.timeLimit.TabIndex = 11;
this.timeLimit.ThousandsSeparator = true; this.timeLimit.ThousandsSeparator = true;
this.timeLimit.Value = new decimal(new int[] { this.timeLimit.Value = new decimal(new int[] {
@ -195,9 +211,9 @@
this.gameModes.Items.AddRange(new object[] { this.gameModes.Items.AddRange(new object[] {
"Free-for-all", "Free-for-all",
"Team death-match"}); "Team death-match"});
this.gameModes.Location = new System.Drawing.Point(78, 66); this.gameModes.Location = new System.Drawing.Point(77, 61);
this.gameModes.Name = "gameModes"; this.gameModes.Name = "gameModes";
this.gameModes.Size = new System.Drawing.Size(110, 21); this.gameModes.Size = new System.Drawing.Size(158, 21);
this.gameModes.TabIndex = 10; this.gameModes.TabIndex = 10;
// //
// label3 // label3
@ -242,11 +258,11 @@
// labelClientsConnected // labelClientsConnected
// //
this.labelClientsConnected.AutoSize = true; this.labelClientsConnected.AutoSize = true;
this.labelClientsConnected.Location = new System.Drawing.Point(9, 149); this.labelClientsConnected.Location = new System.Drawing.Point(131, 147);
this.labelClientsConnected.Name = "labelClientsConnected"; this.labelClientsConnected.Name = "labelClientsConnected";
this.labelClientsConnected.Size = new System.Drawing.Size(104, 13); this.labelClientsConnected.Size = new System.Drawing.Size(80, 13);
this.labelClientsConnected.TabIndex = 8; this.labelClientsConnected.TabIndex = 8;
this.labelClientsConnected.Text = "Clients connected: 0"; this.labelClientsConnected.Text = "Game clients: 0";
// //
// label1 // label1
// //
@ -259,7 +275,7 @@
// //
// nrOfClients // nrOfClients
// //
this.nrOfClients.Location = new System.Drawing.Point(78, 36); this.nrOfClients.Location = new System.Drawing.Point(72, 34);
this.nrOfClients.Maximum = new decimal(new int[] { this.nrOfClients.Maximum = new decimal(new int[] {
20, 20,
0, 0,
@ -271,7 +287,7 @@
0, 0,
0}); 0});
this.nrOfClients.Name = "nrOfClients"; this.nrOfClients.Name = "nrOfClients";
this.nrOfClients.Size = new System.Drawing.Size(39, 20); this.nrOfClients.Size = new System.Drawing.Size(163, 20);
this.nrOfClients.TabIndex = 7; this.nrOfClients.TabIndex = 7;
this.nrOfClients.Value = new decimal(new int[] { this.nrOfClients.Value = new decimal(new int[] {
10, 10,
@ -281,9 +297,10 @@
// //
// buttonStartGame // buttonStartGame
// //
this.buttonStartGame.Location = new System.Drawing.Point(9, 176); this.buttonStartGame.Dock = System.Windows.Forms.DockStyle.Bottom;
this.buttonStartGame.Location = new System.Drawing.Point(0, 166);
this.buttonStartGame.Name = "buttonStartGame"; this.buttonStartGame.Name = "buttonStartGame";
this.buttonStartGame.Size = new System.Drawing.Size(75, 23); this.buttonStartGame.Size = new System.Drawing.Size(241, 22);
this.buttonStartGame.TabIndex = 6; this.buttonStartGame.TabIndex = 6;
this.buttonStartGame.Text = "Start game"; this.buttonStartGame.Text = "Start game";
this.buttonStartGame.UseVisualStyleBackColor = true; this.buttonStartGame.UseVisualStyleBackColor = true;
@ -295,9 +312,9 @@
this.panel_clientArea.Controls.Add(this.splitter1); this.panel_clientArea.Controls.Add(this.splitter1);
this.panel_clientArea.Controls.Add(this.clientInfoBox); this.panel_clientArea.Controls.Add(this.clientInfoBox);
this.panel_clientArea.Dock = System.Windows.Forms.DockStyle.Fill; this.panel_clientArea.Dock = System.Windows.Forms.DockStyle.Fill;
this.panel_clientArea.Location = new System.Drawing.Point(200, 0); this.panel_clientArea.Location = new System.Drawing.Point(241, 0);
this.panel_clientArea.Name = "panel_clientArea"; this.panel_clientArea.Name = "panel_clientArea";
this.panel_clientArea.Size = new System.Drawing.Size(535, 616); this.panel_clientArea.Size = new System.Drawing.Size(494, 616);
this.panel_clientArea.TabIndex = 8; this.panel_clientArea.TabIndex = 8;
// //
// ServerInfoTextArea // ServerInfoTextArea
@ -307,19 +324,19 @@
this.ServerInfoTextArea.Dock = System.Windows.Forms.DockStyle.Fill; this.ServerInfoTextArea.Dock = System.Windows.Forms.DockStyle.Fill;
this.ServerInfoTextArea.Font = new System.Drawing.Font("GulimChe", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.ServerInfoTextArea.Font = new System.Drawing.Font("GulimChe", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.ServerInfoTextArea.ForeColor = System.Drawing.SystemColors.Info; this.ServerInfoTextArea.ForeColor = System.Drawing.SystemColors.Info;
this.ServerInfoTextArea.Location = new System.Drawing.Point(0, 152); this.ServerInfoTextArea.Location = new System.Drawing.Point(0, 269);
this.ServerInfoTextArea.Name = "ServerInfoTextArea"; this.ServerInfoTextArea.Name = "ServerInfoTextArea";
this.ServerInfoTextArea.ReadOnly = true; this.ServerInfoTextArea.ReadOnly = true;
this.ServerInfoTextArea.Size = new System.Drawing.Size(535, 464); this.ServerInfoTextArea.Size = new System.Drawing.Size(494, 347);
this.ServerInfoTextArea.TabIndex = 1; this.ServerInfoTextArea.TabIndex = 1;
this.ServerInfoTextArea.Text = ""; this.ServerInfoTextArea.Text = "";
// //
// splitter1 // splitter1
// //
this.splitter1.Dock = System.Windows.Forms.DockStyle.Top; this.splitter1.Dock = System.Windows.Forms.DockStyle.Top;
this.splitter1.Location = new System.Drawing.Point(0, 147); this.splitter1.Location = new System.Drawing.Point(0, 264);
this.splitter1.Name = "splitter1"; this.splitter1.Name = "splitter1";
this.splitter1.Size = new System.Drawing.Size(535, 5); this.splitter1.Size = new System.Drawing.Size(494, 5);
this.splitter1.TabIndex = 2; this.splitter1.TabIndex = 2;
this.splitter1.TabStop = false; this.splitter1.TabStop = false;
// //
@ -329,19 +346,221 @@
this.clientInfoBox.FormattingEnabled = true; this.clientInfoBox.FormattingEnabled = true;
this.clientInfoBox.Location = new System.Drawing.Point(0, 0); this.clientInfoBox.Location = new System.Drawing.Point(0, 0);
this.clientInfoBox.Name = "clientInfoBox"; this.clientInfoBox.Name = "clientInfoBox";
this.clientInfoBox.Size = new System.Drawing.Size(535, 147); this.clientInfoBox.Size = new System.Drawing.Size(494, 264);
this.clientInfoBox.TabIndex = 0; this.clientInfoBox.TabIndex = 0;
// //
// panel_CommanArea // panel_CommanArea
// //
this.panel_CommanArea.Controls.Add(this.panelServerCommands);
this.panel_CommanArea.Controls.Add(this.panel_commands); this.panel_CommanArea.Controls.Add(this.panel_commands);
this.panel_CommanArea.Controls.Add(this.panel_serverOptions); this.panel_CommanArea.Controls.Add(this.panel_serverOptions);
this.panel_CommanArea.Dock = System.Windows.Forms.DockStyle.Left; this.panel_CommanArea.Dock = System.Windows.Forms.DockStyle.Left;
this.panel_CommanArea.Location = new System.Drawing.Point(0, 0); this.panel_CommanArea.Location = new System.Drawing.Point(0, 0);
this.panel_CommanArea.Name = "panel_CommanArea"; this.panel_CommanArea.Name = "panel_CommanArea";
this.panel_CommanArea.Size = new System.Drawing.Size(200, 616); this.panel_CommanArea.Size = new System.Drawing.Size(241, 616);
this.panel_CommanArea.TabIndex = 9; this.panel_CommanArea.TabIndex = 9;
// //
// label5
//
this.label5.AutoSize = true;
this.label5.Location = new System.Drawing.Point(23, 147);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(81, 13);
this.label5.TabIndex = 8;
this.label5.Text = "Lobby clients: 0";
//
// mapName
//
this.mapName.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.mapName.FormattingEnabled = true;
this.mapName.IntegralHeight = false;
this.mapName.Items.AddRange(new object[] {
"Set default"});
this.mapName.Location = new System.Drawing.Point(72, 7);
this.mapName.Name = "mapName";
this.mapName.Size = new System.Drawing.Size(163, 21);
this.mapName.TabIndex = 10;
//
// panelServerCommands
//
this.panelServerCommands.Controls.Add(this.dataProtocolFields);
this.panelServerCommands.Dock = System.Windows.Forms.DockStyle.Top;
this.panelServerCommands.Location = new System.Drawing.Point(0, 291);
this.panelServerCommands.Name = "panelServerCommands";
this.panelServerCommands.Size = new System.Drawing.Size(241, 85);
this.panelServerCommands.TabIndex = 8;
this.panelServerCommands.Visible = false;
//
// buttonExecuteSend
//
this.buttonExecuteSend.Dock = System.Windows.Forms.DockStyle.Fill;
this.buttonExecuteSend.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.buttonExecuteSend.Location = new System.Drawing.Point(116, 0);
this.buttonExecuteSend.Margin = new System.Windows.Forms.Padding(0);
this.buttonExecuteSend.Name = "buttonExecuteSend";
this.buttonExecuteSend.Size = new System.Drawing.Size(117, 21);
this.buttonExecuteSend.TabIndex = 0;
this.buttonExecuteSend.Text = "Send";
this.buttonExecuteSend.UseVisualStyleBackColor = true;
//
// panel2
//
this.panel2.Controls.Add(this.button2);
this.panel2.Controls.Add(this.textBox1);
this.panel2.Controls.Add(this.comboBox1);
this.panel2.Controls.Add(this.numericUpDown1);
this.panel2.Dock = System.Windows.Forms.DockStyle.Fill;
this.panel2.Location = new System.Drawing.Point(4, 32);
this.panel2.Name = "panel2";
this.panel2.Size = new System.Drawing.Size(233, 21);
this.panel2.TabIndex = 0;
//
// comboBox1
//
this.comboBox1.Dock = System.Windows.Forms.DockStyle.Left;
this.comboBox1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.comboBox1.FormattingEnabled = true;
this.comboBox1.IntegralHeight = false;
this.comboBox1.Items.AddRange(new object[] {
"netBool;",
"netChar;",
"netUChar;",
"netShort;",
"netUShort;",
"netInt;",
"netUInt;",
"netInt64;",
"netUInt64;",
"netFloat;",
"netDouble;",
"netCharPtr;"});
this.comboBox1.Location = new System.Drawing.Point(42, 0);
this.comboBox1.Name = "comboBox1";
this.comboBox1.Size = new System.Drawing.Size(78, 21);
this.comboBox1.TabIndex = 10;
//
// numericUpDown1
//
this.numericUpDown1.Dock = System.Windows.Forms.DockStyle.Left;
this.numericUpDown1.Location = new System.Drawing.Point(0, 0);
this.numericUpDown1.Name = "numericUpDown1";
this.numericUpDown1.Size = new System.Drawing.Size(42, 20);
this.numericUpDown1.TabIndex = 11;
//
// textBox1
//
this.textBox1.Dock = System.Windows.Forms.DockStyle.Left;
this.textBox1.Location = new System.Drawing.Point(120, 0);
this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(64, 20);
this.textBox1.TabIndex = 12;
//
// tableLayoutPanel1
//
this.tableLayoutPanel1.CellBorderStyle = System.Windows.Forms.TableLayoutPanelCellBorderStyle.Single;
this.tableLayoutPanel1.ColumnCount = 3;
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 35.29412F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 64.70588F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 110F));
this.tableLayoutPanel1.Controls.Add(this.label6, 0, 0);
this.tableLayoutPanel1.Controls.Add(this.label7, 1, 0);
this.tableLayoutPanel1.Controls.Add(this.label8, 2, 0);
this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.tableLayoutPanel1.Location = new System.Drawing.Point(4, 4);
this.tableLayoutPanel1.Name = "tableLayoutPanel1";
this.tableLayoutPanel1.RowCount = 1;
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 27.05882F));
this.tableLayoutPanel1.Size = new System.Drawing.Size(233, 21);
this.tableLayoutPanel1.TabIndex = 9;
//
// label6
//
this.label6.AutoSize = true;
this.label6.Location = new System.Drawing.Point(4, 1);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(18, 13);
this.label6.TabIndex = 8;
this.label6.Text = "ID";
this.label6.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// label7
//
this.label7.AutoSize = true;
this.label7.Location = new System.Drawing.Point(46, 1);
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(31, 13);
this.label7.TabIndex = 8;
this.label7.Text = "Type";
//
// label8
//
this.label8.AutoSize = true;
this.label8.Location = new System.Drawing.Point(123, 1);
this.label8.Name = "label8";
this.label8.Size = new System.Drawing.Size(34, 13);
this.label8.TabIndex = 8;
this.label8.Text = "Value";
//
// dataProtocolFields
//
this.dataProtocolFields.CellBorderStyle = System.Windows.Forms.TableLayoutPanelCellBorderStyle.Single;
this.dataProtocolFields.ColumnCount = 1;
this.dataProtocolFields.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 21F));
this.dataProtocolFields.Controls.Add(this.panel2, 0, 1);
this.dataProtocolFields.Controls.Add(this.tableLayoutPanel1, 0, 0);
this.dataProtocolFields.Controls.Add(this.buttonsAtBottom, 0, 2);
this.dataProtocolFields.Dock = System.Windows.Forms.DockStyle.Fill;
this.dataProtocolFields.Location = new System.Drawing.Point(0, 0);
this.dataProtocolFields.Margin = new System.Windows.Forms.Padding(0);
this.dataProtocolFields.Name = "dataProtocolFields";
this.dataProtocolFields.RowCount = 3;
this.dataProtocolFields.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 27F));
this.dataProtocolFields.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 27F));
this.dataProtocolFields.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
this.dataProtocolFields.Size = new System.Drawing.Size(241, 85);
this.dataProtocolFields.TabIndex = 9;
//
// buttonAddNewDataField
//
this.buttonAddNewDataField.Dock = System.Windows.Forms.DockStyle.Fill;
this.buttonAddNewDataField.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.buttonAddNewDataField.Location = new System.Drawing.Point(0, 0);
this.buttonAddNewDataField.Margin = new System.Windows.Forms.Padding(0);
this.buttonAddNewDataField.Name = "buttonAddNewDataField";
this.buttonAddNewDataField.Size = new System.Drawing.Size(116, 21);
this.buttonAddNewDataField.TabIndex = 1;
this.buttonAddNewDataField.Text = "Add field";
this.buttonAddNewDataField.UseVisualStyleBackColor = true;
this.buttonAddNewDataField.Click += new System.EventHandler(this.buttonAddNewDataField_Click);
//
// button2
//
this.button2.Dock = System.Windows.Forms.DockStyle.Fill;
this.button2.FlatAppearance.BorderColor = System.Drawing.Color.Black;
this.button2.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.button2.Location = new System.Drawing.Point(184, 0);
this.button2.Margin = new System.Windows.Forms.Padding(0);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(49, 21);
this.button2.TabIndex = 0;
this.button2.Text = "remove";
this.button2.UseVisualStyleBackColor = true;
//
// buttonsAtBottom
//
this.buttonsAtBottom.ColumnCount = 2;
this.buttonsAtBottom.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.buttonsAtBottom.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.buttonsAtBottom.Controls.Add(this.buttonAddNewDataField, 0, 0);
this.buttonsAtBottom.Controls.Add(this.buttonExecuteSend, 1, 0);
this.buttonsAtBottom.Dock = System.Windows.Forms.DockStyle.Fill;
this.buttonsAtBottom.Location = new System.Drawing.Point(4, 60);
this.buttonsAtBottom.Name = "buttonsAtBottom";
this.buttonsAtBottom.RowCount = 1;
this.buttonsAtBottom.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.buttonsAtBottom.Size = new System.Drawing.Size(233, 21);
this.buttonsAtBottom.TabIndex = 10;
//
// Form1 // Form1
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
@ -361,6 +580,14 @@
((System.ComponentModel.ISupportInitialize)(this.nrOfClients)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.nrOfClients)).EndInit();
this.panel_clientArea.ResumeLayout(false); this.panel_clientArea.ResumeLayout(false);
this.panel_CommanArea.ResumeLayout(false); this.panel_CommanArea.ResumeLayout(false);
this.panelServerCommands.ResumeLayout(false);
this.panel2.ResumeLayout(false);
this.panel2.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).EndInit();
this.tableLayoutPanel1.ResumeLayout(false);
this.tableLayoutPanel1.PerformLayout();
this.dataProtocolFields.ResumeLayout(false);
this.buttonsAtBottom.ResumeLayout(false);
this.ResumeLayout(false); this.ResumeLayout(false);
} }
@ -387,10 +614,25 @@
private System.Windows.Forms.NumericUpDown timeLimit; private System.Windows.Forms.NumericUpDown timeLimit;
private System.Windows.Forms.Label label3; private System.Windows.Forms.Label label3;
private System.Windows.Forms.Label label4; private System.Windows.Forms.Label label4;
private System.Windows.Forms.TextBox mapName;
private System.Windows.Forms.CheckBox forceStart; private System.Windows.Forms.CheckBox forceStart;
private System.Windows.Forms.Label labelClientsConnected; private System.Windows.Forms.Label labelClientsConnected;
private System.Windows.Forms.Panel panel_CommanArea; private System.Windows.Forms.Panel panel_CommanArea;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.ComboBox mapName;
private System.Windows.Forms.Panel panelServerCommands;
private System.Windows.Forms.Button buttonExecuteSend;
private System.Windows.Forms.Panel panel2;
private System.Windows.Forms.ComboBox comboBox1;
private System.Windows.Forms.TextBox textBox1;
private System.Windows.Forms.NumericUpDown numericUpDown1;
private System.Windows.Forms.TableLayoutPanel dataProtocolFields;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
private System.Windows.Forms.Label label6;
private System.Windows.Forms.Label label7;
private System.Windows.Forms.Label label8;
private System.Windows.Forms.Button buttonAddNewDataField;
private System.Windows.Forms.Button button2;
private System.Windows.Forms.TableLayoutPanel buttonsAtBottom;
} }
} }

View File

@ -11,6 +11,7 @@ using System.Windows.Interop;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using System.Threading; using System.Threading;
using System.Timers; using System.Timers;
using System.IO;
namespace StandAloneLauncher namespace StandAloneLauncher
{ {
@ -18,12 +19,22 @@ namespace StandAloneLauncher
{ {
System.Windows.Interop.StandaloneGameServerCLI gameServer; System.Windows.Interop.StandaloneGameServerCLI gameServer;
bool serverIsRunning = false; bool serverIsRunning = false;
bool gameIsStarted = false;
public Form1() public Form1()
{ {
InitializeComponent(); InitializeComponent();
string[] maps = Directory.GetFiles("..\\Content\\Worlds\\");
for (int i = 0; i < maps.Length; i++)
{
string temp = maps[i].Split('\\').Last() ;
this.mapName.Items.Add(temp);
}
this.gameModes.SelectedIndex = 0; this.gameModes.SelectedIndex = 0;
this.mapName.SelectedIndex = 0;
} }
public bool Initiate() public bool Initiate()
@ -55,6 +66,7 @@ namespace StandAloneLauncher
this.serverToggle.Text = "Start server"; this.serverToggle.Text = "Start server";
this.ServerInfoTextArea.AppendText(DateTime.Now.ToUniversalTime() + "\n\t" + "Server terminated!\n"); this.ServerInfoTextArea.AppendText(DateTime.Now.ToUniversalTime() + "\n\t" + "Server terminated!\n");
this.panel_commands.Visible = false; this.panel_commands.Visible = false;
this.panelServerCommands.Visible = false;
} }
else else
{ {
@ -77,6 +89,7 @@ namespace StandAloneLauncher
this.gameServer.ServerStart(); this.gameServer.ServerStart();
this.panel_commands.Visible = true; this.panel_commands.Visible = true;
this.ServerInfoTextArea.AppendText(DateTime.Now.ToUniversalTime() + "\n\t" + "Server initiated!\n\tListening on port " + this.listenPort.Value.ToString() + "\n\tLocal IP: " + info.serverIp + "\n"); this.ServerInfoTextArea.AppendText(DateTime.Now.ToUniversalTime() + "\n\t" + "Server initiated!\n\tListening on port " + this.listenPort.Value.ToString() + "\n\tLocal IP: " + info.serverIp + "\n");
this.panelServerCommands.Visible = true;
} }
else else
{ {
@ -87,18 +100,38 @@ namespace StandAloneLauncher
private void buttonStartGame_Click(object sender, EventArgs e) private void buttonStartGame_Click(object sender, EventArgs e)
{ {
//this.gameServer.GameSetGameMode(this.gameModes.SelectedText); if (!gameIsStarted)
this.gameServer.GameSetGameTime((int)this.timeLimit.Value);
this.gameServer.GameSetMapName(this.mapName.Text);
this.gameServer.GameSetMaxClients((int)this.nrOfClients.Value);
if (!this.gameServer.GameStart( this.forceStart.Checked ))
{ {
this.ServerInfoTextArea.AppendText(DateTime.Now.ToUniversalTime() + "\n\t" + "Failed to start the game session!\n"); //this.gameServer.GameSetGameMode(this.gameModes.SelectedText);
this.gameServer.GameSetGameTime((int)this.timeLimit.Value);
this.gameServer.GameSetMapName(this.mapName.Text);
this.gameServer.GameSetMaxClients((int)this.nrOfClients.Value);
if (!(gameIsStarted = this.gameServer.GameStart(this.forceStart.Checked)))
{
this.ServerInfoTextArea.AppendText(DateTime.Now.ToUniversalTime() + "\n\t" + "Failed to start the game session!\n");
}
else
{
this.ServerInfoTextArea.AppendText(DateTime.Now.ToUniversalTime() + "\n\t" + "Game session started!\n");
this.buttonStartGame.Text = "Stop Game";
this.mapName.Enabled = false;
this.nrOfClients.Enabled = false;
this.gameModes.Enabled = false;
this.timeLimit.Enabled = false;
this.forceStart.Enabled = false;
}
} }
else else
{ {
this.ServerInfoTextArea.AppendText(DateTime.Now.ToUniversalTime() + "\n\t" + "Game session started!\n"); this.gameIsStarted = false;
this.buttonStartGame.Text = "Start Game";
this.mapName.Enabled = true;
this.nrOfClients.Enabled = true;
this.gameModes.Enabled = true;
this.timeLimit.Enabled = true;
this.forceStart.Enabled = true;
} }
} }
@ -109,5 +142,17 @@ namespace StandAloneLauncher
this.gameServer.ServerStop(); this.gameServer.ServerStop();
} }
} }
private void buttonAddNewDataField_Click(object sender, EventArgs e)
{
this.dataProtocolFields.RowCount++;
this.dataProtocolFields.SetRow(this.buttonsAtBottom, this.dataProtocolFields.RowCount - 1);
Panel p = new Panel();
p = this.panel2;
this.dataProtocolFields.RowStyles.Add(new RowStyle(SizeType.Absolute, 27));
}
} }
} }

View File

@ -8,23 +8,31 @@
// </auto-generated> // </auto-generated>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
namespace StandAloneLauncher.Properties namespace StandAloneLauncher.Properties {
{
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
{
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default public static Settings Default {
{ get {
get
{
return defaultInstance; return defaultInstance;
} }
} }
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute(".\\..\\Content\\")]
public string Dennis {
get {
return ((string)(this["Dennis"]));
}
set {
this["Dennis"] = value;
}
}
} }
} }

View File

@ -1,7 +1,9 @@
<?xml version='1.0' encoding='utf-8'?> <?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)"> <SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="StandAloneLauncher.Properties" GeneratedClassName="Settings">
<Profiles> <Profiles />
<Profile Name="(Default)" /> <Settings>
</Profiles> <Setting Name="Dennis" Type="System.String" Scope="User">
<Settings /> <Value Profile="(Default)">.\..\Content\</Value>
</SettingsFile> </Setting>
</Settings>
</SettingsFile>

View File

@ -80,6 +80,7 @@
<ItemGroup> <ItemGroup>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Core" /> <Reference Include="System.Core" />
<Reference Include="System.DirectoryServices" />
<Reference Include="System.Xml.Linq" /> <Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" /> <Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" /> <Reference Include="Microsoft.CSharp" />

View File

@ -40,12 +40,13 @@ CustomNetProtocol::CustomNetProtocol()
{ {
this->privateData = new PrivateData(); this->privateData = new PrivateData();
} }
CustomNetProtocol::CustomNetProtocol(CustomNetProtocol& o) CustomNetProtocol::CustomNetProtocol(const CustomNetProtocol& o)
{ {
this->privateData = new PrivateData(); this->privateData = new PrivateData();
this->privateData->attributes = o.privateData->attributes; this->privateData->attributes = o.privateData->attributes;
} }
const CustomNetProtocol& CustomNetProtocol::operator=(CustomNetProtocol& o)
CustomNetProtocol& CustomNetProtocol::operator=(const CustomNetProtocol& o)
{ {
if(this->privateData) if(this->privateData)
{ {
@ -56,11 +57,29 @@ const CustomNetProtocol& CustomNetProtocol::operator=(CustomNetProtocol& o)
this->privateData->attributes = o.privateData->attributes; this->privateData->attributes = o.privateData->attributes;
return *this; return *this;
} }
CustomNetProtocol::~CustomNetProtocol() CustomNetProtocol::~CustomNetProtocol()
{ {
delete this->privateData; delete this->privateData;
this->privateData = 0; this->privateData = 0;
} }
const NetAttributeContainer& CustomNetProtocol::operator[](int ID) const
{
//if(!this->privateData) this->privateData = new PrivateData();
if((unsigned int)ID >= this->privateData->attributes.Size())
{
NetAttributeContainer temp;
temp.type = NetAttributeType_UNKNOWN;
memset(&temp.value, 0, sizeof(NetAttributeValue));
this->privateData->attributes.Push(ID, temp);
}
return this->privateData->attributes[ID];
}
NetAttributeContainer& CustomNetProtocol::operator[](int ID) NetAttributeContainer& CustomNetProtocol::operator[](int ID)
{ {
//if(!this->privateData) this->privateData = new PrivateData(); //if(!this->privateData) this->privateData = new PrivateData();

View File

@ -130,10 +130,12 @@ namespace Oyster
public: public:
CustomNetProtocol(); CustomNetProtocol();
~CustomNetProtocol(); ~CustomNetProtocol();
CustomNetProtocol(CustomNetProtocol& o); CustomNetProtocol( const CustomNetProtocol& o);
const CustomNetProtocol& operator=(CustomNetProtocol& o); CustomNetProtocol& operator=(const CustomNetProtocol& o);
const NetAttributeContainer& operator[](int ID) const;
NetAttributeContainer& operator[](int ID);
NetAttributeContainer& operator[](int ID);
void Set(int id, Oyster::Network::NetAttributeValue val, Oyster::Network::NetAttributeType type); void Set(int id, Oyster::Network::NetAttributeValue val, Oyster::Network::NetAttributeType type);
void Set(int ID, std::string s); void Set(int ID, std::string s);
const NetAttributeContainer& Get(int id); const NetAttributeContainer& Get(int id);

View File

@ -197,6 +197,7 @@ namespace Oyster
void API::StartRenderWireFrame() void API::StartRenderWireFrame()
{ {
Core::deviceContext->RSSetState(wire); Core::deviceContext->RSSetState(wire);
Core::deviceContext->OMSetRenderTargets(Render::Resources::Gather::Pass.RTV.size(),&Render::Resources::Gather::Pass.RTV[0],NULL);
} }
void API::RenderDebugCube(Math::Matrix world) void API::RenderDebugCube(Math::Matrix world)

View File

@ -338,8 +338,8 @@ namespace Oyster
dTDesc.BindFlags = D3D11_BIND_DEPTH_STENCIL; dTDesc.BindFlags = D3D11_BIND_DEPTH_STENCIL;
dTDesc.CPUAccessFlags=0; dTDesc.CPUAccessFlags=0;
dTDesc.MiscFlags=0; dTDesc.MiscFlags=0;
dTDesc.Height = Core::resolution.y; dTDesc.Height = (UINT)Core::resolution.y;
dTDesc.Width = Core::resolution.x; dTDesc.Width = (UINT)Core::resolution.x;
dTDesc.SampleDesc.Count=1; dTDesc.SampleDesc.Count=1;
dTDesc.SampleDesc.Quality=0; dTDesc.SampleDesc.Quality=0;