コード例 #1
0
ファイル: ConsoleCommands.cpp プロジェクト: Bootz/arcticdev
bool HandlePlayerInfoCommand(BaseConsole * pConsole, int argc, const char * argv[])
{
	if(argc < 2)
		return false;

	RPlayerInfo* plr = sClientMgr.GetRPlayer(std::string(argv[1]));
	if( plr == NULL || plr->GetSession() == NULL )
	{
		pConsole->Write("Player not found.\r\n");
		return true;
	}

	pConsole->Write("Player: %s\r\n", plr->Name);
	pConsole->Write("IP: %s\r\n", plr->GetSession()->GetSocket() ? plr->GetSession()->GetSocket()->GetRemoteIP().c_str() : "disconnected");
	pConsole->Write("Level: %u\r\n", plr->Level);
	pConsole->Write("Account: %s\r\n", plr->GetSession()->GetAccountName());
	return true;
}
コード例 #2
0
ファイル: ConsoleCommands.cpp プロジェクト: Bootz/arcticdev
bool HandleKickCommand(BaseConsole * pConsole, int argc, const char * argv[])
{
	if(argc < 3)
		return false;

	RPlayerInfo* pPlayer;

	pPlayer = sClientMgr.GetRPlayer(std::string(argv[1]));

	if( pPlayer == NULL || pPlayer->GetSession() == NULL)
	{
		pConsole->Write("Could not find player, %s.\r\n", argv[1]);
		return true;
	}

	//bye f****r :D
	pPlayer->GetSession()->GetSocket()->Disconnect();

	pConsole->Write("Kicked player %s.\r\n", pPlayer->Name);
	return true;
}
コード例 #3
0
ファイル: ConsoleCommands.cpp プロジェクト: AscNHalf/AscNHalf
bool HandleKickCommand(BaseConsole * pConsole, int argc, const char * argv[])
{
    if(argc < 3)
        return false;

    RPlayerInfo* pPlayer;

    pPlayer = sClientMgr.GetRPlayer(std::string(argv[1]));

    if( pPlayer == NULL || pPlayer->GetSession() == NULL)
    {
        pConsole->Write("Could not find player, %s.\r\n", argv[1]);
        return true;
    }

    //bye f****r :D
    pPlayer->GetSession()->GetSocket()->Disconnect();


    /*
    char pAnnounce[1024];
    	Player* pPlayer;

    	pPlayer = objmgr.GetPlayer(argv[1]);
    	if( pPlayer == NULL )
    	{
    		pConsole->Write("Could not find player, %s.\r\n", argv[1]);
    		return true;
    	}
    	string outstr;
    	ConcatArgs(outstr, argc, 1, argv);
    	snprintf(pAnnounce, 1024, "%sConsole:|r %s was kicked from the server for: %s.", MSG_COLOR_LIGHTBLUE, pPlayer->GetName(), argv[2]);
    	pPlayer->BroadcastMessage("You were kicked by the console for: %s", argv[2]);
    	sWorld.SendWorldText(pAnnounce, NULL);
    	pPlayer->Kick(5000);*/

    pConsole->Write("Kicked player %s.\r\n", pPlayer->Name);
    return true;
}