My Project
|
NPL root interface It can be used by plug-in dlls to access the NPL interface. More...
#include <INPL.h>
Public Member Functions | |
virtual INPLRuntime * | GetNPLRuntime ()=0 |
the core NPL runtime interface. More... | |
virtual void | FrameMove (float fElapsedTime)=0 |
if one wants to Run NPL runtime in the main thread. More... | |
virtual void | SetGameLoop (const char *scriptName)=0 |
reset the game loop script. More... | |
virtual void | SetGameLoopInterval (float fInterval)=0 |
set the game loop activation interval. More... | |
virtual void | AddNPLCommand (const char *sCommand, int nLength=0)=0 |
add an NPL command code to the (main state's) pending list to be processed in the next frame move cycle. More... | |
virtual int | StartService (const char *pCommandLine)=0 |
start the NPL service. More... | |
virtual void | StopService ()=0 |
stop the NPL service. More... | |
virtual int | activate (const char *sNPLFilename, const char *sCode, int nCodeLength=0)=0 |
[thread safe] activate the specified file. More... | |
NPL root interface It can be used by plug-in dlls to access the NPL interface.
Call GetNPLRuntime() to get the NPL runtime interface One can simply start the NPL service in a different thread, or use the GetNPLRuntime() interface to frame move in the main thread.
|
pure virtual |
[thread safe] activate the specified file.
It can either be local or remote file.
pState | the source runtime state that initiated this activation. If pState is NULL, the main runtime state is used. |
sNPLFileName | a globally unique name of a NPL file name instance. The string format of an NPL file name is like below. [(sRuntimeStateName|gl)][sNID:]sRelativePath[] |
the following is a list of all valid file name combinations: "user001@paraengine.com:script/hello.lua" – a file of user001 in its default gaming thread "(world1)server001@paraengine.com:script/hello.lua" – a file of server001 in its thread world1 "(worker1)script/hello.lua" – a local file in the thread worker1 "(gl)script/hello.lua" – a glia (local) file in the current runtime state's thread "script/hello.lua" – a file in the current thread. For a single threaded application, this is usually enough. "(worker1)NPLRouter.dll" – activate a C++ or C# dll. Please note that, in windows, it looks for NPLRonter.dll; in linux, it looks for ./libNPLRouter.so "plugin/libNPLRouter.dll" – almost same as above, it is recommented to remove the heading 'lib' when loading. In windows, it looks for plugin/NPLRonter.dll; in linux, it looks for ./plugin/libNPLRouter.so
sCode | it is a chunk of pure data table init code that would be transmitted to the destination file. |
Implemented in NPL::CNPL_imp.
|
pure virtual |
add an NPL command code to the (main state's) pending list to be processed in the next frame move cycle.
[thread safe] This function is thread-safe by using a mutex internally.
sCommand | command to call in the next frame move. |
nLength | length in bytes. if 0, we will calculate from the sCommand. |
Implemented in NPL::CNPL_imp.
|
pure virtual |
if one wants to Run NPL runtime in the main thread.
Call this function such as 30 times per second.
fElapsedTime | time (seconds) elapsed since last call. |
Implemented in NPL::CNPL_imp.
|
pure virtual |
the core NPL runtime interface.
change global settings of the NPL runtime as well as managing runtime state.
Implemented in NPL::CNPL_imp.
|
pure virtual |
reset the game loop script.
the game loop script will be activated every 0.5 seconds see SetGameLoopInterval() to change the default interval Please keep the game loop concise. The default game loop is ./script/gameinterface.lua
Implemented in NPL::CNPL_imp.
|
pure virtual |
set the game loop activation interval.
The default value is 0.5 seconds.
Implemented in NPL::CNPL_imp.
|
pure virtual |
start the NPL service.
This function does not return until finished. we may call it inside the main function of an exe or in a different thread.
pCommandLine | e.g. "bootstrapper=\"config/bootstrapper_emptyshell.xml"" |
Implemented in NPL::CNPL_imp.
|
pure virtual |
stop the NPL service.
Sending the stop signal. It does not return until service is stopped.
Implemented in NPL::CNPL_imp.