Unban hack

ok i reinstalled the py script ... no logs and players are still able to connect that are not in the whitelist... no logs being created
whitelist.py is loaded and I don't see any errors... I'm probably doing something wrong..
I deleted whitelist folder and created a new one.
Made whitelist.py out of your script above and placed it inside /Save/PyPlugins/Whitelist
Make sure permissions are correct
Start server
People connect but no log files are created inside the whitelist folder or the logs folder
 
Last edited:
ok i reinstalled the py script ... no logs and players are still able to connect that are not in the whitelist... no logs being created
whitelist.py is loaded and I don't see any errors... I'm probably doing something wrong..
I deleted whitelist folder and created a new one.
Made whitelist.py out of your script above and placed it inside /Save/PyPlugins/Whitelist
Make sure permissions are correct
Start server
People connect but no log files are created inside the whitelist folder or the logs folder
I think you are pasting the code wrong since in python idents are very, very sensitive.


Try downloading the zip
 

Attachments

  • Whitelist.zip
    1.1 KB · Views: 4
OK I removed my whitelist folder and unzipped this file to the norm place.. It loads and creates the .INI files but no logs. There's 28 players on the server all not in the whitelist
 
OK I removed my whitelist folder and unzipped this file to the norm place.. It loads and creates the .INI files but no logs. There's 28 players on the server all not in the whitelist
U sure somebody connected to the server after you reloaded the plugin? The log file should be in the whitelist folder :/
 
i just removed the logs and restarted the server so the logs arnt so huge....
 

Attachments

  • Log_28_12_2014.log.txt
    22.6 KB · Views: 2
aaahhh would u believe i moved tpfriend to magma. and now im getting whitelistdebuglog ....still not working proper though. i have nobody in the whitelist yet players are online and playing
 

Attachments

  • Whitelistdebuglog.log.txt
    3.3 KB · Views: 2
Python:
__author__ = 'DreTaX'
__version__ = '1.0'

import clr

clr.AddReferenceByPartialName("Fougerite")
import Fougerite

"""
    Class
"""


class Whitelist:
    """
        Methods
    """

    red = "[color #FF0000]"
    green = "[color #009900]"

    def On_PluginInit(self):
        self.Whitelist()
        self.DisconnectInfo()

    def Whitelist(self):
        if not Plugin.IniExists("Whitelist"):
            ini = Plugin.CreateIni("Whitelist")
            ini.Save()
        return Plugin.GetIni("Whitelist")

    def DisconnectInfo(self):
        if not Plugin.IniExists("DisconnectInfo"):
            ini = Plugin.CreateIni("DisconnectInfo")
            ini.AddSetting("DisconnectInfo", "Message", "You aren't on whitelist!")
            ini.Save()
        return Plugin.GetIni("DisconnectInfo")

    def TrytoGrabID(self, Player):
        try:
            id = Player.SteamID
            return id
        except:
            return None

    def isMod(self, id):
        if DataStore.ContainsKey("Moderators", id):
            return True
        return False

    def On_PlayerConnected(self, Player):
        id = self.TrytoGrabID(Player)
        if id is None:
            try:
                Player.Disconnect()
            except:
                pass
            return
        if Player.Admin or self.isMod(id):
            return
        name = Player.Name
        whitelist = self.Whitelist()
        checkwl = whitelist.GetSetting("WhiteList", id)
        if checkwl is None:
            ini = self.DisconnectInfo()
            msg = ini.GetSetting("DisconnectInfo", "Message")
            for x in xrange(1, 4):
                Player.Message(self.red + msg)
                Player.Message(self.red + "Your ID: " + self.green + id)
            Plugin.Log("WhiteListJoinLog", str(name) + " Tried to join with id: " + id)
            try:
                Player.Disconnect()
            except:
                pass

    def On_Command(self, Player, cmd, args):
        if not Player.Admin and not self.isMod(Player.SteamID):
            return
        if cmd == "addtowl":
            if len(args) != 1:
                Player.Message("Usage: /addtowl id")
                Player.Message("Example: /addtowl 7656119796999999")
                return
            ini = self.Whitelist()
            idtoadd = str(args[0])
            if not idtoadd.isdigit():
                Player.Message("ID can only contain numbers")
                return
            ini.AddSetting("WhiteList", idtoadd, "1")
            ini.Save()
        elif cmd == "delfromwl":
            if len(args) != 1:
                Player.Message("Usage: /delfromwl id")
                Player.Message("Example: /delfromwl 7656119796999999")
                return
            ini = self.Whitelist()
            idtodel = str(args[0])
            if not idtodel.isdigit():
                Player.Message("ID can only contain numbers")
                return
            ini.DeleteSetting("WhiteList", idtodel)
            ini.Save()
            Player.Message("ID: " + idtodel + " removed.")
        elif cmd == "lwhitelist":
            ini = self.Whitelist()
            enum = ini.EnumSection("WhiteList")
            Player.Message("Current IDs on whitelist: ")
            for id in enum:
                Player.Message("- " + id)