Fake players missing some callbacks

Issue #39 new
Former user created an issue

Copied from bug number 87 in old bug database.

Arnk Kilo Dylie: Fake players do not produce the player action callbacks. This causes a probable crash when using fake players that leave spectator mode. If a player spectates on a fake player, when that fake player leaves, PA_LEAVEARENA is never called, and then game.c:clear_speccing is never called on the appropriate players, so in effect the player they are speccing on is dead memory.

When that player goes to spec on something else, then it is called, then the freed memory is accessed, which can often crash it.

numpf: Fake players seem problematic to me. There are 2 or 3 different objects represented by the Player type: a User and a Session. A User has a name, is authenticated by the billing server, has priviledges, and is global to the server. A Session is an instance of a name, usually the User's name, in an arena. They interact with the physical state and message system of an arena. These are represented informally, along with a third type Client*, by player.h.

A short term fix is auditing the code with the above in mind. I suspect I will find big conceptual problems, and therefore may want to instead do...

The long term fix is explicit separate of these types, at least User and Session. This is a big change which should happen in a branch.

Situations to consider: - bot clients, which could be considered non-users like fake players - staff members, whose session names are prefixed like in IRC (asss seems to support this currently) - more...

The Client type might be better represented as Protocol, which could be divided into "features"; the real difference is what actions are supported. For example, chatnet clients only support the message system and can't get, or be put, in a ship. VIE respects most of what Cont does, minus warpto and ?send, among others. Unless multiple clients become actively developed, this probably isn't necessary. It might be a way of allowing bots to say they can do cont-like things.

grelminar (commenting on bug number 85): I hopefully fixed the crash that arnk mentioned about speccing fake players in rev d8534c.

Comments (1)

  1. Former user Account Deleted

    Copied from bug number 59 in old bug database.

    guest: When using the fake kill interface in game.c it doesn't call the kill callback or setup a green.

  2. Log in to comment