-
Notifications
You must be signed in to change notification settings - Fork 19
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
Conversation
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
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.
There was a problem hiding this 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. |
There was a problem hiding this comment.
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] == "*") { |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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
All looks good, if you tested the TP GM feel free to merge :) |
Uh oh!
There was an error while loading. Please reload this page.