Jump to content

Auto turrets auth

Closed 1.1.0 1.2.0

rrex
rrex

Posted (edited)

Hey! I found that I can authorise my friends into turrets. Is there a way to block this?

 

Edited by rrex
synvy

Posted

Is the "Restrict Turrets" option enabled in the config?

Do you and your friend both have the permission?

rrex

Posted

yes. it's by default in config 🙂 sry for late reply 🙂

so all the rest working great. but this only thing that I can authorise any players into turret from my steam friends 🙂

synvy

Posted

I've added the following check:
 

var playerId = FindPlayerByUserID(player.UserIDString);

if (turret.authorizedPlayers.Count > 0 || playerId != turret.OwnerID)
{
    PrintWarningMessage(player, "AuthorizedWarning");
    return false;
}

 

Let me know if it's working. I do not have the ability to test it at the moment.

rrex

Posted

kk starting the server. thank you

rrex

Posted

it did not compile the new version o_O

error while compiling: SoloEnforcement.cs(168,58): error CS1503: Argument `#1' cannot convert `string' expression to type `ulong'

synvy

Posted

Try it now. My apologies.

rrex

Posted

sorry but the same is not compiling. 🙂

I see another request already there with no compil

I believe your var's a bit breaking it somehow)

synvy

Posted

Edited off phone (no compiler to check for mismatches). I just got on my PC and used a different ID check. Should be compiling now.

  • Like 1
rrex

Posted

yeah it compiled now thx

but I still can assign the turret auth to any amount of my steam friends 🙂

synvy

Posted

Can you please send me a video regarding the bug? There's nothing else that I can find in the Rust documentation that would disable that.

 

rrex

Posted

kk few minutes

rrex

Posted

Sorry my friend was connecting too long. Here is a video link below. (uploading 4-8 minutes more)

You can check all 3 minutes or starting from 2:00

 

  • Like 1
synvy

Posted

I will look into this tonight. 

  • Love 1
rrex

Posted

Any luck bruh?

synvy

Posted (edited)

Apparently the Rust developers did not account for Oxide support when they implemented that function. The only thing I can do to combat it is to check on turret startup whether more than one player is authorized on the turret, stop it from starting up, send a message stating that too many players are authed, and clear the auth list. I am implementing it now.

 

private object OnTurretStartup(AutoTurret turret)
{
     if (_config.restrictTurrets && turret.authorizedPlayers.Count > 0)
     {
         var player = FindPlayerByUserID(turret.OwnerID);

         if (player != null)
         {
             if (HasPerm(player.UserIDString, perm))
             {
                 PrintWarningMessage(player, "TurretStartupWarning");
                 turret.authorizedPlayers.Clear();
                 turret.SendNetworkUpdate();
             } 
         }
     }

     return null;
}

 

Edited by synvy
synvy

Posted (edited)

It's been implemented. Please let me know if there's any issues with it. Since there's no player defined in the OnTurretStartup hook, I used the turret's owner id to get the player. This should only print out the warning message to the owner of the turret.

Edited by synvy
rrex

Posted

I'm uploading a new video) It become worse xD  Will send it in few minutes

synvy

Posted (edited)

BRUH I FORGOT TO RETURN FALSE. I will update it now to fix 🤦‍♂️🤦‍♂️🤦‍♂️🤦‍♂️🤦‍♂️🤦‍♂️🤦‍♂️🤦‍♂️🤦‍♂️🤦‍♂️🤦‍♂️🤦‍♂️🤦‍♂️🤦‍♂️🤦‍♂️🤦‍♂️🤦‍♂️🤦‍♂️

 

EDIT:

100% should stop the turret from turning on now.

Edited by synvy
  • Haha 1
rrex

Posted

sry I'm a bit busy tonight. I;ll check it tomorrow 🙂

  • Like 1
synvy

Posted

I am closing this ticket. Facepunch has finally added a hook to check for assigning other players to turrets.

  • Implemented proper checks for turret authorization by owner.
  • Implemented Discord notifications for admins when players attempt to assign other players to turrets.
synvy

Posted

Changed Status from Pending to Closed

Changed Fixed In to 1.2.0

1.4m

Downloads

Total number of downloads.

6.9k

Customers

Total customers served.

102.4k

Files Sold

Total number of files sold.

2m

Payments Processed

Total payments processed.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.