Search Unity

Problems With Sharing Variables And Methods

Discussion in 'Scripting' started by minecraftgoldmad, Oct 9, 2019.

  1. minecraftgoldmad

    minecraftgoldmad

    Joined:
    Aug 8, 2019
    Posts:
    8
    I Am Making An Anti-Cheat For My Game That Uses Offsets So The Value Is Different And I Am Making A Main Anti-Cheat Script The Other Scripts Can Use. I Want It So That The Offset Variables Are Not Shared Between Scripts Using The Anti-Cheat But They Are Shared Between The Methods Inside Of The Main Anti-Cheat Script And I Don't Know How To Do That. The Main Method Is Public And Static Right Now.


    Thanks For Any Help
     
  2. StarManta

    StarManta

    Joined:
    Oct 23, 2006
    Posts:
    8,775
    Do Not Capitalize Every Word You Type, I Feel Like I'm Stubbing My Toe With Every New Word.
     
    Joe-Censored and Suddoha like this.
  3. minecraftgoldmad

    minecraftgoldmad

    Joined:
    Aug 8, 2019
    Posts:
    8
    sorry but this has nothing to do with unity
     
    Last edited: Oct 9, 2019
  4. Flynn_Prime

    Flynn_Prime

    Joined:
    Apr 26, 2017
    Posts:
    387
    "Anti-cheat" as you call it is usually achieved via some form of data encryption. Offsetting values won't be that effective against more experienced hackers. If they can see the values they would change to hack your game, they could also find your offset values...
     
    Suddoha likes this.
  5. Suddoha

    Suddoha

    Joined:
    Nov 9, 2013
    Posts:
    2,824
    Basically what @ItzChris92 said... it would only tske basic knowledge to cheat in your game, no matter what you try to invent there...

    That is, don't waste the time doing fancy and inefficient anti-cheat mechanisms.
    Instead, work on the project, get it done. Be happy if people feel like cheating in an offline game... i mean, then you've probably made a game worth to be played and worth the effort to find hacks and cheats.
     
  6. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    This ^^^

    And because it is trivial for the more experienced hackers to explain their discoveries to the novices (your inclusion of your anti-cheat actually creates motivation to break it due to the Streisand effect, which then motivates those who do to brag about how they did it), it doesn't really do anything to stop the novices either.
     
    Suddoha likes this.
  7. minecraftgoldmad

    minecraftgoldmad

    Joined:
    Aug 8, 2019
    Posts:
    8
    i know that it might not work but i'm trying to learn the skills of making something like that. i don't need help making the anticheat. i just need help with the variables. also it is more complicated than just an offset, i just said that to keep it short. also i tested the anticheat with cheat engine and i couldn't hack into it, i made it so that if you edit any values it print to the console so i can see that you would be banned (later i will add bans to my mysql database). i'm not an expert hacker or anything but i know enough to test some things on my anti-cheat
     
    Last edited: Oct 10, 2019
  8. Flynn_Prime

    Flynn_Prime

    Joined:
    Apr 26, 2017
    Posts:
    387
    https://stackoverflow.com/questions...-sharp-and-symmetricalgorithm/9034247#9034247

    You're kind of trying to re-invent the wheel here, but the above link seems similar to what you are after.
     
  9. minecraftgoldmad

    minecraftgoldmad

    Joined:
    Aug 8, 2019
    Posts:
    8
    what i was doing is whenever a value changes you interpret that number as hex then convert it to decimal to give you a different number. then times it by -1 and offset it. then to check if it the original has been edited you do the same maths to the original and then compare them. is this a good way to do it or not?
     
  10. Flynn_Prime

    Flynn_Prime

    Joined:
    Apr 26, 2017
    Posts:
    387
    Afraid I can't offer any more advice really. Hopefully someone else can chime in.
     
  11. minecraftgoldmad

    minecraftgoldmad

    Joined:
    Aug 8, 2019
    Posts:
    8
    ok thanks for the help though
     
    Flynn_Prime likes this.