Feature gCLI "fortune" command: better support for player names with spaces

The current implementation of "fortune" disallows specifying custom words while consulting Zatara about a player whose name contains spaces, and if the name contains 3 spaces the command cannot be used at all. In order to address this I have put together a quick patch which allows one to explicitly separate the player name from the words, which I would like to submit for inclusion into upstream Mafia code. You can find the patch here: https://paste.pound-python.org/show/tipOiHww7iMmlPH8IElF/ .

The separator string is -- and is optional. If it is present everything before it is treated as player name and everything following it will be words. If the separator is present but nothing follows it, default words are used. If the separator is absent, everything works as before.

Let me know what you think.
 

fronobulax

Developer
Staff member
Have not looked at the patch yet. Questions for folks with memories better than mine.

Is there anything approaching a mafia/ash convention for this kind of a delimiter? I think a pipe | may have been used. I don't think commas are allowed in user names so commas could be used if that doesn't interfere with multiple commands on one line.

I recall dealing with player names with spaces elsewhere by doing some encoding/decoding. Specifically player name and player%20name are both accepted/allowed. Would this be a better solution?

I agree that the existing fortune command has an undesired feature when the player name has spaces in it so something should be done.
 
The kmail commands (send, csend and kmail) and throw all use double pipes:
Code:
> help ||

csend item [, item]... to recipient [ || message ] - send kmail
kmail item [, item]... to recipient [ || message ] - send kmail
send item [, item]... to recipient [ || message ] - send kmail
throw[?] item at player [ || message part 1 | message part 2 ... ] - use item on someone else
 
Top