How can we contribute to your API (documentation)? Maybe you can add an ability to suggest changes or new pages in docs. and please make API docs for games like rust, because there is BasePlayer and ComsoleCommand, ChatCommand, not just IPlayer and Command.
Documentation (API) contributingSolved
- 1
- 2
You can suggest the changes here. ConsoleCommand and ChatCommand are being removed, so they aren't being added to the new docs, but everything else you can and will be able to find under Docs > Games > Rust and other games.
What may we use instead of ConsoleCommand? CAn we use GetLibrary<Command>().AddConsoleCommand when you remove [ConsoleCommand]?
Then we need a simple and fast casting IPlayer to BasePlayer, otherwise that removal is very strange. Its increases boilerplate code, when we use it for most Rust plugins.
In response to Wulf ():BasePlayer.IPlayer = IPlayer
IPlayer.Object as BasePlayer = BasePlayer (Rust)
Been i...
That is a really stupid method. Please leave commands for rust, because that is really strange to remove them and really unusual to just cast IPlayer object to BasePlayer, it makes your code longer and more stupid
In response to misticos ():That is a really stupid method. Please leave commands for rust, because that is really strange to re...
They may be replaced with another option, but at this time they are being removed as the code associated with them is dated and has been purged in favor of the universal command handling instead of maintaining two implementations that do essentially the same thing. In most cases, commands would rarely need the game-specific object. Far from "stupid" though, but thanks for the feedback.
In response to misticos ():That is a really stupid method. Please leave commands for rust, because that is really strange to re...
I agree with the misticos stupid solution that will only add a hemorrhoid and a headache to the developers of plug-ins, and maybe this direction will shake as not everyone will replace a lot of crutches and templates in remote attributes, I'm against the removal of ConsoleCommand and ChatCommand.
In response to 314zdec ():I agree with the misticos stupid solution that will only add a hemorrhoid and a headache to the deve...
Thanks for the feedback, but all plugins are going to have to be updated regardless of this change. There is very little difference between using the universal method and these, so I don't see any valid reason to keep them in their current state. As I stated though, another option may be added, but at this time they are being removed for uMod to get rid of the code duplication and clean things up. Our goal is to make things as universal and easy-to-use as possible, not cling on the dated methods until they fall apart.
Old mess:
Old mess:
[ConsoleCommand("blah")]
private void CommandExample(ConsoleSystem.Arg arg)
{
BasePlayer player = arg.Player();
if (player == null)
{
return;
}
string[] args = arg.Args;
// Do stuff finally
}
[ChatCommand("blah")]
private void CommandExample(BasePlayer player, string cmd, string[] args)
{
// Call a shared method or do stuff again
}
New method that is more simplistic:
[Command("blah")]
private void CommandExample(IPlayer player, string command, string[] args)
{
// Look at that, less code
}
So you want to check something the universal API doesn't provide:
[Command("blah")]
private void CommandExample(IPlayer player, string command, string[] args)
{
if ((player.Object as BasePlayer).IsDeveloper)
{
player.Reply("Oh look, you're a developer");
}
// That was hard! Do more stuff
}
Or use that BasePlayer more than once:
[Command("blah")]
private void CommandExample(IPlayer player, string command, string[] args)
{
BasePlayer basePlayer = player.Object as BasePlayer;
if (basePlayer.IsDeveloper)
{
player.Reply("Oh look, you're a developer");
}
// Send that BasePlayer, because Kits isn't universal (yet)
Kits.Call("GiveKit", basePlayer, "blah");
// Do more stuff
} In response to Wulf ():Thanks for the feedback, but all plugins are going to have to be updated regardless of this change....
There are versions of uMod for Rust and other games. LEAVE THEM THEIR FUNCTIONALITY. THIS IS UNIVERSAL. BUT A LOT OF PEOPLE PLAY IN RUST AND develop for rust lol sorry for caps :D
In response to misticos ():There are versions of uMod for Rust and other games. LEAVE THEM THEIR FUNCTIONALITY. THIS IS UNIVERS...
I'm sorry that you're missing the reasoning and point, but they aren't coming back as they were. We have to move on at some point and push forward with development, not stay in the past just because someone isn't willing to accept changes. We are overhauling the entire framework, so this is pretty much just 1% of all that has changed so far with our transition to uMod and overall plans.
Tl;dr... Changes are being made as we're overhauling everything, they will likely come back in some manner (just not as they were before exactly), they are being removed for the time being, you won't see that change until uMod is released.
Tl;dr... Changes are being made as we're overhauling everything, they will likely come back in some manner (just not as they were before exactly), they are being removed for the time being, you won't see that change until uMod is released.
Locked automatically
- 1
- 2