Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // This modified version doesn't permanently ban users! This just limits USERS BY IP!!!
- // (Also note that this cannot be modified so go http://bit.ly/ogarIPLimit for extra details / updates)
- // Original Script by /u/AgaryServer on Reddit
- // Modified Script by /u/Q79X on Reddit
- // Please Put " this.ipCounts= []; " inside the function GameServer (~ Line 27) or it will break your server (You Will NOT be HAPPY)
- // ALWAYS REMEMBER TO BACKUP FILES INCASE YOU DID SOMETHING HORRIBLY WRONG
- // PLACE ↓ IP LIMIT CODE ↓ ~ Line 185 / AFTER THE "// -----/Client authenticity check code -----" LINE
- // ----------- Client IP limiting -----------
- // Check if we're past the limit for this IP
- if(this.ipCounts[ws._socket.remoteAddress] > 5) {
- ws.close();
- this.ipCounts[ws._socket.remoteAddress]--;
- return;
- }
- // Increment the count for this IP
- if(this.ipCounts[ws._socket.remoteAddress]) {
- this.ipCounts[ws._socket.remoteAddress]++;
- } else {
- this.ipCounts[ws._socket.remoteAddress] = 1;
- }
- // -----------/Client IP limiting --------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement