示例#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 CConsole::PlayerInfo(char* str)
{
	char player[100];
	if(sscanf(str, "%s", player) != 1)
		return;

	Player * _plr = objmgr.GetPlayer(player, false);
	if(!_plr)
	{
		sLog.outString("Cannot find online player %s", str);
		return;
	}
	
	if(!_plr) return;
	if(!_plr->GetSession())
	{
		sLog.outString("ERROR: this player hasn't got any session !");
		return;
	}

	WorldSession* sess = _plr->GetSession();

		static const char* _classes[12] =
	{"None","Warrior", "Paladin", "Hunter", "Rogue", "Priest", "None", "Shaman", "Mage", "Warlock", "None", "Druid"};
	static const char* _races[12] =
	{"None","Human","Orc","Dwarf","Night Elf","Undead","Tauren","Gnome","Troll","None","Blood Elf","Draenei"};


	sLog.outColor(TGREEN, "Name: ");
	sLog.outColor(TNORMAL, "%s\n", _plr->GetName());
	sLog.outColor(TGREEN, "Account: ");
	sLog.outColor(TNORMAL, "%s\n", sess->GetAccountName().c_str());
	sLog.outColor(TGREEN, "Level: ");
	sLog.outColor(TNORMAL, "%d\n",  _plr->getLevel());
	sLog.outColor(TGREEN, "Race: ");
	sLog.outColor(TNORMAL, "%s\n", _races[_plr->getRace()]);
	sLog.outColor(TGREEN, "Class: ");
	sLog.outColor(TNORMAL, "%s\n", _classes[_plr->getClass()]);
	sLog.outColor(TGREEN, "Map: ");
	sLog.outColor(TNORMAL, "%d\n",  _plr->GetMapId());
	sLog.outColor(TGREEN, "Banned: ");
	sLog.outColor(TNORMAL, "%s\n",  (_plr->IsBanned() ? "Yes" : "No"));
}