Leviathan  0.8.0.0
Leviathan game engine
PongMasterServer.cpp
Go to the documentation of this file.
1 #include "PongMasterServerIncludes.h"
2 // ------------------------------------ //
3 #include "PongMasterServer.h"
4 
7 using namespace Pong;
8 using namespace std;
9 // ------------------------------------ //
11 
13 
15 {
16  return string("PongMasterServer for version " GAME_VERSIONS_ANSI
17  " Leviathan " LEVIATHAN_VERSION_ANSIS);
18 }
19 
21 {
22 
23  if(!MasterInterface)
24  MasterInterface = std::make_unique<PongMasterNetworking>();
25  return MasterInterface.get();
26 }
27 
29 {
30 
31  MasterInterface.reset();
32 }
33 // ------------------------------------ //
34 void Pong::PongMasterServer::Tick(float elapsed) {}
35 // ------------------------------------ //
37 
39 // ------------------------------------ //
41 {
42 
43  return true;
44 }
45 // ------------------------------------ //
47  Lock& guard, GameConfiguration* configobj)
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 }
59 
61  Lock& guard, KeyConfiguration* keyconfigobj)
62 {}
void EnginePreShutdown() override
Leviathan::NetworkInterface * _GetApplicationPacketHandler() override
Called in Initialize to get the derived packet handler type.
Definition: PongGame.h:14
#define LEVIATHAN_VERSION_ANSIS
Definition: Include.h:56
bool InitLoadCustomScriptTypes(asIScriptEngine *engine) override
static void CheckGameConfigurationVariables(Lock &guard, GameConfiguration *configobj)
void _ShutdownApplicationPacketHandler() override
static std::string GenerateWindowTitle()
void CustomizeEnginePostLoad() override
void Tick(float elapsed) override
static void CheckGameKeyConfigVariables(Lock &guard, KeyConfiguration *keyconfigobj)
Class that encapsulates common networking functionality that is required by all networked programs.
std::unique_lock< std::mutex > Lock
Definition: ThreadSafe.h:18