// *************************************************************************** string getDebugInformation() { string str; str += toString("UserId: %u\n", NetMngr.getUserId()); str += toString("HomeId: %u\n", CharacterHomeSessionId.asInt()); extern TSessionId HighestMainlandSessionId; str += toString("ShardId: %u\n", HighestMainlandSessionId.asInt()); extern bool IsInRingSession; if (IsInRingSession) { if (getEditor().isInitialized()) str += toString("SessionId: %u\n", getEditor().getDMC().getEditionModule().getCurrentAdventureId().asInt()); extern R2::TUserRole UserRoleInSession; str += toString("Role: %s\n", UserRoleInSession.toString().c_str()); } else { str += toString("On a Mainland Shard\n"); } CConfigFile::CVar *varPtr= ClientCfg.ConfigFile.getVarPtr("Application"); if(varPtr) str += toString("Application: %s\n", varPtr->asString(0).c_str()); else str += toString("Application: NotFound\n"); if(UserEntity) { str += toString("Player Name: '%s'\n", UserEntity->getEntityName().toString().c_str()); str += toString("UserPosition: %.2f %.2f %.2f\n", UserEntity->pos().x, UserEntity->pos().y, UserEntity->pos().z); } else { str += "No user entity information\n"; } str += toString("ViewPosition: %.2f %.2f %.2f\n", View.viewPos().x, View.viewPos().y, View.viewPos().z); uint64 timeInGame = ingameTime1 (); str += toString("Time in game: %dh %dmin %dsec\n", (uint)(timeInGame/(60*60*1000)), (uint)(timeInGame/(60*1000))%60, (uint)(timeInGame/1000)%60); str += toString("LocalTime: %s\n", NLMISC::IDisplayer::dateToHumanString(time(NULL))); str += toString("ServerTick: %u\n", NetMngr.getCurrentServerTick()); str += toString("ConnectState: %s\n", NetMngr.getConnectionStateCStr()); str += toString("LocalAddress: %s\n", NetMngr.getAddress().asString().c_str()); str += toString("Language: %s\n", CI18N::getCurrentLanguageName().toString().c_str()); str += toString("ClientVersion: "RYZOM_VERSION"\n"); if (ClientCfg.R2Mode) { str += toString("PatchVersion: %s\n", R2ServerVersion.c_str()); } else if ((ShardSelected >= 0) && (ShardSelected < (sint32)Shards.size())) { str += toString("PatchVersion: %s\n", Shards[ShardSelected].Version.c_str()); } str += string("Client is ") + string((ClientCfg.Local?"off":"on")) + string("line\n"); // FarTP/ReselectPerso DebugConnectionHistory.debugDisplayConnectionEvent(str); return str; }
std::string CDynamicMapService::getValue(TSessionId sessionId, const std::string& msg) const { if (_StringMgrModule) { return _StringMgrModule->getValue(sessionId.asInt(), msg); } return msg; }
// return true if we sent the connect because we have all information bool connect() { //nlinfo("connect"); if(!UserEntity || UserEntity->getEntityName().toString().empty()) return false; referer = ContinentMngr.getCurrentContinentSelectName(); std::string params; addParam(params, "ra", randomString()); std::string session = toString("%d%d", NetMngr.getUserId(), CTime::getSecondsSince1970()); addParam(params, "sessioncookie", toUpper(getMD5((const uint8 *)session.c_str(), (uint32)session.size()).toString())); addParam(params, "cookie", cookie()); addParam(params, "browsertoken", "X"); addParam(params, "platformtoken", "Win32"); addParam(params, "language", CI18N::getCurrentLanguageCode()); addParam(params, "page", ""); addParam(params, "pagetitle", referer); addParam(params, "screen", toString("%dx%d", ClientCfg.ConfigFile.getVar("Width").asInt(), ClientCfg.ConfigFile.getVar("Height").asInt())); addParam(params, "referer", "http%3A%2F%2Fwww.ryzom.com%2F"+referer); time_t rawtime; struct tm * timeinfo; char buffer [80]; time ( &rawtime ); timeinfo = localtime ( &rawtime ); strftime (buffer,80,"%H%%3A%M", timeinfo); addParam(params, "localtime", buffer); addParam(params, "cv_name", UserEntity->getEntityName().toUtf8()); //addParam(params, "cv_email", ""); //addParam(params, "cv_avatar", ""); addParam(params, "cv_Userid", toString(NetMngr.getUserId())); extern TSessionId HighestMainlandSessionId; string shard; switch(HighestMainlandSessionId.asInt()) { case 101: shard = "Aniro"; break; // fr case 102: shard = "Leanon"; break; // de case 103: shard = "Arispotle"; break; // en case 301: shard = "Yubo"; break; // yubo default: shard= "unknown"; break; } addParam(params, "cv_Shard", shard); get("http://ryzom.com.woopra-ns.com/visit/"+params); return true; }
void CAiWrapperServer::stopAct(TSessionId sessionId, uint32 aiInstanceId) { nldebug("Stop Act in session %u (aiInstance %u)", sessionId.asInt(), aiInstanceId); CMessage msgout("R2_STOPLIVE"); msgout.serial(aiInstanceId); bool isBase = false; msgout.serial(isBase); CUnifiedNetwork::getInstance()->send("AIS",msgout); }
void CAiWrapperServer::startInstance(TSessionId sessionId, uint32 aiInstanceId) { nldebug("Start Instance in session %u (aiInstance %u)", sessionId.asInt(), aiInstanceId); nlinfo("R2An: startInstance %u", aiInstanceId); CMessage msgout("R2_STARTINSTANCE"); msgout.serial(aiInstanceId); CUnifiedNetwork::getInstance()->send("AIS",msgout); }
void CAiWrapperServer::startAct(TSessionId sessionId, uint32 aiInstanceId, CPersistentDataRecord& pdr) { nldebug("Start Act in session %u (aiInstance %u)", sessionId.asInt(), aiInstanceId); uint32 totalDataSize = pdr.totalDataSize(); char* dest = new char[totalDataSize]; if (!pdr.toBuffer(dest, totalDataSize)) { nlwarning("can't serialise data"); return; } { CMessage msgout("R2_GOLIVE"); bool isBase = false; msgout.serial(sessionId); msgout.serial(aiInstanceId); msgout.serial(isBase); msgout.serial(totalDataSize); msgout.serialBuffer (reinterpret_cast<uint8*>(dest), totalDataSize); CUnifiedNetwork::getInstance()->send("AIS",msgout); } }