Jump to content
 Share

Roy

[C#] Rust User Management (First C# Project)

Recommended Posts

Hey everyone,

 

Today I decided to make a User Management plugin that interacts with the GFL API for Members, Supporters, and VIPs in Rust (the game using Oxide/UMod as a server-side library). I did something like this before using lua, but since that's no longer supported by default in Oxide/UMod and it used MySQL instead, I decided to make one in C# which is fully supported with Oxide/UMod along with using our newer REST API. This plugin will be used on our Rust servers which support Oxide/UMod in the future.

 

This was my first time messing around with C# as well, so that was fun. Was pretty easy to pickup on, though. The below is basically being copied from the Gitlab repository's ReadME:

 

Description
A plugin created in C# for Rust (Oxide/UMod). Interacts with the GFL API and assigns users their appropriate group on player connect or when the um.reloadusers console command is executed.

 

Installation
Place the UserManagement.cs file inside of RustServer/oxide/plugins. Afterwards, edit RustServer/oxide/config/UserManagement.json to your needs.

 

Please also make sure you have existing groups made. You can create groups using oxide.group add <group> <"[Title]"><rank>.

 

Default Config

{
  "Debug": false,
  "Enabled": true,
  "Endpoint": "donators",
  "RemoveExisting": true,
  "RemoveExistingNoGroup": true,
  "Token": "MY_AUTH_TOKEN",
  "URL": "https://api.domain.com/"
}

 

Config Descriptions

  • Debug - Whether or not to enable debugging within the plugin.
  • Enabled - Whether or not to enable the plugin.
  • Endpoint - The API endpoint.
  • RemoveExisting - If true, when given a group, it will remove any others that are a part of the plugin from the user.
  • RemoveExistingNoGroup - If the user has no group, it will remove any groups that are a part of the plugin from the user.
  • Token - The API's token that's set using the Authorization header.
  • URL - The API URL (https/SSL is supported).

 

Gitlab Project

 

Feel free to use and modify to your needs :) 

 

Thanks!

Share this post


Link to post
Share on other sites


18 hours ago, Rick said:

@Roy

 

 

I believe Xy made a plugin for this a while back when I requested one. Would you like to see?

Do you know if it was coded in lua or not? Lua doesn't come with Oxide anymore by default which I'd assume means it isn't really supported much anymore. This is why I made a version in C#.

 

Thanks.

Share this post


Link to post
Share on other sites


Hidden
2 hours ago, Roy said:

Do you know if it was coded in lua or not? Lua doesn't come with Oxide anymore by default which I'd assume means it isn't really supported much anymore. This is why I made a version in C#.

 

Thanks.

The version I coded does not use the API, it uses mysql, which is why it needs replacing. However, it is in C#


71CFA5EE-923C-4740-ACF4-508B753C9AD7.png.92a0d40c0fa7773f71fea2453f581d16.png

(signature made by @Kaylode)

Previously known as Xy.

 

Twitter ❤️Ko-Fi ❤️Github

 

 IMG_0248.jpg

 

ben_mixed_opinions.png

 

Share this post


Link to post

2 minutes ago, Xy said:

The version I coded does not use the API, it uses mysql, which is why it needs replacing. However, it is in C#

Ah, that makes sense. Well at least we got a rewrite that supports the REST API.

 

Can you give me the source code for the one you made?

Share this post


Link to post
Share on other sites


Hidden
7 minutes ago, Roy said:

Ah, that makes sense. Well at least we got a rewrite that supports the REST API.

 

Can you give me the source code for the one you made?

sent via discord


71CFA5EE-923C-4740-ACF4-508B753C9AD7.png.92a0d40c0fa7773f71fea2453f581d16.png

(signature made by @Kaylode)

Previously known as Xy.

 

Twitter ❤️Ko-Fi ❤️Github

 

 IMG_0248.jpg

 

ben_mixed_opinions.png

 

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×
×
  • Create New...