-
-
Notifications
You must be signed in to change notification settings - Fork 123
Implement gift command #640
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
base: master
Are you sure you want to change the base?
Conversation
… made chat command argument respect double quoted strings (and first lvl double quote escaping) and added SendPacketToClient that allows clients to send packets to other clients (relayed via the host if necessary)
…guaranteed to be unique, gifts can now also be send by specifying the id instead of username and did some refactoring
|
I know this is still marked as a draft but just to give my 2 cents with that latest commit, I don't love the idea of the command requiring a user id instead of a username. I haven't done any work with these chat commands in the past but if usernames are not guaranteed to be unique, what happens with the whisper command if there are multiple people with the same username? Because that command does just take in a username and I think that's more intuitive for players to use, though I do fully support userid being an option. I think maybe the best approach is to have username be the main method of sending things, and then if there are multiple people with the same name then when you execute the command the game would tell you there are multiple players with the same name and list out the ids of those players and ask the sender to specify which they were referring to. Also smaller thing that I'm not sure if anyone else agrees with but IMO this command shouldn't be |
|
@PhantomGamers How I implemented it now is that the command both works with userId or username (you can use either) if that is not the case at the moment then I made a mistake as it should definitely support both (and I will fix that), does that satisfy your request or is it more about the internals? I am not sure what happens with the whisper command although I expect it just picks the first player matching that username in the list. Now that I think about It my code does the same if you provide a username that is shared by multiple users. I will make it so that it will block the gift in that case and will notify you to use the userId instead with the userIds for that username which are available to your, I think this falls in line with what you suggest? I'm fine with anything regarding what the command should actually be called, I my mind I associated /give with just giving yourself something (as in a cheat command) so I though /gift would be more appropriate. However I can change it to /give if you want? (I could also change it to /give and make /gift an alias or vice versa (just like /g is))? |
I might have just misread the code then, I didn't actually try testing it in-game to see how it functioned, so yeah ignore if that was not relevant my bad.
Yeah I think this would be good, but I mean that doesn't necessarily have to happen in this PR. I think maybe these commands could be restructured so that that the interchangeability between the username and userid would just be available to any command that requires it.
Yeah the alias idea could work. I understand what you mean about the cheat command though, I was thinking that too, but to me One more thing I just thought of but what happens if someone's username is just a number that could be a userid? Seems like this could be a potential problem as well, though an edge case yeah. |
…s (will also now report about ambiguous usernames if multiple are matching)
… 0.10.x-gift-command
…n the gift packet processor
|
FWIF when I read the title of this PR, |
Notable changes:
Made changes to the INetworkProvider interface to include a SendPacketToClient method and implemented it so it can send a packet from client to client without having to explicitly route it through the host (this is abstracted away)TODO: