RustPlugin vs. CovalencePlugin?Solved

I'm trying to experiment a bit. (creating a plugin for rust)

I know that Covalence plugins should work for every game umod supports, whereas rust plugins only for rust.

Plugin that derives from Rust Plugin can use things like `cmd.AddChatCommand` etc.

1. Where I can find a list of things like cmd. to use? (Knowing this list is somehow easier to look what can do what and find methods using dot peek in the visual studio)

2. My second question is about `server.MaxPlayers` and `players.Connected`, which seem to be only accessible when using : ConvalencePlugin. Are there any alternatives when using RustPlugin? (for server.MaxPlayers I've found by digging into dlls ConVar.Server.maxplayers, but I'm not sure if is safe to use. I mean can Facepunch change this anytime without making something like "ConVar.Server.maxplayers is obsolete: use somethingelse")

I would not recommend using RustPlugin and the older libraries it uses, as it is being removed. I would recommend using CovalencePlugin instead, which is the universal API and focus of Oxide (and uMod).

A CovalencePlugin can be loaded on Rust, just as RustPlugin can be. The plugin type only exists there because we originally only had RustPlugin, so it's there with some ancient methods that are not really promoted anymore.

I would encourage using the API that Oxide provides rather than game code whenever possible to avoid breakage.

Thanks for fast response.

A few more questions:

cmd.AddChatCommand() is the old one with RustPlugin?
AddUniversalCommand()  is new one for all games?
AddCovalenceCommand() is new one for Rust?

all of the above are manually adding /somecommand?

Is it possible to easily add support for !somecommand in chat or I have to do something like:

object OnMessagePlayer(string message, BasePlayer player)
{
    //check if the string is command
    return null;
}
AddCovalenceCommand is universal, AddUniversalCommand is a custom method name in my plugins.

You can use AddCovalenceCommand manually, else [Command("command")] attributes on methods if using CovalencePlugin.

To have ! chat commands, you'd have to intercept the OnUserChat or OnPlayerChat hooks.
5e13a8d5b2bc5.jpg Wulf
I would not recommend using RustPlugin and the older libraries it uses, as it is being removed. I would recommend using CovalencePlugin instead, which is the universal API and focus of Oxide (and uMod).

A CovalencePlugin can be loaded on Rust, just as RustPlugin can be. The plugin type only exists there because we originally only had RustPlugin, so it's there with some ancient methods that are not really promoted anymore.

I would encourage using the API that Oxide provides rather than game code whenever possible to avoid breakage.

Suppose a person had made a some plugins for Rust, and used RustPlugin.  Should they be in a hurry to change them over to CovalencePlugin?  And is there a list of the deprecated methods that they might have to change over?  Asking for a friend.  =)

Zugzwang

Suppose a person had made a some plugins for Rust, and used RustPlugin.  Should they be in a hurry to change them over to CovalencePlugin?  And is there a list of the deprecated methods that they might have to change over?  Asking for a friend.  =)

The majority of plugins will work still for a period when we transition from Oxide to uMod, which would include deprecation of ALL game-specific helpers from the Lua days (i.e. rust.*). CovalencePlugin itself will be deprecated, as Plugin is the replacement for all. There's no rush right now, plenty of time will be given with the old functionality before it is fully removed.
Locked automatically