• [Release] Antinoob (auto-kick script by playtime)
    52 replies, posted
[QUOTE=Leystryku;45881549]If you want to give people coding advice at least do it right. Your code isn't much better than his, since yours is bad too. local net_start = net_start or net.Start will never work. Go read up what locals do[/QUOTE] Actually this would work perfectly fine as net_start only needs to be in scope for the function declaration of net.Start, it doesn't need to be called as a global. For example, here is a simple print detour: [code] local old_print = old_print or print function print(txt) old_print("'old_print' is in scope because it's used in the function declaration of 'print'") end [/code] Now here's what happens when I call print outside of scope of old_print: [img]http://i.gyazo.com/1e99109cbd3957edf2b3e343d691db78.png[/img]
[QUOTE=Hafnium;45882297]Actually this would work perfectly fine as net_start only needs to be in scope for the function declaration of net.Start, it doesn't need to be called as a global. For example, here is a simple print detour: [code] local old_print = old_print or print function print(txt) old_print("'old_print' is in scope because it's used in the function declaration of 'print'") end [/code] Now here's what happens when I call print outside of scope of old_print: [img]http://i.gyazo.com/1e99109cbd3957edf2b3e343d691db78.png[/img][/QUOTE] I'm sorry but you're still wrong. local net_start = net_start or net.Start will never work because net_start is a local. The hole reason for the "whatever = whatever or func" thing is to keep stuff from re-overwriting on autorefresh, breaking/messing up stuff. However, what you're doing won't do anything more than local net_start = net.Start. If you're using local whatever = whatever or func then it needs to be a global, else it won't work since -> local. Also you're not returning anything on your net overwrite, possibly breaking other addons since net normally returns something on net.Start Now please go look at the lua pil
[QUOTE=Leystryku;45882354]I'm sorry but you're still wrong. local net_start = net_start or net.Start will never work because net_start is a local. The hole reason for the "whatever = whatever or func" thing is to keep stuff from re-overwriting on autorefresh, breaking/messing up stuff. However, what you're doing won't do anything more than local net_start = net.Start. If you're using local whatever = whatever or func then it needs to be a global, else it won't work since -> local. Now please go look at the lua pil[/QUOTE] I'm sorry, I completely misunderstood what you meant but yea, you are right, my code is flawed. For those who didn't understand what he meant, basically nettsam's code won't cause a stack overflow because old_print is declared as local, therefor it can't be existent before the code runs, thus checking if it exists is useless.
[QUOTE=Hafnium;45882385]I'm sorry, I completely misunderstood what you meant but yea, you are right, my code is flawed. For those who didn't understand what he meant, basically nettsam's code won't cause a stack overflow because old_print is declared as local, therefor it can't be existent before the code runs, thus checking if it exists is useless. I feel stupid now ^.^[/QUOTE] It wasn't that it was flawed, just useless. And besides, there were major errors in doing it the way he posted. I posted some code demonstrating exactly how to do it above. Without doing everything I did, you would simply cause lua errors when the net buffer was not created.
Who would have thought that a bunch of people could outsmart a guy kicking players by making the client do checks.
Well they can but line 118 [U]doesn't[/U] say: [code]ti > req_h[/code] Still works perfectly. Getting just the more experienced player which are enough. And as long you can't show me how to do it better, I can't believe that my script is bad for what it does and how it does it. Edit: Also as another security measure i could also generate random netweorkstrings.
[QUOTE=Uke;45889284] Also as another security measure i could also generate random netweorkstrings.[/QUOTE] Which you would have to network to the client.
Look at line 50. how I send the security code with nwstr.
funny thing is banning for a vac ban or low hours probably only causes MORE cheaters/minges there are so many smarter ways to do this
[QUOTE=J!NX;45889598]there are so many smarter ways to do this[/QUOTE] But obviously no one can give an example. I mean you're(plural) talking about how bad it is but can't give any reasons. While reading the comments I get to think everybody here can do way much better but when I ask how, everbody is silent. That way I can't take anyone serious. [QUOTE=Hafnium;45874232]It's still a horrible way to get rid of minges and[U] the code is horribly approached[/U], here's where I lost my marbles: [code] ply:SendLua("net.Start(\"noobcheck_playtime\"); net.WriteString(\""..nwstr.."\"); net.WriteFloat(achievements.GetCount(5)); net.SendToServer()") [/code] [/QUOTE] How can I do better? (and yes I'm really trying to take this 16yo kiddo serious) Or best comment so far: [QUOTE=dingusnin;45881798]It's not a question of 'if' ... it's a fact.[/QUOTE] This is just bullshit.
[QUOTE=Uke;45890087]But obviously no one can give an example. I mean you're(plural) talking about how bad it is but can't give any reasons. While reading the comments I get to think everybody here can do way much better but when I ask how, everbody is silent. That way I can't take anyone serious.[/QUOTE] The correct way to do this is on the server check the players steam profile for their play time, this value is not spoofable by the client.
My only worry about that way is that it kicks players with their steam profile set to private. Secondly how do I get a players steam profile page?
[QUOTE=Uke;45891334]My only worry about that way is that it kicks players with their steam profile set to private. Secondly how do I get a players steam profile page?[/QUOTE] Obviously not with Player:SteamID64, eh?
I'm sry that I didn't know about that command until now. Thank you anyway.
[QUOTE=Hafnium;45878225]Are you stupid? net_start is a local so unless it's declared before my script runs (which won't happen) it won't break anything. You obviously don't know much about detouring either, what happens with your code is that assigns net.Start to net_start, you then proceed to detour net.Start, net.Start is now detoured, the next time you run your code net_start will be assigned with net.Start again, this time it's assigned with the detoured version so net_start now contains the detoured version of net.Start, this means your detoured function will now run twice everytime you call net.Start, the loop continues until your game starts getting slower or it crashes, nice. Jeeze, no wonder you got VAC banned.[/QUOTE] It can be declared before your script loads, though, just look at how LeyAC works. He loads before autorun using a super secret method that totally hasn't been C+P'd since LeyAC was released over and over again, bottom line, the server can load scripts before autorun.
[QUOTE=Reyjr43;45906125]It can be declared before your script loads, though, just look at how LeyAC works. He loads before autorun using a super secret method that totally hasn't been C+P'd since LeyAC was released over and over again, bottom line, the server can load scripts before autorun.[/QUOTE] That doesn't explain why the server would create global called net_start
[QUOTE=Hafnium;45907366]That doesn't explain why the server would create global called net_start[/QUOTE] Just to prevent people from using your example
[QUOTE=King Penisless;45890224]The correct way to do this is on the server check the players steam profile for their play time, this value is not spoofable by the client.[/QUOTE] The correct way to do this would be: using http.Fetch with [url]http://api.steampowered.com/ISteamUserStats/GetUserStatsForGame/v0002/?appid=4000&key=KEY&steamid=ID[/url] [code]{ "name": "GMA_X_MINUTES_STAT", "value": 68715 },[/code] (my playtime) Although I don't know if this is the achievement value or w/e (could be changed with SAM) but it works even if their profile is private etc. If that one is the achievement value, you can always use: [url]http://api.steampowered.com/IPlayerService/GetRecentlyPlayedGames/v0001/?appid=4000&key=KEY&steamid=ID[/url] and get [code] { "appid": 4000, "name": "Garry's Mod", "playtime_2weeks": 4655, "playtime_forever": 245075, "img_icon_url": "d9101cbeddcc4ff06c7fa1936c3f381b0bbf2e92", "img_logo_url": "dca12980667e32ab072d79f5dbe91884056a03a2" },[/code] I'm not really sure why these numbers are different though...
[QUOTE=Hafnium;45878225]Are you stupid? net_start is a local so unless it's declared before my script runs (which won't happen) it won't break anything. You obviously don't know much about detouring either, what happens with your code is that assigns net.Start to net_start, you then proceed to detour net.Start, net.Start is now detoured, the next time you run your code net_start will be assigned with net.Start again, this time it's assigned with the detoured version so net_start now contains the detoured version of net.Start, this means your detoured function will now run twice everytime you call net.Start, the loop continues until your game starts getting slower or it crashes, nice. Jeeze, no wonder you got VAC banned.[/QUOTE] inside lua/autorun/client/nicedude.lua [code] function net_start() end [/code] inside lua/nicedude.lua [code] local net_start = net_start or net.Start function net.Start(str) if str == "noobcheck_playtime" then print( "test" ) end net_start(str) end net.Start( "noobcheck_playtime" ) [/code] Output: nothing because its using the original detour called inside autorun/client/nicedude.lua which doesn't do anything wtf are you trying to prove? yes there's no reason for a server to create a global named net_start but there is also no reason to do it the silly way you are doing it i was vac banned for using ley's cheat in singleplayer
[QUOTE=nettsam]garbage[/QUOTE] -snip-, you're laughable.
[QUOTE=Hafnium;45874232]It's still a horrible way to get rid of minges and the code is horribly approached, here's where I lost my marbles: [code] ply:SendLua("net.Start(\"noobcheck_playtime\"); net.WriteString(\""..nwstr.."\"); net.WriteFloat(achievements.GetCount(5)); net.SendToServer()") [/code] [code] local net_start = net_start or net.Start function net.Start(str) if str == "noobcheck_playtime" then return end net_start(str) end [/code][/QUOTE] I don't really see an issue with using a method like this or similar, especially for this kind of thing. Yes he can probably use it as a learning experience to find a better method, but is anyone [b]really[/b] gonna be so adamant that they want to play on his server that they are going to specifically detour to get past his check? Pulling information from the client can be plenty effective for a lot of things like this which are not critical to being able to play (In this case if he doesn't get data from the client he's also going to have to force everyone who joins to have public profiles also), and if you are really super paranoid that 1 in 5000 people is going to use a detour to get around it, you can just add some extra basic authentication to catch out anyone just blocking it from running. Before SethHack went down, I ran a 100% detection rate SethHack cheat which consisted of a single clientside IF statement (if PrintTable then *isacheater* end), this could have easily been found and fixed ([B]Even after I posted it on Facepunch due to GM12 release coming, and saw some posts crop up on HackForums quoting me from here, nothing was done about it[/B]), or if someone wanted they could have just blocked the contact to the server flagging someone as a cheater, yet I ran it for 6 months+ with ZERO issues and shared it with a few other TTT servers I respected on the condition that we all shared the banlist. Probably also due to the fact that we would watch the flagged person (TTT) and ban them for RDM or ghosting when they made it obvious they were cheating, so we rarely got hit with devnull like the other communities with vast anticheats. Even so, the chance of someone actually noticing something like this is minuscule, and the effect of them exploiting it is almost non existent (If they do join and are a decent player then they go unnoticed and everyone is happy, if they join and are a minge then they likely get banned anyway)
[QUOTE=nettsam;45914275] i was vac banned for using ley's cheat in singleplayer[/QUOTE] can we ban this person yet all of u are doing shit that is so unnecessary. u have to detour a single func, thats about it
If you're trying to ban someone and prevent them hopping on an alt, just IP ban in addition to the normal ban you'd give. That adds one more inconvenience to someone trying to regain access to your server. The hours thing will only keep people who do not have much gmod experience out, won't do much about minges. Also, if you're getting the playtime via achievement progress, then the person trying to get into your server could just use Steam Achievement Manager to get the addict achievement and therefore bypass your system.
Sorry, you need to Log In to post a reply to this thread.