Making Modding More Legit.. what do we need to do?

Just thinking this through. As I understand it right now Oxide/Leather work by replacing some of our dlls.

We’d rather avoid that. So if I make the server load any dlls that are in a ‘servermods’ folder - would that be better? Could they still operate without changing the original dlls?

Then the mods could load their submods (like Lua script etc) from inside the -datadir provided by the server owner.

This means that GSPs could give their clients free access to the -datadir folder… while only installing whitelisted dlls in the servermods folder.

I’m investigating strategies here, figuring out what would be best for us, modders, GSPs and server owners going forward.

1 Like

Considering Garry’s Mod would be no where without the ability to turn it upside down with addons I enjoy seeing you worry about helping Rust modding.

And what you proposed definitely sounds better than having to edit Rust dll’s

Well as it is, only people who managed to get the current server dlls can do anything related to modding, even adding a servermods folder would only support developers lucky enough to have the info and direct server files access.
If you could, it would be nice to release a rust server with a limited max slots, bind to localhost only? and even disable the steam server list announcements. That is if you wish to keep GSPs as the only official hosters.

The problem is, modding is extremely limited right now without modifying the dll. changes need to be done to the dll in it’s current state to gain access to features we need, take door sharing for example, i couldn’t come up with a way to share doors without editing Assembly-CSharp.dll’s CIL code to call my mod and check if that player is the owner of the object.

If your willing to add listeners for a bunch of events that plugins can use, and other requests then we could all get along just fine :slight_smile:
I don’t like modifying the DLL and it seems either does anyone else, but right now i don’t think there’s any other way? It’s nice to see you showing interest though, i see this type of game as the kind of game where modding is essential (like Minecraft)

Give us the same control as in gmod.

Why is this guy still allowed to participate in conversations here when he’s been proven to be part of the crew from #ArtificialAiming and has already publically leaked server DLLs on this very forum?

On topic, right now things like sharing doors and manipulating inventory require changing private methods to public in the CSharp assembly DLL. If you even just made more methods public it would be helpful, and hopefully get rid of the need to overwrite DLLs with modified copies. Most of the modification going on is just to change method declarations and gain access to private members, AFAIK.

Event Listeners!

class EventListenerExample : EventListener
	// You can name this method anything
	public void onSpawnEvent(SpawnEvent evt)
		// Your Event Code here!

class ExampleMod : GameMod
	EventListenerExample listener = null;
	public void Example()
		// Example of getting the event manager
		EventManager eventManager = getEventManager();
		// Instantiate our event listener
		var listener = new EventListenerExample();
		IEventListener eventListener = eventManager.CreateListener(listener.onSpawnEvent);
		// Basic Registration
		// Register our event listener
		// We can use a 'generic' event listener
		// Chaining
		// Types ( any number of arguments )
		eventListener.register(typeof(SpawnAnimalEvent), typeof(SpawnZombieEvent));
		// Type Array
		eventListener.register(new Type[] { typeof(SpawnAnimalEvent), typeof(SpawnZombieEvent) });

Creating a ‘servermods’ folder would eliminate the need of a dll loader, such as LeatherLoader, sure - but we still wouldn’t be able to make the adjustments and features the people want if we can’t change the original dlls. BUT, there is a work around. It’s as simple as making classes, methods, and variables accessible. Public - static if need be. Also, eventhandlers as mentioned above would be an amazing touch. Currently, the way we all edit doors is through changing method bodies at runtime and rewriting the method itself in the original dll - which is kind of tedious and excessive. Simply readjusting the access modifiers of most of the variables would open more doors than one would think. To move forward, this is what I think.

We could definitely do something like this. I guess the issue is that it then falls on our shoulders to add events.

What kind of interaction would you want the other way, moving players, killing players, running console commands?

1 Like

I guess the one everyone wants the most would be the ability to return a different value for when you check who the door belongsTo. Some others would include storing the Inventory instance of a PlayerClient/NetUser/Character and something as miniscule as changing the color of names in chat (Ex: have users be able to recognize the PMs our plugins send as actual PMs if the player’s name is too long by changing name color). Things such as moving players, killing players, and running console commands we already accomplish with ease - so don’t worry about that one I think.

Some interfaces that come to mind:

IEntity: Get/SetPos, Get/SetHealth, Kill, SteamID, …
IGameServer: GetMaxPlayers, Log, …
IInventory: Get/SetItem
IPlayerManager: FindByName, GetAll, GetByID, GetBySteamID

These can be retrieved with: mod.getGameServer(), mod.getPlayerManager() or entity.getInventory() etc…

Any sort of official API we can hook into would be great to avoid modifying/injecting our code into the game (feels like server side hacking instead of modding at this point). Instead of just server side modding it would be great if we could hook into the game as a whole. Doing either something like GMod or Minecraft would be beneficial.

Thank you for looking into and supporting the modding community.

Garry’s idea is better than providing interface.
If someone decide to modify DLL’s he will have more possibilities than with an API.
And if the API wants to compete, rust developers will have to add functions to the API and it can take some times.
I guess an API will be just great for 95% of mods but some servers will still modify DLL’s for unique exclusive features.

Sorry for bed england.

Hire me to write the API, problem solved. :v:

Are “door share” servers legit or not? There are rumours going around that they are not. Other people claim they are legit mods. How can a normal player now what is right and what is wrong at the moment? I mean there is a modded tab so it must be kinda official to use these servers.

You are NOT going to be in trouble for playing on those servers if it is the question.

Some way for our mods to interface with the Rust Server functions (whether this is through an API or another method) would certainly be good.

I guess this is better done sooner than later. And people are going to mod whether we want them to do not.

I’ll talk to helk about what he thinks the best solution to this is, and try to work out what we’re going to do.

Would you guys be upset if what we do makes Oxide/Leather redundant?

1 Like

As far as I’m concerned, if you make Oxide/Leather redundant, but open up new possibilities for mods, I don’t think they would mind.

I think everyone involved would love it if you made them redundant. The community is completely divided and its creating hostility between GSPs, developers and everyone else involved.