From 2927b3dfb9aef708a2dfb3686c5529eba7b7bb24 Mon Sep 17 00:00:00 2001 From: kaetemi Date: Mon, 18 Nov 2019 10:54:29 +0800 Subject: [PATCH] Bulk disable webig changes --- code/ryzom/server/src/ai_service/messages.cpp | 2 + .../src/entities_game_service/admin.cpp | 6 + .../building_manager/building_physical.cpp | 4 + .../building_manager/room_instance.cpp | 20 +- .../entities_game_service/client_messages.cpp | 10 +- .../entity_manager/entity_callbacks.cpp | 24 +- .../mission_manager/mission_step_kill.cpp | 244 +++--------------- .../mission_manager/mission_step_talk.cpp | 175 ++----------- .../mission_manager/mission_step_template.cpp | 109 +++----- .../mission_manager/mission_step_template.h | 4 +- .../mission_manager/mission_template.cpp | 110 ++------ .../mission_manager/missions_commands.cpp | 10 +- .../player_manager/character.cpp | 111 ++++---- .../player_manager/character.h | 37 ++- .../player_manager/character_inlines.h | 10 +- .../player_manager/persistent_player_data.cpp | 22 +- .../player_manager/player_manager.cpp | 4 +- .../player_manager/ring_reward_points.cpp | 12 +- .../progression/progression_pvp.cpp | 14 +- .../progression/progression_pvp.h | 2 + .../pvp_manager/pvp_manager_2.cpp | 20 +- 21 files changed, 356 insertions(+), 594 deletions(-) diff --git a/code/ryzom/server/src/ai_service/messages.cpp b/code/ryzom/server/src/ai_service/messages.cpp index 809320de4..068b7b9dc 100644 --- a/code/ryzom/server/src/ai_service/messages.cpp +++ b/code/ryzom/server/src/ai_service/messages.cpp @@ -1028,6 +1028,7 @@ void CBSAIDeathReport::callback(const std::string &name, NLNET::TServiceId id) playerAggroable.push_back(aggroIt->first); } +#ifdef RYZOM_FORGE NLNET::CMessage msgout("TRIGGER_WEBIG"); if (!eventBotKilled.empty()) msgout.serial(eventBotKilled); @@ -1041,6 +1042,7 @@ void CBSAIDeathReport::callback(const std::string &name, NLNET::TServiceId id) msgout.serial(playerAggroable[i]); } sendMessageViaMirror("EGS", msgout); +#endif } } break; diff --git a/code/ryzom/server/src/entities_game_service/admin.cpp b/code/ryzom/server/src/entities_game_service/admin.cpp index 20826d2f3..88d476f2c 100644 --- a/code/ryzom/server/src/entities_game_service/admin.cpp +++ b/code/ryzom/server/src/entities_game_service/admin.cpp @@ -4585,6 +4585,7 @@ NLMISC_COMMAND (connectUserChannel, "Connect to user channels", " ") { if ((args.size() < 2) || (args.size() > 3)) @@ -4625,6 +4626,7 @@ NLMISC_COMMAND (connectLangChannel, "Connect to lang channel", " CCharacter::sendDynamicSystemMessage( eid, "EGS_CHANNEL_INVALID_NAME", params ); return false; } +#endif NLMISC_COMMAND (updateTarget, "Update current target", "") { @@ -6994,6 +6996,7 @@ NLMISC_COMMAND(listGuildMembers, "display guild members list", " ") { @@ -7077,6 +7080,7 @@ NLMISC_COMMAND(roomKick, "kick player from room", " ") return true; } +#endif //---------------------------------------------------------------------------- NLMISC_COMMAND(guildInvite, "send a guild invite to a player character", " ") @@ -7960,6 +7964,7 @@ NLMISC_COMMAND(addGuildBuilding, "sadd a building to guild", " ") { @@ -8006,6 +8011,7 @@ NLMISC_COMMAND(setOrganizationStatus, "set the organization status of a player", return true; } +#endif //---------------------------------------------------------------------------- NLMISC_COMMAND(eventCreateNpcGroup, "create an event npc group", " [] [] [] [] [] [] [client_sheet] [inVIllage?inOutpost?inStable?inAtys?]") diff --git a/code/ryzom/server/src/entities_game_service/building_manager/building_physical.cpp b/code/ryzom/server/src/entities_game_service/building_manager/building_physical.cpp index 30374ec3d..8ee2c357a 100644 --- a/code/ryzom/server/src/entities_game_service/building_manager/building_physical.cpp +++ b/code/ryzom/server/src/entities_game_service/building_manager/building_physical.cpp @@ -545,11 +545,15 @@ bool CBuildingPhysicalPlayer::isUserAllowed(CCharacter * user, uint16 ownerId, u if (user->isDead()) return false; +#ifdef RYZOM_FORGE_ROOM CCharacter * owner = PlayerManager.getChar( _Players[ownerId] ); if (owner) return ( (user->getId() == _Players[ownerId]) || owner->playerHaveRoomAccess(user->getId()) ); else return false; +#else + return (user->getId() == _Players[ownerId]); +#endif } //---------------------------------------------------------------------------- diff --git a/code/ryzom/server/src/entities_game_service/building_manager/room_instance.cpp b/code/ryzom/server/src/entities_game_service/building_manager/room_instance.cpp index 518b30a23..5daf6f681 100644 --- a/code/ryzom/server/src/entities_game_service/building_manager/room_instance.cpp +++ b/code/ryzom/server/src/entities_game_service/building_manager/room_instance.cpp @@ -91,8 +91,6 @@ void CRoomInstanceGuild::removeUser( CCharacter* user ) return; } - user->sendUrl("app_ryzhome action=quit_guild_room&room_name="+guildBuilding->getName(), ""); - --_RefCount; if ( _RefCount == 0 ) { @@ -106,14 +104,14 @@ void CRoomInstanceGuild::addUser( CCharacter* user, CCharacter* owner ) { BOMB_IF( !user, " null character!", return ); +#ifdef RYZOM_FORGE_ROOM CBuildingPhysicalGuild * guildBuilding = dynamic_cast( _Building ); BOMB_IF( !guildBuilding, " building type does not match with room type", return ); +#endif // open guild inventory window PlayerManager.sendImpulseToClient(user->getId(), "GUILD:OPEN_INVENTORY"); - user->sendUrl("app_ryzhome action=open_guild_room&owner="+ owner->getName().toString()+"&room_name="+guildBuilding->getName(), ""); - ++_RefCount; } @@ -147,16 +145,20 @@ void CRoomInstancePlayer::removeUser( CCharacter* user ) ); return; } - - user->sendUrl("app_ryzhome action=quit_player_room&room_name="+playerBuilding->getName(), ""); --_RefCount; if ( _RefCount == 0 ) { +#ifdef RYZOM_FORGE_ROOM playerBuilding->resetRoomCell( _RoomIdx , user->getInRoomOfPlayer()); +#else + playerBuilding->resetRoomCell( _RoomIdx , user->getId() ); +#endif release(); } +#ifdef RYZOM_FORGE_ROOM user->setInRoomOfPlayer(CEntityId::Unknown); +#endif } //---------------------------------------------------------------------------- @@ -164,11 +166,15 @@ void CRoomInstancePlayer::addUser( CCharacter* user, CCharacter* owner ) { BOMB_IF( !user, " null character!", return ); +#ifdef RYZOM_FORGE_ROOM CBuildingPhysicalPlayer * playerBuilding = dynamic_cast( _Building ); BOMB_IF( !playerBuilding, " building type does not match with room type", return ); +#endif // open room inventory window + // TODO: Does a visiting user have access to the inventory? -Kaetemi PlayerManager.sendImpulseToClient(user->getId(), "ITEM:OPEN_ROOM_INVENTORY"); +#ifdef RYZOM_FORGE_ROOM if (owner) { owner->removeRoomAccesToPlayer(user->getId(),false); @@ -179,7 +185,7 @@ void CRoomInstancePlayer::addUser( CCharacter* user, CCharacter* owner ) // Very rare case owner = user; } - user->sendUrl("app_ryzhome action=open_player_room&owner="+ owner->getName().toString()+"&room_name="+playerBuilding->getName(), ""); +#endif ++_RefCount; } diff --git a/code/ryzom/server/src/entities_game_service/client_messages.cpp b/code/ryzom/server/src/entities_game_service/client_messages.cpp index 434b7eefe..e24570cc0 100644 --- a/code/ryzom/server/src/entities_game_service/client_messages.cpp +++ b/code/ryzom/server/src/entities_game_service/client_messages.cpp @@ -1956,7 +1956,7 @@ void cbClientSendCustomEmote( NLNET::CMessage& msgin, const std::string &service return; } - if(behaviour >= 140 && behaviour <= 169) + if (behaviour >= (MBEHAV::EMOTE_BEGIN + 80) && behaviour <= (MBEHAV::EMOTE_BEGIN + 109)) { string name = CEntityIdTranslator::getInstance()->getByEntity(id).toString(); nlwarning("HACK: %s %s tries to launch a firework %d", id.toString().c_str(), name.c_str(), behaviour); @@ -2737,7 +2737,8 @@ void cbClientSetCharacterTitle( NLNET::CMessage& msgin, const std::string & serv } // kxu: TODO: check validity of title chosen by player - c->setNewTitle(CHARACTER_TITLE::toString((CHARACTER_TITLE::ECharacterTitle)title)); + // TODO: Checking validity here is important! This can be easily hacked clientside. -Kaetemi + c->setTitle((CHARACTER_TITLE::ECharacterTitle)title); c->registerName(); } @@ -3072,6 +3073,7 @@ void cbClientQuitGameRequest( NLNET::CMessage& msgin, const std::string & servic if (player) securityCheck.setCookie(player->getLoginCookie()); // if not set (null player), the check won't pass + // TODO_RYZOMCLASSIC: There used to be a value here. -Kaetemi securityCheck.check(""); } } @@ -3618,6 +3620,10 @@ TUnifiedCallbackItem CbClientArray[]= { "CLIENT:DUEL:REFUSE", cbClientDuelRefuse }, { "CLIENT:DUEL:ABANDON", cbClientDuelAbandon }, + // TODO_RYZOMCLASSIC: Revert this, add additional client messages for 'League'. -Kaetemi + // { "CLIENT:PVP_CHALLENGE:ASK", cbClientPVPChallengeAsked }, + // { "CLIENT:PVP_CHALLENGE:ACCEPT", cbClientPVPChallengeAccept }, + // { "CLIENT:PVP_CHALLENGE:REFUSE", cbClientPVPChallengeRefuse }, { "CLIENT:PVP_CHALLENGE:ASK", cbClientLeagueJoinProposal }, { "CLIENT:PVP_CHALLENGE:ACCEPT", cbClientLeagueJoin }, { "CLIENT:PVP_CHALLENGE:REFUSE", cbClientLeagueJoinProposalDecline }, diff --git a/code/ryzom/server/src/entities_game_service/entity_manager/entity_callbacks.cpp b/code/ryzom/server/src/entities_game_service/entity_manager/entity_callbacks.cpp index a8e551cac..bd24fddf7 100644 --- a/code/ryzom/server/src/entities_game_service/entity_manager/entity_callbacks.cpp +++ b/code/ryzom/server/src/entities_game_service/entity_manager/entity_callbacks.cpp @@ -446,8 +446,10 @@ void cbClientReady( CMessage& msgin, const std::string &serviceName, NLNET::TSer c->initAnimalHungerDb(); c->initFactionPointDb(); +#ifdef RYZOM_FORGE c->initPvpPointDb(); c->initOrganizationInfos(); +#endif c->updateOutpostAdminFlagInDB(); @@ -519,7 +521,26 @@ void cbClientReady( CMessage& msgin, const std::string &serviceName, NLNET::TSer // ask backup for offline commands file COfflineCharacterCommand::getInstance()->characterOnline( characterId ); +#ifdef RYZOM_EPISODE2_REACTIVATE + if( CGameEventManager::getInstance().getChannelEventId() != TChanID::Unknown ) + { + if( c->haveAnyPrivilege() ) + { + DynChatEGS.addSession(CGameEventManager::getInstance().getChannelEventId(), entityIndex, true); + } + else + { + DynChatEGS.addSession(CGameEventManager::getInstance().getChannelEventId(), entityIndex, false); + } + } +#endif + c->onConnection(); + +#ifdef RYZOM_EPISODE2_REACTIVATE + CPVPManager2::getInstance()->sendFactionWarsToClient( c ); + CPVPManager2::getInstance()->addOrRemoveFactionChannel( c ); +#endif } // cbClientReady // @@ -3052,6 +3073,7 @@ void cbTeleportPlayer(NLNET::CMessage& msgin, const std::string &serviceName, NL chr->teleportCharacter(x, y, z, true, true, t); } +#ifdef RYZOM_FORGE //--------------------------------------------------- // trigger the webig //--------------------------------------------------- @@ -3076,7 +3098,7 @@ void cbTriggerWebig(NLNET::CMessage& msgin, const std::string &serviceName, NLNE chr->sendUrl(event, ""); } } - +#endif //--------------------------------------------------- /// Forage source position validation diff --git a/code/ryzom/server/src/entities_game_service/mission_manager/mission_step_kill.cpp b/code/ryzom/server/src/entities_game_service/mission_manager/mission_step_kill.cpp index 7e8e809d4..b481ce8c3 100644 --- a/code/ryzom/server/src/entities_game_service/mission_manager/mission_step_kill.cpp +++ b/code/ryzom/server/src/entities_game_service/mission_manager/mission_step_kill.cpp @@ -48,7 +48,6 @@ class CMissionStepKillFauna : public IMissionStepTemplate { struct CSubStep { - string Dynamic; CSheetId Sheet; uint16 Quantity; }; @@ -69,36 +68,24 @@ class CMissionStepKillFauna : public IMissionStepTemplate _SubSteps.reserve( subs.size() ); for ( uint i = 0; i < subs.size(); i++ ) { - CSubStep subStep; - std::vector< std::string > args; CMissionParser::tokenizeString( subs[i]," \t", args ); - //// Dynamic Mission Args : #dynamic# - if ((args.size() == 2) && (args[0] == "#dynamic#")) + if ( args.size() != 2 ) { - subStep.Dynamic = missionData.Name; - subStep.Quantity = atoi(args[1].c_str()); + MISLOGSYNTAXERROR(" *[; ] [: ]"); + return false; } - //// - else + missionData.ChatParams.push_back( make_pair(args[0],STRING_MANAGER::creature_model) ); + + CSubStep subStep; + subStep.Sheet = CSheetId( args[0] + ".creature"); + if ( subStep.Sheet == CSheetId::Unknown ) { - if ( args.size() != 2 ) - { - MISLOGSYNTAXERROR(" *[; ] [: ]"); - return false; - } - missionData.ChatParams.push_back( make_pair(args[0],STRING_MANAGER::creature_model) ); - - subStep.Dynamic = ""; - subStep.Sheet = CSheetId( args[0] + ".creature"); - if ( subStep.Sheet == CSheetId::Unknown ) - { - ret = false; - MISLOGERROR1("invalid sheet '%s'", args[0].c_str()); - } - NLMISC::fromString(args[1], subStep.Quantity); + ret = false; + MISLOGERROR1("invalid sheet '%s'", args[0].c_str()); } + NLMISC::fromString(args[1], subStep.Quantity); _SubSteps.push_back(subStep); } if ( script.size() == 3 ) @@ -119,53 +106,16 @@ class CMissionStepKillFauna : public IMissionStepTemplate } uint processEvent( const TDataSetRow & userRow, const CMissionEvent & event,uint subStepIndex,const TDataSetRow & giverRow ) { - string webAppUrl; - bool ret = true; - _User = PlayerManager.getChar(getEntityIdFromRow(userRow)); - if ( event.Type == CMissionEvent::Kill ) { CMissionEventKill & eventSpe = (CMissionEventKill&)event; CCreature * c = CreatureManager.getCreature( event.TargetEntity ); - CSheetId faunaSheet; - - //// Dynamic Mission Args - if (_SubSteps[subStepIndex].Dynamic.empty()) { - faunaSheet = _SubSteps[subStepIndex].Sheet; - } - else - { - vector params = _User->getCustomMissionParams(_SubSteps[subStepIndex].Dynamic); - if (params.size() < 2) - { - LOGMISSIONSTEPERROR("kill_fauna : invalid dynamic creature"); - return 0; - } - else - { - webAppUrl = params[0]; - faunaSheet = CSheetId(params[1]); - - if (params.size() > 2) { - string placeStr = CMissionParser::getNoBlankString( params[2] ); - CPlace * place = CZoneManager::getInstance().getPlaceFromName( placeStr ); - if ( !place ) - { - ret = false; - LOGMISSIONSTEPERROR("kill_fauna : invalid place "+params[2]); - } - else - _Place = place->getId(); - } - } - //// - } if ( !c ) { LOGMISSIONSTEPERROR("kill_fauna : invalid creature " + toString(event.TargetEntity.getIndex())); } - else if ( faunaSheet == c->getType() ) + else if ( _SubSteps[subStepIndex].Sheet == c->getType() ) { if ( _Place != 0xFFFF ) { @@ -179,8 +129,6 @@ class CMissionStepKillFauna : public IMissionStepTemplate if ( region && region->getId() == _Place ) { - if (!webAppUrl.empty()) - _User->validateDynamicMissionStep(webAppUrl); LOGMISSIONSTEPSUCCESS("kill_fauna"); return 1; } @@ -189,8 +137,6 @@ class CMissionStepKillFauna : public IMissionStepTemplate { if ( places[i] && places[i]->getId() == _Place ) { - if (!webAppUrl.empty()) - _User->validateDynamicMissionStep(webAppUrl); LOGMISSIONSTEPSUCCESS("kill_fauna"); return 1; } @@ -199,8 +145,6 @@ class CMissionStepKillFauna : public IMissionStepTemplate } else { - if (!webAppUrl.empty()) - _User->validateDynamicMissionStep(webAppUrl); LOGMISSIONSTEPSUCCESS("kill_fauna"); return 1; } @@ -215,87 +159,48 @@ class CMissionStepKillFauna : public IMissionStepTemplate ret.clear(); ret.resize( _SubSteps.size() ); for ( uint i = 0; i < _SubSteps.size(); i++ ) + { ret[i] = _SubSteps[i].Quantity; + } } virtual void getTextParams( uint & nbSubSteps,const std::string* & textPtr,TVectorParamCheck& retParams, const std::vector& subStepStates) { - static const std::string stepTextReact = "MIS_NEED_REACTIVATION"; static const std::string stepText = "MIS_KILL_FAUNA_"; static const std::string stepTextLoc = "MIS_KILL_FAUNA_LOC_"; nlassert( _SubSteps.size() == subStepStates.size() ); - CSheetId faunaSheet; for ( uint i = 0; i < subStepStates.size(); i++ ) { if( subStepStates[i] != 0 ) { - if (_SubSteps[i].Dynamic.empty()) - { - faunaSheet = _SubSteps[i].Sheet; - } - else - { - //// Dynamic Mission Args - vector params = _User->getCustomMissionParams(_SubSteps[i].Dynamic); - if (params.size() < 2) - { - faunaSheet = CSheetId::Unknown; - } - else - { - faunaSheet = CSheetId(params[1]); - } - - if ((_Place == 0xFFFF) && (params.size() > 2)) - { - string placeStr = CMissionParser::getNoBlankString( params[2] ); - CPlace * place = CZoneManager::getInstance().getPlaceFromName( placeStr ); - if ( !place ) - { - MISLOG("sline:%u ERROR : kill_fauna : Invalid place %u", _SourceLine, _Place); - } - else - _Place = place->getId(); - } - //// - } - nbSubSteps++; - if (faunaSheet != CSheetId::Unknown) - { - retParams.push_back(STRING_MANAGER::TParam()); - retParams.back().Type = STRING_MANAGER::creature_model; - retParams.back().SheetId = faunaSheet; + retParams.push_back(STRING_MANAGER::TParam()); + retParams.back().Type = STRING_MANAGER::creature_model; + retParams.back().SheetId = _SubSteps[i].Sheet; - retParams.push_back(STRING_MANAGER::TParam()); - retParams.back().Type = STRING_MANAGER::integer; - retParams.back().Int = subStepStates[i]; - } + retParams.push_back(STRING_MANAGER::TParam()); + retParams.back().Type = STRING_MANAGER::integer; + retParams.back().Int = subStepStates[i]; } } - if (faunaSheet != CSheetId::Unknown) + if ( _Place != 0xFFFF ) { - if ( _Place != 0xFFFF ) + STRING_MANAGER::TParam param; + param.Type = STRING_MANAGER::place; + CPlace * place = CZoneManager::getInstance().getPlaceFromId(_Place); + if ( !place ) { - STRING_MANAGER::TParam param; - param.Type = STRING_MANAGER::place; - CPlace * place = CZoneManager::getInstance().getPlaceFromId(_Place); - if ( !place ) - { - MISLOG("sline:%u ERROR : kill_fauna : Invalid place %u", _SourceLine, _Place); - } - else - { - param.Identifier = place->getName(); - retParams.push_back(param); - } - textPtr = &stepTextLoc; + MISLOG("sline:%u ERROR : kill_fauna : Invalid place %u", _SourceLine, _Place); } else - textPtr = &stepText; + { + param.Identifier = place->getName(); + retParams.push_back(param); + } + textPtr = &stepTextLoc; } else - textPtr = &stepTextReact; + textPtr = &stepText; } std::vector< CSubStep > _SubSteps; @@ -480,7 +385,6 @@ class CMissionStepKillNpc : public IMissionStepTemplate { struct CSubStep { - string Dynamic; TAIAlias Alias; // NLMISC::TStringId NpcName; }; @@ -501,17 +405,9 @@ class CMissionStepKillNpc : public IMissionStepTemplate for ( uint i = 0; i < subs.size(); i++ ) { CSubStep subStep; - //// Dynamic Mission Args : #dynamic# - if (trim(subs[i]) == "#dynamic#") { - subStep.Dynamic = missionData.Name; - } - //// - else - { - subStep.Alias = CAIAliasTranslator::Invalid; - if ( !CMissionParser::parseBotName(subs[i],subStep.Alias,missionData) ) - ret = false; - } + subStep.Alias = CAIAliasTranslator::Invalid; + if ( !CMissionParser::parseBotName(subs[i],subStep.Alias,missionData) ) + ret = false; _SubSteps.push_back( subStep ); } return ret; @@ -519,9 +415,6 @@ class CMissionStepKillNpc : public IMissionStepTemplate } uint processEvent( const TDataSetRow & userRow, const CMissionEvent & event,uint subStepIndex,const TDataSetRow & giverRow ) { - string webAppUrl; - CCharacter * user = PlayerManager.getChar(getEntityIdFromRow(userRow)); - if ( event.Type == CMissionEvent::Kill ) { CMissionEventKill & eventSpe = (CMissionEventKill&)event; @@ -532,44 +425,18 @@ class CMissionStepKillNpc : public IMissionStepTemplate } else { - if (_SubSteps[subStepIndex].Dynamic.empty()) + if ( _SubSteps[subStepIndex].Alias != CAIAliasTranslator::Invalid ) { - if ( _SubSteps[subStepIndex].Alias != CAIAliasTranslator::Invalid ) - { - if ( _SubSteps[subStepIndex].Alias == c->getAlias() ) - { - LOGMISSIONSTEPSUCCESS("kill_npc"); - return 1; - } - } - else if ( event.TargetEntity == giverRow ) + if ( _SubSteps[subStepIndex].Alias == c->getAlias() ) { LOGMISSIONSTEPSUCCESS("kill_npc"); return 1; } } - else + else if ( event.TargetEntity == giverRow ) { - //// Dynamic Mission Args - vector params = user->getCustomMissionParams(_SubSteps[subStepIndex].Dynamic); - if (params.size() < 2) { - LOGMISSIONSTEPERROR("kill_npc : invalid dynamic npc"); - return 0; - } - else - { - webAppUrl = params[0]; - string name; - - CAIAliasTranslator::getInstance()->getNPCNameFromAlias(c->getAlias(), name); - if ( name == params[1] ) - { - user->validateDynamicMissionStep(webAppUrl); - LOGMISSIONSTEPSUCCESS("kill_npc"); - return 1; - } - } - //// + LOGMISSIONSTEPSUCCESS("kill_npc"); + return 1; } } } @@ -588,7 +455,6 @@ class CMissionStepKillNpc : public IMissionStepTemplate virtual void getTextParams( uint & nbSubSteps, const std::string* & textPtr,TVectorParamCheck& retParams, const std::vector& subStepStates) { - static const std::string stepTextReact = "MIS_NEED_REACTIVATION"; static const std::string stepText = "MIS_KILL_NPC_"; textPtr = &stepText; nlassert( _SubSteps.size() == subStepStates.size() ); @@ -599,34 +465,10 @@ class CMissionStepKillNpc : public IMissionStepTemplate nbSubSteps++; retParams.push_back(STRING_MANAGER::TParam()); retParams.back().Type = STRING_MANAGER::bot; - if (_SubSteps[i].Dynamic.empty()) - { - if ( _SubSteps[i].Alias != CAIAliasTranslator::Invalid ) - retParams.back().Int = _SubSteps[i].Alias; - else - retParams.back().Identifier = "giver"; - } + if ( _SubSteps[i].Alias != CAIAliasTranslator::Invalid ) + retParams.back().Int = _SubSteps[i].Alias; else - { - vector params = _User->getCustomMissionParams(_SubSteps[i].Dynamic); - if (params.size() < 2) - { - nlinfo("kill_npc : invalid dynamic npc"); - textPtr = &stepTextReact; - return; - } - else - { - vector aliases; - CAIAliasTranslator::getInstance()->getNPCAliasesFromName( params[1] , aliases ); - if ( aliases.empty() ) - { - retParams.back().Int = CAIAliasTranslator::Invalid; - return; - } - retParams.back().Int = aliases[0]; - } - } + retParams.back().Identifier = "giver"; } } } diff --git a/code/ryzom/server/src/entities_game_service/mission_manager/mission_step_talk.cpp b/code/ryzom/server/src/entities_game_service/mission_manager/mission_step_talk.cpp index ff20126ac..5b35c1991 100644 --- a/code/ryzom/server/src/entities_game_service/mission_manager/mission_step_talk.cpp +++ b/code/ryzom/server/src/entities_game_service/mission_manager/mission_step_talk.cpp @@ -22,7 +22,6 @@ #include "mission_manager/mission_parser.h" #include "mission_manager/ai_alias_translator.h" #include "player_manager/character.h" -#include "player_manager/player_manager.h" #include "creature_manager/creature_manager.h" #include "mission_manager/mission_manager.h" #include "game_item_manager/player_inv_xchg.h" @@ -56,71 +55,42 @@ class CMissionStepTalk : public IMissionStepTemplate return false; } bool ret = true; - //// Dynamic Mission Args : #dynamic# - if (trim(script[1]) == "#dynamic#") + // parse bot + if ( !CMissionParser::parseBotName(script[1], _Bot, missionData) ) { - _Dynamic = missionData.Name; - _PhraseId = _Dynamic+"_ACTION"; - _IsDynamic = true; + MISLOGERROR1("invalid npc '%s'", script[1].c_str()); + return false; } - else + + // parse phrase and params + if (script.size() > 2) { - _IsDynamic = false; - // parse bot - if ( !CMissionParser::parseBotName(script[1], _Bot, missionData) ) + // parse a specific phrase + if (!CMissionParser::parseParamText(line, script[2], _PhraseId, _Params )) { - MISLOGERROR1("invalid npc '%s'", script[1].c_str()); + MISLOGERROR1("invalid text '%s'", script[2].c_str()); return false; } - - // parse phrase and params - if (script.size() > 2) - { - // parse a specific phrase - if (!CMissionParser::parseParamText(line, script[2], _PhraseId, _Params )) - { - MISLOGERROR1("invalid text '%s'", script[2].c_str()); - return false; - } - } - else - { - // use the default phrase - _PhraseId = "MIS_TALK_TO_MENU"; - } - - // add a first default param (the name of the bot we talk to) - _Params.insert(_Params.begin(), STRING_MANAGER::TParam()); - _Params[0].Identifier = CMissionParser::getNoBlankString(script[1]); } + else + { + // use the default phrase + _PhraseId = "MIS_TALK_TO_MENU"; + } + + // add a first default param (the name of the bot we talk to) + _Params.insert(_Params.begin(), STRING_MANAGER::TParam()); + _Params[0].Identifier = CMissionParser::getNoBlankString(script[1]); + return true; } uint processEvent( const TDataSetRow & userRow, const CMissionEvent & event,uint subStepIndex,const TDataSetRow & giverRow ) { - string webAppUrl; - _User = PlayerManager.getChar(getEntityIdFromRow(userRow)); - - if (_IsDynamic && _User != NULL) - { - vector params = _User->getCustomMissionParams(_Dynamic); - if (params.size() < 2) - { - LOGMISSIONSTEPERROR("talk_to : invalid npc name"); - return 0; - } - else - { - webAppUrl = params[0]; - } - } - // not check here : they are done befor. If a talk event comes here, the step is complete if( event.Type == CMissionEvent::Talk ) { - if (!webAppUrl.empty() && _User != NULL) - _User->validateDynamicMissionStep(webAppUrl); LOGMISSIONSTEPSUCCESS("talk_to"); return 1; } @@ -134,69 +104,9 @@ class CMissionStepTalk : public IMissionStepTemplate ret[0] = 1; } - bool getDynamicBot(TAIAlias & aliasRet) - { - if (_User != NULL) - { - vector params = _User->getCustomMissionParams(_Dynamic); - if (params.size() < 2) - { - MISLOG("sline:%u ERROR : talk_to (sendContextText) : invalid bot", _SourceLine); - return false; - } - else - { - vector aliases; - CAIAliasTranslator::getInstance()->getNPCAliasesFromName(params[1], aliases); - if ( aliases.empty() ) - { - MISLOG("sline:%u ERROR : talk_to (sendContextText) : invalid bot", _SourceLine); - return false; - } - - aliasRet = aliases[0]; - return true; - } - } - return false; - } - virtual uint32 sendContextText(const TDataSetRow& user, const TDataSetRow& interlocutor, CMission * instance, bool & gift, const NLMISC::CEntityId & giver ) { - - if (_IsDynamic) - { - if (!getDynamicBot(_Bot) || _User == NULL) - { - MISLOG("sline:%u ERROR : talk_to (sendContextText) : invalid bot", _SourceLine); - return 0; - } - - _User = PlayerManager.getChar(getEntityIdFromRow(user)); - uint32 userId = PlayerManager.getPlayerId(_User->getId()); - string text = _PhraseId; - if (_User) - { - uint32 userId = PlayerManager.getPlayerId(_User->getId()); - text = _User->getCustomMissionText(_PhraseId); - if (text.empty()) - return 0; - } - TVectorParamCheck params; - ucstring phrase = ucstring(_PhraseId+"(){["+text+"]}"); - NLNET::CMessage msgout("SET_PHRASE"); - msgout.serial(_PhraseId); - msgout.serial(phrase); - sendMessageViaMirror("IOS", msgout); - - return STRING_MANAGER::sendStringToClient( user, _PhraseId, params ); - -/* SM_STATIC_PARAMS_1(params, STRING_MANAGER::literal); - params[0].Literal= text;*/ - } - CCreature * bot = CreatureManager.getCreature( interlocutor ); - if ( bot ) { if ( ( _Bot != CAIAliasTranslator::Invalid && _Bot == bot->getAlias() ) || @@ -216,12 +126,6 @@ class CMissionStepTalk : public IMissionStepTemplate virtual bool hasBotChatOption(const TDataSetRow & interlocutor, CMission * instance, bool & gift) { - if (_IsDynamic && !getDynamicBot(_Bot)) - { - MISLOG("sline:%u ERROR : talk_to (sendContextText) : invalid bot", _SourceLine); - return 0; - } - CCreature * bot = CreatureManager.getCreature( interlocutor ); if ( bot ) { @@ -238,27 +142,6 @@ class CMissionStepTalk : public IMissionStepTemplate virtual void getTextParams( uint & nbSubSteps,const std::string* & textPtr,TVectorParamCheck& retParams, const std::vector& subStepStates) { - if (_IsDynamic && !getDynamicBot(_Bot)) - { - MISLOG("sline:%u ERROR : talk_to (sendContextText) : invalid bot", _SourceLine); - static const std::string stepText = "DEBUG_CRASH_P_SMG_CRASH2"; - textPtr = &stepText; - return; - } - - if (_IsDynamic && _User != NULL) - { - - vector params = _User->getCustomMissionParams(_Dynamic); - if (params.size() < 2) - { - MISLOG("sline:%u ERROR : talk_to (sendContextText) : invalid bot", _SourceLine); - return; - } - _Params.insert(_Params.begin(), STRING_MANAGER::TParam()); - _Params[0].Identifier = params[1]; - } - nbSubSteps = 1; static const std::string stepText = "MIS_TALK_TO"; textPtr = &stepText; @@ -270,23 +153,15 @@ class CMissionStepTalk : public IMissionStepTemplate else retParams[0].Identifier = "giver"; } - bool solveTextsParams( CMissionSpecificParsingData & missionData,CMissionTemplate * templ ) { - if (!_IsDynamic) - { - bool ret = IMissionStepTemplate::solveTextsParams(missionData,templ); - if ( !CMissionParser::solveTextsParams(_SourceLine, _Params,missionData ) ) - ret = false; - return ret; - } - return true; + bool ret = IMissionStepTemplate::solveTextsParams(missionData,templ); + if ( !CMissionParser::solveTextsParams(_SourceLine, _Params,missionData ) ) + ret = false; + return ret; } + - virtual TAIAlias getInvolvedBot(bool& invalidIsGiver) const { invalidIsGiver=true; return _Bot; } - - bool _IsDynamic; - std::string _Dynamic; std::string _PhraseId; TVectorParamCheck _Params; TAIAlias _Bot; diff --git a/code/ryzom/server/src/entities_game_service/mission_manager/mission_step_template.cpp b/code/ryzom/server/src/entities_game_service/mission_manager/mission_step_template.cpp index 179bea350..9deb93582 100644 --- a/code/ryzom/server/src/entities_game_service/mission_manager/mission_step_template.cpp +++ b/code/ryzom/server/src/entities_game_service/mission_manager/mission_step_template.cpp @@ -102,60 +102,37 @@ uint32 IMissionStepTemplate::sendRpStepText(CCharacter * user,const std::vector< uint nbSteps = 0; const std::string* textPtr = NULL; - _User = user; - - if (_RoleplayText.compare(0, 6, "WEBIG_") == 0) + if ( !_RoleplayText.empty() ) { - TVectorParamCheck params; - string name = _RoleplayText; - if (user) + // build the param list + getTextParams(nbSteps,(const std::string *&)textPtr,params,stepStates); + + params.reserve(params.size() + _AdditionalParams.size()); + params.insert(params.end(), _AdditionalParams.begin(), _AdditionalParams.end()); + if ( textPtr && !textPtr->empty() && (*textPtr)[textPtr->size()-1] == '_' ) { - uint32 userId = PlayerManager.getPlayerId(user->getId()); - string text = user->getCustomMissionText(_RoleplayText); - if (text.empty()) - return 0; - name = _RoleplayText+"_"+toString(userId); - ucstring phrase = ucstring(name+"(){["+text+"]}"); - NLNET::CMessage msgout("SET_PHRASE"); - msgout.serial(name); - msgout.serial(phrase); - sendMessageViaMirror("IOS", msgout); + buffer = _RoleplayText + "_"; + textPtr = &buffer; } - return STRING_MANAGER::sendStringToClient( user->getEntityRowId(), name, params ); + else + textPtr = &_RoleplayText; } - else - { - if ( !_RoleplayText.empty() ) - { - // build the param list - getTextParams(nbSteps,(const std::string *&)textPtr,params,stepStates); - - params.reserve(params.size() + _AdditionalParams.size()); - params.insert(params.end(), _AdditionalParams.begin(), _AdditionalParams.end()); - if ( textPtr && !textPtr->empty() && (*textPtr)[textPtr->size()-1] == '_' ) - { - buffer = _RoleplayText + "_"; - textPtr = &buffer; - } - else - textPtr = &_RoleplayText; - } - if( !textPtr ) - return 0; + if( !textPtr ) + return 0; - // solve dynamic names - CMissionParser::solveEntitiesNames(params,user->getEntityRowId(),giver); + // solve dynamic names + CMissionParser::solveEntitiesNames(params,user->getEntityRowId(),giver); - // if the text was generated, compute its suffix - if ( !textPtr->empty() && (*textPtr)[textPtr->size()-1] == '_' ) - { - std::string text = NLMISC::toString( "%s%u", textPtr->c_str(),nbSteps ); - return STRING_MANAGER::sendStringToClient( user->getEntityRowId(),text,params); - } - else - return STRING_MANAGER::sendStringToClient( user->getEntityRowId(),*textPtr,params); + // if the text was generated, compute its suffix + if ( !textPtr->empty() && (*textPtr)[textPtr->size()-1] == '_' ) + { + std::string text = NLMISC::toString( "%s%u", textPtr->c_str(),nbSteps ); + return STRING_MANAGER::sendStringToClient( user->getEntityRowId(),text,params); } + else + return STRING_MANAGER::sendStringToClient( user->getEntityRowId(),*textPtr,params); + }// IMissionStepTemplate::sendRpStepText @@ -166,48 +143,30 @@ uint32 IMissionStepTemplate::sendStepText(CCharacter * user,const std::vectorempty() && (*textPtr)[textPtr->size()-1] == '_' ) { - uint32 userId = PlayerManager.getPlayerId(user->getId()); - text = user->getCustomMissionText(_OverridenText); - if (text.empty()) - text = _OverridenText; + buffer = _OverridenText + "_"; + textPtr = &buffer; } - SM_STATIC_PARAMS_1(params, STRING_MANAGER::literal); - params[0].Literal.fromUtf8(text); - return STRING_MANAGER::sendStringToClient( user->getEntityRowId(), "LITERAL", params ); + else + textPtr = &_OverridenText; } else { - if ( _AddDefaultParams ) - { - params.reserve(params.size() + _AdditionalParams.size()); - params.insert(params.end(), _AdditionalParams.begin(), _AdditionalParams.end()); - if ( textPtr && !textPtr->empty() && (*textPtr)[textPtr->size()-1] == '_' ) - { - buffer = _OverridenText + "_"; - textPtr = &buffer; - } - else - textPtr = &_OverridenText; - } - else - { - params = _AdditionalParams; - textPtr = &_OverridenText; - } + params = _AdditionalParams; + textPtr = &_OverridenText; } + } if( !textPtr ) diff --git a/code/ryzom/server/src/entities_game_service/mission_manager/mission_step_template.h b/code/ryzom/server/src/entities_game_service/mission_manager/mission_step_template.h index 31953fb60..d157d8c9d 100644 --- a/code/ryzom/server/src/entities_game_service/mission_manager/mission_step_template.h +++ b/code/ryzom/server/src/entities_game_service/mission_manager/mission_step_template.h @@ -41,7 +41,7 @@ public: //@{ /// ctor inline IMissionStepTemplate() - :_OOOStepIndex(0xFFFFFFFF),_Any(false),_Displayed(true),_IconDisplayedOnStepNPC(true),_IsInOverridenOOO(false),_User(NULL) {} + :_OOOStepIndex(0xFFFFFFFF),_Any(false),_Displayed(true),_IconDisplayedOnStepNPC(true),_IsInOverridenOOO(false) {} //BRIANCODE my appologies, need access to this data from CMissionStepGiveItem struct CSubStep @@ -164,8 +164,6 @@ protected: bool _AddDefaultParams; /// flag set to true if the step is in an OOO block which text wad overriden bool _IsInOverridenOOO; - /// Player running the mission - CCharacter * _User; }; diff --git a/code/ryzom/server/src/entities_game_service/mission_manager/mission_template.cpp b/code/ryzom/server/src/entities_game_service/mission_manager/mission_template.cpp index d8c9e4694..9da9906e5 100644 --- a/code/ryzom/server/src/entities_game_service/mission_manager/mission_template.cpp +++ b/code/ryzom/server/src/entities_game_service/mission_manager/mission_template.cpp @@ -2441,109 +2441,55 @@ uint32 CMissionTemplate::testPrerequisits( CCharacter * user, CPrerequisitInfos uint32 CMissionTemplate::sendTitleText( const TDataSetRow & userRow, const TDataSetRow & giver ) const { - if (TitleText.compare(0, 6, "WEBIG_") == 0) - { - string text = TitleText; - CCharacter *user = PlayerManager.getChar(getEntityIdFromRow(userRow)); - if (user) - { - uint32 userId = PlayerManager.getPlayerId(user->getId()); - text = user->getCustomMissionText(TitleText); - if (text.empty()) - text = ""; - } - SM_STATIC_PARAMS_1(params, STRING_MANAGER::literal); - params[0].Literal.fromUtf8(text); - return STRING_MANAGER::sendStringToClient( userRow, "LITERAL", params ); - } - else - { - TVectorParamCheck params(1 + TitleParams.size() ); - std::copy( TitleParams.begin(),TitleParams.end(), params.begin() + 1 ); - params[0].Type = STRING_MANAGER::bot; - params[0].setEIdAIAlias( getEntityIdFromRow( giver ), CAIAliasTranslator::getInstance()->getAIAlias(getEntityIdFromRow( giver )) ); - CMissionParser::solveEntitiesNames(params,userRow,params[0].getEId()); - return STRING_MANAGER::sendStringToClient( userRow, TitleText,params ); - } +TVectorParamCheck params(1 + TitleParams.size() ); + std::copy( TitleParams.begin(),TitleParams.end(), params.begin() + 1 ); + params[0].Type = STRING_MANAGER::bot; + params[0].setEIdAIAlias( getEntityIdFromRow( giver ), CAIAliasTranslator::getInstance()->getAIAlias(getEntityIdFromRow( giver )) ); + CMissionParser::solveEntitiesNames(params,userRow,params[0].getEId()); + return STRING_MANAGER::sendStringToClient( userRow, TitleText,params ); }// CMissionTemplate sendTitleText uint32 CMissionTemplate::sendAutoText( const TDataSetRow & userRow,const NLMISC::CEntityId & giver) const { - if (AutoText.compare(0, 6, "WEBIG_") == 0) - { - string text = AutoText; - CCharacter *user = PlayerManager.getChar(getEntityIdFromRow(userRow)); - if (user) - { - uint32 userId = PlayerManager.getPlayerId(user->getId()); - text = user->getCustomMissionText(AutoText); - if (text.empty()) - return 0; - } - SM_STATIC_PARAMS_1(params, STRING_MANAGER::literal); - params[0].Literal.fromUtf8(text); - return STRING_MANAGER::sendStringToClient( userRow, "LITERAL", params ); - } - else - { - TVectorParamCheck params = AutoParams; - CMissionParser::solveEntitiesNames(params,userRow,giver); - return STRING_MANAGER::sendStringToClient( userRow, AutoText,params ); - } + TVectorParamCheck params = AutoParams; + CMissionParser::solveEntitiesNames(params,userRow,giver); + return STRING_MANAGER::sendStringToClient( userRow, AutoText,params ); }// CMissionTemplate::sendAutoText uint32 CMissionTemplate::sendDescText( const TDataSetRow & userRow, const TDataSetRow & giver, uint32 descIndex) const { - if (DescText.compare(0, 6, "WEBIG_") == 0) + CEntityId id = getEntityIdFromRow( giver ); + + TVectorParamCheck params; + const TVectorParamCheck* addParams = NULL; + const string * txt = NULL; + if ( descIndex == 0xFFFFFFFF ) { - string text = DescText; - CCharacter *user = PlayerManager.getChar(getEntityIdFromRow(userRow)); - if (user) - { - uint32 userId = PlayerManager.getPlayerId(user->getId()); - text = user->getCustomMissionText(DescText); - if (text.empty()) - text = ""; - } - SM_STATIC_PARAMS_1(params, STRING_MANAGER::literal); - params[0].Literal.fromUtf8(text); - return STRING_MANAGER::sendStringToClient( userRow, "LITERAL", params ); + txt = &DescText; + addParams = &DescParams; } else { - CEntityId id = getEntityIdFromRow( giver ); - - TVectorParamCheck params; - const TVectorParamCheck* addParams = NULL; - const string * txt = NULL; - if ( descIndex == 0xFFFFFFFF ) + if ( descIndex >= OverloadedDescs.size() ) { + nlwarning(" Invalid descIndex %u, size is %u",descIndex,OverloadedDescs.size() ); txt = &DescText; addParams = &DescParams; } else { - if ( descIndex >= OverloadedDescs.size() ) - { - nlwarning(" Invalid descIndex %u, size is %u",descIndex,OverloadedDescs.size() ); - txt = &DescText; - addParams = &DescParams; - } - else - { - txt = &(OverloadedDescs[descIndex].Text); - addParams = &(OverloadedDescs[descIndex].Params); - } + txt = &(OverloadedDescs[descIndex].Text); + addParams = &(OverloadedDescs[descIndex].Params); } - params.reserve(1 + (*addParams).size() ); - params.push_back(STRING_MANAGER::TParam(STRING_MANAGER::entity)); - params.back().setEIdAIAlias(id, CAIAliasTranslator::getInstance()->getAIAlias(id)); - params.insert(params.end(), (*addParams).begin(), (*addParams).end()); + } + params.reserve(1 + (*addParams).size() ); + params.push_back(STRING_MANAGER::TParam(STRING_MANAGER::entity)); + params.back().setEIdAIAlias(id, CAIAliasTranslator::getInstance()->getAIAlias(id)); + params.insert(params.end(), (*addParams).begin(), (*addParams).end()); - CMissionParser::solveEntitiesNames(params,userRow,id); - return STRING_MANAGER::sendStringToClient( userRow,*txt,params ); - } + CMissionParser::solveEntitiesNames(params,userRow,id); + return STRING_MANAGER::sendStringToClient( userRow,*txt,params ); }// CMissionTemplate sendDetailsText /* diff --git a/code/ryzom/server/src/entities_game_service/mission_manager/missions_commands.cpp b/code/ryzom/server/src/entities_game_service/mission_manager/missions_commands.cpp index 63e19c8a2..adfd4a4f3 100644 --- a/code/ryzom/server/src/entities_game_service/mission_manager/missions_commands.cpp +++ b/code/ryzom/server/src/entities_game_service/mission_manager/missions_commands.cpp @@ -936,7 +936,9 @@ NLMISC_COMMAND(getFames, "get fames of player", " faction1,faction2,faction std::pair allegiance = c->getAllegiance(); log.displayNL("%s", PVP_CLAN::toString(allegiance.first).c_str()); log.displayNL("%s", PVP_CLAN::toString(allegiance.second).c_str()); +#ifdef RYZOM_FORGE log.displayNL("%d", c->getOrganization()); +#endif std::vector fames; NLMISC::splitString(args[1], ",", fames); @@ -1013,7 +1015,7 @@ NLMISC_COMMAND(getMoney, "get money of player", "") return true; } - +#ifdef RYZOM_FORGE //---------------------------------------------------------------------------- NLMISC_COMMAND(getPvpPoints, "get pvp points of player", "") { @@ -1025,7 +1027,9 @@ NLMISC_COMMAND(getPvpPoints, "get pvp points of player", "") return true; } +#endif +#ifdef RYZOM_FORGE //---------------------------------------------------------------------------- NLMISC_COMMAND(getCivCultOrg, "get civ cult and organization of player", "") { @@ -1038,8 +1042,9 @@ NLMISC_COMMAND(getCivCultOrg, "get civ cult and organization of player", "" return true; } +#endif - +#ifdef RYZOM_FORGE //---------------------------------------------------------------------------- NLMISC_COMMAND(accessPowo, "give access to the powo", " player_name number") { @@ -1122,6 +1127,7 @@ NLMISC_COMMAND(slide, "slide to the powo", " x y cell [z] [h]") return true; } +#endif //---------------------------------------------------------------------------- NLMISC_COMMAND(spawn, "spawn entity", " quantity sheet dispersion orientation groupname x y look cell") diff --git a/code/ryzom/server/src/entities_game_service/player_manager/character.cpp b/code/ryzom/server/src/entities_game_service/player_manager/character.cpp index d5e836aa4..d140a3f2d 100644 --- a/code/ryzom/server/src/entities_game_service/player_manager/character.cpp +++ b/code/ryzom/server/src/entities_game_service/player_manager/character.cpp @@ -423,16 +423,21 @@ CCharacter::CCharacter(): CEntityBase(false), for (uint i = 0 ; i < (PVP_CLAN::EndClans-PVP_CLAN::BeginClans+1); ++i) _FactionPoint[i] = 0; +#ifdef RYZOM_FORGE _PvpPoint = 0; +#endif + _PVPFlagLastTimeChange = 0; _PVPFlagTimeSettedOn = 0; _PvPDatabaseCounter = 0; _PVPFlag = false; _PVPRecentActionTime = 0; +#ifdef RYZOM_FORGE _Organization = 0; _OrganizationStatus = 0; _OrganizationPoints = 0; +#endif // do not start berserk _IsBerserk = false; @@ -660,7 +665,9 @@ CCharacter::CCharacter(): CEntityBase(false), // For client/server contact list communication _ContactIdPool= 0; +#ifdef RYZOM_FORGE_ROOM _inRoomOfPlayer = CEntityId::Unknown; +#endif for(uint i = 0; i < BRICK_FAMILIES::NbFamilies; ++i ) _BrickFamilyBitField[i] = 0; @@ -669,16 +676,20 @@ CCharacter::CCharacter(): CEntityBase(false), _LastTickNpcControlUpdated = CTickEventHandler::getGameCycle(); +#ifdef RYZOM_FORGE _LastWebCommandIndex = 0; _LastUrlIndex = 0; _CustomMissionsParams.clear(); +#endif _FriendVisibility = VisibleToAll; +#ifdef RYZOM_FORGE _LangChannel = "en"; _NewTitle = "Refugee"; +#endif initDatabase(); } // CCharacter // @@ -704,7 +715,9 @@ void CCharacter::clear() _ForbidAuraUseStartDate=0; _ForbidAuraUseEndDate=0; _Title= CHARACTER_TITLE::Refugee; +#ifdef RYZOM_FORGE _NewTitle = "Refugee"; +#endif SET_STRUCT_MEMBER(_VisualPropertyA,PropertySubData.HatModel,0); SET_STRUCT_MEMBER(_VisualPropertyA,PropertySubData.HatColor,0); @@ -3027,6 +3040,7 @@ void CCharacter::postLoadTreatment() computeMiscBonus(); } + // Always enable XP Catalyaer for non-trial accounts CPlayer * p = PlayerManager.getPlayer(PlayerManager.getPlayerId( getId() )); if (!p->isTrialPlayer()) { @@ -3708,7 +3722,7 @@ void CCharacter::setTargetBotchatProgramm( CEntityBase * target, const CEntityId { // send the web page title uint32 text; - if(c->getWebPageName().find("MENU_") == 0) + if (NLMISC::startsWith(c->getWebPageName(), "MENU_")) // TODO: What is this? { text = STRING_MANAGER::sendStringToClient(_EntityRowId, c->getWebPageName(), TVectorParamCheck() ); } @@ -3725,6 +3739,7 @@ void CCharacter::setTargetBotchatProgramm( CEntityBase * target, const CEntityId SM_STATIC_PARAMS_1(params, STRING_MANAGER::literal); string url = c->getWebPage(); +#ifdef RYZOM_FORGE // add ? or & with if ( url.find('?') == string::npos ) url += NLMISC::toString("?urlidx=%d", getUrlIndex()); @@ -3732,6 +3747,7 @@ void CCharacter::setTargetBotchatProgramm( CEntityBase * target, const CEntityId url += NLMISC::toString("&urlidx=%d", getUrlIndex()); setUrlIndex(getUrlIndex()+1); +#endif url += "&player_eid="+getId().toString(); @@ -3895,16 +3911,10 @@ void CCharacter::sendBetaTesterStatus() sendReservedTitleStatus( CHARACTER_TITLE::FBT, p->isBetaTester() ); - /*if (!p->isBetaTester() && _Title == CHARACTER_TITLE::FBT) + if (!p->isBetaTester() && _Title == CHARACTER_TITLE::FBT) { _Title = CHARACTER_TITLE::Refugee; registerName(); - }*/ - - if (!p->isBetaTester() && _NewTitle == "FBT") - { - _NewTitle = "Refugee"; - registerName(); } } @@ -3919,16 +3929,10 @@ void CCharacter::sendWindermeerStatus() sendReservedTitleStatus( CHARACTER_TITLE::WIND, p->isWindermeerCommunity() ); - /*if ( !p->isWindermeerCommunity() && _Title == CHARACTER_TITLE::WIND) + if ( !p->isWindermeerCommunity() && _Title == CHARACTER_TITLE::WIND) { _Title = CHARACTER_TITLE::Refugee; registerName(); - }*/ - - if ( !p->isWindermeerCommunity() && _NewTitle == "WIND") - { - _NewTitle = "Refugee"; - registerName(); } } @@ -8094,7 +8098,9 @@ void CCharacter::setStartStatistics( const CCreateCharMsg& createCharMsg ) _Race = (EGSPD::CPeople::TPeople) createCharMsg.People; _Gender = createCharMsg.Sex; _Title = CHARACTER_TITLE::Refugee; +#ifdef RYZOM_FORGE _NewTitle = "Refugee"; +#endif // fame information // Players start out as Neutral in their declared clans @@ -9042,7 +9048,9 @@ void CCharacter::setDatabase() _IneffectiveAuras.activate(); _ConsumableOverdoseEndDates.activate(); // init the RRPs - //RingRewardPoints.initDb(); +#ifdef RYZOM_RING_REACTIVATE + RingRewardPoints.initDb(); +#endif }// setDatabase // @@ -9105,7 +9113,7 @@ void CCharacter::startTradeItemSession( uint16 session ) fame = MinFameToTrade; } - if ( (bot->getOrganization() == 0 && fame < MinFameToTrade) || (bot->getOrganization() != 0 && bot->getOrganization() != getOrganization()) ) + else if ( fame < MinFameToTrade ) { SM_STATIC_PARAMS_1(params, STRING_MANAGER::bot); params[0].setEIdAIAlias( _CurrentInterlocutor, CAIAliasTranslator::getInstance()->getAIAlias(_CurrentInterlocutor) ); @@ -9113,8 +9121,6 @@ void CCharacter::startTradeItemSession( uint16 session ) npcTellToPlayerEx( bot->getEntityRowId(),_EntityRowId,txt ); return; } - else if (bot->getOrganization() != 0 && bot->getOrganization() == getOrganization()) - fame = 0; float fameFactor = 1.0f; @@ -9213,8 +9219,7 @@ void CCharacter::startTradePhrases(uint16 session) { nlwarning("fame %u is INVALID",(uint)bot->getRace() ); } - - if ( (bot->getOrganization() == 0 && fame < MinFameToTrade) || (bot->getOrganization() != 0 && bot->getOrganization() != getOrganization()) ) + if ( fame < MinFameToTrade ) { SM_STATIC_PARAMS_1(params, STRING_MANAGER::bot); params[0].setEIdAIAlias( _CurrentInterlocutor, CAIAliasTranslator::getInstance()->getAIAlias(_CurrentInterlocutor) ); @@ -9942,7 +9947,11 @@ bool CCharacter::queryItemPrice( const CGameItemPtr item, uint32& price ) quality = theItem->quality(); if ( theItem->maxDurability() ) wornFactor = float(theItem->durability()) / float(theItem->maxDurability()); +#ifdef RYZOM_FORGE price = (uint32) ( CShopTypeManager::computeBasePrice( theItem, quality ) * wornFactor * 0.02 ); +#else + price = (uint32) ( CShopTypeManager::computeBasePrice( theItem, quality ) * wornFactor ); +#endif return true; } @@ -9984,7 +9993,7 @@ void CCharacter::sellItem( INVENTORIES::TInventory inv, uint32 slot, uint32 quan fame = MinFameToTrade; } - if ( (bot->getOrganization() == 0 && fame < MinFameToTrade) || (bot->getOrganization() != 0 && bot->getOrganization() != getOrganization()) ) + else if ( fame < MinFameToTrade ) { SM_STATIC_PARAMS_1(params, STRING_MANAGER::bot); params[0].setEIdAIAlias( _CurrentInterlocutor, CAIAliasTranslator::getInstance()->getAIAlias(_CurrentInterlocutor) ); @@ -9996,8 +10005,6 @@ void CCharacter::sellItem( INVENTORIES::TInventory inv, uint32 slot, uint32 quan return; } - else if (bot->getOrganization() != 0 && bot->getOrganization() == getOrganization()) - fame = 0; CInventoryPtr child = _Inventory[ inv ]; if( child->getSlotCount() > slot && child->getItem( slot ) != NULL ) @@ -10033,13 +10040,6 @@ void CCharacter::sellItem( INVENTORIES::TInventory inv, uint32 slot, uint32 quan return; } - // You cannot exchange genesis named items - if (item->getPhraseId().find("genesis_") == 0) - { - nlwarning("Character %s tries to sell '%s'", _Id.toString().c_str(), item->getPhraseId().c_str() ); - return; - } - if( ! ITEMFAMILY::isSellableByPlayer( itemForm->Family ) ) { nlwarning(" character %s try to sell an unsealable item %s, must not permited by client", _Id.toString().c_str(), sheet.toString().c_str() ); @@ -10342,7 +10342,7 @@ void CCharacter::initFactionPointDb() } } - +#ifdef RYZOM_FORGE //----------------------------------------------- // setPvpPoint : set the number of pvp point // @@ -10447,7 +10447,7 @@ void CCharacter::initOrganizationInfos() CBankAccessor_PLR::getUSER().getRRPS_LEVELS(2).setVALUE(_PropertyDatabase, _OrganizationStatus ); CBankAccessor_PLR::getUSER().getRRPS_LEVELS(3).setVALUE(_PropertyDatabase, _OrganizationPoints ); } - +#endif //----------------------------------------------------------------------------- void CCharacter::sendFactionPointGainMessage(PVP_CLAN::TPVPClan clan, uint32 fpGain) @@ -11682,7 +11682,12 @@ void CCharacter::setBerserkFlag(bool isBerserk) } else { +#ifdef RYZOM_FORGE sint8 percentTmp = sint8( (127.0 * ( target->getPhysScores()._PhysicalScores[ SCORES::hit_points ].Current ) ) / ( target->getPhysScores()._PhysicalScores[ SCORES::hit_points ].Max ) ); +#else + // TODO: Find out why this was changed to 127? + sint8 percentTmp = sint8( (100.0 * ( target->getPhysScores()._PhysicalScores[ SCORES::hit_points ].Current ) ) / ( target->getPhysScores()._PhysicalScores[ SCORES::hit_points ].Max ) ); +#endif if( percentTmp < 0 ) percent = 0; else @@ -12062,7 +12067,7 @@ bool CCharacter::processMissionEventList( std::list< CMissionEvent* > & eventLis bool processed = false; bool firstEvent = true; - CGuild * guild = CGuildManager::getInstance()->getGuildFromId( _GuildId ); + CGuild *guild = NULL; while ( !eventList.empty() ) { bool eventProcessed = false; @@ -12086,6 +12091,7 @@ bool CCharacter::processMissionEventList( std::list< CMissionEvent* > & eventLis else { // We find the guild and each guild members and we instanciate the mission for them + guild = CGuildManager::getInstance()->getGuildFromId(_GuildId); if (guild) { for ( std::map::iterator it = guild->getMembersBegin(); @@ -12867,7 +12873,7 @@ void CCharacter::updateSavedMissions() TVectorParamCheck params(1); sint32 x = 0; sint32 y = 0; - string msg; + const char *msg; CCreature * c = CreatureManager.getCreature( CAIAliasTranslator::getInstance()->getEntityId( (*itCompass).second.getBotId() ) ); if ( c ) { @@ -13126,7 +13132,7 @@ void CCharacter::registerName(const ucstring &newName) CMessage msgName("CHARACTER_NAME_LANG"); msgName.serial(_EntityRowId); - string sTitle = getFullTitle(); + string sTitle = CHARACTER_TITLE::toString(_Title); ucstring RegisteredName; if (newName.empty()) RegisteredName = getName() + string("$") + sTitle + string("$"); @@ -13300,6 +13306,7 @@ void CCharacter::setPlaces(const std::vector & places) } } +#ifdef RYZOM_FORGE //----------------------------------------------- // isSpawnValid //----------------------------------------------- @@ -13359,6 +13366,7 @@ bool CCharacter::isSpawnValid(bool inVillage, bool inOutpost, bool inStable, boo return true; } +#endif //----------------------------------------------- // memorize @@ -13887,6 +13895,7 @@ uint16 CCharacter::getFirstFreeSlotInKnownPhrase() return (uint16)_KnownPhrases.size()-1; } // getFirstFreeSlotInKnownPhrase // +#ifdef RYZOM_FORGE void CCharacter::sendDynamicMessage(const string &phrase, const string &message) { @@ -13984,6 +13993,8 @@ string CCharacter::getCustomMissionText(const string &missionName) return ""; } +#endif + #ifdef RYZOM_FORGE // !!! Deprecated !!! void CCharacter::addWebCommandCheck(const string &url, const string &data, const string &salt) @@ -14326,6 +14337,7 @@ bool CCharacter::pickUpRawMaterial( uint32 indexInTempInv, bool * lastMaterial ) // Send url for Arcc triggers +#ifdef RYZOM_FORGE vector params = getCustomMissionParams("__LOOT_SHEET__"); if (params.size() >= 2) { @@ -14367,6 +14379,8 @@ bool CCharacter::pickUpRawMaterial( uint32 indexInTempInv, bool * lastMaterial ) } } } +#endif + // first slots are filled with loot items, quarter items are not in temp inv but only info in DB uint32 rawMaterialIndex = indexInTempInv - creature->getLootSlotCount(); const CCreatureRawMaterial * mp = creature->getCreatureRawMaterial( rawMaterialIndex ); @@ -14592,15 +14606,15 @@ void CCharacter::resetFameDatabase() // Check fames and fix bad values if (!haveAnyPrivilege()) { - CFameManager::getInstance().enforceFameCaps(getId(), getAllegiance()); - CFameManager::getInstance().setAndEnforceTribeFameCap(getId(), getAllegiance()); + CFameManager::getInstance().enforceFameCaps(getId(), getAllegiance()); // TODO: Remove allegiance + CFameManager::getInstance().setAndEnforceTribeFameCap(getId(), getAllegiance()); // TODO: Remove allegiance } for (uint i=0; ihavePriv( ":SGM:GM:VG:SG:G:EM:EG:" )) ) // if online, messages from CSRs can't be ignored + if ( (!player) || (!player->havePriv( ":SGM:GM:VG:SG:G:" )) ) // if online, messages from CSRs can't be ignored { CEntityId senderId = getId(); CEntityId ignoredId = id; @@ -15584,6 +15599,7 @@ void CCharacter::removePlayerFromIgnoreListByIndex(uint16 index) sendMessageViaMirror ("IOS", msgName); } +#ifdef RYZOM_FORGE_ROOM //-------------------------------------------------------------- // CCharacter::removeRoomAccesToPlayer() //-------------------------------------------------------------- @@ -15619,6 +15635,7 @@ void CCharacter::removeRoomAccesToPlayer(const NLMISC::CEntityId &id, bool kick) } } } +#endif //-------------------------------------------------------------- // CCharacter::removePlayerFromFriendListByEntityId() @@ -16092,7 +16109,7 @@ void CCharacter::online(bool onlineStatus) // if the character has a CSR grade, remove from all ignore lists - if ( onlineStatus && (! _IsIgnoredBy.empty()) && havePriv( ":SGM:GM:VG:SG:G:EM:EG:" ) ) + if ( onlineStatus && (! _IsIgnoredBy.empty()) && havePriv( ":SGM:GM:VG:SG:G:" ) ) { CMessage msgout( "UNIGNORE_ALL" ); msgout.serial( _Id ); @@ -16282,13 +16299,16 @@ void CCharacter::onConnection() { // Add all handledAIGroups for all missions of the player spawnAllHandledAIGroup(); + // Add character to event channel if event occurs + CGameEventManager::getInstance().addCharacterToChannelEvent( this ); - // update for the unified entity locator + // Update for the unified entity locator if (IShardUnifierEvent::getInstance() != NULL) { IShardUnifierEvent::getInstance()->charConnected(_Id, getLastDisconnectionDate()); } + // Notify PvP manager CPVPManager2::getInstance()->playerConnects(this); } @@ -17183,6 +17203,7 @@ void CCharacter::checkScoresValues( SCORES::TScores score, CHARACTERISTICS::TCha sint32 base = (_PhysCharacs._PhysicalCharacteristics[ charac ].Base + PhysicalCharacteristicsBaseValue) * PhysicalCharacteristicsFactor + _ScorePermanentModifiers[ score ]; if( _PhysScores._PhysicalScores[ score ].Base != base ) { + // TODO: What's this? nlwarning("BADCHECK For player %s, for %s, player should have %u and he has %u !", _Id.toString().c_str(), SCORES::toString(score).c_str(), base, _PhysScores._PhysicalScores[ score ].Base); //vl _PhysScores._PhysicalScores[ score ].Base = base; } @@ -17194,6 +17215,7 @@ void CCharacter::checkScoresValues( SCORES::TScores score, CHARACTERISTICS::TCha baseRegenerateAction += RegenOffset; if( fabs((_PhysScores._PhysicalScores[ score ].BaseRegenerateRepos * 100.0f) - (100.0f * baseRegenerateRepos)) > 0.001) { + // TODO: What's this? nlwarning("BADCHECK For player %s, for %s regen, player should have %f and he has %f !", _Id.toString().c_str(), SCORES::toString(score).c_str(), baseRegenerateRepos, _PhysScores._PhysicalScores[ score ].BaseRegenerateRepos); //vl _PhysScores._PhysicalScores[ score ].BaseRegenerateRepos = baseRegenerateRepos; //vl _PhysScores._PhysicalScores[ score ].BaseRegenerateAction = baseRegenerateAction; @@ -17259,6 +17281,7 @@ void CCharacter::checkCharacAndScoresValues() // compare if (_PhysCharacs._PhysicalCharacteristics[charac].Base != tvalue) { + // TODO: What's this? nlwarning("BADCHECK For player %s, for charac %s, player should have %u and he has %u !", _Id.toString().c_str(), CHARACTERISTICS::toString(charac).c_str(), tvalue,_PhysCharacs._PhysicalCharacteristics[charac].Base); //vl _PhysCharacs._PhysicalCharacteristics[charac].Base = tvalue; @@ -19466,7 +19489,7 @@ void CCharacter::setStartupInstance(uint32 instanceId) void CCharacter::setTitle( CHARACTER_TITLE::ECharacterTitle title ) { - setNewTitle(CHARACTER_TITLE::toString(title)); + _Title = title; } diff --git a/code/ryzom/server/src/entities_game_service/player_manager/character.h b/code/ryzom/server/src/entities_game_service/player_manager/character.h index ec12f94d4..885942e6d 100644 --- a/code/ryzom/server/src/entities_game_service/player_manager/character.h +++ b/code/ryzom/server/src/entities_game_service/player_manager/character.h @@ -1203,11 +1203,13 @@ public: /// get the number of faction point given a faction uint32 getFactionPoint(PVP_CLAN::TPVPClan clan); +#ifdef RYZOM_FORGE /// set the number of pvp point void setPvpPoint(uint32 nbPt); /// get the number of pvp point given a faction uint32 getPvpPoint(); +#endif /// set the SDB path where player wins HoF points in PvP (if not empty) void setSDBPvPPath(const std::string & sdbPvPPath); @@ -1218,6 +1220,7 @@ public: /// init faction point in client database void initFactionPointDb(); +#ifdef RYZOM_FORGE /// init pvp point in client database void initPvpPointDb(); @@ -1226,6 +1229,7 @@ public: void setOrganizationStatus(uint32 status); void changeOrganizationStatus(sint32 status); void changeOrganizationPoints(sint32 points); +#endif /// send faction point gain phrase to the client void sendFactionPointGainMessage(PVP_CLAN::TPVPClan clan, uint32 fpGain); @@ -1560,8 +1564,10 @@ public: /// client (in)validate melee combat void validateMeleeCombat(bool flag); +#ifdef RYZOM_FORGE /// check is player can spawn npc group in here position bool isSpawnValid(bool inVillage, bool inOutpost, bool inStable, bool inAtys); +#endif /// memorize a phrase void memorize(uint8 memorizationSet, uint8 index, uint16 phraseId, const std::vector &bricks); @@ -1681,6 +1687,7 @@ public: /// get ammo item virtual CGameItemPtr getAmmoItem() const; +#ifdef RYZOM_FORGE /// send dynamic message void sendDynamicMessage(const std::string &phrase, const std::string &message); @@ -1701,6 +1708,7 @@ public: /// validate dynamic mission step sending url void validateDynamicMissionStep(const std::string &url); +#endif #ifdef RYZOM_FORGE /// add web command validation check @@ -1966,6 +1974,7 @@ public: void removePlayerFromFriendListByContactId(uint32 contactId); void removePlayerFromFriendListByEntityId(const NLMISC::CEntityId &id); +#ifdef RYZOM_FORGE_ROOM void setInRoomOfPlayer(const NLMISC::CEntityId &id); const NLMISC::CEntityId& getInRoomOfPlayer(); @@ -1977,6 +1986,7 @@ public: /// remove room acces to player void removeRoomAccesToPlayer(const NLMISC::CEntityId &id, bool kick); +#endif /// remove player from league list void removePlayerFromLeagueListByContactId(uint32 contactId); @@ -2385,10 +2395,12 @@ public: void setPvPSafeZoneActive(); /// clear pvp zone safe flag void clearSafeInPvPSafeZone(); +#ifdef RYZOM_FORGE /// get pvp fames allies TYPE_PVP_CLAN getPVPFamesAllies(); /// get pvp fames ennemys TYPE_PVP_CLAN getPVPFamesEnemies(); +#endif /// update the clan in visuale property void updatePVPClanVP() const; //@} @@ -2425,6 +2437,7 @@ public: uint32 getLastConnectedDate() const; uint32 getPlayedTime() const; +#ifdef RYZOM_FORGE const std::string& getLangChannel() const; void setLangChannel(const std::string &lang); @@ -2432,7 +2445,9 @@ public: void setNewTitle(const std::string &title); std::string getFullTitle() const; +#endif +#ifdef RYZOM_FORGE std::string getTagA() const; void setTagA(const std::string &tag); @@ -2444,9 +2459,13 @@ public: std::string getTagPvPB() const; void setTagPvPB(const std::string &tag); +#endif +#ifdef RYZOM_FORGE uint32 getOrganization() const; uint32 getOrganizationStatus() const; +#endif + const std::list& getLastLogStats() const; void updateConnexionStat(); void setDisconnexionTime(); @@ -3079,19 +3098,28 @@ private: uint32 _FactionPoint[PVP_CLAN::EndClans-PVP_CLAN::BeginClans+1]; +#ifdef RYZOM_FORGE uint32 _PvpPoint; +#endif +#ifdef RYZOM_FORGE uint32 _Organization; uint32 _OrganizationStatus; uint32 _OrganizationPoints; +#endif +#ifdef RYZOM_FORGE std::string _LangChannel; std::string _NewTitle; +#endif + +#ifdef RYZOM_FORGE std::string _TagPvPA; std::string _TagPvPB; std::string _TagA; std::string _TagB; +#endif /// SDB path where player wins HoF points in PvP (if not empty) std::string _SDBPvPPath; @@ -3347,6 +3375,7 @@ private: /// nb of users channels uint8 _NbUserChannels; +#ifdef RYZOM_FORGE /// last webcommand index uint32 _LastWebCommandIndex; @@ -3354,6 +3383,7 @@ private: uint32 _LastUrlIndex; std::map _CustomMissionsParams; +#endif // for a power/combat event, stores start and end ticks struct CFlagTickRange { @@ -3415,8 +3445,10 @@ private: }; uint32 _ContactIdPool; +#ifdef RYZOM_FORGE_ROOM std::vector _RoomersList; // Players who have acces to player's room NLMISC::CEntityId _inRoomOfPlayer; +#endif // friends list std::vector _FriendsList; @@ -3753,8 +3785,10 @@ private: /// keep the Ids of the mission queues in which is this player std::vector _MissionsQueues; +#ifdef RYZOM_FORGE /// keep the validated web commandes std::set _ValideWebCommandIndex; +#endif /// keep here the queue for which this player currently has an enter critical zone proposal uint32 _EnterCriticalZoneProposalQueueId; @@ -3818,7 +3852,7 @@ private: /// General god flag for persistence bool _GodModeSave; public: - +#ifdef RYZOM_FORGE void setWebCommandIndex(uint32 index) { _LastWebCommandIndex = index;} uint32 getWebCommandIndex() const { return _LastWebCommandIndex;} @@ -3827,6 +3861,7 @@ public: void setUrlIndex(uint32 index) { _LastUrlIndex = index;} uint32 getUrlIndex() const { return _LastUrlIndex;} +#endif bool getInvisibility() const { return _Invisibility;} /// Set the invisibility flag, NB : just for persistence, do not change nothing. diff --git a/code/ryzom/server/src/entities_game_service/player_manager/character_inlines.h b/code/ryzom/server/src/entities_game_service/player_manager/character_inlines.h index eb45824a1..1634535d7 100644 --- a/code/ryzom/server/src/entities_game_service/player_manager/character_inlines.h +++ b/code/ryzom/server/src/entities_game_service/player_manager/character_inlines.h @@ -904,6 +904,7 @@ inline uint32 CCharacter::getPlayedTime() const return _PlayedTime; } +#ifdef RYZOM_FORGE //------------------------------------------------------------------------------ inline const std::string& CCharacter::getLangChannel() const @@ -917,7 +918,9 @@ inline const std::string& CCharacter::getNewTitle() const { return _NewTitle; } +#endif +#ifdef RYZOM_FORGE //------------------------------------------------------------------------------ inline std::string CCharacter::getTagA() const @@ -954,8 +957,9 @@ inline std::string CCharacter::getTagPvPB() const return "_"; return _TagPvPB; } +#endif - +#ifdef RYZOM_FORGE //------------------------------------------------------------------------------ inline std::string CCharacter::getFullTitle() const { @@ -964,7 +968,9 @@ inline std::string CCharacter::getFullTitle() const else return _NewTitle; } +#endif +#ifdef RYZOM_FORGE //------------------------------------------------------------------------------ inline uint32 CCharacter::getOrganization() const @@ -977,7 +983,7 @@ inline uint32 CCharacter::getOrganizationStatus() const { return _OrganizationStatus; } - +#endif //------------------------------------------------------------------------------ diff --git a/code/ryzom/server/src/entities_game_service/player_manager/persistent_player_data.cpp b/code/ryzom/server/src/entities_game_service/player_manager/persistent_player_data.cpp index 9ff135745..774c2be58 100644 --- a/code/ryzom/server/src/entities_game_service/player_manager/persistent_player_data.cpp +++ b/code/ryzom/server/src/entities_game_service/player_manager/persistent_player_data.cpp @@ -414,11 +414,11 @@ static void prepareCharacterPositionForStore ( COfflineEntityState & state, cons _FactionPoint[i],\ PVP_CLAN::TPVPClan k=PVP_CLAN::fromString(key); if ((k>=PVP_CLAN::BeginClans) && (k<=PVP_CLAN::EndClans)) _FactionPoint[k-PVP_CLAN::BeginClans]=val)\ \ - PROP(uint32,_PvpPoint)\ - PROP2(_LangChannel,string,_LangChannel,_LangChannel=val)\ - PROP(uint32,_Organization)\ - PROP(uint32,_OrganizationStatus)\ - PROP(uint32,_OrganizationPoints)\ + /*PROP(uint32,_PvpPoint)*/\ + /*PROP2(_LangChannel,string,_LangChannel,_LangChannel=val)*/\ + /*PROP(uint32,_Organization)*/\ + /*PROP(uint32,_OrganizationStatus)*/\ + /*PROP(uint32,_OrganizationPoints)*/\ PROP2(DeclaredCult,string,PVP_CLAN::toString(_DeclaredCult),_DeclaredCult=PVP_CLAN::fromString(val))\ PROP2(DeclaredCiv,string,PVP_CLAN::toString(_DeclaredCiv),_DeclaredCiv=PVP_CLAN::fromString(val))\ \ @@ -439,11 +439,11 @@ static void prepareCharacterPositionForStore ( COfflineEntityState & state, cons PROP_GAME_CYCLE_COMP(_ForbidAuraUseStartDate)\ PROP_GAME_CYCLE_COMP(_ForbidAuraUseEndDate)\ PROP2(_Title, string, CHARACTER_TITLE::toString(getTitle()), setTitle(CHARACTER_TITLE::toCharacterTitle(val)))\ - PROP2(_NewTitle, string, _NewTitle, _NewTitle=val)\ - PROP2(_TagPvPA, string, _TagPvPA, _TagPvPA=val)\ - PROP2(_TagPvPB, string, _TagPvPB, _TagPvPB=val)\ - PROP2(_TagA, string, _TagA, _TagA=val)\ - PROP2(_TagB, string, _TagB, _TagB=val)\ + /*PROP2(_NewTitle, string, _NewTitle, _NewTitle=val)*/\ + /*PROP2(_TagPvPA, string, _TagPvPA, _TagPvPA=val)*/\ + /*PROP2(_TagPvPB, string, _TagPvPB, _TagPvPB=val)*/\ + /*PROP2(_TagA, string, _TagA, _TagA=val)*/\ + /*PROP2(_TagB, string, _TagB, _TagB=val)*/\ \ /* Visual Properties */\ PROP2(HairType, uint8, _VisualPropertyA().PropertySubData.HatModel, SET_STRUCT_MEMBER(_VisualPropertyA,PropertySubData.HatModel,val))\ @@ -507,7 +507,7 @@ static void prepareCharacterPositionForStore ( COfflineEntityState & state, cons STRUCT_VECT(_Pact)\ STRUCT_VECT(_KnownPhrases)\ STRUCT_MAP(TAIAlias, TMissionHistory, _MissionHistories)\ - PROP_MAP(string, string, _CustomMissionsParams)\ + /*PROP_MAP(string, string, _CustomMissionsParams)*/\ LSTRUCT(_WelcomeMissionDesc, if (_WelcomeMissionDesc.isValid()))\ STRUCT_ARRAY(_PlayerPets,_PlayerPets.size())\ \ diff --git a/code/ryzom/server/src/entities_game_service/player_manager/player_manager.cpp b/code/ryzom/server/src/entities_game_service/player_manager/player_manager.cpp index feb961a23..a3eb72c76 100644 --- a/code/ryzom/server/src/entities_game_service/player_manager/player_manager.cpp +++ b/code/ryzom/server/src/entities_game_service/player_manager/player_manager.cpp @@ -460,7 +460,9 @@ void CPlayerManager::addClientCallback() { "SET_PLAYER_SEASON", cbSetPlayerSeason }, // from DSS { "TELEPORT_PLAYER", cbTeleportPlayer }, // from AIS +#ifdef RYZOM_FORGE { "TRIGGER_WEBIG", cbTriggerWebig }, // from AIS +#endif { "SET_CHAR_AIINSTANCE", cbSetCharacterAIInstance}, @@ -2252,7 +2254,7 @@ bool CPlayerManager::hasBetterCSRGrade( CPlayer* p1, CPlayer *p2, bool devIsNorm if ( p2->havePriv(":SGM:") ) return ( p1->havePriv(":SGM:") ); if ( p2->havePriv(":EM:") ) - return ( p1->havePriv(":SGM:EM:GM:") ); + return ( p1->havePriv(":SGM:EM:") ); if ( p2->havePriv(":GM:") ) return ( p1->havePriv(":SGM:EM:GM:") ); if ( p2->havePriv(":EG:") ) diff --git a/code/ryzom/server/src/entities_game_service/player_manager/ring_reward_points.cpp b/code/ryzom/server/src/entities_game_service/player_manager/ring_reward_points.cpp index 5c4901614..0d023a47a 100644 --- a/code/ryzom/server/src/entities_game_service/player_manager/ring_reward_points.cpp +++ b/code/ryzom/server/src/entities_game_service/player_manager/ring_reward_points.cpp @@ -588,12 +588,12 @@ CRingRewardPoints::TGenerateRewardResult CRingRewardPointsImpl::generateReward(R } // in any case, generate a mission event -//#pragma message (NL_LOC_WRN "give the correct scenario tag") +#pragma message (NL_LOC_WRN "give the correct scenario tag") // TODO: give the correct scenario tag CMissionEventTaggedRingScenarioDone event("blabla"); _ParentCharacter->processMissionEvent(event); -//#pragma message (NL_LOC_WRN "Implements 'rare' item reward generation") +#pragma message (NL_LOC_WRN "Implements 'rare' item reward generation") // TODO: Implements 'rare' item reward generation // make sure the reward level is valid BOMB_IF(rewardLevel>R2::TSessionLevel::last_enum_item,"Ignoring attempting to generate reward of invalid level for character "<<_ParentCharacter->getId().toString(),return CRingRewardPoints::grr_invalid); @@ -615,8 +615,8 @@ CRingRewardPoints::TGenerateRewardResult CRingRewardPointsImpl::generateReward(R */ /* *** todo *** */ -//#pragma message (NL_LOC_WRN "Implements mission step validation") -//#pragma message (NL_LOC_WRN "Implements 'rare' item reward generation") +#pragma message (NL_LOC_WRN "Implements mission step validation") +#pragma message (NL_LOC_WRN "Implements 'rare' item reward generation") // TODO: Implements mission step validation and 'rare' item reward generation // NB : need to return grr_ok_rare if rare item were gained @@ -687,7 +687,7 @@ CRingRewardPoints::TGenerateRewardResult CRingRewardPointsImpl::generateReward(R /* This is where we add some code to validate the mission step if player is in newbyland and has the 'complete a ring scenario' mission */ -//#pragma message (NL_LOC_WRN "Implements mission step validation") +#pragma message (NL_LOC_WRN "Implements mission step validation") // TODO: Implements mission step validation /* *** todo *** */ @@ -781,7 +781,7 @@ CRingRewardPoints::TGenerateRewardResult CRingRewardPointsImpl::generateReward(R } // NB : need to return grr_ok_rare if rare item were gained -//#pragma message (NL_LOC_WRN "Implements 'rare' item reward generation") +#pragma message (NL_LOC_WRN "Implements 'rare' item reward generation") // TODO: Implements 'rare' item reward generation } diff --git a/code/ryzom/server/src/entities_game_service/progression/progression_pvp.cpp b/code/ryzom/server/src/entities_game_service/progression/progression_pvp.cpp index d819db2ee..41a71f844 100644 --- a/code/ryzom/server/src/entities_game_service/progression/progression_pvp.cpp +++ b/code/ryzom/server/src/entities_game_service/progression/progression_pvp.cpp @@ -1232,6 +1232,7 @@ void CDamageScoreManager::playerDeath(CCharacter * victimChar, const CCharacter if (winnerGainFactionPoints) { +#ifdef RYZOM_FORGE // Compute Fames delta sint32 fameFactor = 0; for (uint8 fameIdx = 0; fameIdx < 7; fameIdx++) @@ -1253,6 +1254,11 @@ void CDamageScoreManager::playerDeath(CCharacter * victimChar, const CCharacter // player gains faction points changePlayerPvpPoints(winnerChar, sint32(fpPerPlayer) * fameFactor); winnerChar->sendFactionPointGainKillMessage(winnerFaction, fpPerPlayer * fameFactor, victimChar->getId()); +#elif defined(RYZOM_EPISODE2_REACTIVATE) + // player gains faction points + changePlayerFactionPoints(winnerChar, winnerFaction, sint32(fpPerPlayer)); + winnerChar->sendFactionPointGainKillMessage(winnerFaction, fpPerPlayer, victimChar->getId()); +#endif } // player gains HoF points @@ -1260,14 +1266,15 @@ void CDamageScoreManager::playerDeath(CCharacter * victimChar, const CCharacter // and a way for known if an episode occurs (and specs for known if other episode pemrti to win HoF point...) //changePlayerHoFPoints(winnerChar, sint32(hofpPerPlayer)); - /* +#ifdef RYZOM_EPISODE2_REACTIVATE // PvP faction winner HOF reward CPVPManager2::getInstance()->characterKillerInPvPFaction( winnerChar, winnerFaction, (sint32)fpPerPlayer ); if( finalBlower == winnerChar ) { CPVPManager2::getInstance()->finalBlowerKillerInPvPFaction( winnerChar, winnerFaction, victimChar ); } - */ +#endif + rewardedKillers.push_back(winnerChar->getId()); nbRewardedMembers++; } @@ -1856,6 +1863,7 @@ sint32 CDamageScoreManager::changePlayerFactionPoints(CCharacter * playerChar, P return fpDelta; } +#ifdef RYZOM_FORGE //----------------------------------------------------------------------------- sint32 CDamageScoreManager::changePlayerPvpPoints(CCharacter * playerChar, sint32 fpDelta) { @@ -1876,7 +1884,7 @@ sint32 CDamageScoreManager::changePlayerPvpPoints(CCharacter * playerChar, sint3 return fpDelta; } - +#endif //----------------------------------------------------------------------------- void CDamageScoreManager::changePlayerHoFPoints(CCharacter * playerChar, sint32 hofpDelta) diff --git a/code/ryzom/server/src/entities_game_service/progression/progression_pvp.h b/code/ryzom/server/src/entities_game_service/progression/progression_pvp.h index f426c71e2..bbca1ec21 100644 --- a/code/ryzom/server/src/entities_game_service/progression/progression_pvp.h +++ b/code/ryzom/server/src/entities_game_service/progression/progression_pvp.h @@ -359,9 +359,11 @@ private: /// \return the applied delta (a negative delta may have been modified up to zero to keep faction points positive) sint32 changePlayerFactionPoints(CCharacter * playerChar, PVP_CLAN::TPVPClan faction, sint32 fpDelta); +#ifdef RYZOM_FORGE /// add/remove pvp points to a player /// \return the applied delta (a negative delta may have been modified up to zero to keep pvp points positive) sint32 changePlayerPvpPoints(CCharacter * playerChar, sint32 fpDelta); +#endif /// add/remove HoF points to a player and his guild if his SDB PvP path is defined void changePlayerHoFPoints(CCharacter * playerChar, sint32 hofpDelta); diff --git a/code/ryzom/server/src/entities_game_service/pvp_manager/pvp_manager_2.cpp b/code/ryzom/server/src/entities_game_service/pvp_manager/pvp_manager_2.cpp index c7231fe4b..aa056a215 100644 --- a/code/ryzom/server/src/entities_game_service/pvp_manager/pvp_manager_2.cpp +++ b/code/ryzom/server/src/entities_game_service/pvp_manager/pvp_manager_2.cpp @@ -72,6 +72,11 @@ void CPVPManager2::init() IPVPInterface * pvpFaction = new CPVPFaction(); BOMB_IF(pvpFaction == 0, "Can't allocate CPVPFaction", nlstop ); _Instance->_PVPInterface.push_back(pvpFaction); +#ifdef RYZOM_EPISODE2_REACTIVATE + // add war between kami and karavan faction (must be controled by GM tools later + _Instance->addFactionWar(PVP_CLAN::Kami, PVP_CLAN::Karavan); +#endif + // instantiate pvp duel class IPVPInterface * pvpDuel = new CPVPDuel(); BOMB_IF(pvpDuel == 0, "Can't allocate CPVPDuel", nlstop ); @@ -210,6 +215,9 @@ std::vector CPVPManager2::getCharacterChannels(CCharacter * user) std::vector result; result.clear(); + // NOTE: It's better to just rely on user-made channels. -Kaetemi + +#ifdef RYZOM_FORGE // Add lang channel, should be first. if (!user->getLangChannel().empty()) { @@ -232,14 +240,19 @@ std::vector CPVPManager2::getCharacterChannels(CCharacter * user) result.push_back((*it).second); } } +#endif +#ifdef RYZOM_FORGE PVP_CLAN::TPVPClan faction = user->getAllegiance().first; if( faction != PVP_CLAN::Neutral ) { - TMAPFactionChannel::iterator it = _FactionChannel.find(faction); - if( it != _FactionChannel.end() ) + if (isFactionInWar(faction)) { - result.push_back((*it).second); + TMAPFactionChannel::iterator it = _FactionChannel.find(faction); + if (it != _FactionChannel.end()) + { + result.push_back((*it).second); + } } } @@ -252,6 +265,7 @@ std::vector CPVPManager2::getCharacterChannels(CCharacter * user) result.push_back((*it).second); } } +#endif /* bool matis = CFameInterface::getInstance().getFameIndexed(user->getId(), 0) >= PVPFameRequired*6000;