Skip to content

Command overloading stopped working properly #344

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Sasino97 opened this issue Apr 25, 2020 · 5 comments
Closed

Command overloading stopped working properly #344

Sasino97 opened this issue Apr 25, 2020 · 5 comments
Labels
area-Commands Issues related to player/RCON commands area-GM Issues related to SampSharp.GameMode bug
Milestone

Comments

@Sasino97
Copy link

Command overloading used to work fine, but after updating to the latest SampSharp version, only the first version of a command is being recognized.

The following code:

[Command("rob", "rb")]
private void RobCommand(Player victim) // Player is a subclass of BasePlayer
{
    // omitted
}

[Command("rob", "rb")]
private void RobCommand()
{
    // omitted
}

Outputs:

Usage: /rob [victim]

If the players types /rob without specifying the victim parameter.

@ikkentim
Copy link
Owner

In what version did it last work?

@Sasino97
Copy link
Author

Sasino97 commented May 2, 2020

I migrated from SampSharp.Core 0.9.0 and GameMode 0.9.0 to SampSharp.Core 0.9.3 and GameMode 0.9.1 about 2 months ago. I didn't immediately notice the issue, and other changes were made meanwhile, in fact I also moved from .NET Core 2.2 to 3.1.

@Sasino97
Copy link
Author

New info, now that I have rolled back to 0.9.0, it looks the command overloading is still not working properly, so I assume that the feature could have stopped working when I migrated from 0.8.0.

@ikkentim
Copy link
Owner

Thanks, I’ll check what I changed between those releases.

@ikkentim ikkentim added bug area-Commands Issues related to player/RCON commands area-GM Issues related to SampSharp.GameMode labels Sep 16, 2020
@ikkentim ikkentim added this to the 0.9.0 milestone Sep 16, 2020
@ikkentim
Copy link
Owner

ikkentim commented Dec 1, 2020

Fixed this particular issue... SampSharp is still a bit bad at deciding what to do when no valid parameters are provided, for example when commands /foo and /foo [player] exists, when the player enters /foo 9 (id 9 is not connected), it will invoke /foo instead of /foo [player] further command improvements are planned for a future update.

@ikkentim ikkentim closed this as completed Dec 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-Commands Issues related to player/RCON commands area-GM Issues related to SampSharp.GameMode bug
Projects
None yet
Development

No branches or pull requests

2 participants