I was wondering if anyone had decent luck with a connection account for swfotefuss?
That was one of the major things I'd like to get accomplished in my conversion rather than having each player log into their character directly. They'd connect to an account and from there log into one of their characters. I know quite a few current games offer such account systems...

I'll admit I am looking for a pretty easy drop in and run solution with a few tweaks here and there.While I'd love to try and whip up something from scratch is likely beyond my limited abilities. I'm just not sure whats going on with descriptors and all that fun jazz. Pretty low level stuff compared to what I'm used to mucking about with.

I dunno if anyone has plugin code for you, but the idea is simple enough.

Just add a new state to the login sequence, so instead of being a characer name, it gets a login/user name and checks a new file directory where you'll keep user accounts. After successfully logging in or creating a new user, you'd have the old character name state where it gets which character you want to log into.

The difference is, character names not stored in the user file would be rejected. If you want to be fancy, you could print a listing of existing names and let the user pick them by number as well.

Each character would need to have a new field to refer back to the owning user.

So I've hacked together bits and parts taking the idea's from the account file snippet I found over on mudbytes.Accounts seem to be loading, even have it where I can reward them with RP Points (YAY!). However, I'm having issues with do_quit function of act_comm.c . . . GRRR

What I'm trying to do is once your ready to quit, have you return back to the account screen. I thought it would be as simple as changing your descriptor once your character has quit to point back to CON_ACCOUNT_PENDING. Like whats in the patch file.

I haven't looked at said account snippet, but maybe you need to modify the extract_char function? As far as I recall there's some code at the bottom that closes the socket. You could do some magic there to ensure you get back to the account menu rather than closing the socket.

Hmm, seems I've not thought about rewarding RPP all the way though. Right now, since its stored as account data, and account data is accessed via ch->desc->account, when one uses 'loadup <character>' to reward them the game crashes as its looking for a descriptor which naturally isn't there, or any command that's trying to pull account data.

I am drawing a blank on how to add the account junk to loadup so that its valid?

Naa, I know why the descriptor is invalid because its set to NULL in the code from do_loadup. Nothing is actually open and pointing to 'd'.
I was originally thinking that I wanted to see if I could fake the descriptor to something just so I could write to the account file directly. However, I've come up with a better(?) solution. Since I didn't remove the rppoints from CHAR_DATA, why not use it? It seems so obvious, I don't know why I didn't think of it at first.

Basically tossed in a check to reward to look for ch->desc != NULL. IF its null then we reward to the pfile, if its not null then we reward to the account. As I understand it, the descriptor should be valid as long as there is a connection. If we try to reward a linkdead player, it writes out to their pfile.

When the player loads that character, in the account start-up, after it runs load_char_obj looks for if(d->character->rppoints != 0) and then sums them up to d->account->points. As of right now, it won't do anything if an imm loads them up and they reconnect in the loadup process as they are already playing. I honestly don't see that as a big deal, however if players do start to complain about it, then I'll do something about it.

The downside of this system is that if someone who posts a log gets rewarded on someone who doesn't play very often, well there is a chance they could be missing some rpp. However, if they were expecting some RPP on that character, then it should be up to them to check that they received on it.
I even added a nice little line right before the title/motd print saying 'Some RPP were moved from this Character to your account!'.

I'm still interested in if anyone has a better way of going about it.
ayuri

Ok, well now I'm fully stumped. I'm trying to allow multi-playing though the account system so that each player tied to the account shares RPP. Here's my current situation: Two players connect using the same account 'test', players are called player1 and player2 to help me explain. I reward player1 10 rpp. Player1 types 'account' to display account info and they see 10 rpp listed. Player2 types 'account' and they show 0 rpp. I look at the physical account file, the account file saved to disk shows 10 rpp.
Its my understanding since the data is being written to the file, anyone on that account should be able to see updated data...I have this feeling I'm missing something simple here, but I'm just not seeing it.

Here's some of the relevant code, if you wish to see more let me know.
First up, the reward function so you can see that its saving the account:

Maybe I'm just not understanding something here. I've looked at setship for an example, you set the ship, the ship saves the data via save_ship and then you stat the ship and the changes show up with out having to reload the ship file, shouldn't I be able to do the same with account files? Granted, descriptor and character names will be different, but they are all pointing back to account->name, so it should then pull the most current info. . . Right?

And looping though every connected descriptor and setting them all at once. This way every descriptor connected has the same value. Granted this would need to be put in for everything that would read/write the points line, but it *should* work.. . Right?

I know its ugly, but I'm still not seeing why the points value isn't updating across players.
*goes back to beating the code with a sledge hammer, while muttering "I'm in way over my head"*
ayuri