google-code-export / evennia

Automatically exported from code.google.com/p/evennia
Other
1 stars 0 forks source link

Calling commands as a player #408

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
A) What steps will reproduce the problem?

@py me.execute_cmd('look', sessid=me.sessid)
@py me.player.execute_cmd('look', sessid=me.sessid)

B) What is the expected output? What do you see instead (tracebacks, error
messages)?

If you call player.execute_cmd(sessid=<session id that HAS a puppet>), it will 
call it as the player, and it won't match with character commands.

This behavior surprised me.  I expected that if I passed in a session ID for a 
session that has a puppet, that it would behave the same as if I called the 
command on the puppet object itself.

C) What version/revision of Evennia are you using? On what operating
system? Give as much information as possible to make it easier for
developers to recreate the problem.

Beta-rb2102c213d29

D) Please provide any additional information or suggestions below.

Original issue reported on code.google.com by daniel@benoy.name on 24 Jul 2013 at 7:19

GoogleCodeExporter commented 9 years ago
It's different to execute a command on the player or on the Character. Some 
commands are even player-specific. How would a puppeted character ever call an 
Player-specific command if not this way?
.
Griatch

Original comment by griatch on 21 Aug 2013 at 1:40

GoogleCodeExporter commented 9 years ago
If it's intentional then I guess that's fine.  I'd just have to add extra logic 
that says 'Does this player and session have a puppet?  If so, then call the 
object's execute_cmd, and if not, then call the player's execute_cmd'

Original comment by daniel@benoy.name on 21 Aug 2013 at 8:23

GoogleCodeExporter commented 9 years ago

Original comment by griatch on 22 Sep 2013 at 8:32