Open GoogleCodeExporter opened 9 years ago
Since Python reference-counts, it's not enough to destroy an object in one
context; it lives on until it is destroyed in all contexts. Right now, my
original logic in network.py ignores an object's membership in our new
structures:
http://code.google.com/p/sigma-mud/source/browse/trunk/network.py#37
Aside from clearing the master list, the only other delete is from the current
room's players list. This was great at first, but it at least needs to be
broadened and likely belongs to the player class itself or libsigma. The
player object knows his memberships better than the basic program context.
Of course, the act of quitting during combat is in itself a gateway for
misbehavior. Circle implemented the 'link-dead' concept to allow a player to
die honorably even when a player was disconnected. While their implementation
was sophisticated, my feeling is that the framework can be restricted to when a
player is in active combat.
At this moment, I'm okay with allowing a chicken escape via automatic logout on
link death. Later, this can be added fairly easily with a new zombie playstate
and the associated command and login handling. But, we at least need to refine
the logout mechanism to remove crashes from the equation.
One of my biggest fears from my original codebase was that too much exception
logic would be pushed out to the game mechanisms. I would prefer to see the
combat be agnostic of absent players. Otherwise, this is a severe blockage to
designer participation in the codebase, and so is a major threat to the mission
of the project. The objects themselves and libsigma must be able to account
for these things before they reach configurable code, which would include the
combat task and player commands.
A test of reference counting is attached.
As an aside but still on this subject, Player probably needs to check the link
before sending or receiving anything at all across the wire. Otherwise, an
unlinked player could crash the system with a socket failure. Is the crash
currently on socket transmit/receive?
Production system will also need to catch all exceptions and log them rather
than crashing! But this should be configurable of course.
Original comment by bmcca...@gmail.com
on 20 Jul 2010 at 7:10
Attachments:
Original issue reported on code.google.com by
meagains...@gmail.com
on 19 Jul 2010 at 7:57