You don't actually have to worry about changing the logging part right now, like I said. You just have to handle the rewarding part. You can actually pull this off without changing much of the existing systems, just drop in the part I mentioned about keeping track of the unread counts.

The letter count in particular is what the admins use to determine who's in need of a log check, when they select a player to assess it gives them a list of people with unread RP posts and sorts it by who has the highest count. This obviously requires the system to know who has what, which is the tricky part about handling this without manually loading everyone's values inside of a savefile loop. I got around that problem by creating the SQLite index file I mentioned above, which is basically just a database that contains a ckey, a letter count, a post count, and an offline reward number.

Once you've done that all you need to do is have the player's existing counts get stored when they login for the first time with the new system (doing it retroactively would be a big headache and it's not worth the trouble), then you set something to tell the system not to do that initial storage again -- because at that point you'd want to change it so the values are loaded from the database and not saved to it, then you just save the values in SaveCharacter() by dropping them into the database. This makes it so you don't have to change any of the existing code that handles the count variables, you just need to save/load them from a different, more centralized location.

Now that you've got the counts stored inside of a SQLite database you don't need the ugly sorting routines anymore and can write your own system to handle loading the list of people who need a check from the SQLite database.

Once selected it's just a matter of loading up the stuff from the text logs as usual. You don't really need a dummy mob because all you're after is rewards, you don't need to deal with admin edits or anything of that sort when the player is offline, not worth the effort (again).

The only two places you need to worry about changes at this point are in the 'Clear' command, and the 'Reward RPP' command on the super assess window, for both you'd need to go in and check if the player is offline at the time the reward would be applied, if they are you simply stick the reward value into the database I mentioned earlier in this post. This would obviously set the database values for their post counts to 0, so when they login next it'll load a 0 value (if they're online you just 0 out the variables, or both if you want to be extra careful).

When you're loading their unread counts from the database when they login, you check the offline reward value, and call the GetRP() (I think, it's been a while since I saw Eternia's source) proc with that value as it would be done if the person had been rewarded if they were online at the time. It'd give them the 'you have gained [x] RPP' message and all that without having to get all crazy with fake mobs and all that nonsense.

This is how I'd do it, if I just wanted a quick way to patch in offline rewarding without changing the logging system entirely.

If you're still having trouble getting the hang of it tomorrow when I'm around, you could try talking Chance into letting me access the source for a short time to write it up, as I've obviously got a pretty solid plan for doing so already.
Page: 1 2