|
My Project
|
import C++ functions from ParaEngine API More...
Public Types | |
| enum | NPLRuntimeStateType { NPLRuntimeStateType_NPL = 0, NPLRuntimeStateType_NPL_LITE, NPLRuntimeStateType_DLL, NPLRuntimeStateType_NPL_ExternalLuaState } |
| The types of CNPLRuntimeState. More... | |
| enum | NPLReturnCode { NPL_OK = 0, NPL_Error, NPL_ConnectionNotEstablished, NPL_QueueIsFull, NPL_StreamError, NPL_RuntimeState_NotExist, NPL_FailedToLoadFile, NPL_RuntimeState_NotReady, NPL_FileAccessDenied, NPL_ConnectionEstablished, NPL_UnableToResolveName, NPL_ConnectionTimeout, NPL_ConnectionDisconnected, NPL_ConnectionAborted, NPL_Command, NPL_WrongProtocol } |
| enum | NPLConnectionState { ConnectionDisconnected, ConnectionConnecting, ConnectionConnected, ConnectionAuthenticating, ConnectionAuthenticated } |
| This describes the possible states of a NPLConnection object. More... | |
| enum | PacketPriority { SYSTEM_PRIORITY, HIGH_PRIORITY, MEDIUM_PRIORITY, LOW_PRIORITY, NUMBER_OF_PRIORITIES } |
| These enumerations are used to describe when packets are delivered. More... | |
| enum | PacketReliability { UNRELIABLE, UNRELIABLE_SEQUENCED, RELIABLE, RELIABLE_ORDERED, RELIABLE_SEQUENCED } |
| These enumerations are used to describe how packets are delivered. More... | |
| enum | NPLMessageType { MSG_TYPE_FILE_ACTIVATION = 0, MSG_TYPE_COMMAND_BEGIN, MSG_TYPE_RESET, MSG_TYPE_EXIT, MSG_TYPE_TICK, MSG_TYPE_FILE_LOAD } |
| message type in NPLMessage More... | |
| typedef boost::shared_ptr< CNPLRuntimeState > | NPLRuntimeState_ptr |
| typedef boost::shared_ptr< NPLServerInfo > | NPLServerInfo_ptr |
| typedef ParaIntrusivePtr< NPLMessage > | NPLMessage_ptr |
| typedef boost::shared_ptr< NPLRuntimeAddress > | NPLRuntimeAddress_ptr |
| typedef boost::shared_ptr< NPLTimer > | NPLTimer_ptr |
| typedef boost::shared_ptr< CNPLConnection > | NPLConnection_ptr |
| typedef boost::shared_ptr< CNPLRuntimeState > | NPLRuntimeState_ptr |
| typedef boost::shared_ptr< NPLServerInfo > | NPLServerInfo_ptr |
| typedef ParaIntrusivePtr< NPLMessage > | NPLMessage_ptr |
| typedef ParaIntrusivePtr< NPLMsgOut > | NPLMsgOut_ptr |
| typedef boost::shared_ptr< NPLRuntimeAddress > | NPLRuntimeAddress_ptr |
| typedef boost::shared_ptr< NPLTimer > | NPLTimer_ptr |
| typedef std::basic_string< char, std::char_traits< char >, ParaEngine::CNPLPool_Char_alloc<> > | NPLString |
| NPL String can be used instead of std::string, for strings which are created and deleted very regularly. More... | |
| typedef ParaIntrusivePtr< NPLObjectBase > | NPLObjectBase_ptr |
| typedef ParaIntrusivePtr< NPLTable > | NPLTable_ptr |
| typedef ParaIntrusivePtr< NPLNumberObject > | NPLNumberObject_ptr |
| typedef ParaIntrusivePtr< NPLBoolObject > | NPLBoolObject_ptr |
| typedef ParaIntrusivePtr< NPLStringObject > | NPLStringObject_ptr |
| typedef CNPLWriterT< ParaEngine::StringBuilder > | CNPLBufWriter |
| using StringBuilder for buffering. More... | |
| typedef CNPLWriterT< std::string > | CNPLWriter |
| using std::string for buffering | |
Static Public Member Functions | |
| static string | HelloWorld () |
| This function is for testing NPLMonoInterface.cs More... | |
| static string | GetCurrentMsg (System.IntPtr npl_runtime_state) |
| Get the current incoming message of a npl_runtime_state. More... | |
| static void | activate (System.IntPtr npl_runtime_state, string file_name, string msg) |
| activate a local or remote file More... | |
| static void | activate2 (string file_name, string msg) |
| same as activate2. More... | |
| static void | accept (string tid, string nid) |
| accept a given connection. More... | |
| static void | reject (string tid) |
| reject and close a given connection. More... | |
| static string | HelloWorld () |
| This function is for testing NPLMonoInterface.cs More... | |
| static string | GetCurrentMsg (System.IntPtr npl_runtime_state) |
| Get the current incoming message of a npl_runtime_state. More... | |
| static void | activate (System.IntPtr npl_runtime_state, string file_name, string msg) |
| activate a local or remote file More... | |
| static void | activate2 (string file_name, string msg) |
| same as activate2. More... | |
| static void | accept (string tid, string nid) |
| accept a given connection. More... | |
| static void | reject (string tid) |
| reject and close a given connection. More... | |
Public Attributes | |
| const char * | NPLBaseFiles [] |
import C++ functions from ParaEngine API
| typedef CNPLWriterT< ParaEngine::StringBuilder > NPL.CNPLBufWriter |
using StringBuilder for buffering.
This is the prefered way to do the code generator
| typedef std::basic_string<char, std::char_traits<char>, ParaEngine::CNPLPool_Char_alloc<> > NPL.NPLString |
NPL String can be used instead of std::string, for strings which are created and deleted very regularly.
iternally it uses memory pool CNPLPool_Char_alloc for memory allocation. NPL String uses SSO(small string optimization 16 bytes) as std::string; for string smaller or equal to 2048 Bytes, it uses one of its internal memory pools, for even bigger string, standard malloc is used(default to std::string behavior).
This describes the possible states of a NPLConnection object.
the larger the value, the later the stage.
| enum NPL::NPLMessageType |
message type in NPLMessage
| Enumerator | |
|---|---|
| MSG_TYPE_FILE_ACTIVATION | normal file activation |
| MSG_TYPE_EXIT | exit the runtime state |
| MSG_TYPE_TICK | frame move tick |
| MSG_TYPE_FILE_LOAD | load without activation |
The types of CNPLRuntimeState.
| Enumerator | |
|---|---|
| NPLRuntimeStateType_NPL | the default NPL runtime state, with all NPL and ParaEngine functions loaded. it will consume about 1MB memory at start up. |
| NPLRuntimeStateType_NPL_LITE | the light-weighter NPL runtime state, with only NPL and very limited functions loaded. |
| NPLRuntimeStateType_DLL | it consumes nothing. and is usually used with DLL plugins. |
| NPLRuntimeStateType_NPL_ExternalLuaState | same as NPLRuntimeStateType_NPL, but with externally set lua state |
| enum NPL::PacketPriority |
These enumerations are used to describe when packets are delivered.
These enumerations are used to describe how packets are delivered.
|
static |
accept a given connection.
The connection will be regarded as authenticated once accepted.
| tid | the temporary id or NID of the connection to be accepted. usually it is from msg.tid or msg.nid. |
| nid | if this is not nil, tid will be renamed to nid after accepted. |
|
static |
accept a given connection.
The connection will be regarded as authenticated once accepted.
| tid | the temporary id or NID of the connection to be accepted. usually it is from msg.tid or msg.nid. |
| nid | if this is not nil, tid will be renamed to nid after accepted. |
|
static |
activate a local or remote file
| npl_runtime_state | |
| file_name | 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 |
| msg |
|
static |
activate a local or remote file
| npl_runtime_state | |
| file_name | 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 |
| msg |
|
static |
same as activate2.
except that no npl_runtime_state is specified, the main runtime state is assumed.
| file_name | |
| msg |
|
static |
same as activate2.
except that no npl_runtime_state is specified, the main runtime state is assumed.
| file_name | |
| msg |
|
static |
Get the current incoming message of a npl_runtime_state.
| mono_scripting_state |
|
static |
Get the current incoming message of a npl_runtime_state.
| mono_scripting_state |
|
static |
This function is for testing NPLMonoInterface.cs
|
static |
This function is for testing NPLMonoInterface.cs
|
static |
reject and close a given connection.
The connection will be closed once rejected.
| tid | the temporary id or NID of the connection to be rejected. usually it is from msg.tid or msg.nid. |
|
static |
reject and close a given connection.
The connection will be closed once rejected.
| tid | the temporary id or NID of the connection to be rejected. usually it is from msg.tid or msg.nid. |
| const char* NPL.NPLBaseFiles[] |
1.8.12