extern "C" int TargetHandle(int worldId, const char* name) { int handle = 0; if (NULL != name) { SessionManager* pMgr = g_SessionManagers.Get(worldId); if (NULL != pMgr) { handle = pMgr->TargetHandle(name); } } return handle; }
extern "C" int SendCommandByName(int worldId, const char* name, const char* command) { int ret = 0; if (NULL != name && NULL != command) { SessionManager* pMgr = g_SessionManagers.Get(worldId); if (NULL != pMgr) { int dest = pMgr->TargetHandle(name); ret = SendCommandByHandle(worldId, dest, command); } } return ret; }
extern "C" int SendByName(int worldId, const char* name, const void* data, int len) { int ret = 0; if (NULL != name && NULL != data) { SessionManager* pMgr = g_SessionManagers.Get(worldId); if (NULL != pMgr) { int dest = pMgr->TargetHandle(name); ret = SendByHandle(worldId, dest, data, len); } } return ret; }