[1.3.b50] Automatically save message history

If you have an idea for a new feature, please discuss it in the main MapTool forum first, then post a summary of the discussion here. Use the first Sticky as a template.

Moderators: dorpond, trevor, Azhrei, giliath, jay, Mr.Ice

Post Reply
User avatar
Merkuri
Giant
Posts: 194
Joined: Sat Feb 28, 2009 3:20 pm
Location: Massachusetts, USA

[1.3.b50] Automatically save message history

Post by Merkuri »

I would like there to be a way to save the message history automatically.

I used to be an OpenRPG user (technically I still am, but I'm trying to get my group to move over to MapTool) and one of the few OpenRPG features I liked that I didn't find in MapTool was that OpenRPG saved a chat log as you played. It seemed to save it line-by-line as you were playing, so if the program crashed you didn't lose the whole history. I would love it if MapTool did something like this.

It should save the log to a directory of the user's choosing (set in Edit -> Preferences?) and should save it with a name like "Name-Year-Month-Day.htm". The name could be customizable (also set in Edit -> Preferences?). An example would be, "Log-2009-03-01.htm".

An acceptable feature would be if it saved the log automatically on quit, but even better would be if it added to the log file one line at a time so that in the event of a crash or a hard shutdown you wouldn't lose the whole session's log.
Adventure is not outside; it is within.
--Found in a fortune cookie on game night

MapTool Framework for Sufficiently Advanced

User avatar
Azhrei
Site Admin
Posts: 12086
Joined: Mon Jun 12, 2006 1:20 pm
Location: Tampa, FL

Re: [1.3.b50] Automatically save message history

Post by Azhrei »

Hmm, this is cool. :)

I think I'd like some options about how often it saves the log, though. Every line is certainly one option. Perhaps another could be whenever a GM posts a message (whisper or otherwise).

To save a new line each time would mean either keeping the file open and always appending new text. That's a pain under Windows because then the file can't be viewed at the same time. Another option would be to open the file, append to the end, and then close it. That's more overhead, but allows the file to be copied out from under the application if necessary (so to upload to a web site in the middle of a game session).

Does anyone else have any conditions which should trigger an auto-save?

User avatar
Merkuri
Giant
Posts: 194
Joined: Sat Feb 28, 2009 3:20 pm
Location: Massachusetts, USA

Re: [1.3.b50] Automatically save message history

Post by Merkuri »

Azhrei wrote:Another option would be to open the file, append to the end, and then close it.
I think that's what OpenRPG does, and it doesn't seem to have a problem. I know that you can view the file while you're playing a game. If it doesn't log every single post it at least logs very frequently, maybe once a second or so.

I think it's perfectly acceptable to put in options for how often it logs. Maybe have the user choose between "log on close", "log every post" and "log once every X seconds" where X is a user-inputted number between 1 and 60 (I don't think you'd want to log any slower than once an hour).
Adventure is not outside; it is within.
--Found in a fortune cookie on game night

MapTool Framework for Sufficiently Advanced

User avatar
palmer
Great Wyrm
Posts: 1367
Joined: Sat Sep 06, 2008 7:54 pm

Re: [1.3.b50] Automatically save message history

Post by palmer »

Myself, I would set it to save

A: After every message
B: unless it was last saved less than 5 (or X) seconds ago

This keeps the log very close to real-time, but doesn't bog it down with file access when there's a sudden spate of messages.

User avatar
Azhrei
Site Admin
Posts: 12086
Joined: Mon Jun 12, 2006 1:20 pm
Location: Tampa, FL

Re: [1.3.b50] Automatically save message history

Post by Azhrei »

Alright, I've added this to my todo list.

User avatar
jfrazierjr
Deity
Posts: 5176
Joined: Tue Sep 11, 2007 7:31 pm

Re: [1.3.b50] Automatically save message history

Post by jfrazierjr »

Azhrei wrote: Does anyone else have any conditions which should trigger an auto-save?
How about the most obvious: When maptool autosaves the campaign every 5 minutes.

Issues to think about: how do you deal with saving and to where when someone has used the /clear command???? Perhaps there would need to be some type of value incremented with /clear so that the filename could be created without overriding the previous one and not duplicate data?
I save all my Campaign Files to DropBox. Not only can I access a campaign file from pretty much any OS that will run Maptool(Win,OSX, linux), but each file is versioned, so if something goes crazy wild, I can always roll back to a previous version of the same file.

Get your Dropbox 2GB via my referral link, and as a bonus, I get an extra 250 MB of space. Even if you don't don't use my link, I still enthusiastically recommend Dropbox..

User avatar
Merkuri
Giant
Posts: 194
Joined: Sat Feb 28, 2009 3:20 pm
Location: Massachusetts, USA

Re: [1.3.b50] Automatically save message history

