Synopsis: Loading/changing offline players. December 96 From: erwin@pip.dknet.dk To: MERC/Envy Mailing List Subject: Re: editing a string of a file online On Sun, 8 Dec 1996, do i care? wrote: > let's say you want to remove someone who is not on off a clan: > offline you will edit his file and remove the line with the clan field, > but what i wanan do is do everything online, The best solution would be not to keep clan data in a player file, but rather keep the list of players in the clan file (and so, always online). Then, when a player logs on, set his ->clan to point at whatever clan he is in, so you don't have to look every clan up if you want to check clan membership. You could also load the off-line player, change his clan field, save him, and free him. Set up a "fake" descriptor, as load_char_obj takes one, and then load the player, something like: DESCRIPTOR_DATA d; if (!load_char_obj(&d, name)) /* validate name first! */ no player with that name else d.character->desc = NULL - to make sure nothing will send to this fake descriptor by accident Move the character to the proper room, including pets and such remove from clan Move the character (and pets) to the room where he was when loaded save_char_obj(d.character) do_quit(d.character,""); Of course, you have to make sure that the player really isn't online while this happens, as then this will have bad results :) Also, you need to make absolutely sure that you do everything that the game does when entering a new player: this especially includes moving the pet to the location with the character. I use roughly the above technique for a command that loads offline players so I can do fun things to them :P I don't quit them, they simply stay linkdead, and I can force them/advance them/demote/examine their inventory them etc. - which is a bit easier than finding the player file and editting it (considering the server is quite far away from me). ============================================================================== Erwin Andreasen Viby J, Denmark Computer Science Student at Aarhus Business erwin@pip.dknet.dk College ============================================================================== [This post originally used d->character rather than d.character, as pointed out by Eric Kidder]