|
|
|
@ -108,18 +108,15 @@ extern vector<CMainlandSummary> Mainlands;
|
|
|
|
|
|
|
|
|
|
extern CVariable<bool> DontUseSU;
|
|
|
|
|
|
|
|
|
|
// For shard names
|
|
|
|
|
extern NLMISC::CVariable<uint32> FixedSessionId;
|
|
|
|
|
|
|
|
|
|
// Send to client if name is valide (true for valide)
|
|
|
|
|
void sendIfNameIsValide( uint32 userId, bool nameValide );
|
|
|
|
|
|
|
|
|
|
// finish create char
|
|
|
|
|
void cbCreateChar_part2(uint32 userId, const CCreateCharMsg &createCharMsg, bool ok);
|
|
|
|
|
|
|
|
|
|
// For a mainland shard (non ring), we need the session id to initialize the normal position stack with
|
|
|
|
|
// the current far position after loading an old character file with no stored session id.
|
|
|
|
|
// (Alternatively, the ServerAnimationModule could sent it to any mainland shard, looking up in the DB
|
|
|
|
|
// ring:sessions).
|
|
|
|
|
NLMISC::CVariable<uint32> FixedSessionId( "egs", "FixedSessionId", "For a mainland shard, the session id", 0, 0, true );
|
|
|
|
|
|
|
|
|
|
// (!IsRingShard only) (For mainland shard)
|
|
|
|
|
// This parameter controls what we do we characters coming from another mainland shard.
|
|
|
|
|
// It allows to test character files from a live shard on a private shard.
|
|
|
|
@ -197,7 +194,7 @@ void cbClientConnection(CMessage& msgin, const std::string &serviceName, NLNET::
|
|
|
|
|
msgin.serial( userName, userPriv, userExtended, languageId);
|
|
|
|
|
msgin.serial( fromAddr );
|
|
|
|
|
msgin.serial( cookie );
|
|
|
|
|
#ifdef NL_DEBUG
|
|
|
|
|
#ifdef NL_DEBUG
|
|
|
|
|
egs_ecinfo("WEB: received cookie %s from player %u", cookie.toString().c_str(), userId);
|
|
|
|
|
#endif
|
|
|
|
|
//Bsi.append( StatPath, NLMISC::toString("[UC] %u %s %s %s %s %s", userId, userName.c_str(), userPriv.c_str(), languageId.c_str(), fromAddr.c_str(), cookie.toString().c_str()) );
|
|
|
|
@ -230,7 +227,7 @@ void cbClientConnection(CMessage& msgin, const std::string &serviceName, NLNET::
|
|
|
|
|
|
|
|
|
|
// set the front end id of this player
|
|
|
|
|
PlayerManager.setPlayerFrontEndId( userId, serviceId );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const bool betaTester = (userExtended.find(":FBT:") != string::npos);
|
|
|
|
|
const bool preOrder = (userExtended.find(":PO:") != string::npos);
|
|
|
|
|
const bool windermeerCommunity = (userExtended.find(":WIND:") != string::npos);
|
|
|
|
@ -294,19 +291,19 @@ void cbClientConnection(CMessage& msgin, const std::string &serviceName, NLNET::
|
|
|
|
|
//
|
|
|
|
|
// msgin.serial( longUserId );
|
|
|
|
|
// userId = (uint32) longUserId;
|
|
|
|
|
//
|
|
|
|
|
//
|
|
|
|
|
// CCharacter * c = PlayerManager.getActiveChar( userId );
|
|
|
|
|
// if( c != 0 )
|
|
|
|
|
// {
|
|
|
|
|
// charId = c->getId();
|
|
|
|
|
//
|
|
|
|
|
// // send userId/charId association to the FE
|
|
|
|
|
// CMessage msgout("CL_ID");
|
|
|
|
|
// CMessage msgout("CL_ID");
|
|
|
|
|
// msgout.serial(userId);
|
|
|
|
|
// msgout.serial( charId );
|
|
|
|
|
// uint16 frontEndId = PlayerManager.getPlayerFrontEndId( userId );
|
|
|
|
|
// CUnifiedNetwork::getInstance()->send(frontEndId, msgout);
|
|
|
|
|
//
|
|
|
|
|
//
|
|
|
|
|
// // send acknowledge to client for received Enter message
|
|
|
|
|
// CBitMemStream bms;
|
|
|
|
|
// if ( ! GenericMsgManager.pushNameToStream( "CONNECTION:READY", bms) )
|
|
|
|
@ -338,7 +335,7 @@ void cbClientConnection(CMessage& msgin, const std::string &serviceName, NLNET::
|
|
|
|
|
void cbClientReady( CMessage& msgin, const std::string &serviceName, NLNET::TServiceId serviceId )
|
|
|
|
|
{
|
|
|
|
|
H_AUTO(cbClientReady);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// read the player id
|
|
|
|
|
CEntityId characterId;
|
|
|
|
|
msgin.serial( characterId );
|
|
|
|
@ -349,7 +346,7 @@ void cbClientReady( CMessage& msgin, const std::string &serviceName, NLNET::TSer
|
|
|
|
|
disconnectUser( PlayerManager.getPlayerId( characterId ) );
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// add the character in the GPMS
|
|
|
|
|
COfflineEntityState state;
|
|
|
|
|
PlayerManager.getState( characterId ).setCOfflineEntityState( state ); // state properties with temp storage
|
|
|
|
@ -367,7 +364,7 @@ void cbClientReady( CMessage& msgin, const std::string &serviceName, NLNET::TSer
|
|
|
|
|
// validate player web account
|
|
|
|
|
// \todo this is unsafe, because name is an ucstring which might be fucked up when casted into string
|
|
|
|
|
CMailForumValidator::validateUserEntry( c->getHomeMainlandSessionId(), c->getName().toString(), player->getLoginCookie().toString() );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
NLNET::CMessage msgout( "IMPULSION_ID" );
|
|
|
|
|
CEntityId id = c->getId();
|
|
|
|
|
msgout.serial( id );
|
|
|
|
@ -376,11 +373,11 @@ void cbClientReady( CMessage& msgin, const std::string &serviceName, NLNET::TSer
|
|
|
|
|
{
|
|
|
|
|
uint32 shardId = IService::getInstance()->getShardId();
|
|
|
|
|
bms.serial(shardId);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CConfigFile::CVar *var = IService::getInstance()->ConfigFile.getVarPtr("WebSrvHost");
|
|
|
|
|
string webHost = (var != NULL ? var->asString() : "");
|
|
|
|
|
bms.serial(webHost);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
msgout.serialBufferWithSize((uint8*)bms.buffer(), bms.length());
|
|
|
|
|
CUnifiedNetwork::getInstance()->send( NLNET::TServiceId(c->getId().getDynamicId()), msgout ); // sendMessageViaMirror() not needed to FS in general
|
|
|
|
|
}
|
|
|
|
@ -388,9 +385,9 @@ void cbClientReady( CMessage& msgin, const std::string &serviceName, NLNET::TSer
|
|
|
|
|
{
|
|
|
|
|
nlwarning("Unable to send CONNECTION:SHARD_ID to player %s", id.toString().c_str());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Add player in the mirror // createEntity() will produce warnings if it fails
|
|
|
|
|
if ( ! Mirror.createEntity( characterId ) )
|
|
|
|
|
{
|
|
|
|
@ -419,7 +416,7 @@ void cbClientReady( CMessage& msgin, const std::string &serviceName, NLNET::TSer
|
|
|
|
|
uint32 in = c->getStartupInstance();
|
|
|
|
|
if (in != INVALID_AI_INSTANCE)
|
|
|
|
|
{
|
|
|
|
|
nldebug("Setting player %s in ring instance #%u",
|
|
|
|
|
nldebug("Setting player %s in ring instance #%u",
|
|
|
|
|
c->getId().toString().c_str(), in);
|
|
|
|
|
|
|
|
|
|
// set instance id for ring session
|
|
|
|
@ -438,7 +435,7 @@ void cbClientReady( CMessage& msgin, const std::string &serviceName, NLNET::TSer
|
|
|
|
|
nlwarning("user %s is in invalid continent '%s'", c->getId().toString().c_str(), strlwr( CONTINENT::toString(c->getCurrentContinent()) ).c_str() );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
nldebug("Setting player %s in instance #%u for continent '%s'",
|
|
|
|
|
nldebug("Setting player %s in instance #%u for continent '%s'",
|
|
|
|
|
c->getId().toString().c_str(), in, strlwr( CONTINENT::toString(c->getCurrentContinent())).c_str());
|
|
|
|
|
c->setInstanceNumber( in );
|
|
|
|
|
}
|
|
|
|
@ -500,26 +497,26 @@ void cbClientReady( CMessage& msgin, const std::string &serviceName, NLNET::TSer
|
|
|
|
|
{
|
|
|
|
|
c->setWhoSeesMe(UINT64_CONSTANT(0xffffffffffffffff));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!IsRingShard && player->havePriv(AlwaysInvisiblePriv))
|
|
|
|
|
{
|
|
|
|
|
c->setWhoSeesMe(uint64(0));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
TheDataset.declareEntity( entityIndex ); // after the writing of properties to mirror
|
|
|
|
|
|
|
|
|
|
//#ifdef NL_DEBUG
|
|
|
|
|
egs_ecinfo("Client ready (entity %s (Row %u) added to mirror)", characterId.toString().c_str(), entityIndex.getIndex() );
|
|
|
|
|
//#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// player enter the game
|
|
|
|
|
PlayerManager.setEnterFlag( characterId, true );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// ask backup for offline commands file
|
|
|
|
|
COfflineCharacterCommand::getInstance()->characterOnline( characterId );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if( CGameEventManager::getInstance().getChannelEventId() != TChanID::Unknown )
|
|
|
|
|
{
|
|
|
|
|
if( c->haveAnyPrivilege() )
|
|
|
|
@ -541,7 +538,7 @@ void cbClientReady( CMessage& msgin, const std::string &serviceName, NLNET::TSer
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------
|
|
|
|
|
// finalizeClientReady :
|
|
|
|
|
//
|
|
|
|
|
//
|
|
|
|
|
//---------------------------------------------------
|
|
|
|
|
void finalizeClientReady( uint32 userId, uint32 index )
|
|
|
|
|
{
|
|
|
|
@ -549,21 +546,21 @@ void finalizeClientReady( uint32 userId, uint32 index )
|
|
|
|
|
|
|
|
|
|
CPlayer *player = PlayerManager.getPlayer(userId);
|
|
|
|
|
BOMB_IF( player == 0,"Failed to get player from user Id",return );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
BOMB_IF( index==-1, "Failed to find char with given index for this player", return );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// get the char infos
|
|
|
|
|
CCharacter * c = PlayerManager.getChar( userId, index );
|
|
|
|
|
BOMB_IF( c == NULL, toString("Character %u of user %u not created", index, userId), return);
|
|
|
|
|
|
|
|
|
|
// get character CEntityId
|
|
|
|
|
CEntityId characterId = c->getId();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
c->sendDynamicSystemMessage( c->getId(), "OPS_WELCOME" );
|
|
|
|
|
// c->sendMessageToClient( c->getId(), "OPS_WELCOME" );
|
|
|
|
|
|
|
|
|
|
c->sendMessageOfTheDay();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
c->checkSkillTreeForLockedSkill();
|
|
|
|
|
|
|
|
|
|
c->setDatabase();
|
|
|
|
@ -598,7 +595,7 @@ void finalizeClientReady( uint32 userId, uint32 index )
|
|
|
|
|
nlwarning("<cbclientReady : user %s is not in his guild>");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
c->resetFameDatabase();
|
|
|
|
|
|
|
|
|
|
// notify player respawn points system that player is ready
|
|
|
|
@ -657,7 +654,7 @@ void finalizeClientReady( uint32 userId, uint32 index )
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// check sell store
|
|
|
|
|
c->checkSellStore();
|
|
|
|
|
|
|
|
|
@ -684,13 +681,13 @@ void finalizeClientReady( uint32 userId, uint32 index )
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// for GM player, trigger a 'infos' command to remember their persistent state
|
|
|
|
|
if (!PlayerManager.getPlayer(uint32(c->getId().getShortId())>>4)->getUserPriv().empty())
|
|
|
|
|
CCommandRegistry::getInstance().execute(toString("infos %s", c->getId().toString().c_str()).c_str(), InfoLog(), true);
|
|
|
|
|
|
|
|
|
|
} // finalizeClientReady //
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//-----------------------------------------------
|
|
|
|
|
// cbClientDisconnection :
|
|
|
|
@ -699,7 +696,7 @@ void finalizeClientReady( uint32 userId, uint32 index )
|
|
|
|
|
void cbClientDisconnection(CMessage& msgin, const string &serviceName, NLNET::TServiceId serviceId)
|
|
|
|
|
{
|
|
|
|
|
H_AUTO(cbClientDisconnection);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// read the player id
|
|
|
|
|
uint32 userId;
|
|
|
|
|
msgin.serial( userId );
|
|
|
|
@ -736,7 +733,7 @@ void cbClientDisconnection(CMessage& msgin, const string &serviceName, NLNET::TS
|
|
|
|
|
void disconnectUser(uint32 userId)
|
|
|
|
|
{
|
|
|
|
|
H_AUTO(disconnectUser);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PlayerManager.disconnectPlayer( userId );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -747,7 +744,7 @@ void disconnectUser(uint32 userId)
|
|
|
|
|
void cbSelectChar( CMessage& msgin, const std::string &serviceName, NLNET::TServiceId serviceId )
|
|
|
|
|
{
|
|
|
|
|
H_AUTO(cbSelectChar);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// read the player id
|
|
|
|
|
// uint64 longUserId;
|
|
|
|
|
uint32 userId;
|
|
|
|
@ -773,7 +770,7 @@ void cbSelectChar( CMessage& msgin, const std::string &serviceName, NLNET::TServ
|
|
|
|
|
{
|
|
|
|
|
// get the char infos
|
|
|
|
|
CCharacter * ch = PlayerManager.getChar( userId, index );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if( ch != 0 )
|
|
|
|
|
{
|
|
|
|
|
// Check if not loading an old file with no normal positions
|
|
|
|
@ -817,11 +814,11 @@ void cbSelectChar( CMessage& msgin, const std::string &serviceName, NLNET::TServ
|
|
|
|
|
|
|
|
|
|
// store the ai instance
|
|
|
|
|
ch->setStartupInstance(instanceId);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Send userId/charId association to the FE (IMPULSION_ID becomes valid from now on)
|
|
|
|
|
CEntityId charId = ch->getId();
|
|
|
|
|
PlayerManager.setActiveCharForPlayer( userId, index, charId );
|
|
|
|
|
CMessage msgout2("CL_ID");
|
|
|
|
|
CMessage msgout2("CL_ID");
|
|
|
|
|
msgout2.serial( userId );
|
|
|
|
|
msgout2.serial( charId );
|
|
|
|
|
NLNET::TServiceId frontEndId = PlayerManager.getPlayerFrontEndId( userId );
|
|
|
|
@ -852,10 +849,10 @@ void cbSelectChar( CMessage& msgin, const std::string &serviceName, NLNET::TServ
|
|
|
|
|
// Continue on same shard => send user char data (start pos, etc.)
|
|
|
|
|
ch->sendUserChar( userId, 0 /*auto*/, R2::TUserRole::ur_player );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// send CEntityId/name association to the IOS
|
|
|
|
|
// ch->registerName();
|
|
|
|
|
|
|
|
|
|
// ch->registerName();
|
|
|
|
|
|
|
|
|
|
// send acknowledge to client for received Enter message (new: it includes version handshake)
|
|
|
|
|
CBitMemStream bms2;
|
|
|
|
|
nlverify(GenericMsgManager.pushNameToStream( "CONNECTION:READY", bms2));
|
|
|
|
@ -864,12 +861,12 @@ void cbSelectChar( CMessage& msgin, const std::string &serviceName, NLNET::TServ
|
|
|
|
|
msgout3.serial( charId );
|
|
|
|
|
msgout3.serialBufferWithSize((uint8*)bms2.buffer(), bms2.length());
|
|
|
|
|
CUnifiedNetwork::getInstance()->send( frontEndId, msgout3 );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// // Remove user language from IOS, we don't need it anymore
|
|
|
|
|
// CMessage msgout4("REMOVE_USER_LANGUAGE");
|
|
|
|
|
// msgout4.serial(userId);
|
|
|
|
|
// CUnifiedNetwork::getInstance()->send("IOS", msgout4);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if( CPVPManager2::getInstance()->inSafeZone( ch->getPosition() ) )
|
|
|
|
|
{
|
|
|
|
|
// character must be safe in PVP until he leave safe zone
|
|
|
|
@ -906,11 +903,11 @@ void cbSelectChar( CMessage& msgin, const std::string &serviceName, NLNET::TServ
|
|
|
|
|
void cbCheckName( CMessage& msgin, const std::string &serviceName, NLNET::TServiceId serviceId )
|
|
|
|
|
{
|
|
|
|
|
H_AUTO(cbCheckName);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
uint64 longUid;
|
|
|
|
|
uint32 userId;
|
|
|
|
|
CCheckNameMsg checkNameMsg;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
msgin.serial( longUid );
|
|
|
|
|
userId = (uint32) longUid;
|
|
|
|
|
msgin.serial( checkNameMsg );
|
|
|
|
@ -944,16 +941,16 @@ void cbCheckName( CMessage& msgin, const std::string &serviceName, NLNET::TServi
|
|
|
|
|
void cbCreateChar( CMessage& msgin, const std::string &serviceName, NLNET::TServiceId serviceId )
|
|
|
|
|
{
|
|
|
|
|
H_AUTO(cbCreateChar);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// read the player id
|
|
|
|
|
uint64 longUserId;
|
|
|
|
|
uint32 userId;
|
|
|
|
|
msgin.serial( longUserId );
|
|
|
|
|
userId = (uint32) longUserId;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CCreateCharMsg createCharMsg;
|
|
|
|
|
createCharMsg.serial( msgin );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Yoyo: fix to force new newbieland.
|
|
|
|
|
if(UseNewNewbieLandStartingPoint)
|
|
|
|
|
{
|
|
|
|
@ -974,7 +971,7 @@ void cbCreateChar( CMessage& msgin, const std::string &serviceName, NLNET::TServ
|
|
|
|
|
createCharMsg.Name[i] = createCharMsg.Name[i] - 'A' + 'a';
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CCreateCharErrorMsg createCharErrorMsg;
|
|
|
|
|
if( ! CCharacter::checkCreateParams( createCharMsg, createCharErrorMsg, userId ) )
|
|
|
|
|
{
|
|
|
|
@ -1031,7 +1028,7 @@ CreationFailed:
|
|
|
|
|
sendCharactersSummary( PlayerManager.getPlayer( userId ) );
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void cbCreateChar_part2(uint32 userId, const CCreateCharMsg &createCharMsg, bool ok)
|
|
|
|
|
{
|
|
|
|
@ -1051,12 +1048,12 @@ void cbCreateChar_part2(uint32 userId, const CCreateCharMsg &createCharMsg, bool
|
|
|
|
|
|
|
|
|
|
// create a new char
|
|
|
|
|
CCharacter * ch = new CCharacter();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
createCharMsg.Slot;
|
|
|
|
|
|
|
|
|
|
CEntityId charId = PlayerManager.createCharacterId( userId, createCharMsg.Slot );
|
|
|
|
|
|
|
|
|
|
ch->setId( charId );
|
|
|
|
|
ch->setId( charId );
|
|
|
|
|
ch->setName( createCharMsg.Name );
|
|
|
|
|
// ch->setSurname( string("unknown") );
|
|
|
|
|
|
|
|
|
@ -1095,7 +1092,7 @@ void cbCreateChar_part2(uint32 userId, const CCreateCharMsg &createCharMsg, bool
|
|
|
|
|
{
|
|
|
|
|
nlwarning( "(PS)<cbCreateChar> Error: %s", e.what() );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PlayerManager.savePlayerChar( userId, createCharMsg.Slot );
|
|
|
|
|
|
|
|
|
|
// update the ring database with the new char
|
|
|
|
@ -1113,7 +1110,7 @@ void cbCreateChar_part2(uint32 userId, const CCreateCharMsg &createCharMsg, bool
|
|
|
|
|
// std::pair<PVP_CLAN::TPVPClan, PVP_CLAN::TPVPClan> allegiance = ch->getAllegiance();
|
|
|
|
|
// charInfo.setCivilisation(ch->
|
|
|
|
|
// charInfo.setCult(
|
|
|
|
|
// no respawn points
|
|
|
|
|
// no respawn points
|
|
|
|
|
IShardUnifierEvent::getInstance()->onNewChar(charInfo);
|
|
|
|
|
}
|
|
|
|
|
} // cbCreateChar //
|
|
|
|
@ -1126,7 +1123,7 @@ void cbCreateChar_part2(uint32 userId, const CCreateCharMsg &createCharMsg, bool
|
|
|
|
|
void sendIfNameIsValide( uint32 userId, bool nameValide )
|
|
|
|
|
{
|
|
|
|
|
H_AUTO(sendIfNameIsValide);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CBitMemStream bmsName;
|
|
|
|
|
if ( ! GenericMsgManager.pushNameToStream( "CONNECTION:VALID_NAME", bmsName) )
|
|
|
|
|
{
|
|
|
|
@ -1135,11 +1132,11 @@ void sendIfNameIsValide( uint32 userId, bool nameValide )
|
|
|
|
|
}
|
|
|
|
|
uint8 valide = nameValide;
|
|
|
|
|
bmsName.serial( valide );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CMessage msgoutName( "IMPULSION_UID" );
|
|
|
|
|
msgoutName.serial( userId );
|
|
|
|
|
msgoutName.serialBufferWithSize((uint8*)bmsName.buffer(), bmsName.length());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
CUnifiedNetwork::getInstance()->send( PlayerManager.getPlayerFrontEndId( userId ), msgoutName );
|
|
|
|
@ -1158,16 +1155,16 @@ void sendIfNameIsValide( uint32 userId, bool nameValide )
|
|
|
|
|
void cbDeleteChar( CMessage& msgin, const std::string &serviceName, NLNET::TServiceId serviceId )
|
|
|
|
|
{
|
|
|
|
|
H_AUTO(cbDeleteChar);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// read the player id
|
|
|
|
|
uint64 longUserId;
|
|
|
|
|
uint32 userId;
|
|
|
|
|
msgin.serial( longUserId );
|
|
|
|
|
userId = (uint32) longUserId;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
uint8 characterIndex;
|
|
|
|
|
msgin.serial( characterIndex );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CPlayer* player = PlayerManager.getPlayer( userId );
|
|
|
|
|
if ( player == NULL )
|
|
|
|
|
{
|
|
|
|
@ -1198,10 +1195,10 @@ void cbDeleteChar( CMessage& msgin, const std::string &serviceName, NLNET::TServ
|
|
|
|
|
|
|
|
|
|
fileName = charPath+NLMISC::toString( "account_%u_%d.xml", userId, index );
|
|
|
|
|
BsiGlobal.deleteFile( fileName );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fileName = charPath+NLMISC::toString( "account_%u_%d.xml.backup", userId, index );
|
|
|
|
|
BsiGlobal.deleteFile( fileName );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fileName = charPath+NLMISC::toString( "account_%u_%d.bin", userId, index );
|
|
|
|
|
BsiGlobal.deleteFile( fileName );
|
|
|
|
|
|
|
|
|
@ -1233,7 +1230,7 @@ void cbDeleteChar( CMessage& msgin, const std::string &serviceName, NLNET::TServ
|
|
|
|
|
void sendCharactersSummary( CPlayer *player, bool AllAutorized, uint32 bitfieldOwnerOfActiveAnimSession, uint32 bitfieldOwnerOfEditSession )
|
|
|
|
|
{
|
|
|
|
|
H_AUTO(sendCharactersSummary);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ( player == NULL )
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
@ -1244,14 +1241,14 @@ void sendCharactersSummary( CPlayer *player, bool AllAutorized, uint32 bitfieldO
|
|
|
|
|
{
|
|
|
|
|
for ( uint i=0, len=(uint)chars.size(); i!=len; ++i )
|
|
|
|
|
{
|
|
|
|
|
chars[i].InRingSession = ((bitfieldOwnerOfActiveAnimSession & (1 << i)) != 0);
|
|
|
|
|
chars[i].InRingSession = ((bitfieldOwnerOfActiveAnimSession & (1 << i)) != 0);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (bitfieldOwnerOfEditSession != 0)
|
|
|
|
|
{
|
|
|
|
|
for ( uint i=0, len=(uint)chars.size(); i!=len; ++i )
|
|
|
|
|
{
|
|
|
|
|
{
|
|
|
|
|
chars[i].HasEditSession = ((bitfieldOwnerOfEditSession & (1 << i)) != 0);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -1305,7 +1302,7 @@ void sendCharactersSummary( CPlayer *player, bool AllAutorized, uint32 bitfieldO
|
|
|
|
|
bms.serialCont (shardNames);
|
|
|
|
|
|
|
|
|
|
// send privileges in all cases
|
|
|
|
|
std::string priv;
|
|
|
|
|
std::string priv;
|
|
|
|
|
priv = player->getUserPriv();
|
|
|
|
|
bms.serial(priv);
|
|
|
|
|
|
|
|
|
@ -1339,7 +1336,7 @@ void sendCharactersSummary( CPlayer *player, bool AllAutorized, uint32 bitfieldO
|
|
|
|
|
void cbEntityPos(CMessage& msgin, const string &serviceName, NLNET::TServiceId serviceId)
|
|
|
|
|
{
|
|
|
|
|
H_AUTO(cbEntityPos);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CEntityId id;
|
|
|
|
|
sint32 x, y, z;
|
|
|
|
|
float t;
|
|
|
|
@ -1385,7 +1382,7 @@ void cbEntityPos(CMessage& msgin, const string &serviceName, NLNET::TServiceId s
|
|
|
|
|
void cbClientTpAck( NLNET::CMessage& msgin, const std::string &serviceName, NLNET::TServiceId serviceId)
|
|
|
|
|
{
|
|
|
|
|
H_AUTO(cbTpAcknowledge);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CEntityId Id;
|
|
|
|
|
|
|
|
|
|
msgin.serial( Id );
|
|
|
|
@ -1446,7 +1443,7 @@ void cbClientTpAck( NLNET::CMessage& msgin, const std::string &serviceName, NLNE
|
|
|
|
|
CBankAccessor_PLR::getTARGET().getBARS().setFOCUS(ch->_PropertyDatabase, 0 );
|
|
|
|
|
ch->setTarget( CEntityId::Unknown );
|
|
|
|
|
|
|
|
|
|
// player still intangible for a few seconds
|
|
|
|
|
// player still intangible for a few seconds
|
|
|
|
|
ch->setIntangibleEndDate( CTickEventHandler::getGameCycle() + IntangibleTimeAfterTP );
|
|
|
|
|
|
|
|
|
|
if (ch->getMode()==MBEHAV::DEATH)
|
|
|
|
@ -1474,11 +1471,11 @@ void cbClientTpAck( NLNET::CMessage& msgin, const std::string &serviceName, NLNE
|
|
|
|
|
{
|
|
|
|
|
nlwarning("<TP>%s will arrive in invalid continent %s", ch->getId().toString().c_str(), NLMISC::strlwr( cont->getName() ).c_str() );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// respawn the pets if needed
|
|
|
|
|
ch->respawnPetAfterTp( state, in );
|
|
|
|
|
|
|
|
|
|
nldebug("Setting player %s in instance #%u for continent '%s'",
|
|
|
|
|
|
|
|
|
|
nldebug("Setting player %s in instance #%u for continent '%s'",
|
|
|
|
|
ch->getId().toString().c_str(),
|
|
|
|
|
in,
|
|
|
|
|
CONTINENT::toString(contId).c_str());
|
|
|
|
@ -1528,8 +1525,8 @@ void cbClientTpAck( NLNET::CMessage& msgin, const std::string &serviceName, NLNE
|
|
|
|
|
ch->setWhoSeesMe( IsRingShard? R2_VISION::buildWhoSeesMe(R2_VISION::WHOSEESME_VISIBLE_PLAYER,true): UINT64_CONSTANT(0xffffffffffffffff) );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -1546,12 +1543,12 @@ void cbClientTpAck( NLNET::CMessage& msgin, const std::string &serviceName, NLNE
|
|
|
|
|
} // cbTpAcknowledge //
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------
|
|
|
|
|
// cbLeaveTeam: a player
|
|
|
|
|
// cbLeaveTeam: a player
|
|
|
|
|
//---------------------------------------------------
|
|
|
|
|
void cbLeaveTeam( NLNET::CMessage& msgin, const std::string &serviceName, NLNET::TServiceId serviceId)
|
|
|
|
|
{
|
|
|
|
|
H_AUTO(cbLeaveTeam);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CEntityId charId;
|
|
|
|
|
msgin.serial( charId );
|
|
|
|
|
TeamManager.quitTeam( charId );
|
|
|
|
@ -1563,7 +1560,7 @@ void cbLeaveTeam( NLNET::CMessage& msgin, const std::string &serviceName, NLNET:
|
|
|
|
|
void cbJoinTeam( NLNET::CMessage& msgin, const std::string &serviceName, NLNET::TServiceId serviceId)
|
|
|
|
|
{
|
|
|
|
|
H_AUTO(cbJoinTeam);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CEntityId charId;
|
|
|
|
|
msgin.serial( charId );
|
|
|
|
|
TeamManager.joinAccept( charId );
|
|
|
|
@ -1575,7 +1572,7 @@ void cbJoinTeam( NLNET::CMessage& msgin, const std::string &serviceName, NLNET::
|
|
|
|
|
void cbJoinTeamDecline( NLNET::CMessage& msgin, const std::string &serviceName, NLNET::TServiceId serviceId)
|
|
|
|
|
{
|
|
|
|
|
H_AUTO(cbJoinTeamDecline);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CEntityId charId;
|
|
|
|
|
msgin.serial( charId );
|
|
|
|
|
TeamManager.joinDecline( charId );
|
|
|
|
@ -1588,7 +1585,7 @@ void cbJoinTeamDecline( NLNET::CMessage& msgin, const std::string &serviceName,
|
|
|
|
|
void cbJoinTeamProposal( NLNET::CMessage& msgin, const std::string &serviceName, NLNET::TServiceId serviceId)
|
|
|
|
|
{
|
|
|
|
|
H_AUTO(cbJoinTeamProposal);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CEntityId charId;
|
|
|
|
|
msgin.serial( charId );
|
|
|
|
|
|
|
|
|
@ -1609,7 +1606,7 @@ void cbJoinTeamProposal( NLNET::CMessage& msgin, const std::string &serviceName,
|
|
|
|
|
void cbKickTeammate( NLNET::CMessage& msgin, const std::string &serviceName, NLNET::TServiceId serviceId)
|
|
|
|
|
{
|
|
|
|
|
H_AUTO(cbKickTeammate);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CEntityId charId;
|
|
|
|
|
uint8 memberIndex;
|
|
|
|
|
msgin.serial( charId );
|
|
|
|
@ -1633,7 +1630,7 @@ void cbKickTeammate( NLNET::CMessage& msgin, const std::string &serviceName, NLN
|
|
|
|
|
void cbHarvest( NLNET::CMessage& msgin, const std::string &serviceName, NLNET::TServiceId serviceId)
|
|
|
|
|
{
|
|
|
|
|
H_AUTO(cbHarvest);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CEntityId charId;
|
|
|
|
|
msgin.serial( charId );
|
|
|
|
|
|
|
|
|
@ -1661,7 +1658,7 @@ void cbHarvest( NLNET::CMessage& msgin, const std::string &serviceName, NLNET::T
|
|
|
|
|
void cbHarvestClose( NLNET::CMessage& msgin, const std::string &serviceName, NLNET::TServiceId serviceId)
|
|
|
|
|
{
|
|
|
|
|
H_AUTO(cbHarvestClose);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CEntityId charId;
|
|
|
|
|
msgin.serial( charId );
|
|
|
|
|
|
|
|
|
@ -1687,7 +1684,7 @@ void cbHarvestClose( NLNET::CMessage& msgin, const std::string &serviceName, NLN
|
|
|
|
|
void cbHarvestDeposit( NLNET::CMessage& msgin, const std::string &serviceName, NLNET::TServiceId serviceId)
|
|
|
|
|
{
|
|
|
|
|
H_AUTO(cbHarvestDeposit);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CEntityId charId;
|
|
|
|
|
msgin.serial( charId );
|
|
|
|
|
|
|
|
|
@ -1728,7 +1725,7 @@ void cbHarvestDeposit( NLNET::CMessage& msgin, const std::string &serviceName, N
|
|
|
|
|
nlerror( "character->harvestDeposit(true);" ); // TODO
|
|
|
|
|
/*character->depositSearchSkill(skill);
|
|
|
|
|
character->openHarvest();*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// character->sendMessageToClient( character->getId(), "WOS_HARVEST_SEARCHING" );
|
|
|
|
|
nlerror( "CZoneManager::getInstance().harvestDeposit(character);" );
|
|
|
|
|
|
|
|
|
@ -1744,7 +1741,7 @@ void cbHarvestDeposit( NLNET::CMessage& msgin, const std::string &serviceName, N
|
|
|
|
|
// Changed : Wait new harvest rules ////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
// character->setBehaviour( MBEHAV::HARVESTING );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} // cbHarvestDeposit //
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -1755,7 +1752,7 @@ void cbHarvestDeposit( NLNET::CMessage& msgin, const std::string &serviceName, N
|
|
|
|
|
void cbHarvestMPDestroyed( NLNET::CMessage& msgin, const std::string &serviceName, NLNET::TServiceId serviceId)
|
|
|
|
|
{
|
|
|
|
|
H_AUTO(cbHarvestMPDestroyed);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CEntityId charId;
|
|
|
|
|
msgin.serial( charId );
|
|
|
|
|
|
|
|
|
@ -1800,7 +1797,7 @@ void cbHarvestMPDestroyed( NLNET::CMessage& msgin, const std::string &serviceNam
|
|
|
|
|
void cbHarvestInterrupted( NLNET::CMessage& msgin, const std::string &serviceName, NLNET::TServiceId serviceId)
|
|
|
|
|
{
|
|
|
|
|
H_AUTO(cbHarvestInterrupted);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CEntityId charId;
|
|
|
|
|
msgin.serial( charId );
|
|
|
|
|
|
|
|
|
@ -1839,13 +1836,13 @@ void cbHarvestInterrupted( NLNET::CMessage& msgin, const std::string &serviceNam
|
|
|
|
|
void cbHarvestDB( NLNET::CMessage& msgin, const std::string &serviceName, NLNET::TServiceId serviceId)
|
|
|
|
|
{
|
|
|
|
|
H_AUTO(cbHarvestDB);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CEntityId charId;
|
|
|
|
|
CSheetId sheet;
|
|
|
|
|
uint16 quantity;
|
|
|
|
|
uint16 minQuality;
|
|
|
|
|
uint16 maxQuality;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
msgin.serial( charId );
|
|
|
|
|
msgin.serial( sheet );
|
|
|
|
|
msgin.serial( quantity );
|
|
|
|
@ -1871,7 +1868,7 @@ void cbHarvestDB( NLNET::CMessage& msgin, const std::string &serviceName, NLNET:
|
|
|
|
|
character->staticActionInProgress(true);
|
|
|
|
|
|
|
|
|
|
CTempInventory *invTemp = (CTempInventory*)(CInventoryBase*)character->getInventory(INVENTORIES::temporary);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (uint32 i = 0 ; i < invTemp->getSlotCount(); ++i )
|
|
|
|
|
{
|
|
|
|
|
if (i != 0 )
|
|
|
|
@ -1883,7 +1880,7 @@ void cbHarvestDB( NLNET::CMessage& msgin, const std::string &serviceName, NLNET:
|
|
|
|
|
{
|
|
|
|
|
invTemp->setDispQuantity(i, quantity);
|
|
|
|
|
invTemp->setDispSheetId(i, sheet);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
invTemp->setDispQuality(i, 0);
|
|
|
|
|
//trap character->incSlotVersion( INVENTORIES::temporary,i );
|
|
|
|
|
}
|
|
|
|
@ -1947,7 +1944,7 @@ void cbHarvestDBUpdateQty( NLNET::CMessage& msgin, const std::string &serviceNam
|
|
|
|
|
void cbClearHarvestDB( NLNET::CMessage& msgin, const std::string &serviceName, NLNET::TServiceId serviceId)
|
|
|
|
|
{
|
|
|
|
|
H_AUTO(cbClearHarvestDB);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CEntityId charId;
|
|
|
|
|
msgin.serial( charId );
|
|
|
|
|
|
|
|
|
@ -1982,7 +1979,7 @@ void cbClearHarvestDB( NLNET::CMessage& msgin, const std::string &serviceName, N
|
|
|
|
|
|
|
|
|
|
uint16 quantity;
|
|
|
|
|
msgin.serial( quantity );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
uint16 quality;
|
|
|
|
|
msgin.serial( quality );
|
|
|
|
|
|
|
|
|
@ -2013,7 +2010,7 @@ void cbClearHarvestDB( NLNET::CMessage& msgin, const std::string &serviceName, N
|
|
|
|
|
void cbFightingTarget( NLNET::CMessage& msgin, const std::string &serviceName, NLNET::TServiceId serviceId)
|
|
|
|
|
{
|
|
|
|
|
H_AUTO(cbFightingTarget);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CEntityId IdCharacter, Target;
|
|
|
|
|
|
|
|
|
|
msgin.serial( IdCharacter );
|
|
|
|
@ -2043,7 +2040,7 @@ void cbFightingTarget( NLNET::CMessage& msgin, const std::string &serviceName, N
|
|
|
|
|
void cbAnimalCommand( NLNET::CMessage& msgin, const std::string &serviceName, NLNET::TServiceId serviceId)
|
|
|
|
|
{
|
|
|
|
|
H_AUTO(cbAnimalCommand);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CEntityId entity;
|
|
|
|
|
uint8 beastIndex;
|
|
|
|
|
uint8 command;
|
|
|
|
@ -2119,7 +2116,7 @@ void cbTradeListReceived( NLNET::CMessage& msgin, const std::string &serviceName
|
|
|
|
|
void cbTradeBuySomething( NLNET::CMessage& msgin, const std::string &serviceName, NLNET::TServiceId serviceId)
|
|
|
|
|
{
|
|
|
|
|
H_AUTO(cbTradeBuySomething);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CEntityId player;
|
|
|
|
|
uint8 ItemNumber;
|
|
|
|
|
uint16 Quantity;
|
|
|
|
@ -2171,7 +2168,7 @@ void cbGiveSeed( NLNET::CMessage& msgin, const std::string &serviceName, uint16
|
|
|
|
|
void cbAddSurvivePact( NLNET::CMessage& msgin, const std::string &serviceName, NLNET::TServiceId serviceId)
|
|
|
|
|
{
|
|
|
|
|
H_AUTO(cbAddSurvivePact);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CEntityId player;
|
|
|
|
|
uint8 PactNature, PactType;
|
|
|
|
|
|
|
|
|
@ -2233,7 +2230,7 @@ void cbFameChange( NLNET::CMessage& msgin, const std::string &serviceName, uint1
|
|
|
|
|
// read the creature id
|
|
|
|
|
CEntityId Id;
|
|
|
|
|
msgin.serial( Id );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// read creature sheet id
|
|
|
|
|
uint32 Sheet;
|
|
|
|
|
msgin.serial( Sheet );
|
|
|
|
@ -2272,7 +2269,7 @@ void cbFameChange( NLNET::CMessage& msgin, const std::string &serviceName, uint1
|
|
|
|
|
void cbSetValue( CMessage& msgin, const std::string &serviceName, NLNET::TServiceId serviceId )
|
|
|
|
|
{
|
|
|
|
|
H_AUTO(cbSetValue);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// read the entity id
|
|
|
|
|
CEntityId Id;
|
|
|
|
|
msgin.serial( Id );
|
|
|
|
@ -2305,7 +2302,7 @@ void cbSetValue( CMessage& msgin, const std::string &serviceName, NLNET::TServic
|
|
|
|
|
void cbModifyValue( CMessage& msgin, const std::string &serviceName, NLNET::TServiceId serviceId )
|
|
|
|
|
{
|
|
|
|
|
H_AUTO(cbModifyValue);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// read the creature id
|
|
|
|
|
CEntityId Id;
|
|
|
|
|
msgin.serial( Id );
|
|
|
|
@ -2319,7 +2316,7 @@ void cbModifyValue( CMessage& msgin, const std::string &serviceName, NLNET::TSer
|
|
|
|
|
msgin.serial( modifValue );
|
|
|
|
|
|
|
|
|
|
// egs_ecinfo("*** cbModifyValue from service %s modify value %s to %s", serviceName.c_str(), var.c_str(), modifValue.c_str() );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CEntityBase* entity = CEntityBaseManager::getEntityBasePtr( Id );
|
|
|
|
|
|
|
|
|
|
if (entity == 0)
|
|
|
|
@ -2336,7 +2333,7 @@ void cbModifyValue( CMessage& msgin, const std::string &serviceName, NLNET::TSer
|
|
|
|
|
void cbTarget( CMessage& msgin, const std::string &serviceName, NLNET::TServiceId serviceId )
|
|
|
|
|
{
|
|
|
|
|
H_AUTO(cbTarget);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ( ! Mirror.mirrorIsReady() )
|
|
|
|
|
{
|
|
|
|
|
nlwarning("<cbTarget> Received from %s service but mirror not yet ready", serviceName.c_str() );
|
|
|
|
@ -2348,7 +2345,7 @@ void cbTarget( CMessage& msgin, const std::string &serviceName, NLNET::TServiceI
|
|
|
|
|
// read the entity id
|
|
|
|
|
TDataSetRow Id;
|
|
|
|
|
msgin.serial(Id);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// read the target id
|
|
|
|
|
TDataSetRow targetId;
|
|
|
|
|
msgin.serial(targetId);
|
|
|
|
@ -2364,12 +2361,12 @@ void cbTarget( CMessage& msgin, const std::string &serviceName, NLNET::TServiceI
|
|
|
|
|
CEntityBase* entity = CEntityBaseManager::getEntityBasePtr(Id);
|
|
|
|
|
CEntityId EentityId=TheDataset.getEntityId(Id);
|
|
|
|
|
CEntityId EtargetId=TheDataset.getEntityId(targetId);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (entity == 0)
|
|
|
|
|
{
|
|
|
|
|
nlwarning("<cbTarget> Invalid entity Id %s", EentityId.toString().c_str() );
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (entity->getId().getType()==RYZOMID::player)
|
|
|
|
|
{
|
|
|
|
|
entity->setTarget(EtargetId);
|
|
|
|
@ -2384,7 +2381,7 @@ void cbTarget( CMessage& msgin, const std::string &serviceName, NLNET::TServiceI
|
|
|
|
|
void cbChangeMode( CMessage& msgin, const std::string &serviceName, NLNET::TServiceId serviceId )
|
|
|
|
|
{
|
|
|
|
|
H_AUTO(cbChangeMode);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*// read the character id
|
|
|
|
|
CEntityId Id;
|
|
|
|
|
msgin.serial( Id );
|
|
|
|
@ -2416,7 +2413,7 @@ void cbChangeMode( CMessage& msgin, const std::string &serviceName, NLNET::TServ
|
|
|
|
|
void cbChangeBehaviour( CMessage& msgin, const std::string &serviceName, NLNET::TServiceId serviceId )
|
|
|
|
|
{
|
|
|
|
|
H_AUTO(cbChangeBehaviour);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// read the character id
|
|
|
|
|
CEntityId Id;
|
|
|
|
|
msgin.serial( Id );
|
|
|
|
@ -2445,7 +2442,7 @@ void cbItemDrop( CMessage& msgin, const std::string &serviceName, NLNET::TServic
|
|
|
|
|
{
|
|
|
|
|
nlwarning("cbItemDrop no more allowed");
|
|
|
|
|
// H_AUTO(cbItemDrop);
|
|
|
|
|
//
|
|
|
|
|
//
|
|
|
|
|
// CEntityId user;
|
|
|
|
|
// uint16 inventory,slot,quantity;
|
|
|
|
|
//
|
|
|
|
@ -2501,7 +2498,7 @@ void cbItemPickup( NLNET::CMessage& msgin, const std::string &serviceName, NLNET
|
|
|
|
|
void cbItemClosePickup( NLNET::CMessage& msgin, const std::string &serviceName, NLNET::TServiceId serviceId )
|
|
|
|
|
{
|
|
|
|
|
H_AUTO(cbItemClosePickup);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CEntityId charId;
|
|
|
|
|
msgin.serial( charId );
|
|
|
|
|
|
|
|
|
@ -2522,7 +2519,7 @@ void cbItemSwap( NLNET::CMessage& msgin, const std::string &serviceName, NLNET::
|
|
|
|
|
{
|
|
|
|
|
H_AUTO(cbItemSwap);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CEntityId charId;
|
|
|
|
|
uint16 slotSrc, slotDst, quantity;
|
|
|
|
|
INVENTORIES::TInventory inventorySrc, inventoryDst;
|
|
|
|
@ -2545,7 +2542,7 @@ void cbItemSwap( NLNET::CMessage& msgin, const std::string &serviceName, NLNET::
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
TLogContext_Item_Swap logContext(character->getId());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
character->setAfkState(false);
|
|
|
|
|
|
|
|
|
|
// increment inventory counter
|
|
|
|
@ -2553,11 +2550,11 @@ void cbItemSwap( NLNET::CMessage& msgin, const std::string &serviceName, NLNET::
|
|
|
|
|
character->incInterfaceCounter();
|
|
|
|
|
|
|
|
|
|
// Special case for guilds
|
|
|
|
|
if (inventorySrc == INVENTORIES::guild || inventoryDst == INVENTORIES::guild)
|
|
|
|
|
if (inventorySrc == INVENTORIES::guild || inventoryDst == INVENTORIES::guild)
|
|
|
|
|
{
|
|
|
|
|
uint16 nGuildSessionCounter;
|
|
|
|
|
msgin.serial( nGuildSessionCounter );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
string sDebug = "<cbItemSwap> user:" + TheDataset.getEntityId(character->getEntityRowId()).toString() + " ";
|
|
|
|
|
|
|
|
|
|
CGuild *pGuild = CGuildManager::getInstance()->getGuildFromId( character->getGuildId() );
|
|
|
|
@ -2611,18 +2608,18 @@ void cbItemSwap( NLNET::CMessage& msgin, const std::string &serviceName, NLNET::
|
|
|
|
|
void cbEngage( NLNET::CMessage& msgin, const std::string &serviceName, NLNET::TServiceId serviceId)
|
|
|
|
|
{
|
|
|
|
|
H_AUTO(cbEngage);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CEntityId charId;
|
|
|
|
|
msgin.serial( charId );
|
|
|
|
|
|
|
|
|
|
CEntityBase* entity = CEntityBaseManager::getEntityBasePtr( charId );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (entity == NULL)
|
|
|
|
|
{
|
|
|
|
|
nlwarning("<EntityCallbacks::cbEngage> Invalid entity Id %s", charId.toString().c_str() );
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CEntityId targetId = entity->getTarget();
|
|
|
|
|
|
|
|
|
|
vector<CSheetId> bricks;
|
|
|
|
@ -2651,9 +2648,9 @@ void cbDefaultAttack( NLNET::CMessage& msgin, const std::string &serviceName, NL
|
|
|
|
|
|
|
|
|
|
CEntityId entityId;
|
|
|
|
|
msgin.serial( entityId );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CEntityBase* entity = CEntityBaseManager::getEntityBasePtr( entityId );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (entity == NULL)
|
|
|
|
|
{
|
|
|
|
|
nlwarning("<EntityCallbacks::cbDefaultAttack> Invalid entity Id %s", entityId.toString().c_str() );
|
|
|
|
@ -2666,7 +2663,7 @@ void cbDefaultAttack( NLNET::CMessage& msgin, const std::string &serviceName, NL
|
|
|
|
|
|
|
|
|
|
CEntityId targetId = entity->getTarget();
|
|
|
|
|
CPhraseManager::getInstance().defaultAttackSabrina( entityId, targetId );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} // cbDefaultAttack //
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -2676,12 +2673,12 @@ void cbDefaultAttack( NLNET::CMessage& msgin, const std::string &serviceName, NL
|
|
|
|
|
void cbStun( NLNET::CMessage& msgin, const std::string &serviceName, NLNET::TServiceId serviceId)
|
|
|
|
|
{
|
|
|
|
|
H_AUTO(cbStun);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CEntityId charId;
|
|
|
|
|
msgin.serial( charId );
|
|
|
|
|
|
|
|
|
|
CEntityBase* entity = CEntityBaseManager::getEntityBasePtr( charId );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (entity == NULL)
|
|
|
|
|
{
|
|
|
|
|
nlwarning("<EntityCallbacks::cbStun> Invalid entity Id %s", charId.toString().c_str() );
|
|
|
|
@ -2698,12 +2695,12 @@ void cbStun( NLNET::CMessage& msgin, const std::string &serviceName, NLNET::TSer
|
|
|
|
|
void cbWake( NLNET::CMessage& msgin, const std::string &serviceName, NLNET::TServiceId serviceId)
|
|
|
|
|
{
|
|
|
|
|
H_AUTO(cbWake);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CEntityId charId;
|
|
|
|
|
msgin.serial( charId );
|
|
|
|
|
|
|
|
|
|
CEntityBase* entity = CEntityBaseManager::getEntityBasePtr( charId );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (entity == NULL)
|
|
|
|
|
{
|
|
|
|
|
nlwarning("<EntityCallbacks::cbWake> Invalid entity Id %s", charId.toString().c_str() );
|
|
|
|
@ -2741,7 +2738,7 @@ void cbExchangeProposal( NLNET::CMessage& msgin, const std::string &serviceName,
|
|
|
|
|
void cbAcceptExchangeInvitation( NLNET::CMessage& msgin, const std::string &serviceName, NLNET::TServiceId serviceId)
|
|
|
|
|
{
|
|
|
|
|
H_AUTO(cbAcceptExchangeInvitation);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CEntityId charId;
|
|
|
|
|
msgin.serial( charId );
|
|
|
|
|
CCharacter * c = PlayerManager.getChar( charId );
|
|
|
|
@ -2760,7 +2757,7 @@ void cbAcceptExchangeInvitation( NLNET::CMessage& msgin, const std::string &serv
|
|
|
|
|
void cbDeclineExchangeInvitation( NLNET::CMessage& msgin, const std::string &serviceName, NLNET::TServiceId serviceId)
|
|
|
|
|
{
|
|
|
|
|
H_AUTO(cbDeclineExchangeInvitation);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CEntityId charId;
|
|
|
|
|
msgin.serial( charId );
|
|
|
|
|
CCharacter * c = PlayerManager.getChar( charId );
|
|
|
|
@ -2780,7 +2777,7 @@ void cbDeclineExchangeInvitation( NLNET::CMessage& msgin, const std::string &ser
|
|
|
|
|
void cbAcceptExchange( NLNET::CMessage& msgin, const std::string &serviceName, NLNET::TServiceId serviceId)
|
|
|
|
|
{
|
|
|
|
|
H_AUTO(cbAcceptExchange);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CEntityId charId;
|
|
|
|
|
uint8 exchangeId;
|
|
|
|
|
msgin.serial( charId );
|
|
|
|
@ -2801,7 +2798,7 @@ void cbAcceptExchange( NLNET::CMessage& msgin, const std::string &serviceName, N
|
|
|
|
|
void cbEndExchange( NLNET::CMessage& msgin, const std::string &serviceName, NLNET::TServiceId serviceId)
|
|
|
|
|
{
|
|
|
|
|
H_AUTO(cbEndExchange);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CEntityId charId;
|
|
|
|
|
msgin.serial( charId );
|
|
|
|
|
CCharacter * c = PlayerManager.getChar( charId );
|
|
|
|
@ -2821,7 +2818,7 @@ void cbEndExchange( NLNET::CMessage& msgin, const std::string &serviceName, NLNE
|
|
|
|
|
void cbExchangeSeeds( NLNET::CMessage& msgin, const std::string &serviceName, NLNET::TServiceId serviceId)
|
|
|
|
|
{
|
|
|
|
|
H_AUTO(cbExchangeSeeds);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
///\todo : why not an uint64?
|
|
|
|
|
CEntityId charId;
|
|
|
|
|
sint64 quantity;
|
|
|
|
@ -2845,7 +2842,7 @@ void cbExchangeSeeds( NLNET::CMessage& msgin, const std::string &serviceName, NL
|
|
|
|
|
void cbAnimalMount( NLNET::CMessage& msgin, const std::string &serviceName, NLNET::TServiceId serviceId )
|
|
|
|
|
{
|
|
|
|
|
H_AUTO(cbAnimalMount);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CEntityId id;
|
|
|
|
|
msgin.serial( id );
|
|
|
|
|
|
|
|
|
@ -2917,7 +2914,7 @@ void cbAnimalMount( NLNET::CMessage& msgin, const std::string &serviceName, NLNE
|
|
|
|
|
void cbAnimalUnseat( NLNET::CMessage& msgin, const std::string &serviceName, NLNET::TServiceId serviceId )
|
|
|
|
|
{
|
|
|
|
|
H_AUTO(cbAnimalUnseat);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CEntityId id;
|
|
|
|
|
msgin.serial( id );
|
|
|
|
|
|
|
|
|
@ -2979,7 +2976,7 @@ void cbSetPlayerSeason(NLNET::CMessage& msgin, const std::string &serviceName, N
|
|
|
|
|
void cbTeleportPlayer(NLNET::CMessage& msgin, const std::string &serviceName, NLNET::TServiceId serviceId)
|
|
|
|
|
{
|
|
|
|
|
H_AUTO(cbTeleportPlayer);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CEntityId playerEid;
|
|
|
|
|
sint32 x, y, z;
|
|
|
|
|
float t;
|
|
|
|
@ -2990,12 +2987,12 @@ void cbTeleportPlayer(NLNET::CMessage& msgin, const std::string &serviceName, NL
|
|
|
|
|
nlRead(msgin, serial, t);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CCharacter *chr = PlayerManager.getChar(playerEid);
|
|
|
|
|
CCharacter *chr = PlayerManager.getChar(playerEid);
|
|
|
|
|
if (!chr)
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
chr->teleportCharacter(x, y, z, true, true, t);
|
|
|
|
|
chr->teleportCharacter(x, y, z, true, true, t);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -3032,7 +3029,7 @@ void cbRcvValidateSourceSpawnReply( NLNET::CMessage& msgin, const std::string &s
|
|
|
|
|
// End spawning (either leave it or destroy it)
|
|
|
|
|
harvestSource->spawnEnd( canSpawn );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ( ! prospectorDataSetRow.isNull() ) // is null for auto-spawned sources
|
|
|
|
|
{
|
|
|
|
|
// Report the sources found (or not found) to the user
|
|
|
|
@ -3055,7 +3052,7 @@ void cbRcvValidateSourceSpawnReply( NLNET::CMessage& msgin, const std::string &s
|
|
|
|
|
void cbPlayerUnreachable( NLNET::CMessage& msgin, const std::string &serviceName, NLNET::TServiceId serviceId)
|
|
|
|
|
{
|
|
|
|
|
H_AUTO(cbPlayerUnreachable);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CEntityId creatureId;
|
|
|
|
|
msgin.serial( creatureId );
|
|
|
|
|
CCreature * creature = CreatureManager.getCreature( creatureId );
|
|
|
|
@ -3064,7 +3061,7 @@ void cbPlayerUnreachable( NLNET::CMessage& msgin, const std::string &serviceName
|
|
|
|
|
nlwarning("<cbPlayerUnreachable> Unknown creature %s", creatureId.toString().c_str() );
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CEntityId charId;
|
|
|
|
|
msgin.serial( charId );
|
|
|
|
|
CCharacter * character = PlayerManager.getChar( charId );
|
|
|
|
@ -3073,7 +3070,7 @@ void cbPlayerUnreachable( NLNET::CMessage& msgin, const std::string &serviceName
|
|
|
|
|
nlwarning("<cbPlayerUnreachable> Unknown character %s", charId.toString().c_str() );
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Do nothing for now, damage removal is done in aggro lost.
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|