Leviathan  0.8.0.0
Leviathan game engine
Pong::PongMasterServer Class Reference

#include <PongMasterServer.h>

+ Inheritance diagram for Pong::PongMasterServer:

Public Member Functions

 PongMasterServer ()
 
 ~PongMasterServer ()
 
void Tick (float elapsed) override
 
void CustomizeEnginePostLoad () override
 
void EnginePreShutdown () override
 
bool InitLoadCustomScriptTypes (asIScriptEngine *engine) override
 
- Public Member Functions inherited from Leviathan::MasterServerApplication
DLLEXPORT MasterServerApplication ()
 
DLLEXPORT ~MasterServerApplication ()
 
DLLEXPORT bool PassCommandLine (int argcount, char *args[]) override
 Makes sure doesn't start in GUI mode. More...
 
NETWORKED_TYPE GetProgramNetType () const override
 
- Public Member Functions inherited from Leviathan::LeviathanApplication
DLLEXPORT LeviathanApplication ()
 
DLLEXPORT LeviathanApplication (Engine *engine)
 Version for tests with incomplete engine instance. More...
 
virtual DLLEXPORT ~LeviathanApplication ()
 
virtual DLLEXPORT bool Initialize (AppDef *configuration)
 
DLLEXPORT void ForceRelease ()
 Used to immediately terminate the program. More...
 
virtual DLLEXPORT void StartRelease ()
 Safely releases the Application //. More...
 
DLLEXPORT void MarkAsClosing ()
 Thread safely marks the game to close sometime. More...
 
virtual DLLEXPORT int RunMessageLoop ()
 
virtual DLLEXPORT float RunSingleUpdate ()
 Runs a single engine update cycle (tick + render) More...
 
virtual DLLEXPORT void PreFirstTick ()
 
DLLEXPORT bool Quitting ()
 
DLLEXPORT EngineGetEngine ()
 
DLLEXPORT AppDefGetDefinition ()
 
DLLEXPORT void ClearTimers ()
 Resets all time sensitive timers. More...
 
virtual DLLEXPORT std::shared_ptr< GameWorldGetGameWorld (int id)
 Used to query a world for specific id. More...
 
- Public Member Functions inherited from Leviathan::ThreadSafeGeneric< MutexType >
DLLEXPORT ThreadSafeGeneric ()
 
DLLEXPORT ~ThreadSafeGeneric ()
 
FORCE_INLINE void VerifyLock (RecursiveLock &guard) const
 
FORCE_INLINE void VerifyLock (Lock &lockit) const
 

Static Public Member Functions

static std::string GenerateWindowTitle ()
 
static void CheckGameConfigurationVariables (Lock &guard, GameConfiguration *configobj)
 
static void CheckGameKeyConfigVariables (Lock &guard, KeyConfiguration *keyconfigobj)
 
- Static Public Member Functions inherited from Leviathan::LeviathanApplication
static DLLEXPORT LeviathanApplicationGet ()
 
static DLLEXPORT void DummyGameConfigurationVariables (GameConfiguration *configobj)
 
static DLLEXPORT void DummyGameKeyConfigVariables (KeyConfiguration *keyconfigobj)
 
static DLLEXPORT void StartServerProcess (const std::string &processname, const std::string &commandline)
 
static DLLEXPORT std::vector< std::string > CommandLineStringSplitter (const char *str, std::vector< char * > &argcharstrings, bool addprogramname=true)
 Splits a single string command line into arguments. More...
 

Protected Member Functions

Leviathan::NetworkInterface_GetApplicationPacketHandler () override
 Called in Initialize to get the derived packet handler type. More...
 
void _ShutdownApplicationPacketHandler () override
 
- Protected Member Functions inherited from Leviathan::LeviathanApplication
virtual DLLEXPORT void Release ()
 Performs the final steps in the release process. More...
 
virtual DLLEXPORT void _InternalInit ()
 

Protected Attributes

std::unique_ptr< PongMasterNetworkingMasterInterface
 
- Protected Attributes inherited from Leviathan::LeviathanApplication
bool Quit = false
 
bool ShouldQuit = false
 
bool QuitSometime = false
 This can be quickly set anywhere to quit sometime in the future. More...
 
bool ExternalEngineInstance = false
 
Engine_Engine
 
AppDefApplicationConfiguration = nullptr
 
bool PreferSleepOverLoopAccuracy = false
 
- Protected Attributes inherited from Leviathan::ThreadSafeGeneric< MutexType >
MutexType ObjectsLock
 

