My Project
INPLRuntime.h
1 #pragma once
2 //-----------------------------------------------------------------------------
3 // Copyright (C) 2007 - 2010 ParaEngine Corporation, All Rights Reserved.
4 // Author: LiXizhi
5 // Date: 2010.2.26
6 // Description: API for NPL interface
7 //-----------------------------------------------------------------------------
8 #include "baseinterface.h"
9 #include <string>
10 #include "INPLRuntimeState.h"
11 
12 namespace ParaEngine
13 {
14  class INPLJabberClient;
15  class CURLRequestTask;
16 }
17 namespace NPL
18 {
19  class INPLRuntimeState;
20 
31  {
32  public:
34  virtual void Init() = 0;
35 
41  virtual void Run(bool bToEnd = true) = 0;
42 
44  virtual void Cleanup() = 0;
45 
53  virtual void SetHostMainStatesInFrameMove(bool bHostMainStatesInFrameMove) = 0;
54 
61  virtual INPLRuntimeState* CreateState(const char* name, NPLRuntimeStateType type_=NPLRuntimeStateType_NPL) = 0;
62 
67  virtual INPLRuntimeState* GetState(const char* name = NULL) = 0;
68 
70  virtual INPLRuntimeState* CreateGetState(const char* name, NPLRuntimeStateType type_=NPLRuntimeStateType_NPL) = 0;
71 
74  virtual bool DeleteState(INPLRuntimeState* pRuntime_state) = 0;
75 
77  virtual INPLRuntimeState* GetMainState() = 0;
78 
82  virtual bool AddToMainThread(INPLRuntimeState* runtime_state) = 0;
83 
88  virtual void SetUseCompression(bool bCompressIncoming, bool bCompressOutgoing) = 0;
89 
102  virtual void SetCompressionKey(const byte* sKey=0, int nSize=0, int nUsePlainTextEncoding = 0) = 0;
103 
111  virtual void SetCompressionLevel(int nLevel) = 0;
112  virtual int GetCompressionLevel() = 0;
113 
118  virtual void SetCompressionThreshold(int nThreshold) = 0;
119  virtual int GetCompressionThreshold() = 0;
120 
135  virtual void SetTCPKeepAlive(bool bEnable) = 0;
136 
140  virtual bool IsTCPKeepAliveEnabled() = 0;
141 
146  virtual void SetKeepAlive(bool bEnable) = 0;
147  virtual bool IsKeepAliveEnabled() = 0;
148 
155  virtual void EnableIdleTimeout(bool bEnable) = 0;
156  virtual bool IsIdleTimeoutEnabled() = 0;
157 
159  virtual void SetIdleTimeoutPeriod(int nMilliseconds) = 0;
160  virtual int GetIdleTimeoutPeriod() = 0;
161 
168  virtual void StartNetServer(const char* server=NULL, const char* port=NULL) = 0;
169 
171  virtual void StopNetServer() = 0;
172 
181  virtual void AddPublicFile(const std::string& filename, int nID) = 0;
182 
186  virtual void ClearPublicFiles() = 0;
187 
194  virtual void GetIP(const char* nid, char* pOutput) = 0;
195 
196 
202  virtual void accept(const char* tid, const char* nid = NULL) = 0;
203 
209  virtual void reject(const char* nid, int nReason = 0) = 0;
210 
211 
213  //
214  // jabber client functions
215  //
217 
223  virtual ParaEngine::INPLJabberClient* GetJabberClient(const char* sJID) = 0;
228  virtual ParaEngine::INPLJabberClient* CreateJabberClient(const char* sJID) = 0;
229 
235  virtual bool CloseJabberClient(const char* sJID) = 0;
236 
238  //
239  // new libcUrl interface.
240  //
242 
247  virtual bool AppendURLRequest(ParaEngine::CURLRequestTask* pUrlTask, const char* sPoolName = NULL) = 0;
248 
253  virtual bool ChangeRequestPoolSize(const char* sPoolName, int nCount) = 0;
254 
255 
257  //
258  // Downloader functions
259  //
261 
267  virtual void AsyncDownload(const char* url, const char* destFolder, const char* callbackScript, const char* DownloaderName) = 0;
268 
269 
274  virtual void CancelDownload(const char* DownloaderName) = 0;
275 
281  virtual int Download(const char* url, const char* destFolder, const char* callbackScript, const char* DownloaderName) = 0;
282 
292  virtual void NPL_AddDNSRecord(const char * sDNSName, const char* sAddress) = 0;
293 
298  virtual void NPL_SetDefaultChannel(int channel_ID) = 0;
303  virtual int NPL_GetDefaultChannel() = 0;
304 
323  virtual void NPL_SetChannelProperty(int channel_ID, int priority, int reliability) = 0;
337  virtual void NPL_ResetChannelProperties() = 0;
338 
345  virtual void NPL_GetChannelProperty(int channel_ID, int* priority, int* reliability) = 0;
346 
348  //
349  // Global activation functions
350  //
352 
396  virtual int Activate(INPLRuntimeState* pRuntimeState, const char * sNeuronFile, const char * code = NULL,int nLength=0, int channel=0, int priority=2, int reliability=3) = 0;
397  };
398 }
define this to enable debugging of NPL code in visual studio
Definition: INPL.h:9
The base class for interfaces in ParaEngine.
Definition: baseinterface.h:29
INPLRuntimeState interface for DLL interface.
Definition: INPLRuntimeState.h:27
different physics engine has different winding order.
Definition: EventBinding.h:32
URL request can be a HTTP get/post request etc.
Definition: NPLNetClient.h:45
NPL interface of a Jabber-XMPP client proxy.
Definition: IParaWebService.h:108
Definition: inftrees.h:24
NPL Runtime Environment interface.
Definition: INPLRuntime.h:30