Post by Merkuri »

The log should ignore the /clear command. I want the log to be something I can look back on after the game is over in case I want to remember a certain NPC's name, or where they said we could find the next McGuffin. If I use the /clear command to get rid of old clutter in the chat window that's all I want it to do... clear the chat window. It shouldn't go back and delete anything in the log file.

And personally, I don't think five minutes is fast enough to log. I want a situation as real-time as possible so that if somebody smashes their car into the utility pole outside and I lose power I'll lose as little of the log as possible. A lot can happen in five minutes in the chat window. I understand that others might not want it to log that fast, but I do. :) Which is why I'm all for putting in a configurable time limit.
Adventure is not outside; it is within.
--Found in a fortune cookie on game night

MapTool Framework for Sufficiently Advanced

User avatar
Merkuri
Giant
Posts: 194
Joined: Sat Feb 28, 2009 3:20 pm
Location: Massachusetts, USA

Re: [1.3.b50] Automatically save message history

Post by Merkuri »

Azhrei wrote:Alright, I've added this to my todo list.
Thanks much! :D
Adventure is not outside; it is within.
--Found in a fortune cookie on game night

MapTool Framework for Sufficiently Advanced

User avatar
Mrugnak
Dragon
Posts: 745
Joined: Mon Jul 21, 2008 7:38 pm

Re: [1.3.b50] Automatically save message history

Post by Mrugnak »

I'd also want as close to real-time as possible but if the first implementation is just part of the autosave process, that's cool too.

Ideally, I'd like a file name based on the date, and the time the session started.

Optional bonus feature would be to start with the name of the campaign file you had loaded, or server/IP you connected to if you're just a player. THEN add date, then time.

Date should not be in the American format. I love you guys, but seriously, computer nerds everywhere know that dates should sort numerically :D

YYYY MM DD HH MM (SS?) - not this demented MM DD YY business you guys get up to.

Super bonus points for letting us define our own naming pattern, using wildcards, %Year or whatever. :D

User avatar
Merkuri
Giant
Posts: 194
Joined: Sat Feb 28, 2009 3:20 pm
Location: Massachusetts, USA

Re: [1.3.b50] Automatically save message history

Post by Merkuri »

OpenRPG creates a log named "Log-YYYY-MM-DD.html" The "log" name is configurable. All chat messages posted on the same day go into the same log file, even if you had one session in the morning and one at night, and if you have a session that goes past midnight it gets split into several files.

This implementation is perfectly fine with me, and will probably be very easy to implement. It's really easy to merge or cut HTML files yourself if you don't like the way they ended up. I really just want something quick and dirty that ensures I have something to search through if I forgot who took that +1 Cloak of Resistance two weeks ago.

More advanced features like those Mrugnak suggested can come later.
Adventure is not outside; it is within.
--Found in a fortune cookie on game night

MapTool Framework for Sufficiently Advanced

User avatar
Azhrei
Site Admin
Posts: 12086
Joined: Mon Jun 12, 2006 1:20 pm
Location: Tampa, FL

Re: [1.3.b50] Automatically save message history

Post by Azhrei »

Mrugnak wrote:Date should not be in the American format. I love you guys, but seriously, computer nerds everywhere know that dates should sort numerically :D
Heh-heh. But you see, we know how to write code, so for us it's easy to set a later field to be the primary key and an earlier field as the secondary key. ;)

Yeah, my plan is to use the format specifiers provided by the java.util.text library (I think that's it). This is the same one Craig uses for the strformat() macro function.

I'm going to try to work on this tonight and tomorrow.

User avatar
Merkuri
Giant
Posts: 194
Joined: Sat Feb 28, 2009 3:20 pm
Location: Massachusetts, USA

Re: [1.3.b50] Automatically save message history

Post by Merkuri »

Is there any hope to get this in before 1.3 goes final? We lost the transcript of our most recent game because MapTool crashed before the GM could save it. We lost the transcript of the game before due to a power outage. It would really have been nice if the transcript was saving as we went along.
Adventure is not outside; it is within.
--Found in a fortune cookie on game night

MapTool Framework for Sufficiently Advanced

User avatar
Azhrei
Site Admin
Posts: 12086
Joined: Mon Jun 12, 2006 1:20 pm
Location: Tampa, FL

Re: [1.3.b50] Automatically save message history

Post by Azhrei »

I've been saying this for the last couple weeks now, but maybe it'll be a reality now?

"I've got some time off so I'm hoping to get back into MapTool coding." (sigh)

I'm not scheduled to work again until early June, so in addition to some work on my brother's web site, some business stuff (writing a new course on Linux Performance Mgmt), and other miscellaneous jobs, I want to work on my TODO list (see the link in my sig)...

Post Reply

Return to “Feature Requests”