emulating a client/server based ParaEngine world editing game, using NPL language.
More...
#include <EmuCSParaEditGame.h>
|
enum | CurrentState { STATE_STAND_ALONE = 0,
STATE_SERVER,
STATE_CLIENT
} |
|
|
CurrentState | GetState () |
| get the current state More...
|
|
bool | SetState (CurrentState state) |
| set the current game engine states. More...
|
|
bool | OnReceiveNPLPacket (NPL::NPLPacket *p) |
| Whenever an NPL chat packet is received. More...
|
|
bool | OnCenterUserLost (const char *sUserName) |
| this function is called automatically by the NPL runtime, when a user is lost by the center More...
|
|
bool | OnReceptorUserLost (const char *sUserName) |
| this function is called automatically by the NPL runtime, when a user is lost by the receptor More...
|
|
bool | SendTerrainUpdate (const string &sDestination, const D3DXVECTOR3 &vCenter, float fRadius, float fResolution=1.f) |
| Call this function to send a copy of the local terrain to a destination world at a given resolution. More...
|
|
bool | OnReceiveTerrainUpdate (NPL::NPLPacket *p) |
| called when received a terrain update from the network. More...
|
|
void | FrameMove () |
| this should be called every frame. More...
|
|
emulating a client/server based ParaEngine world editing game, using NPL language.
we might create other network application classes in future for truly distributed network logics. for simplicity, this class is for C/S only.
§ FrameMove()
void CEmuCSParaEditGame::FrameMove |
( |
| ) |
|
this should be called every frame.
Internally, it may send certain network packages at some given rate.
§ GetInstance()
get the singleton instance.
§ GetState()
CEmuCSParaEditGame::CurrentState CEmuCSParaEditGame::GetState |
( |
| ) |
|
get the current state
- Returns
§ OnCenterUserLost()
bool ParaEngine::CEmuCSParaEditGame::OnCenterUserLost |
( |
const char * |
sUserName | ) |
|
this function is called automatically by the NPL runtime, when a user is lost by the center
- Parameters
-
- Returns
§ OnReceiveNPLPacket()
bool CEmuCSParaEditGame::OnReceiveNPLPacket |
( |
NPL::NPLPacket * |
p | ) |
|
Whenever an NPL chat packet is received.
This function will call other handlers.
- Returns
- :true if the packet is successfully processed.
§ OnReceiveTerrainUpdate()
bool ParaEngine::CEmuCSParaEditGame::OnReceiveTerrainUpdate |
( |
NPL::NPLPacket * |
p | ) |
|
called when received a terrain update from the network.
It will update the local global terrain data according to the received data.
- Parameters
-
- Returns
§ OnReceptorUserLost()
bool ParaEngine::CEmuCSParaEditGame::OnReceptorUserLost |
( |
const char * |
sUserName | ) |
|
this function is called automatically by the NPL runtime, when a user is lost by the receptor
- Parameters
-
- Returns
§ SendTerrainUpdate()
bool CEmuCSParaEditGame::SendTerrainUpdate |
( |
const string & |
sDestination, |
|
|
const D3DXVECTOR3 & |
vCenter, |
|
|
float |
fRadius, |
|
|
float |
fResolution = 1.f |
|
) |
| |
Call this function to send a copy of the local terrain to a destination world at a given resolution.
- Parameters
-
sDestination | a destination name, it could be "all@server" or "@server", etc. This will be used to fill the destination address of the packet to be sent. |
sSource | a source name, it could be "". |
vCenter | center of the terrain region to send |
fRadius | radius of the terrain region to send |
fResolution | if this is 1.f, the local world terrain grid resolution is used. |
- Returns
§ SetState()
bool CEmuCSParaEditGame::SetState |
( |
CurrentState |
state | ) |
|
set the current game engine states.
- Returns
- : true if successful.
The documentation for this class was generated from the following files:
- Client/trunk/ParaEngineClient/Engine/Obsoleted/EmuCSParaEditGame.h
- Client/trunk/ParaEngineClient/Engine/Obsoleted/EmuCSParaEditGame.cpp