HM-CODE / Haunted-Memories

A repository for Haunted Memories code.
http://www.haunted-memories.net/
BSD 3-Clause "New" or "Revised" License
4 stars 5 forks source link

Two separate +lock/list commands should be different commands #141

Closed Bradamante closed 12 years ago

Bradamante commented 13 years ago

+lock/list EXIT , to display all players holding keys to an exit, is frequently preempted by +lock/list PLAYER, to display all keys held by a player.

When it does so because a player is typing it, it throws an error message, which causes it to look like +lock/list is broken in general.

Ideally, +lock/list PLAYER should be changed to a different command name to avoid this problem.

ETA: sigh I always forget GitHub eats angle brackets.

nivthefox commented 12 years ago

Actually instead of changing +lock/list player; we should merge the two commands together so that it is a single command which works for players or exits. A simple pmatch() will tell us if it's a player; if it is, treat the results as a player. If it isn't, treat the results as an exit. If it turns out not to be an exit, either, then we can bail out entirely.

Bradamante commented 12 years ago

Loki: That is the current behavior, and it is in practice not desirable; it causes the command to apparently randomly fail to be recognize when issued by players on their own exits (because the exit alias is also a player's alias), and it makes it irritatingly difficult to pull information off of exits even as a staffer.

nivthefox commented 12 years ago

Ah. I'll think about this some more. Having a specific /exit flag may be desirable, but I'd like to avoid that if possible. Maybe doing a locate() first, /then/ pmatch, /then/ exit. There are better ways to do this that won't involve a separate command for what is effectively the same thing.

Bradamante commented 12 years ago

I suspect that a /player flag, or changing it to "+lock/keys player" instead of +lock/list player, is probably better; I don't know how often anyone else uses the command, but I have to use +lock/list exit an average of between one and two times a day, and +lock/list player once so far in a month.

(However, +lock/list is so inefficient that it is already on the list for replacement anyway, so... XD )

firstmagic commented 12 years ago

This has been fixed with some modifications to the +lock code. One command to rule them all, etc.

It now gives preference to locally named exits now instead of player names/aliases. This removes all the frustration from players. :) And it's still just as easy for staffers to use.

If you need to +lock/list a player and there's a locally named exit that conflicts, just prepend a * to the player name, or use their full name, or use their dbref, or switch rooms.