Skip to content

Fix major issues and perms #151

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

Merged
merged 7 commits into from
Dec 28, 2020
Merged

Fix major issues and perms #151

merged 7 commits into from
Dec 28, 2020

Conversation

elenawinters
Copy link
Contributor

@elenawinters elenawinters commented Dec 23, 2020

  • Fixed Character component (you can see other people's equipment and also equip things again)
  • Add a /execute command for admins (this still has issues, consider it experimental)
  • Coins with 0 value (showing up as a question mark) no longer drop
  • Fixes the Teleport GameMessage, as well as the command.
  • Fix permissions on /smash
  • Fix permissions on /pvp
  • Add .bat files to gitignore (I use bat files to build and run the server)

Previously, /pvp was admin only. This is now a Mythran level command.

Also added .bat files to the gitignore (I use bat files to build and run the server)
- Fixed Character component (you can see other people's equipment and also equip things again)
- Add a /execute command for admins (this still has issues)
- Coins with 0 value (showing up as a question mark) no longer drop
- Fix permissions on /smash
@elenawinters elenawinters changed the title Change perms for /pvp command Fix major issues and perms Dec 24, 2020
@elenawinters elenawinters added type: enhancement New feature or request affects: gameplay Related to gameplay labels Dec 24, 2020
The code wasn't casting to the correct type.
This just moved the explicit cast to the 0, since that's the only thing we are really worried about.
Copy link
Member

@MickVermeulen MickVermeulen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good overall, just had some style / documentation requests.

@@ -86,6 +87,7 @@ public string ChangeCoin(string[] arguments, Player player)
{
if (arguments.Length != 1) return "coin <delta>";

/// We parse this as an int instead of long, due to the max long causing bugs. Currency maxes out at a long.
Copy link
Member

@MickVermeulen MickVermeulen Dec 26, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really nitpicky but we generally only use double slash comments inline and use triple slash comments for doc strings

public async Task<string> Execute(string[] arguments, Player executor)
{
List<Player> players = new List<Player>();
if (arguments[0] == "*") {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code in this block doesn't adhere to the overall Uchu / C# style, we generally do:

if ()
{
    ... stuff
}
else
{
    ... other stuff
}

and

foreach ()
{
    ... stuff
}

c => c.Id == executor.Id
);

var _com = new List<string>(arguments);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bit of a odd variable name, if you meant command I would just use command here


if (!SocialHandler.ClientCommands.Contains(message.Split(" ").ElementAt(0)) && message.Split(" ").ElementAt(0) != "/execute" && message.Length > 1) {
foreach (Player player in players) {
player.SendChatMessage("You feel a magical power...", PlayerChatChannel.Normal);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lol I like this little extra



[CommandHandler(Signature = "execute", Help = "Execute a command as another player", GameMasterLevel = GameMasterLevel.Admin)]
public async Task<string> Execute(string[] arguments, Player executor)
Copy link
Member

@MickVermeulen MickVermeulen Dec 26, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd appreciate a doc string here with maybe some example usage

Also added a check on execute command if empty
We can teleport now
@MickVermeulen
Copy link
Member

All looks good, if you tested the TP GM feel free to merge :)

@elenawinters elenawinters merged commit e85c703 into UchuServer:dev Dec 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects: gameplay Related to gameplay type: enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants