]> de.git.xonotic.org Git - xonotic/netradiant.git/blobdiff - radiant/watchbsp.h
Merge branch 'fixcflags' into 'master'
[xonotic/netradiant.git] / radiant / watchbsp.h
index f92ed46462c4d50793f17a7efe79c63af29bf022..94b5a58491b1b64b3729a0420833d0822630a35c 100644 (file)
    SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef _BSPWINDOW_H_
-#define _BSPWINDOW_H_
+#if !defined( INCLUDED_WATCHBSP_H )
+#define INCLUDED_WATCHBSP_H
 
-#include "l_net/l_net.h"
+void BuildMonitor_Construct();
+void BuildMonitor_Destroy();
 
-class CWatchBSP
-{
-private:
-// a flag we have set to true when using an external BSP plugin
-// the resulting code with that is a bit dirty, cleaner solution would be to seperate the succession of commands from the listening loop
-// (in two seperate classes probably)
-bool m_bBSPPlugin;
+typedef struct _GPtrArray GPtrArray;
+void BuildMonitor_Run( GPtrArray* commands, const char* mapName );
 
-// EIdle: we are not listening
-//   DoMonitoringLoop will change state to EBeginStep
-// EBeginStep: the socket is up for listening, we are expecting incoming connection
-//   incoming connection will change state to EWatching
-// EWatching: we have a connection, monitor it
-//   connection closed will see if we start a new step (EBeginStep) or launch Quake3 and end (EIdle)
-enum EWatchBSPState { EIdle, EBeginStep, EWatching } m_eState;
-socket_t *m_pListenSocket;
-socket_t *m_pInSocket;
-netmessage_t msg;
-GPtrArray *m_pCmd;
-// used to timeout EBeginStep
-GTimer    *m_pTimer;
-unsigned int m_iCurrentStep;
-// name of the map so we can run the engine
-char    *m_sBSPName;
-// buffer we use in push mode to receive data directly from the network
-xmlParserInputBufferPtr m_xmlInputBuffer;
-xmlParserInputPtr m_xmlInput;
-xmlParserCtxtPtr m_xmlParserCtxt;
-// call this to switch the set listening mode
-bool SetupListening();
-// start a new EBeginStep
-void DoEBeginStep();
-// the xml and sax parser state
-char m_xmlBuf[MAX_NETMESSAGE];
-bool m_bNeedCtxtInit;
-message_info_s m_message_info;
-
-public:
-CWatchBSP() { m_bBSPPlugin = false; m_pListenSocket = NULL; m_pInSocket = NULL; m_eState = EIdle; m_pTimer = g_timer_new(); m_sBSPName = NULL; m_xmlInputBuffer = NULL; m_bNeedCtxtInit = true; }
-virtual ~CWatchBSP();
-bool HasBSPPlugin() const
-{ return m_bBSPPlugin; }
-
-// called regularly to keep listening
-void RoutineProcessing();
-// start a monitoring loop with the following steps
-void DoMonitoringLoop( GPtrArray *pCmd, char *sBSPName );
-// close everything - may be called from the outside to abort the process
-void Reset();
-// start a listening loop for an external process, possibly a BSP plugin
-void ExternalListen();
-};
-
-void WINAPI QERApp_Listen();
+extern bool g_WatchBSP_Enabled;
+extern bool g_WatchBSP_LeakStop;
 
 #endif