Public Member Functions | |
NPLFileName (const char *filename) | |
create the NPL file name object from a string. | |
void | SetRelativePath (const char *sPath, int nCount=-1) |
set the relaive_Path | |
string | ToString (bool bIncludeType=false) |
convert to string of the following format [ namespace : ] relativepath [ @ DNSServerName ] e.g. | |
void | FromString (const char *filename) |
build from string: see also NPLFileName(const char * filename); | |
Public Attributes | |
string | sNamespace |
string | sRelativePath |
string | sDNSServerName |
bool | bGlia |
bool | bLocal |
NPLFileName::NPLFileName | ( | const char * | filename | ) |
create the NPL file name object from a string.
The string is of the following file format
filename,: | [(g|gl|l)] [ namespace : ] relative_path [ @ DNSServerName ] the following is a list of all valid file name combinations: "NPC:NPL/CreatureA.lua@world" -- neuron file with "NPC" namespace and a specified DNS "NPC:NPL/CreatureA.lua" -- neuron file with "NPC" namespace and local DNS "(g)NPL/CreatureA.lua" -- glia file, which will be sent to UI receivers and activated from there. So one can think of the content of glia file as a bunch of UI functions. "(gl)NPL/CreatureA.lua" -- glia file forcing local activation: which will omit UI receivers and activate from local environment. "(l)NPL/CreatureA.lua" -- local neuron file: which uses no namespace and no DNS, it is just treated as a local neuron file. |
[ namespace : ]: namespace specifies a computer on which the file is. The syntax is given by examples below: "LXZ:": a simple namespace name. A server computer can use it to refer to another server called "LXZ". "@LXZ:":a central server. A client can use it to refer to the central server on computer specified by namespace "LXZ". "player1@LXZ:": a client named player1 which is connected to central server "LXZ". Both client and server can use it to refer to a computer in the network. "all@LXZ:": all clients connected to a center. the central server can use it to broadcast messages to all clients. "@server:": the currect connected world server. A client can simply use it to refer to the current connected world server. "player1@:server": a client named player1 which is connected to the local central server. A server computer can use it to refer to one of its client. "all@server": all clients connected to the local central server. a server computer can use it to refer to all its clients. ":" or "": the local glia file if they are not specified, otherwise the g|l tag is used.
relative_path: if relative_path contains "\\", it will be converted to "/".
void NPLFileName::SetRelativePath | ( | const char * | sPath, | |
int | nCount = -1 | |||
) |
set the relaive_Path
sPath,: | where the path string is. | |
nCount,: | the number of characters to copy from sPath. If this is negative. the whole sPath will be read. |
string NPLFileName::ToString | ( | bool | bIncludeType = false |
) |
convert to string of the following format [ namespace : ] relativepath [ @ DNSServerName ] e.g.
"NPC:NPL/CreatureA.lua@world" "NPC:NPL/CreatureA.lua" "NPL/CreatureA.lua" "(gl)NPL/CreatureA.lua"
bIncludeType,: | if true, the activation type is included, such as (gl|g|l) |
void NPLFileName::FromString | ( | const char * | filename | ) |
build from string: see also NPLFileName(const char * filename);
get the activation type
get namespace
get relative path
get relative path
get DNS server name