#AntiCheat

1 messages · Page 1 of 1 (latest)

low mica
#

I want to do something like an anti-cheat. And while I'm trying to hide the generators from a distance. The question is, how to do this at all?

low mica
high wraith
# low mica and which one is used in the game?
using System.Collections.Generic;
using Mirror;

public class CustomInterestManagement : InterestManagement
{
    public override bool OnCheckObserver(NetworkIdentity identity, NetworkConnectionToClient newObserver)
    {
        return true;
    }

    public override void OnRebuildObservers(NetworkIdentity identity, HashSet<NetworkConnectionToClient> newObservers)
    {
        if (identity.visible == Visibility.ForceHidden)
        {
            return;
        }
        foreach (NetworkConnectionToClient value in NetworkServer.connections.Values)
        {
            if (value.isReady)
            {
                newObservers.Add(value);
            }
        }
        if (NetworkServer.localConnection != null && NetworkServer.localConnection.isReady)
        {
            newObservers.Add(NetworkServer.localConnection);
        }
    }
}

The game just uses this one

#

you need to patch it or just register your own

#

and make that everything else is visibile except if you are in distance of the Generators

low mica
high wraith
#

but be careful

#

because some stuff NEEDS to be registered

#

and needs to always be added

high wraith
#

Because this is not a client thing

#

you need to add a code that sometimes make it rebuild

#

NOT ALWAYS

#

you will crash the client

low mica
high wraith
#

but yea

#

if you already have a system in place why not

low mica
high wraith
#

DestroyNetworkIdentitiy

#

and spawn it

#

once in range

#

do a monobehavior that does that

#

its honestly easier

low mica
high wraith