Release AntiNameChanger
#1
As requested a plugin against name changers. It checks every 4-12 seconds if a player changed his name. When he did it a specific time an action will be taken.

Requires @Nukem's Server Addon 1.290+

sv_config.ini entries:
Code:
[NameChange] //After how many name changes action should be taken Changes=3 //Which action should be taken (kickClient, tempbanClient, banClient) Command=kickClient //Message to be displayed on server when an action is being taken, valid placeholder {0} = last name {1} = xuid //Example: Player {0} with the XUID {1} has been kicked ServerMsg= //Reason for action (displayed to the client when action is being taken) CommandMsg=

Source code
Code:
using System; using System.Collections.Generic; using System.Text; using Addon; using System.Threading; namespace AntiNameChanger { public class Class1 : CPlugin { //Store old names Dictionary<string, string> OldNames = new Dictionary<string, string>(); //Store name changes Dictionary<string, int> NameChanges = new Dictionary<string, int>(); //How many changes to take action int Changes = 3; string command = "kickClient"; string commandMsg = string.Empty; string srvMsg = string.Empty; public override void OnFastRestart() { OnMapChange(); } public override void OnMapChange() { OldNames.Clear(); NameChanges.Clear(); } public override void OnServerLoad() { try { ServerPrint("\n AntiNameChanger loaded \n Author: zxz0O0 \n Thanks to Nukem, Jariz and Pozzuh\n"); ServerPrint(" youtube.com/zxz0O0 \n itsmods.com\n"); Changes = int.Parse(GetServerCFG("NameChange", "Changes", "3")); command = GetServerCFG("NameChange", "Command", "kickClient"); srvMsg = GetServerCFG("NameChange", "ServerMsg", string.Empty); ThreadPool.QueueUserWorkItem(new WaitCallback(CheckWorker)); } catch (Exception e) { ServerPrint(e.Message); } } private void CheckWorker(object o) { Random i = new Random(); while (true) { int q = i.Next(0, 80); Thread.Sleep(4000 + q*100); CheckNames(); } } private void CheckNames() { try { foreach (ServerClient c in GetClients()) { //If player is already registred if (OldNames.ContainsKey(c.XUID)) { //If name didn't change if (OldNames[c.XUID] == c.Name) continue; //Else add to NameChanges int else { //If already stored increase value if (NameChanges.ContainsKey(c.XUID)) NameChanges[c.XUID]++; else NameChanges.Add(c.XUID, 1); //Store new name again OldNames[c.XUID] = c.Name; //Check if action should be taken if (Changes <= NameChanges[c.XUID]) { if (!string.IsNullOrEmpty(srvMsg)) ServerSay(string.Format(srvMsg, c.Name, c.XUID), false); ServerPrint("AntiNameChanger executed: " + command + " " + c.ClientNum + " \"" + commandMsg + "\""); ServerPrint("AntiNameChanger Last Name: " + c.Name); ServerCommand(command + " " + c.ClientNum + " \"" + commandMsg + "\""); } } } else OldNames.Add(c.XUID, c.Name); } } catch (Exception e) { ServerPrint(e.Message); } } } }


Attached Files
.zip   AntiNameChanger.zip (Size: 2.97 KB / Downloads: 663)
[Image: azuw.jpg]
Reply

#2
@SuperNovaAO mad
[Image: lQDUjba.jpg]
Reply

#3
(03-27-2012, 18:10)OrangePL Wrote: @SuperNovaAO mad

He said he would bypass this in a second. But this will work for the other 99%.

Noob hackers tommorow:
[Image: we-are-the-99-percent.png] [Image: success-kid-cut-out.png]
Reply

#4
(03-27-2012, 18:24)surtek Wrote:
(03-27-2012, 18:10)OrangePL Wrote: @SuperNovaAO mad

He said he would bypass this in a second. But this will work for the other 99%.
How can he bypass it when I use a random wait period Troll
[Image: azuw.jpg]
Reply

#5
(03-27-2012, 18:41)zxz0O0 Wrote:
(03-27-2012, 18:24)surtek Wrote:
(03-27-2012, 18:10)OrangePL Wrote: @SuperNovaAO mad

He said he would bypass this in a second. But this will work for the other 99%.
How can he bypass it when I use a random wait period Troll

He is @SuperNovaAO He can do whatever sh#t he wants to... Troll

Thanks Barata...
Don't worry if things aren't the way you planned, in the end everything will solve itself...
Reply

#6
He can make a hack which randomly guesses these periods Troll
Reply

#7
thankyou
[Image: b_560_95_1.png]


[Image: b_560_95_1.png]

Reply

#8
Weird that this hasn't been made before, good job!
(08-10-2011, 12:58)Pozzuh Wrote:
Se7en Wrote:Stealed, from cod4 mod ...
look who's talking

[Release] Old School Mod v2.2
[Release] Scroll menu

Reply

#9
nice +rep
Reply

#10
Random() is pseudo random and the seed the server starts with can be calculated.

Then I make a Random()-generator with the same seed -> same random numbers.

But my server crash exploit is much more fun now.
Also, have you tried it?
Reply



Possibly Related Threads…
Thread Author Replies Views Last Post
  [Release] AntiNameChanger [Z00MBY] Alex 14 12,590 02-18-2013, 09:18
Last Post: JariZ

Forum Jump:


Users browsing this thread:
1 Guest(s)

Forum Powered By MyBB, Theme by © 2002-2026 Melroy van den Berg.