예제 #1
0
void Tracker::CreateTracker(WorldSession * adder, const char * args)
{
	if(!*args)
		return;

	char *pname = strtok((char*)args, " ");
	if(!pname)
	{
		if( adder != NULL )
			sChatHandler.RedSystemMessage(adder, "No name specified.");

		return;
	}
	Player *toAdd = objmgr.GetPlayer((const char*)pname, false);
	if( toAdd && toAdd->GetSession() && toAdd->GetSession()->GetSocket() )
	{
		WorldSession * toAddSession = toAdd->GetSession();
		TrackedPlr *user			= new TrackedPlr;
		user->Id					= sTracker.GenerateID();
		user->AcctId				= toAddSession->GetAccountId();
		user->Name					= toAddSession->GetAccountName();
		user->IP_Address			= toAddSession->GetSocket()->GetIP();

		AddTracker(user, false);

		char msg[128];
		sprintf(msg, "%sTracker:|r User [%s] is now being tracked (Tracker ID: %u)", MSG_COLOR_CYAN, toAddSession->GetAccountName().c_str(), (uint32)user->Id);
		sWorld.SendGMWorldText( msg );
	}
	else
	{
		if( adder != NULL )
			sChatHandler.RedSystemMessage(adder, "Server was unable to handle your request, please check your syntax.");
	}
}
예제 #2
0
void ClusterInterface::DestroySession(uint32 sid)
{
	WorldSession * s = _sessions[sid];
	_sessions[sid] = 0;
	if(s)
	{
		/* todo: replace this with an event so we don't remove from the wrong thread */
		if(s->GetPlayer())
			s->LogoutPlayer(true);

		delete s->GetSocket();
		delete s;
	}
}
예제 #3
0
bool ChatHandler::HandleFullDismountCommand(const char * args, WorldSession *m_session)
{
	Player* p_target = getSelectedChar(m_session, false);
	if(!p_target)
	{
		SystemMessage(m_session, "Select a player or yourself first.");
		return false;
	}

   if(!p_target->IsInWorld())
       return false;

	WorldSession* sess = p_target->GetSession();
   
	if(!sess || !sess->GetSocket())
   	{
       RedSystemMessage(m_session, "Not able to locate player %s.", sess->GetPlayer()->GetName()); 
       return false;
	}

	if(!p_target->m_taxiPaths.size())
		p_target->SetTaxiState(false);

	p_target->SetTaxiPath(NULL);
	p_target->UnSetTaxiPos();
	p_target->m_taxi_ride_time = 0;

	p_target->SetUInt32Value(UNIT_FIELD_MOUNTDISPLAYID , 0);
	p_target->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_MOUNTED_TAXI);
	p_target->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_LOCK_PLAYER);
	p_target->Dismount();
	sEventMgr.RemoveEvents(p_target, EVENT_PLAYER_TAXI_INTERPOLATE);

	if( p_target->m_taxiPaths.size() )
		p_target->m_taxiPaths.clear();
	return true;
}