Changed: Synchronization with SVN

This commit is contained in:
kervala 2012-10-05 14:57:05 +02:00
parent 0d382e9034
commit e8b1eedc97
19 changed files with 475 additions and 133 deletions

View file

@ -532,7 +532,10 @@ static CMessage getFileClassImp( CMessage& msgin)
for (uint j=0; j<classes[i].size(); ++j) for (uint j=0; j<classes[i].size(); ++j)
{ {
std::string rfile = getBackupFileName(classes[i][j].File); std::string rfile = classes[i][j].File;
// if there's wildcard, the file is already full so we don't need to add again the backup path or we ll have "save_shard/save_shard/..." that is not valid
if (!CFile::isExists(rfile))
rfile = getBackupFileName(classes[i][j].File);
fdc.addFile(classes[i][j].File, CFile::getFileModificationDate(rfile),CFile::getFileSize(rfile)); fdc.addFile(classes[i][j].File, CFile::getFileModificationDate(rfile),CFile::getFileSize(rfile));
} }
} }

View file

@ -181,6 +181,7 @@ AdminCommandsInit[] =
"validateRespawnPoint", true, "validateRespawnPoint", true,
"summonPet", true, "summonPet", true,
"connectUserChannel", true, "connectUserChannel", true,
"connectLangChannel", true,
"updateTarget", true, "updateTarget", true,
"resetName", true, "resetName", true,
"showOnline", true, "showOnline", true,
@ -1126,6 +1127,8 @@ ENTITY_VARIABLE(Position, "Position of a player (in meter) <eid> <posx>,<posy>[,
vector<string> res; vector<string> res;
sint32 x = 0, y = 0, z = 0; sint32 x = 0, y = 0, z = 0;
sint32 cell = 0;
if (get) if (get)
{ {
x = e->getState().X() / 1000; x = e->getState().X() / 1000;
@ -1229,6 +1232,10 @@ ENTITY_VARIABLE(Position, "Position of a player (in meter) <eid> <posx>,<posy>[,
x = entityBase->getState().X + sint32 (cos (entityBase->getState ().Heading) * 2000); x = entityBase->getState().X + sint32 (cos (entityBase->getState ().Heading) * 2000);
y = entityBase->getState().Y + sint32 (sin (entityBase->getState ().Heading) * 2000); y = entityBase->getState().Y + sint32 (sin (entityBase->getState ().Heading) * 2000);
z = entityBase->getState().Z; z = entityBase->getState().Z;
TDataSetRow dsr = entityBase->getEntityRowId();
CMirrorPropValueRO<TYPE_CELL> mirrorCell( TheDataset, dsr, DSPropertyCELL );
cell = mirrorCell;
} }
} }
} }
@ -1258,11 +1265,11 @@ ENTITY_VARIABLE(Position, "Position of a player (in meter) <eid> <posx>,<posy>[,
// season included // season included
uint8 season; uint8 season;
NLMISC::fromString(res[3], season); NLMISC::fromString(res[3], season);
c->teleportCharacter(x,y,z,true, false, 0.f, 0xFF, 0, season); c->teleportCharacter(x,y,z,true, false, 0.f, 0xFF, cell, season);
} }
else else
{ {
c->teleportCharacter(x,y,z,true); c->teleportCharacter(x,y,z,true, false, 0.f, 0xFF, cell);
} }
if ( cont ) if ( cont )
@ -3780,7 +3787,7 @@ NLMISC_COMMAND( monitorMissions, "monitor a player missions", "<CSR id><player n
CHECK_RIGHT( c,target ); CHECK_RIGHT( c,target );
// CSR must have no missions to monitor a player // CSR must have no missions to monitor a player
if ( c->getMissionsBegin() == c->getMissionsEnd() ) if ( c->getMissionsBegin() != c->getMissionsEnd() )
{ {
CCharacter::sendDynamicSystemMessage( c->getEntityRowId() , "CSR_HAS_MISSION" ); CCharacter::sendDynamicSystemMessage( c->getEntityRowId() , "CSR_HAS_MISSION" );
return true; return true;
@ -4014,8 +4021,6 @@ NLMISC_COMMAND (unmuteUniverse, "unmute the univers chat", "<csr id><player name
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
NLMISC_COMMAND (setGMGuild, "set the current GM guild", "") NLMISC_COMMAND (setGMGuild, "set the current GM guild", "")
{ {
if ( args.size() != 1 )
return false;
GET_CHARACTER; GET_CHARACTER;
uint32 guildId = c->getGuildId(); uint32 guildId = c->getGuildId();
CGuildManager::getInstance()->setGMGuild( guildId ); CGuildManager::getInstance()->setGMGuild( guildId );
@ -4450,8 +4455,8 @@ NLMISC_COMMAND (connectUserChannel, "Connect to user channels", "<user id> <chan
CPVPManager2 *inst = CPVPManager2::getInstance(); CPVPManager2 *inst = CPVPManager2::getInstance();
string pass; string pass;
string name = args[1]; string name = toLower(args[1]);
TChanID channel = CPVPManager2::getInstance()->getUserDynChannel(name); TChanID channel = inst->getUserDynChannel(name);
if (args.size() < 3) if (args.size() < 3)
pass = toLower(name); pass = toLower(name);
@ -4499,6 +4504,38 @@ NLMISC_COMMAND (connectUserChannel, "Connect to user channels", "<user id> <chan
} }
NLMISC_COMMAND (connectLangChannel, "Connect to lang channel", "<user id> <lang>")
{
if ((args.size() < 2) || (args.size() > 3))
return false;
GET_CHARACTER
CPVPManager2 *inst = CPVPManager2::getInstance();
string action;
string lang = args[1];
if (lang != "en" && lang != "fr" && lang != "de" && lang != "ru" && lang != "es")
return false;
TChanID channel = inst->getFactionDynChannel(lang);
if (channel != DYN_CHAT_INVALID_CHAN)
{
if (!c->getLangChannel().empty()) {
TChanID current_channel = inst->getFactionDynChannel(c->getLangChannel());
inst->removeFactionChannelForCharacter(current_channel, c);
}
inst->addFactionChannelToCharacter(channel, c, true);
c->setLangChannel(lang);
return true;
}
SM_STATIC_PARAMS_1(params, STRING_MANAGER::literal);
params[0].Literal = lang;
CCharacter::sendDynamicSystemMessage( eid, "EGS_CHANNEL_INVALID_NAME", params );
return false;
}
NLMISC_COMMAND (updateTarget, "Update current target", "<user id>") NLMISC_COMMAND (updateTarget, "Update current target", "<user id>")
{ {
GET_CHARACTER GET_CHARACTER
@ -4601,9 +4638,15 @@ NLMISC_COMMAND (webExecCommand, "Execute a web command", "<user id> <web_app_url
GET_CHARACTER GET_CHARACTER
bool new_check = false; bool new_check = false;
if (args.size() >= 6 && args[5] == "1") bool new_separator = false;
// New check using HMagic
if (args.size() >= 6 && (args[5] == "1" || args[5] == "3"))
new_check = true; new_check = true;
// New separator "|"
if (args.size() >= 6 && (args[5] == "2" || args[5] == "3"))
new_separator = true;
bool next_step = false; bool next_step = false;
if (args.size() >= 7 && args[6] == "1") if (args.size() >= 7 && args[6] == "1")
next_step = true; next_step = true;
@ -4680,6 +4723,9 @@ NLMISC_COMMAND (webExecCommand, "Execute a web command", "<user id> <web_app_url
} }
std::vector<std::string> command_args; std::vector<std::string> command_args;
if (new_separator)
NLMISC::splitString(command, "|", command_args);
else
NLMISC::splitString(command, "!", command_args); NLMISC::splitString(command, "!", command_args);
if (command_args.empty()) if (command_args.empty())
return false; return false;
@ -5317,8 +5363,10 @@ NLMISC_COMMAND (webExecCommand, "Execute a web command", "<user id> <web_app_url
uint32 value; uint32 value;
fromString(command_args[2], value); fromString(command_args[2], value);
if (target)
target->setHairColor(value); target->setHairColor(value);
else
return false;
} }
//************************************************* //*************************************************
@ -5468,12 +5516,35 @@ NLMISC_COMMAND (webExecCommand, "Execute a web command", "<user id> <web_app_url
//************************************************* //*************************************************
//***************** set_title //***************** set_title
//************************************************* //*************************************************
// /a webExecCommand debug 1 set_title!toto hmac 0
else if (command_args[0] == "set_title") else if (command_args[0] == "set_title")
{ {
if (command_args.size () != 2) return false; if (command_args.size () != 2) return false;
TDataSetRow row = c->getEntityRowId(); TDataSetRow row = c->getEntityRowId();
ucstring name = ucstring(c->getName().toString()+"$"+command_args[1]+"$"); c->setNewTitle(command_args[1]);
string fullname = c->getName().toString()+"$"+command_args[1]+"#"+c->getTagPvPA()+"#"+c->getTagPvPB()+"#"+c->getTagA()+"#"+c->getTagB()+"$";
ucstring name;
name.fromUtf8(fullname);
NLNET::CMessage msgout("CHARACTER_NAME");
msgout.serial(row);
msgout.serial(name);
sendMessageViaMirror("IOS", msgout);
}
//*************************************************
//***************** set_tag
//*************************************************
else if (command_args[0] == "set_tag") {
if (command_args.size () != 3) return false;
TDataSetRow row = c->getEntityRowId();
if (command_args[1] == "pvpA") c->setTagPvPA(command_args[2]);
if (command_args[1] == "pvpB") c->setTagPvPB(command_args[2]);
if (command_args[1] == "A") c->setTagA(command_args[2]);
if (command_args[1] == "B") c->setTagB(command_args[2]);
string fullname = c->getName().toString()+"$"+c->getNewTitle()+"#"+c->getTagPvPA()+"#"+c->getTagPvPB()+"#"+c->getTagA()+"#"+c->getTagB()+"$";
ucstring name;
name.fromUtf8(fullname);
NLNET::CMessage msgout("CHARACTER_NAME"); NLNET::CMessage msgout("CHARACTER_NAME");
msgout.serial(row); msgout.serial(row);
msgout.serial(name); msgout.serial(name);
@ -5500,6 +5571,7 @@ NLMISC_COMMAND (webExecCommand, "Execute a web command", "<user id> <web_app_url
vector<string> res; vector<string> res;
sint32 x = 0, y = 0, z = 0; sint32 x = 0, y = 0, z = 0;
float h = 0; float h = 0;
sint32 cell;
if ( value.find(',') != string::npos ) // Position x,y,z,a if ( value.find(',') != string::npos ) // Position x,y,z,a
{ {
explode (value, string(","), res); explode (value, string(","), res);
@ -5591,6 +5663,10 @@ NLMISC_COMMAND (webExecCommand, "Execute a web command", "<user id> <web_app_url
y = entityBase->getState().Y + sint32 (sin (entityBase->getState ().Heading) * 2000); y = entityBase->getState().Y + sint32 (sin (entityBase->getState ().Heading) * 2000);
z = entityBase->getState().Z; z = entityBase->getState().Z;
h = entityBase->getState().Heading; h = entityBase->getState().Heading;
TDataSetRow dsr = entityBase->getEntityRowId();
CMirrorPropValueRO<TYPE_CELL> mirrorCell( TheDataset, dsr, DSPropertyCELL );
cell = mirrorCell;
} }
} }
} }
@ -5620,7 +5696,7 @@ NLMISC_COMMAND (webExecCommand, "Execute a web command", "<user id> <web_app_url
c->applyRespawnEffects(); c->applyRespawnEffects();
} }
c->teleportCharacter(x,y,z,allowPetTp,true,h); c->teleportCharacter(x,y,z,allowPetTp,true,h,0xFF,cell);
if ( cont ) if ( cont )
{ {
@ -5903,6 +5979,7 @@ NLMISC_COMMAND (webExecCommand, "Execute a web command", "<user id> <web_app_url
{ {
if (send_url) if (send_url)
c->sendUrl(web_app_url+"&player_eid="+c->getId().toString()+"&event=failed&desc=no_enough_faction_points", getSalt()); c->sendUrl(web_app_url+"&player_eid="+c->getId().toString()+"&event=failed&desc=no_enough_faction_points", getSalt());
return true;
} }
} }
else if (action=="set") else if (action=="set")
@ -5941,6 +6018,7 @@ NLMISC_COMMAND (webExecCommand, "Execute a web command", "<user id> <web_app_url
{ {
if (send_url) if (send_url)
c->sendUrl(web_app_url+"&player_eid="+c->getId().toString()+"&event=failed&desc=no_enough_pvp_points", getSalt()); c->sendUrl(web_app_url+"&player_eid="+c->getId().toString()+"&event=failed&desc=no_enough_pvp_points", getSalt());
return true;
} }
} }
else if (action=="set") else if (action=="set")
@ -5957,6 +6035,51 @@ NLMISC_COMMAND (webExecCommand, "Execute a web command", "<user id> <web_app_url
} }
} }
//*************************************************
//***************** ios
//*************************************************
else if (command_args[0] == "ios")
{
if (command_args.size() < 4)
return false;
string action = command_args[1]; // single_phrase
if (action == "single_phrase")
{
string phraseName = command_args[2];
ucstring phraseContent = phraseName;
ucstring phraseText;
phraseText.fromUtf8(command_args[3]);
phraseContent += "(){[";
phraseContent += phraseText;
phraseContent += "]}";
string msgname = "SET_PHRASE";
bool withLang = false;
string lang = "";
if (command_args.size() == 5)
{
lang = command_args[3];
if (lang != "all")
{
withLang = true;
msgname = "SET_PHRASE_LANG";
}
}
NLNET::CMessage msgout(msgname);
msgout.serial(phraseName);
msgout.serial(phraseContent);
if (withLang)
msgout.serial(lang);
sendMessageViaMirror("IOS", msgout);
return true;
}
}
//************************************************* //*************************************************
//***************** missions //***************** missions
//************************************************* //*************************************************
@ -6921,7 +7044,7 @@ NLMISC_COMMAND(setChanHistoricSize, "Set size of the historic for a localized ch
// add a client to a channel // add a client to a channel
NLMISC_COMMAND(addChanClient, "add a client to a channel", "<client name or user id><string name of the channel localized name>[1=Read/Write,0=ReadOnly(default)]") NLMISC_COMMAND(addChanClient, "add a client to a channel", "<client name or user id><string name of the channel localized name>[1=Read/Write,0=ReadOnly(default)]")
{ {
if (args.size() != 2) return false; if (args.size() < 2 || args.size() > 3) return false;
GET_CHARACTER GET_CHARACTER
TChanID chanID = DynChatEGS.getChanIDFromName(args[1]); TChanID chanID = DynChatEGS.getChanIDFromName(args[1]);
if (chanID == DYN_CHAT_INVALID_CHAN) if (chanID == DYN_CHAT_INVALID_CHAN)

View file

@ -89,7 +89,15 @@ bool IBuildingPhysical::addUser(CCharacter * user, uint16 roomIdx, uint16 ownerI
return false; return false;
} }
if (user->currentHp() <= 0 )
{
nlwarning("<BUILDING>user %s is dead",user->getId().toString().c_str());
return false;
}
CCharacter *owner; CCharacter *owner;
if (ownerIdx < _Players.size()) if (ownerIdx < _Players.size())
{ {
owner = PlayerManager.getChar(_Players[ownerIdx] ); owner = PlayerManager.getChar(_Players[ownerIdx] );

View file

@ -2078,7 +2078,7 @@ void cbClientSit( NLNET::CMessage& msgin, const std::string &serviceName, NLNET:
} }
// client send a command to chang guild motd // client send a command to change guild motd
void cbClientGuildMotd( NLNET::CMessage& msgin, const std::string &serviceName, NLNET::TServiceId serviceId ) void cbClientGuildMotd( NLNET::CMessage& msgin, const std::string &serviceName, NLNET::TServiceId serviceId )
{ {
H_AUTO(cbClientGuildMotd); H_AUTO(cbClientGuildMotd);
@ -2737,7 +2737,7 @@ void cbClientSetCharacterTitle( NLNET::CMessage& msgin, const std::string & serv
} }
// kxu: TODO: check validity of title chosen by player // kxu: TODO: check validity of title chosen by player
c->setTitle( (CHARACTER_TITLE::ECharacterTitle) title ); c->setNewTitle(CHARACTER_TITLE::toString((CHARACTER_TITLE::ECharacterTitle)title));
c->registerName(); c->registerName();
} }

View file

@ -4321,41 +4321,7 @@ NLMISC_COMMAND(setAllSkillsToValue,"set all skills to value","<entity id(id:type
if( e ) if( e )
{ {
log.displayNL("Player %s skills are all set to value %u", id.toString().c_str(), value); log.displayNL("Player %s skills are all set to value %u", id.toString().c_str(), value);
// get pointer on static skills tree definition e->setSkillsToValue(value);
CSheetId sheet("skills.skill_tree");
const CStaticSkillsTree * SkillsTree = CSheets::getSkillsTreeForm( sheet );
nlassert( SkillsTree );
for(int i = 0; i < SKILLS::NUM_SKILLS; ++i )
{
CSkills &skills = e->getSkills();
skills._Skills[ i ].Base = min( value, (sint32)SkillsTree->SkillsTree[ i ].MaxSkillValue );
skills._Skills[ i ].Current = skills._Skills[ i ].Base;
skills._Skills[ i ].MaxLvlReached = skills._Skills[ i ].Base;
// update all parent skill with new max children
SKILLS::ESkills skillUpdated = (SKILLS::ESkills)i;
while( SkillsTree->SkillsTree[ skillUpdated ].ParentSkill != SKILLS::unknown )
{
if( skills._Skills[ i ].Base > skills._Skills[ SkillsTree->SkillsTree[ skillUpdated ].ParentSkill ].MaxLvlReached )
{
skills._Skills[ SkillsTree->SkillsTree[ skillUpdated ].ParentSkill ].MaxLvlReached = skills._Skills[ i ].Base;
skills._Skills[ SkillsTree->SkillsTree[ skillUpdated ].ParentSkill ].Base = min( skills._Skills[ skillUpdated ].Base, (sint32)SkillsTree->SkillsTree[ SkillsTree->SkillsTree[ skillUpdated ].ParentSkill ].MaxSkillValue );
skillUpdated = SkillsTree->SkillsTree[ skillUpdated ].ParentSkill;
}
else
{
break;
}
}
// e->_PropertyDatabase.x_setProp( string("CHARACTER_INFO:SKILLS:") + NLMISC::toStringEnum( i ) + string(":SKILL"), skills._Skills[ i ].Base );
CBankAccessor_PLR::getCHARACTER_INFO().getSKILLS().getArray(i).setSKILL(e->_PropertyDatabase, checkedCast<uint16>(skills._Skills[ i ].Base) );
// e->_PropertyDatabase.x_setProp( string("CHARACTER_INFO:SKILLS:") + NLMISC::toStringEnum( i ) + string(":BaseSKILL"), skills._Skills[ i ].Base );
CBankAccessor_PLR::getCHARACTER_INFO().getSKILLS().getArray(i).setBaseSKILL(e->_PropertyDatabase, checkedCast<uint16>(skills._Skills[ i ].Base) );
}
} }
else else
{ {

View file

@ -237,6 +237,16 @@ void CGuild::setMOTD( const std::string& motd, const NLMISC::CEntityId& eId)
nlwarning("<CGuildMemberModule::setMOTD>%s invalid member id %s",eId.toString().c_str()); nlwarning("<CGuildMemberModule::setMOTD>%s invalid member id %s",eId.toString().c_str());
return; return;
} }
if ( motd == "?" )
{
// Show the old MOTD
SM_STATIC_PARAMS_1(params, STRING_MANAGER::literal);
params[0].Literal= _MessageOfTheDay;
CCharacter::sendDynamicMessageToChatGroup(user->getEntityRowId(), "GMOTD", CChatGroup::guild, params);
return;
}
EGSPD::CGuildGrade::TGuildGrade memberGrade = member->getGrade(); EGSPD::CGuildGrade::TGuildGrade memberGrade = member->getGrade();
if( memberGrade >= EGSPD::CGuildGrade::Member) if( memberGrade >= EGSPD::CGuildGrade::Member)
{ {
@ -255,9 +265,10 @@ void CGuild::setMOTD( const std::string& motd, const NLMISC::CEntityId& eId)
if(!_MessageOfTheDay.empty()) if(!_MessageOfTheDay.empty())
{ {
// Show new MOTD to all members
SM_STATIC_PARAMS_1(params, STRING_MANAGER::literal); SM_STATIC_PARAMS_1(params, STRING_MANAGER::literal);
params[0].Literal= _MessageOfTheDay; params[0].Literal= _MessageOfTheDay;
CCharacter::sendDynamicMessageToChatGroup(user->getEntityRowId(), "GMOTD", CChatGroup::guild, params); sendMessageToGuildChat("GMOTD", params);
} }
} }
else else
@ -1408,6 +1419,25 @@ void CGuild::sendMessageToGuildMembers( const std::string & msg, const TVectorP
IGuildUnifier::getInstance()->sendMessageToGuildMembers(this, msg, params); IGuildUnifier::getInstance()->sendMessageToGuildMembers(this, msg, params);
} }
//----------------------------------------------------------------------------
void CGuild::sendMessageToGuildChat( const std::string & msg, const TVectorParamCheck & params )const
{
for ( std::map< EGSPD::TCharacterId, EGSPD::CGuildMemberPD*>::const_iterator it = getMembersBegin(); it != getMembersEnd(); ++it )
{
CGuildMember * member = EGS_PD_CAST<CGuildMember*>( (*it).second );
EGS_PD_AST( member );
// continue if the player is offline
CGuildMemberModule * module = NULL;
if ( member->getReferencingModule(module) )
{
CGuildCharProxy proxy;
module->getProxy(proxy);
proxy.sendDynamicMessageToChatGroup(msg, CChatGroup::guild, params);
}
}
}
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
void CGuild::setMemberClientDB( CGuildMember* member ) void CGuild::setMemberClientDB( CGuildMember* member )
{ {

View file

@ -165,6 +165,8 @@ public:
void addMemberToGuildChat(CGuildMember *member); void addMemberToGuildChat(CGuildMember *member);
/// send a message to all members /// send a message to all members
void sendMessageToGuildMembers( const std::string & msg, const TVectorParamCheck & params = TVectorParamCheck() )const; void sendMessageToGuildMembers( const std::string & msg, const TVectorParamCheck & params = TVectorParamCheck() )const;
/// send a message to all members in guild chat
void sendMessageToGuildChat( const std::string & msg, const TVectorParamCheck & params = TVectorParamCheck() )const;
/// set information relative to a member in the guild client database /// set information relative to a member in the guild client database
void setMemberClientDB( CGuildMember* member ); void setMemberClientDB( CGuildMember* member );
/// return the best online user /// return the best online user

View file

@ -215,10 +215,8 @@ class CMissionStepKillFauna : public IMissionStepTemplate
ret.clear(); ret.clear();
ret.resize( _SubSteps.size() ); ret.resize( _SubSteps.size() );
for ( uint i = 0; i < _SubSteps.size(); i++ ) for ( uint i = 0; i < _SubSteps.size(); i++ )
{
ret[i] = _SubSteps[i].Quantity; ret[i] = _SubSteps[i].Quantity;
} }
}
virtual void getTextParams( uint & nbSubSteps,const std::string* & textPtr,TVectorParamCheck& retParams, const std::vector<uint32>& subStepStates) virtual void getTextParams( uint & nbSubSteps,const std::string* & textPtr,TVectorParamCheck& retParams, const std::vector<uint32>& subStepStates)
{ {

View file

@ -121,7 +121,7 @@ NLMISC_COMMAND(outpostSimulateTimer0End, "", "<outpost_id> [<absolute end time>
if (args.size()>1) if (args.size()>1)
{ {
NLMISC::fromString(args[1], endTime); NLMISC::fromString(args[1], endTime);
if (args[1][0]=='+') if (args[1].find('+')==0)
endTime += CTime::getSecondsSince1970(); endTime += CTime::getSecondsSince1970();
} }
if (endTime==0) endTime = 1; if (endTime==0) endTime = 1;
@ -144,7 +144,7 @@ NLMISC_COMMAND(outpostSimulateTimer1End, "", "<outpost_id> [<absolute end time>
if (args.size()>1) if (args.size()>1)
{ {
NLMISC::fromString(args[1], endTime); NLMISC::fromString(args[1], endTime);
if (args[1][0]=='+') if (args[1].find('+')==0)
endTime += CTime::getSecondsSince1970(); endTime += CTime::getSecondsSince1970();
} }
if (endTime==0) endTime = 1; if (endTime==0) endTime = 1;
@ -167,7 +167,7 @@ NLMISC_COMMAND(outpostSimulateTimer2End, "", "<outpost_id> [<absolute end time>
if (args.size()>1) if (args.size()>1)
{ {
NLMISC::fromString(args[1], endTime); NLMISC::fromString(args[1], endTime);
if (args[1][0]=='+') if (args[1].find('+')==0)
endTime += CTime::getSecondsSince1970(); endTime += CTime::getSecondsSince1970();
} }
if (endTime==0) endTime = 1; if (endTime==0) endTime = 1;

View file

@ -281,7 +281,7 @@ public:
} }
else else
{ {
c->wearRightHandItem(); c->wearRightHandItem(phrase->getMps().size()/10);
// report Xp Gain unless used tool is worned // report Xp Gain unless used tool is worned
PROGRESSIONPVE::CCharacterProgressionPVE::getInstance()->actionReport( report, true, false ); PROGRESSIONPVE::CCharacterProgressionPVE::getInstance()->actionReport( report, true, false );

View file

@ -249,6 +249,14 @@ bool CFaberPhrase::validate()
return false; return false;
} }
// check quality of right hand item (need be >= Recommended (level of item))
if (rightHandItem->recommended()+49 < _Recommended)
{
PHRASE_UTILITIES::sendDynamicSystemMessage(_ActorRowId, "CRAFT_NEED_RECOMMENDED_CRAFTING_TOOL");
return false;
}
// entities cant craft if in combat // entities cant craft if in combat
/* commented as test of right hand item is now made... /* commented as test of right hand item is now made...
TDataSetRow entityRowId = CPhraseManager::getInstance().getEntityEngagedMeleeBy( _ActorRowId ); TDataSetRow entityRowId = CPhraseManager::getInstance().getEntityEngagedMeleeBy( _ActorRowId );
@ -697,7 +705,7 @@ void CFaberPhrase::stop()
} // stop // } // stop //
NLMISC_COMMAND(simuCraft, "Simulation de craft pour verifier les probabilités de reusir un item","<Nb simulations><level skill><item quality>") NLMISC_COMMAND(simuCraft, "Craft simulation to verify probabilities to succesfully craft an item","<Nb simulations><level skill><item quality>")
{ {
if (args.size() != 3) if (args.size() != 3)
return false; return false;

View file

@ -544,6 +544,15 @@ bool CFgExtractionPhrase::validate()
return false; // has disappeared return false; // has disappeared
} }
// test if tool have enough quality
sint depositQ = (sint)harvestSource->forageSite()->deposit()->maxQuality();
if ((depositQ > 0) && (item->recommended()+49 < depositQ))
{
PHRASE_UTILITIES::sendDynamicSystemMessage(_ActorRowId, "FORAGE_TOOL_QUALITY_TOO_LOW");
return false;
}
// Check the distance from the player to the source (ignoring Z because for tunnel case, player couldn't target the source) // Check the distance from the player to the source (ignoring Z because for tunnel case, player couldn't target the source)
const CEntityState& state = player->getState(); const CEntityState& state = player->getState();
CVector2f playerPos( (float)state.X / 1000.0f, (float)state.Y / 1000.0f ); CVector2f playerPos( (float)state.X / 1000.0f, (float)state.Y / 1000.0f );

View file

@ -675,6 +675,9 @@ CCharacter::CCharacter(): CEntityBase(false),
_FriendVisibility = VisibleToAll; _FriendVisibility = VisibleToAll;
_LangChannel = "en";
_NewTitle = "Refugee";
initDatabase(); initDatabase();
} // CCharacter // } // CCharacter //
@ -699,6 +702,7 @@ void CCharacter::clear()
_ForbidAuraUseStartDate=0; _ForbidAuraUseStartDate=0;
_ForbidAuraUseEndDate=0; _ForbidAuraUseEndDate=0;
_Title= CHARACTER_TITLE::Refugee; _Title= CHARACTER_TITLE::Refugee;
_NewTitle = "Refugee";
SET_STRUCT_MEMBER(_VisualPropertyA,PropertySubData.HatModel,0); SET_STRUCT_MEMBER(_VisualPropertyA,PropertySubData.HatModel,0);
SET_STRUCT_MEMBER(_VisualPropertyA,PropertySubData.HatColor,0); SET_STRUCT_MEMBER(_VisualPropertyA,PropertySubData.HatColor,0);
@ -3851,9 +3855,9 @@ void CCharacter::sendBetaTesterStatus()
sendReservedTitleStatus( CHARACTER_TITLE::FBT, p->isBetaTester() ); sendReservedTitleStatus( CHARACTER_TITLE::FBT, p->isBetaTester() );
if (!p->isBetaTester() && _Title == CHARACTER_TITLE::FBT) if (!p->isBetaTester() && _NewTitle == "FBT")
{ {
_Title = CHARACTER_TITLE::Refugee; _NewTitle = "Refugee";
registerName(); registerName();
} }
} }
@ -3869,9 +3873,9 @@ void CCharacter::sendWindermeerStatus()
sendReservedTitleStatus( CHARACTER_TITLE::WIND, p->isWindermeerCommunity() ); sendReservedTitleStatus( CHARACTER_TITLE::WIND, p->isWindermeerCommunity() );
if ( !p->isWindermeerCommunity() && _Title == CHARACTER_TITLE::WIND) if ( !p->isWindermeerCommunity() && _NewTitle == "WIND")
{ {
_Title = CHARACTER_TITLE::Refugee; _NewTitle = "Refugee";
registerName(); registerName();
} }
} }
@ -6963,12 +6967,12 @@ double CCharacter::addXpToSkillInternal( double XpGain, const std::string& ContS
CBankAccessor_PLR::getCHARACTER_INFO().getRING_XP_CATALYSER().setCount(_PropertyDatabase, checkedCast<uint16>(ringCatalyserCount) ); CBankAccessor_PLR::getCHARACTER_INFO().getRING_XP_CATALYSER().setCount(_PropertyDatabase, checkedCast<uint16>(ringCatalyserCount) );
} }
} }
}
if (!p->isTrialPlayer()) if (!p->isTrialPlayer())
{ {
xpBonus = XpGain; xpBonus = XpGain;
} }
}
XpGain += xpBonus + ringXpBonus; XpGain += xpBonus + ringXpBonus;
@ -7081,7 +7085,7 @@ double CCharacter::addXpToSkillInternal( double XpGain, const std::string& ContS
SM_STATIC_PARAMS_3(paramsP, STRING_MANAGER::skill, STRING_MANAGER::integer, STRING_MANAGER::integer); SM_STATIC_PARAMS_3(paramsP, STRING_MANAGER::skill, STRING_MANAGER::integer, STRING_MANAGER::integer);
paramsP[0].Enum = skillEnum; paramsP[0].Enum = skillEnum;
paramsP[1].Int = max((sint32)1, sint32(100*XpGain) ); paramsP[1].Int = max((sint32)1, sint32(100*XpGain) );
paramsP[2].Int = max((sint32)1, sint32(100*(XpGain - (xpBonus+ringXpBonus))) ); paramsP[2].Int = max((sint32)1, sint32(100*(XpGain - xpBonus - ringXpBonus)));
PHRASE_UTILITIES::sendDynamicSystemMessage(_EntityRowId, "XP_CATALYSER_PROGRESS_NORMAL_GAIN", paramsP); PHRASE_UTILITIES::sendDynamicSystemMessage(_EntityRowId, "XP_CATALYSER_PROGRESS_NORMAL_GAIN", paramsP);
if( xpBonus > 0 ) if( xpBonus > 0 )
@ -7329,11 +7333,18 @@ double CCharacter::addXpToSkillInternal( double XpGain, const std::string& ContS
return XpGainRemainder; return XpGainRemainder;
} }
//----------------------------------------------- //-----------------------------------------------
// CCharacter::setSkillTreeToMaxValue Set skill tree of character to max value of each skill // CCharacter::setSkillTreeToMaxValue Set skill tree of character to max value of each skill
//----------------------------------------------- //-----------------------------------------------
void CCharacter::setSkillsToMaxValue() void CCharacter::setSkillsToMaxValue()
{
setSkillsToValue(-1);
}
//-----------------------------------------------
// CCharacter::setSkillTreeToMaxValue Set skill tree of character to max value of each skill
//-----------------------------------------------
void CCharacter::setSkillsToValue(const sint32& value)
{ {
// get pointer on static skills tree definition // get pointer on static skills tree definition
CSheetId sheet("skills.skill_tree"); CSheetId sheet("skills.skill_tree");
@ -7342,15 +7353,30 @@ void CCharacter::setSkillsToMaxValue()
for( uint i = 0; i < SKILLS::NUM_SKILLS; ++i ) for( uint i = 0; i < SKILLS::NUM_SKILLS; ++i )
{ {
_Skills._Skills[ i ].Base = SkillsTree->SkillsTree[ i ].MaxSkillValue; _Skills._Skills[ i ].Base = (value < 0) ? SkillsTree->SkillsTree[ i ].MaxSkillValue : min( value, (sint32)SkillsTree->SkillsTree[ i ].MaxSkillValue );
_Skills._Skills[ i ].Current = SkillsTree->SkillsTree[ i ].MaxSkillValue + _Skills._Skills[ i ].Modifier; _Skills._Skills[ i ].Current = SkillsTree->SkillsTree[ i ].MaxSkillValue + _Skills._Skills[ i ].Modifier;
// _PropertyDatabase.setProp( _DataIndexReminder->CHARACTER_INFO.SKILLS.Skill[i], _Skills._Skills[ i ].Current ); _Skills._Skills[ i ].MaxLvlReached = _Skills._Skills[ i ].Current;
CBankAccessor_PLR::getCHARACTER_INFO().getSKILLS().getArray(i).setSKILL(_PropertyDatabase, checkedCast<uint16>(_Skills._Skills[ i ].Current) );
// _PropertyDatabase.setProp( _DataIndexReminder->CHARACTER_INFO.SKILLS.BaseSkill[i], _Skills._Skills[ i ].Base );
CBankAccessor_PLR::getCHARACTER_INFO().getSKILLS().getArray(i).setBaseSKILL(_PropertyDatabase, checkedCast<uint16>(_Skills._Skills[ i ].Base) );
}
}
CBankAccessor_PLR::getCHARACTER_INFO().getSKILLS().getArray(i).setBaseSKILL(_PropertyDatabase, checkedCast<uint16>(_Skills._Skills[ i ].Base) );
CBankAccessor_PLR::getCHARACTER_INFO().getSKILLS().getArray(i).setSKILL(_PropertyDatabase, checkedCast<uint16>(_Skills._Skills[ i ].Current) );
// update all parent skill with new max children
SKILLS::ESkills skillUpdated = (SKILLS::ESkills)i;
while( SkillsTree->SkillsTree[ skillUpdated ].ParentSkill != SKILLS::unknown )
{
if( _Skills._Skills[ i ].Base > _Skills._Skills[ SkillsTree->SkillsTree[ skillUpdated ].ParentSkill ].MaxLvlReached )
{
_Skills._Skills[ SkillsTree->SkillsTree[ skillUpdated ].ParentSkill ].MaxLvlReached = _Skills._Skills[ i ].Base;
_Skills._Skills[ SkillsTree->SkillsTree[ skillUpdated ].ParentSkill ].Base = min( _Skills._Skills[ skillUpdated ].Base, (sint32)SkillsTree->SkillsTree[ SkillsTree->SkillsTree[ skillUpdated ].ParentSkill ].MaxSkillValue );
skillUpdated = SkillsTree->SkillsTree[ skillUpdated ].ParentSkill;
}
else
{
break;
}
}
}
}
//----------------------------------------------- //-----------------------------------------------
// CCharacter::sendDynamicSystemMessage // CCharacter::sendDynamicSystemMessage
@ -7949,6 +7975,7 @@ void CCharacter::setStartStatistics( const CCreateCharMsg& createCharMsg )
_Race = (EGSPD::CPeople::TPeople) createCharMsg.People; _Race = (EGSPD::CPeople::TPeople) createCharMsg.People;
_Gender = createCharMsg.Sex; _Gender = createCharMsg.Sex;
_Title = CHARACTER_TITLE::Refugee; _Title = CHARACTER_TITLE::Refugee;
_NewTitle = "Refugee";
// fame information // fame information
// Players start out as Neutral in their declared clans // Players start out as Neutral in their declared clans
@ -9787,7 +9814,7 @@ bool CCharacter::queryItemPrice( const CGameItemPtr item, uint32& price )
quality = theItem->quality(); quality = theItem->quality();
if ( theItem->maxDurability() ) if ( theItem->maxDurability() )
wornFactor = float(theItem->durability()) / float(theItem->maxDurability()); wornFactor = float(theItem->durability()) / float(theItem->maxDurability());
price = (uint32) ( CShopTypeManager::computeBasePrice( theItem, quality ) * wornFactor ); price = (uint32) ( CShopTypeManager::computeBasePrice( theItem, quality ) * wornFactor * 0.02 );
return true; return true;
} }
@ -10214,6 +10241,35 @@ void CCharacter::initPvpPointDb()
CBankAccessor_PLR::getUSER().getRRPS_LEVELS(0).setVALUE(_PropertyDatabase, _PvpPoint ); CBankAccessor_PLR::getUSER().getRRPS_LEVELS(0).setVALUE(_PropertyDatabase, _PvpPoint );
} }
//-----------------------------------------------------------------------------
void CCharacter::setLangChannel(const string &lang) {
_LangChannel = lang;
}
//-----------------------------------------------------------------------------
void CCharacter::setNewTitle(const string &title) {
_NewTitle = title;
}
//-----------------------------------------------------------------------------
void CCharacter::setTagPvPA(const string &tag) {
_TagPvPA = tag;
}
//-----------------------------------------------------------------------------
void CCharacter::setTagPvPB(const string &tag) {
_TagPvPB = tag;
}
//-----------------------------------------------------------------------------
void CCharacter::setTagA(const string &tag) {
_TagA = tag;
}
//-----------------------------------------------------------------------------
void CCharacter::setTagB(const string &tag) {
_TagB = tag;
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void CCharacter::setOrganization(uint32 org) void CCharacter::setOrganization(uint32 org)
@ -12895,7 +12951,7 @@ void CCharacter::registerName(const ucstring &newName)
CMessage msgName("CHARACTER_NAME_LANG"); CMessage msgName("CHARACTER_NAME_LANG");
msgName.serial(_EntityRowId); msgName.serial(_EntityRowId);
string sTitle = CHARACTER_TITLE::toString(_Title); string sTitle = getFullTitle();
ucstring RegisteredName; ucstring RegisteredName;
if (newName.empty()) if (newName.empty())
RegisteredName = getName() + string("$") + sTitle + string("$"); RegisteredName = getName() + string("$") + sTitle + string("$");
@ -16162,13 +16218,28 @@ void CCharacter::applyGooDamage( float gooDistance )
if( hpLost > _PhysScores._PhysicalScores[ SCORES::hit_points ].Current ) if( hpLost > _PhysScores._PhysicalScores[ SCORES::hit_points ].Current )
{ {
_PhysScores._PhysicalScores[ SCORES::hit_points ].Current = 0; _PhysScores._PhysicalScores[ SCORES::hit_points ].Current = 0;
// send message to player for inform is dead by goo
// send message to player for inform is dead by goo or other
if (_CurrentContinent == CONTINENT::FYROS)
sendDynamicSystemMessage(_EntityRowId, "KILLED_BY_FIRE");
else if (_CurrentContinent == CONTINENT::TRYKER)
sendDynamicSystemMessage(_EntityRowId, "KILLED_BY_STEAM");
else if (_CurrentContinent == CONTINENT::MATIS)
sendDynamicSystemMessage(_EntityRowId, "KILLED_BY_POISON");
else
sendDynamicSystemMessage(_EntityRowId, "KILLED_BY_GOO"); sendDynamicSystemMessage(_EntityRowId, "KILLED_BY_GOO");
} }
else else
{ {
_PhysScores._PhysicalScores[ SCORES::hit_points ].Current = _PhysScores._PhysicalScores[ SCORES::hit_points ].Current - hpLost; _PhysScores._PhysicalScores[ SCORES::hit_points ].Current = _PhysScores._PhysicalScores[ SCORES::hit_points ].Current - hpLost;
// send message to player for inform is suffer goo damage // send message to player for inform is suffer goo damage
if (_CurrentContinent == CONTINENT::FYROS)
sendDynamicSystemMessage(_EntityRowId, "SUFFER_FIRE_DAMAGE");
else if (_CurrentContinent == CONTINENT::TRYKER)
sendDynamicSystemMessage(_EntityRowId, "SUFFER_STEAM_DAMAGE");
else if (_CurrentContinent == CONTINENT::MATIS)
sendDynamicSystemMessage(_EntityRowId, "SUFFER_POISON_DAMAGE");
else
sendDynamicSystemMessage(_EntityRowId, "SUFFER_GOO_DAMAGE"); sendDynamicSystemMessage(_EntityRowId, "SUFFER_GOO_DAMAGE");
} }
} }
@ -19057,7 +19128,7 @@ void CCharacter::setStartupInstance(uint32 instanceId)
void CCharacter::setTitle( CHARACTER_TITLE::ECharacterTitle title ) void CCharacter::setTitle( CHARACTER_TITLE::ECharacterTitle title )
{ {
_Title = title; setNewTitle(CHARACTER_TITLE::toString(title));
} }

View file

@ -890,6 +890,9 @@ public:
// Set skill tree of character to max value of each skill // Set skill tree of character to max value of each skill
void setSkillsToMaxValue(); void setSkillsToMaxValue();
// Set skill tree of character to specified value
void setSkillsToValue(const sint32& value);
// for respawn management, need to modify _TimeDeath in cbTpAcknownledge callback // for respawn management, need to modify _TimeDeath in cbTpAcknownledge callback
NLMISC::TGameTime& getTimeOfDeath(); NLMISC::TGameTime& getTimeOfDeath();
void setTimeOfDeath( NLMISC::TGameTime t); void setTimeOfDeath( NLMISC::TGameTime t);
@ -2392,6 +2395,27 @@ public:
uint32 getLastConnectedTime() const; uint32 getLastConnectedTime() const;
uint32 getLastConnectedDate() const; uint32 getLastConnectedDate() const;
uint32 getPlayedTime() const; uint32 getPlayedTime() const;
const std::string& getLangChannel() const;
void setLangChannel(const std::string &lang);
const std::string& getNewTitle() const;
void setNewTitle(const std::string &title);
std::string getFullTitle() const;
std::string getTagA() const;
void setTagA(const std::string &tag);
std::string getTagB() const;
void setTagB(const std::string &tag);
std::string getTagPvPA() const;
void setTagPvPA(const std::string &tag);
std::string getTagPvPB() const;
void setTagPvPB(const std::string &tag);
uint32 getOrganization() const; uint32 getOrganization() const;
uint32 getOrganizationStatus() const; uint32 getOrganizationStatus() const;
const std::list<TCharacterLogTime>& getLastLogStats() const; const std::list<TCharacterLogTime>& getLastLogStats() const;
@ -3032,6 +3056,14 @@ private:
uint32 _OrganizationStatus; uint32 _OrganizationStatus;
uint32 _OrganizationPoints; uint32 _OrganizationPoints;
std::string _LangChannel;
std::string _NewTitle;
std::string _TagPvPA;
std::string _TagPvPB;
std::string _TagA;
std::string _TagB;
/// SDB path where player wins HoF points in PvP (if not empty) /// SDB path where player wins HoF points in PvP (if not empty)
std::string _SDBPvPPath; std::string _SDBPvPPath;

View file

@ -894,6 +894,67 @@ inline uint32 CCharacter::getPlayedTime() const
return _PlayedTime; return _PlayedTime;
} }
//------------------------------------------------------------------------------
inline const std::string& CCharacter::getLangChannel() const
{
return _LangChannel;
}
//------------------------------------------------------------------------------
inline const std::string& CCharacter::getNewTitle() const
{
return _NewTitle;
}
//------------------------------------------------------------------------------
inline std::string CCharacter::getTagA() const
{
if (_TagA.empty())
return "_";
return _TagA;
}
//------------------------------------------------------------------------------
inline std::string CCharacter::getTagB() const
{
if (_TagB.empty())
return "_";
return _TagB;
}
//------------------------------------------------------------------------------
inline std::string CCharacter::getTagPvPA() const
{
if (_TagPvPA.empty())
return "_";
return _TagPvPA;
}
//------------------------------------------------------------------------------
inline std::string CCharacter::getTagPvPB() const
{
if (_TagPvPB.empty())
return "_";
return _TagPvPB;
}
//------------------------------------------------------------------------------
inline std::string CCharacter::getFullTitle() const
{
if (!_TagA.empty() || !_TagB.empty() || !_TagPvPA.empty() || !_TagPvPB.empty())
return _NewTitle+"#"+getTagPvPA()+"#"+getTagPvPB()+"#"+getTagA()+"#"+getTagB();
else
return _NewTitle;
}
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
inline uint32 CCharacter::getOrganization() const inline uint32 CCharacter::getOrganization() const

View file

@ -321,7 +321,7 @@ static void prepareCharacterPositionForStore ( COfflineEntityState & state, cons
H_AUTO(CCharacterStore);\ H_AUTO(CCharacterStore);\
CFameManager::getInstance().savePlayerFame(_Id, const_cast<EGSPD::CFameContainerPD &>(*_Fames));\ CFameManager::getInstance().savePlayerFame(_Id, const_cast<EGSPD::CFameContainerPD &>(*_Fames));\
/* Update the current playing session duration */ \ /* Update the current playing session duration */ \
if (_LastLogStats.size() > 0) _LastLogStats.begin()->Duration = CTime::getSecondsSince1970() - _LastLogStats.begin()->LoginTime; \ if (!_LastLogStats.empty()) _LastLogStats.begin()->Duration = CTime::getSecondsSince1970() - _LastLogStats.begin()->LoginTime;\
else nlwarning("Cannot update play session duration, _LastLogStats is empty, new character?");\ else nlwarning("Cannot update play session duration, _LastLogStats is empty, new character?");\
\ \
/* Unless the top of the position stack is locked, */ \ /* Unless the top of the position stack is locked, */ \
@ -415,6 +415,7 @@ static void prepareCharacterPositionForStore ( COfflineEntityState & state, cons
PVP_CLAN::TPVPClan k=PVP_CLAN::fromString(key); if ((k>=PVP_CLAN::BeginClans) && (k<=PVP_CLAN::EndClans)) _FactionPoint[k-PVP_CLAN::BeginClans]=val)\ 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)\ PROP(uint32,_PvpPoint)\
PROP2(_LangChannel,string,_LangChannel,_LangChannel=val)\
PROP(uint32,_Organization)\ PROP(uint32,_Organization)\
PROP(uint32,_OrganizationStatus)\ PROP(uint32,_OrganizationStatus)\
PROP(uint32,_OrganizationPoints)\ PROP(uint32,_OrganizationPoints)\
@ -438,6 +439,11 @@ static void prepareCharacterPositionForStore ( COfflineEntityState & state, cons
PROP_GAME_CYCLE_COMP(_ForbidAuraUseStartDate)\ PROP_GAME_CYCLE_COMP(_ForbidAuraUseStartDate)\
PROP_GAME_CYCLE_COMP(_ForbidAuraUseEndDate)\ PROP_GAME_CYCLE_COMP(_ForbidAuraUseEndDate)\
PROP2(_Title, string, CHARACTER_TITLE::toString(getTitle()), setTitle(CHARACTER_TITLE::toCharacterTitle(val)))\ 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)\
\ \
/* Visual Properties */\ /* Visual Properties */\
PROP2(HairType, uint8, _VisualPropertyA().PropertySubData.HatModel, SET_STRUCT_MEMBER(_VisualPropertyA,PropertySubData.HatModel,val))\ PROP2(HairType, uint8, _VisualPropertyA().PropertySubData.HatModel, SET_STRUCT_MEMBER(_VisualPropertyA,PropertySubData.HatModel,val))\

View file

@ -230,6 +230,22 @@ std::vector<TChanID> CPVPManager2::getCharacterChannels(CCharacter * user)
} }
} }
// Add lang channel
if (!user->getLangChannel().empty()) {
TMAPExtraFactionChannel::iterator it = _ExtraFactionChannel.find(user->getLangChannel());
if (it != _ExtraFactionChannel.end())
{
result.push_back((*it).second);
}
} else {
TMAPExtraFactionChannel::iterator it = _ExtraFactionChannel.find("en");
if (it != _ExtraFactionChannel.end())
{
result.push_back((*it).second);
}
}
/*
bool matis = CFameInterface::getInstance().getFameIndexed(user->getId(), 0) >= PVPFameRequired*6000; bool matis = CFameInterface::getInstance().getFameIndexed(user->getId(), 0) >= PVPFameRequired*6000;
bool fyros = CFameInterface::getInstance().getFameIndexed(user->getId(), 1) >= PVPFameRequired*6000; bool fyros = CFameInterface::getInstance().getFameIndexed(user->getId(), 1) >= PVPFameRequired*6000;
bool tryker = CFameInterface::getInstance().getFameIndexed(user->getId(), 2) >= PVPFameRequired*6000; bool tryker = CFameInterface::getInstance().getFameIndexed(user->getId(), 2) >= PVPFameRequired*6000;
@ -279,7 +295,7 @@ std::vector<TChanID> CPVPManager2::getCharacterChannels(CCharacter * user)
result.push_back((*it).second); result.push_back((*it).second);
} }
} }
// } */
return result; return result;
} }
@ -1088,10 +1104,19 @@ bool CPVPManager2::addFactionWar( PVP_CLAN::TPVPClan clan1, PVP_CLAN::TPVPClan c
void CPVPManager2::onIOSMirrorUp() void CPVPManager2::onIOSMirrorUp()
{ {
// create extra factions channels // create extra factions channels
/*
createExtraFactionChannel("hominists"); createExtraFactionChannel("hominists");
createExtraFactionChannel("urasies"); createExtraFactionChannel("urasies");
createExtraFactionChannel("marauders"); createExtraFactionChannel("marauders");
createExtraFactionChannel("agnos"); createExtraFactionChannel("agnos");
*/
// Community Channels
createExtraFactionChannel("en");
createExtraFactionChannel("fr");
createExtraFactionChannel("de");
createExtraFactionChannel("ru");
createExtraFactionChannel("es");
for (uint i = PVP_CLAN::BeginClans; i <= PVP_CLAN::EndClans; i++) for (uint i = PVP_CLAN::BeginClans; i <= PVP_CLAN::EndClans; i++)
{ {

View file

@ -1508,7 +1508,7 @@ bool CZoneManager::getPlace( sint32 x, sint32 y, float& gooDistance, const CPlac
} }
for (uint k = 0; k < _Continents[i].getRegions()[j]->getPlaces().size(); k++ ) for (uint k = 0; k < _Continents[i].getRegions()[j]->getPlaces().size(); k++ )
{ {
if( _Continents[i].getRegions()[j]->getPlaces()[k]->isGooPath() == false ) if(!_Continents[i].getRegions()[j]->getPlaces()[k]->isGooActive())
{ {
if ( _Continents[i].getRegions()[j]->getPlaces()[k]->contains( vect ) ) if ( _Continents[i].getRegions()[j]->getPlaces()[k]->contains( vect ) )
{ {

View file

@ -47,7 +47,7 @@ public:
// TODO: check if good // TODO: check if good
static bool exists( const TDataSetRow& entityIndex ); static bool exists( const TDataSetRow& entityIndex );
static const NLMISC::CEntityId& getEntityId( const TDataSetRow& entityIndex ); static const NLMISC::CEntityId& getEntityId( const TDataSetRow& entityIndex );
static const uint16 getTeamId(const TDataSetRow& entityIndex); static uint16 getTeamId(const TDataSetRow& entityIndex);
static CAICoord x( const TDataSetRow& entityIndex ); static CAICoord x( const TDataSetRow& entityIndex );
static CAICoord y( const TDataSetRow& entityIndex ); static CAICoord y( const TDataSetRow& entityIndex );