Follow us on
Follow us on Facebook Follow us on Twitter Watch us on YouTube


MMOCoin

Results 1 to 2 of 2
  1. #1
    Graphics Guru

    Join Date
    Feb 2009
    Posts
    1,377
    Rep Power
    24
    Reputation
    382

    Post Anti Dual Boxing Script


    Register to remove this ad

    Script that can help stop multiple logins per IP Address.

    I am not the developer of this script
    , I'm just sharing this line of code with everyone that wants to use it on their server, if they so choose.
    This script will only work on any revision after (7240faf), which was committed on June 21st, 2014. Some edits might be required, so keep that in mind.

    Notice
    : Players are still able to login to the character screen with this, but not the world. After the player(s) hit the "Enter World" button, they will be disconnected on that secondary account.

    Code:
    /***
     *  @project: Firestorm Freelance
     *  @author: Meltie2013 (github) aka Lilcrazy
     *  @copyright: 2017
     */
    
    #include "ScriptMgr.h"
    
    #include "World.h"
    #include "WorldSession.h"
    
    // Check to see if the player is attempting to multi-box
    class multi_login_check : public PlayerScript
    {
    public:
        multi_login_check() : PlayerScript("multi_login_check") { }
    
        void OnLogin(Player* player, bool /*firstLogin*/) override
        {
            SessionMap sessions = sWorld->GetAllSessions();
            for (SessionMap::iterator itr = sessions.begin(); itr != sessions.end(); ++itr)
            {
                if (Player* login = itr->second->GetPlayer())
                {
                    if (player != login)
                    {
                        // If Remote Address matches, remove the player from the world
                        if (player->GetSession()->GetRemoteAddress() == login->GetSession()->GetRemoteAddress())
                            player->GetSession()->KickPlayer();
                    }
                }
            }
        }
    };
    
    
    void AddSC_player_session_checks()
    {
        new multi_login_check;
    }




  2. #2
    Beginner

    Join Date
    Jan 2018
    Posts
    15
    Rep Power
    9
    Reputation
    2

    Register to remove this ad
    I want to put this script in my source but I have no knowledge of c ++ and I get this error can help me to fix it to compileCaptura.jpg

 

 

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -5. The time now is 04:29 PM.
Powered by vBulletin® Copyright ©2000-2026, Jelsoft Enterprises Ltd.
vBulletin Licensed to: MMOPro.org
vBulletin Skin By: PurevB.com