[Twisted-Python] Reality Servers

Glyph Lefkowitz glyph at twistedmatrix.com
Tue Sep 4 03:27:10 MDT 2001


On Tue, Sep 04, 2001 at 04:47:55PM +1000, Chris.Hadgis at mincom.com wrote:
> Further progress...
> 
> I have changed the Drop routine for the Romero figure. It first tests if 
> the location hasIntelligence() before broadcastToPair() the fact it made a 
> noise when dropped. Is testing the location for hasIntelligence() the 
> standard way of finding out if the location is a guest/player?

Yes, but this shouldn't be necessary :-\... if you try it while sitting in a
chair, other interesting things will happen, I'm sure.

> I would think that the broadcast routine could be coded as one routine 
> with the following parameters:
>
> (self, subject, to_target, to_subject, to_other)

Yes, this sounds like a good thing.  Also, allHear/oneHears/pairHears should go
away, as they're basically just versions of 'broadcast' which don't respect
position and containment flags.

> I admit I have not sat down and thought about all the different scenarios.
> I'll get to that soon. Hopefully, there will only need to be a few broadcast
> routines (preferably one) which will be suitable for all situations.

Your broadcast routine sounds fine, except for the fact that it's sometimes
convenient to have defaults for situations where you don't need everything.
I'd like to have 'toOther' (the coding standard has changed since I wrote that
original TR code ^_^) as the first param, so you could say something like

frob.broadcast([frob," frobs!"])

and have everyone hear that, adding more of the parameters as keyword
parameters depending on the complexity of your message.

> Glyph, I will provide a diff as soon as we can work out what to do with the
> container problem I mentioned in this thread yesterday.

Responding to that email separately...

-- 
                      ______      __   __  _____  _     _
                     |  ____ |      \_/   |_____] |_____|
                     |_____| |_____  |    |       |     |
                     @ t w i s t e d m a t r i x  . c o m
                     http://twistedmatrix.com/users/glyph





More information about the Twisted-Python mailing list