When logging out while in a ship

    Joined
    Nov 16, 2014
    Messages
    22
    Reaction score
    1
    I think it would help admins a great deal if ship cores would act as an undeathinator when players log out of the game while in a ship core.

    I spend a lot of time locating and giving people ship cores to fly back to their ships that have floated away,
     
    Joined
    Aug 30, 2013
    Messages
    1,744
    Reaction score
    323
    Wouldn't that be a bonus, hell respawning on a ship period would be great but I know why it's hard to program that in
     

    jayman38

    Precentor-Primus, pro-tempore
    Joined
    Jul 13, 2014
    Messages
    2,518
    Reaction score
    787
    • Purchased!
    • Thinking Positive
    • Legacy Citizen 4
    It shouldn't be that hard to program.
    1. Add a linked list hook into the entity code, so that every structure can hold a list of other entities. In this case, the list would contain "held" entities (primarily, player and NPC entities).
    2. Add each on-board player and their relative coordinates to this list when that player enters a computer, control chair, activates logic, activates a door group, or exits the game (basically, does anything on the structure), and take them out of the list when they leave the structure's bounding box and are no longer aligned with it. If a player hasn't done anything to merit being on the "held list", they probably don't need to expect that they are on-board the ship when they return to the game.

    Then, whenever the player logs in, they are teleported to the ship on which they are listed, at the coordinates stored. If a bug causes them to be on more on than one structure's list, the first list wins, and subsequent lists have that player purged.

    This process lends itself well to database storage and retrieval, so when a player logs in, the game can do a quick query search of the saved data for only that player, to determine which entity they are in, if any. If they are found, they are teleported to the holding entity. If not, the existing logic takes over and their regular logoff coordinates are used instead. It should be a quick subroutine added into the existing logic.

    To log in multiple people at once, there probably needs to be a delay between subsequent players, so that if a whole pile of players logs on at once (for instance, maybe a popular server just rebooted), it won't crush the server.
     

    Blakpik

    Angler
    Joined
    Dec 3, 2013
    Messages
    431
    Reaction score
    119
    • Legacy Citizen 10
    It shouldn't be that hard to program.
    1. Add a linked list hook into the entity code, so that every structure can hold a list of other entities. In this case, the list would contain "held" entities (primarily, player and NPC entities).
    2. Add each on-board player and their relative coordinates to this list when that player enters a computer, control chair, activates logic, activates a door group, or exits the game (basically, does anything on the structure), and take them out of the list when they leave the structure's bounding box and are no longer aligned with it. If a player hasn't done anything to merit being on the "held list", they probably don't need to expect that they are on-board the ship when they return to the game.

    Then, whenever the player logs in, they are teleported to the ship on which they are listed, at the coordinates stored. If a bug causes them to be on more on than one structure's list, the first list wins, and subsequent lists have that player purged.

    This process lends itself well to database storage and retrieval, so when a player logs in, the game can do a quick query search of the saved data for only that player, to determine which entity they are in, if any. If they are found, they are teleported to the holding entity. If not, the existing logic takes over and their regular logoff coordinates are used instead. It should be a quick subroutine added into the existing logic.

    To log in multiple people at once, there probably needs to be a delay between subsequent players, so that if a whole pile of players logs on at once (for instance, maybe a popular server just rebooted), it won't crush the server.
    I may be a dumbarse, but all I saw was long and confusing words. :P
     

    jayman38

    Precentor-Primus, pro-tempore
    Joined
    Jul 13, 2014
    Messages
    2,518
    Reaction score
    787
    • Purchased!
    • Thinking Positive
    • Legacy Citizen 4
    I may be a dumbarse, but all I saw was long and confusing words. :p
    It goes to show that Schema's amazing work to make this game function is actually much harder than a layperson would think. All hail the cat.