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

This commit is contained in:
dean11 2014-02-21 09:44:29 +01:00
commit 956c1a726c
2 changed files with 28 additions and 11 deletions

View File

@ -501,7 +501,7 @@ const GameClientState::NetEvent & GameState::DataRecieved( const GameClientState
// set countdown // set countdown
case protocol_Gameplay_ObjectDisconnectPlayer: case protocol_Gameplay_ObjectDisconnectPlayer:
{ {
//Removes //Remove the disconnected player
Protocol_ObjectDisconnectPlayer decoded(data); Protocol_ObjectDisconnectPlayer decoded(data);
auto object = this->privData->dynamicObjects->find( decoded.objectID ); auto object = this->privData->dynamicObjects->find( decoded.objectID );
if( object != this->privData->dynamicObjects->end() ) if( object != this->privData->dynamicObjects->end() )

View File

@ -22,16 +22,16 @@ namespace Oyster
{ {
struct BroadcastOptions struct BroadcastOptions
{ {
//bool broadcast; bool broadcast;
//float broadcastInterval; float broadcastInterval;
//std::wstring subnetToBroadcast; std::wstring subnetToBroadcast;
//CustomNetProtocol broadcastMessage; CustomNetProtocol broadcastMessage;
//BroadcastOptions() BroadcastOptions()
//{ {
// broadcast = true; broadcast = true;
// broadcastInterval = 1.0f; broadcastInterval = 1.0f;
// subnetToBroadcast = L"192.168.0.1"; subnetToBroadcast = L"192.168.0.1";
//} }
} broadcastOptions; } broadcastOptions;
struct MainOptions struct MainOptions
@ -117,6 +117,23 @@ namespace Oyster
*/ */
int NetworkServer::GetPort(); int NetworkServer::GetPort();
/***************************************
Broadcast functions
***************************************/
//Set broadcast settings.
void SetBroadcast(CustomNetProtocol& broadcastMessage, float interval = 1.0f, bool enable = true);
//Set broadcast settings.
void SetBroadcastMessage(CustomNetProtocol& broadcastMessage);
//Enable/disable broadcast.
void SetBroadcast(bool enable);
//Set interval between each broadcast message in seconds.
void SetBroadcastInterval(float interval);
private: private:
struct PrivateData; struct PrivateData;
PrivateData* privateData; PrivateData* privateData;