Ban types

Started by Mötley, May 07, 2016, 03:57 PM

Previous topic - Next topic

Mötley

Okay so I want to eventually have stronger ban methods than just a IP ban,.

Does XML scripting in the style of [LU] exist? Would be interesting to script in a replica of the banlist.xml from [LU]

For now I am only using a real basic setting for ban types until I configure how I really want to actually do it,.

So If anyone has any Ideas and or methods please be kind and share., I prefer to not use SQ_Lite methods,..

This method can be bypassed as we all know...
    if (cmd == "ban") {
      if ((Level < AdminFlagTypes.Ban)) {
        MessagePlayer( "Invalid command! Type /cmds", player);
        return true;
      }
   
      if (!text) {
         MessagePlayer( "Ban player: /ban [id]", player);
         return true;
      }
 
      local id = FindPlayer(text.tointeger());
   
      if (!id) {
         MessagePlayer( "Player is not connected", player);
         return true;   
      }
         
      Message( "Admin " + player.Name + " has banned " + id.Name, );
      BanPlayer(id);

      return true;
    }

KAKAN

no way to do in XML, but a way to do in JSON is there. However, the JSON plugin is outdated :(
Though, XML will be implemented, but later.
oh no

Mötley

So WriteIni can supposedly corrupt data? I think this would be the last clean resort, also would be nice to add in, I can make subnet bans without Sq_Lite as well. so any other method than Sq_Lite bans would be nice. If I can not figure out a correct way hear, I will just configure something..

Coolkid

Quote from: Mötley on May 07, 2016, 03:57 PMOkay so I want to eventually have stronger ban methods than just a IP ban,.

Does XML scripting in the style of [LU] exist? Would be interesting to script in a replica of the banlist.xml from [LU]

For now I am only using a real basic setting for ban types until I configure how I really want to actually do it,.

So If anyone has any Ideas and or methods please be kind and share., I prefer to not use SQ_Lite methods,..

This method can be bypassed as we all know...
    if (cmd == "ban") {
      if ((Level < AdminFlagTypes.Ban)) {
        MessagePlayer( "Invalid command! Type /cmds", player);
        return true;
      }
   
      if (!text) {
         MessagePlayer( "Ban player: /ban [id]", player);
         return true;
      }
 
      local id = FindPlayer(text.tointeger());
   
      if (!id) {
         MessagePlayer( "Player is not connected", player);
         return true;   
      }
         
      Message( "Admin " + player.Name + " has banned " + id.Name, );
      BanPlayer(id);

      return true;
    }

How can it be bypassed i would prefer sqlite byt how would it be byapassed how can player byapass a UID ban???????

Mötley

That is a IP ban.  I wish it were UID

ysc3839

Quote from: Coolkid on May 07, 2016, 09:27 PM
Quote from: Mötley on May 07, 2016, 03:57 PMOkay so I want to eventually have stronger ban methods than just a IP ban,.

Does XML scripting in the style of [LU] exist? Would be interesting to script in a replica of the banlist.xml from [LU]

For now I am only using a real basic setting for ban types until I configure how I really want to actually do it,.

So If anyone has any Ideas and or methods please be kind and share., I prefer to not use SQ_Lite methods,..

This method can be bypassed as we all know...
    if (cmd == "ban") {
      if ((Level < AdminFlagTypes.Ban)) {
        MessagePlayer( "Invalid command! Type /cmds", player);
        return true;
      }
   
      if (!text) {
         MessagePlayer( "Ban player: /ban [id]", player);
         return true;
      }
 
      local id = FindPlayer(text.tointeger());
   
      if (!id) {
         MessagePlayer( "Player is not connected", player);
         return true;   
      }
         
      Message( "Admin " + player.Name + " has banned " + id.Name, );
      BanPlayer(id);

      return true;
    }

How can it be bypassed i would prefer sqlite byt how would it be byapassed how can player byapass a UID ban???????
Just hook something and you can change the UID to anything you want.

Xmair

I don't really get what you mean, but, this might help you.
Subban system || UID ban system.

Credits to Boystang!

VU Full Member | VCDC 6 Coordinator & Scripter | EG A/D Contributor | Developer of VCCNR | Developer of KTB | Ex-Scripter of EAD

Mötley

I would prefer to just ban the uid normally,. As a project I am working on I need to keep anything Sq_Lite related out (hashes)

I can create a ban system with hashes, I can even create subnet bans with hashes. I want to know of any other possible ways of ban methods, I have tried BanPlayer(id.UniqueID); but of course errors.

Any Idea's? maybe Stormeus? anything else I could do to the banlist file before I do anything else first?

KAKAN

ah well,
@Stormeus I was trying this code:
foreach( idx, value in CPlayer )
print( idx + " : " + value );
Well, it didn't show UID or UID2 or UniqueID in the function list :(
oh no

Stormeus

@KAKAN It's not a function. It's a property hidden in the _get metamethod.

.

Because UID, UID2 is a property. And properties are in two get/set tables that are retrieved by the _get/_set meta-methods whenever the requested index does not exist.

foreach (idx, val in CPlayer.__getTable) print(idx + " : " + value);
foreach (idx, val in CPlayer.__setTable) print(idx + " : " + value);
http://forum.vc-mp.org/?topic=2085.msg15450#msg15450
.

KAKAN

Quote from: Stormeus on May 08, 2016, 04:06 AM@KAKAN It's not a function. It's a property hidden in the _get metamethod.
I was thinking of that. I got another question, can we have some private variables inside a class in Squirrel?

:edit: Oops, my fault, this one is working:
foreach( idx, value in CPlayer.__getTable )
print( idx + " : " + value );
oh no

.

Quote from: KAKAN on May 08, 2016, 04:09 AMI got another question, can we have some private variables inside a class in Squirrel?

Squirrel has no concept of encapsulation. Maybe, just maybe, you can fool the language using the _get/_set meta-methods to stop direct access. However, that encapsulation can be broken with indirect methods of access.
.

Mötley

So... lol I take it BanPlayer(id.UniqueID); would never work in any way?

the error is

parameter 1 has an invalid type string expected instance

KAKAN

man.
BanPlayer is a inbuilt function, which needs to have a player instance.
Use your custom ban function instead.
function Ban( uid )
{
//Open the INI file
//Write the info
//Done
}


Quote from: . on May 08, 2016, 04:12 AM
Quote from: KAKAN on May 08, 2016, 04:09 AMI got another question, can we have some private variables inside a class in Squirrel?

Squirrel has no concept of encapsulation. Maybe, just maybe, you can fool the language using the _get/_set meta-methods to stop direct access. However, that encapsulation can be broken with indirect methods of access.
got it, thanks
oh no