Additional Inherited Members

- Public Types inherited from Leviathan::ThreadSafeGeneric< MutexType >
using LockT = typename LockTypeResolver< MutexType >::LType
 
- Static Protected Attributes inherited from Leviathan::LeviathanApplication
static LeviathanApplicationCurapp = NULL
 

Detailed Description

Definition at line 10 of file PongMasterServer.h.

Constructor & Destructor Documentation

◆ PongMasterServer()

Pong::PongMasterServer::PongMasterServer ( )

Definition at line 10 of file PongMasterServer.cpp.

10 {}

◆ ~PongMasterServer()

Pong::PongMasterServer::~PongMasterServer ( )

Definition at line 12 of file PongMasterServer.cpp.

12 {}

Member Function Documentation

◆ _GetApplicationPacketHandler()

Leviathan::NetworkInterface * PongMasterServer::_GetApplicationPacketHandler ( )
overrideprotectedvirtual

Called in Initialize to get the derived packet handler type.

Implements Leviathan::LeviathanApplication.

Definition at line 20 of file PongMasterServer.cpp.

21 {
22 
23  if(!MasterInterface)
24  MasterInterface = std::make_unique<PongMasterNetworking>();
25  return MasterInterface.get();
26 }
std::unique_ptr< PongMasterNetworking > MasterInterface

◆ _ShutdownApplicationPacketHandler()

void PongMasterServer::_ShutdownApplicationPacketHandler ( )
overrideprotectedvirtual

Called to destroy the custom packet handler. This is called just before the engine is released and the main loop exited

Implements Leviathan::LeviathanApplication.

Definition at line 28 of file PongMasterServer.cpp.

29 {
30 
31  MasterInterface.reset();
32 }
std::unique_ptr< PongMasterNetworking > MasterInterface

◆ CheckGameConfigurationVariables()

void Pong::PongMasterServer::CheckGameConfigurationVariables ( Lock &  guard,
GameConfiguration *  configobj 
)
static

Definition at line 46 of file PongMasterServer.cpp.

48 {
49  // Check for various variables //
50  NamedVars* vars = configobj->AccessVariables(guard);
51 
52  // Master server port //
53  if(vars->ShouldAddValueIfNotFoundOrWrongType<int>("MasterServerPort")) {
54  // Add new //
55  vars->AddVar("MasterServerPort", new VariableBlock(53220));
56  configobj->MarkModified(guard);
57  }
58 }

◆ CheckGameKeyConfigVariables()

void Pong::PongMasterServer::CheckGameKeyConfigVariables ( Lock &  guard,
KeyConfiguration *  keyconfigobj 
)
static

Definition at line 60 of file PongMasterServer.cpp.

62 {}

◆ CustomizeEnginePostLoad()

void Pong::PongMasterServer::CustomizeEnginePostLoad ( )
overridevirtual

Reimplemented from Leviathan::LeviathanApplication.

Definition at line 36 of file PongMasterServer.cpp.

36 {}

◆ EnginePreShutdown()

void Pong::PongMasterServer::EnginePreShutdown ( )
overridevirtual

Reimplemented from Leviathan::LeviathanApplication.

Definition at line 38 of file PongMasterServer.cpp.

38 {}

◆ GenerateWindowTitle()

std::string Pong::PongMasterServer::GenerateWindowTitle ( )
static

Definition at line 14 of file PongMasterServer.cpp.

15 {
16  return string("PongMasterServer for version " GAME_VERSIONS_ANSI
17  " Leviathan " LEVIATHAN_VERSION_ANSIS);
18 }
#define LEVIATHAN_VERSION_ANSIS
Definition: Include.h:56

◆ InitLoadCustomScriptTypes()

bool Pong::PongMasterServer::InitLoadCustomScriptTypes ( asIScriptEngine *  engine)
overridevirtual

Reimplemented from Leviathan::LeviathanApplication.

Definition at line 40 of file PongMasterServer.cpp.

41 {
42 
43  return true;
44 }

◆ Tick()

void Pong::PongMasterServer::Tick ( float  elapsed)
overridevirtual

Reimplemented from Leviathan::LeviathanApplication.

Definition at line 34 of file PongMasterServer.cpp.

34 {}

Member Data Documentation

◆ MasterInterface

std::unique_ptr<PongMasterNetworking> Pong::PongMasterServer::MasterInterface
protected

Definition at line 34 of file PongMasterServer.h.


The documentation for this class was generated from the following files: