]> de.git.xonotic.org Git - xonotic/netradiant.git/blobdiff - radiant/watchbsp.h
Merge branch 'fixcflags' into 'master'
[xonotic/netradiant.git] / radiant / watchbsp.h
index c124c54f2965f8ef03b79aab56377f025e1b4449..94b5a58491b1b64b3729a0420833d0822630a35c 100644 (file)
@@ -1,91 +1,43 @@
-/*\r
-Copyright (c) 2001, Loki software, inc.\r
-All rights reserved.\r
-\r
-Redistribution and use in source and binary forms, with or without modification, \r
-are permitted provided that the following conditions are met:\r
-\r
-Redistributions of source code must retain the above copyright notice, this list \r
-of conditions and the following disclaimer.\r
-\r
-Redistributions in binary form must reproduce the above copyright notice, this\r
-list of conditions and the following disclaimer in the documentation and/or\r
-other materials provided with the distribution.\r
-\r
-Neither the name of Loki software nor the names of its contributors may be used \r
-to endorse or promote products derived from this software without specific prior \r
-written permission. \r
-\r
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' \r
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE \r
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE \r
-DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY \r
-DIRECT,INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES \r
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; \r
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON \r
-ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT \r
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS \r
-SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \r
-*/\r
-\r
-#ifndef _BSPWINDOW_H_\r
-#define _BSPWINDOW_H_\r
-\r
-#include "l_net/l_net.h"\r
-\r
-class CWatchBSP\r
-{\r
-private:\r
-  // a flag we have set to true when using an external BSP plugin\r
-  // the resulting code with that is a bit dirty, cleaner solution would be to seperate the succession of commands from the listening loop\r
-  // (in two seperate classes probably)\r
-  bool m_bBSPPlugin;\r
-\r
-  // EIdle: we are not listening\r
-  //   DoMonitoringLoop will change state to EBeginStep\r
-  // EBeginStep: the socket is up for listening, we are expecting incoming connection\r
-  //   incoming connection will change state to EWatching\r
-  // EWatching: we have a connection, monitor it\r
-  //   connection closed will see if we start a new step (EBeginStep) or launch Quake3 and end (EIdle)\r
-  enum EWatchBSPState { EIdle, EBeginStep, EWatching } m_eState;\r
-  socket_t *m_pListenSocket;\r
-  socket_t *m_pInSocket;\r
-  netmessage_t msg;\r
-  GPtrArray *m_pCmd;\r
-  // used to timeout EBeginStep\r
-  GTimer    *m_pTimer;\r
-  unsigned int m_iCurrentStep;\r
-  // name of the map so we can run the engine\r
-  char    *m_sBSPName;\r
-  // buffer we use in push mode to receive data directly from the network\r
-  xmlParserInputBufferPtr m_xmlInputBuffer;\r
-  xmlParserInputPtr m_xmlInput;\r
-  xmlParserCtxtPtr m_xmlParserCtxt;\r
-  // call this to switch the set listening mode\r
-  bool SetupListening();\r
-  // start a new EBeginStep\r
-  void DoEBeginStep();\r
-  // the xml and sax parser state\r
-  char m_xmlBuf[MAX_NETMESSAGE];\r
-  bool m_bNeedCtxtInit;\r
-  message_info_s m_message_info;\r
-\r
-public:\r
-  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; }\r
-  virtual ~CWatchBSP();\r
-  bool HasBSPPlugin () const\r
-    { return m_bBSPPlugin; }\r
-\r
-  // called regularly to keep listening\r
-  void RoutineProcessing();\r
-  // start a monitoring loop with the following steps\r
-  void DoMonitoringLoop( GPtrArray *pCmd, char *sBSPName );\r
-  // close everything - may be called from the outside to abort the process\r
-  void Reset();\r
-  // start a listening loop for an external process, possibly a BSP plugin\r
-  void ExternalListen();\r
-};\r
-\r
-void WINAPI QERApp_Listen();\r
-\r
-#endif\r
+/*
+   Copyright (c) 2001, Loki software, inc.
+   All rights reserved.
+
+   Redistribution and use in source and binary forms, with or without modification,
+   are permitted provided that the following conditions are met:
+
+   Redistributions of source code must retain the above copyright notice, this list
+   of conditions and the following disclaimer.
+
+   Redistributions in binary form must reproduce the above copyright notice, this
+   list of conditions and the following disclaimer in the documentation and/or
+   other materials provided with the distribution.
+
+   Neither the name of Loki software nor the names of its contributors may be used
+   to endorse or promote products derived from this software without specific prior
+   written permission.
+
+   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
+   AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+   IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+   DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
+   DIRECT,INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+   (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+   LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+   ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+   SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#if !defined( INCLUDED_WATCHBSP_H )
+#define INCLUDED_WATCHBSP_H
+
+void BuildMonitor_Construct();
+void BuildMonitor_Destroy();
+
+typedef struct _GPtrArray GPtrArray;
+void BuildMonitor_Run( GPtrArray* commands, const char* mapName );
+
+extern bool g_WatchBSP_Enabled;
+extern bool g_WatchBSP_LeakStop;
+
+#endif