From d6ee7ec642cc6b3097c8d321a1a00630e24027d1 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Sat, 16 Feb 2008 12:22:33 +0000 Subject: initial client-to-server connection --- src/core/application.h | 36 +++++++++++++++++++++++++++++------- 1 file changed, 29 insertions(+), 7 deletions(-) (limited to 'src/core/application.h') diff --git a/src/core/application.h b/src/core/application.h index 9a531de..5bdc6ef 100644 --- a/src/core/application.h +++ b/src/core/application.h @@ -9,6 +9,8 @@ #include "core/cvar.h" #include "core/netserver.h" +#include "core/netconnection.h" +#include "core/gameinterface.h" namespace core { @@ -16,6 +18,12 @@ namespace core /// cvar to indicate dedicated server status extern Cvar sv_dedicated; +/// cvar to indicate private server status +/** + * A private server is a client with server cababilities. + */ +extern Cvar sv_private; + /// core interface for the client and server Application classes class Application { @@ -35,26 +43,40 @@ public: /// run a core frame virtual void frame(float seconds); - /// a pointer to the current console instance + /// a pointer to the current application instance static Application *instance(); /// quit the application virtual void quit(int status); - /// load the game module - void connect(); + /// start the server or connect to remote host + void connect(std::string const &host); /// disconnect from the game module void disconnect(); - /// time the core has been running, in seconds - float current_time; + /// time the has been connected, in seconds + float time() const; - /// global application object - static Application *application_instance; + /// preloaded game object + GameInterface *gameinterface_preload; + + /// true if the core is connected to a game module or a remote server + bool connected() const; /// network server instance NetServer *netserver; + + /// network client to server connection + NetConnection netconnection; + + /// global application object + static Application *application_instance; + +private: + /// time the core has been running + float game_time; + }; -- cgit v1.2.3