ID:1362539
 
(See the best response by Lavitiz.)
Code:
world/Del()
if(fexists("SystemFiles/Changelog.txt"))
fdel("SystemFiles/Changelog.txt")
text2file(Changelog,"SystemFiles/Changelog.txt")
else
text2file(Changelog,"SystemFiles/Changelog.txt")
..()
world/New()
if(fexists("SystemFiles/Changelog.txt"))
Changelog = file2text("SystemFiles/Changelog.txt")
..()

mob
var
ChangelogUp = 0
verb
Changelog()
if(usr.ChangelogUp==0)
winset(usr,"Changelog","titlebar=0;is-visible=true;border=0;can-resize=false")
usr << browse("<html><body bgcolor='#900020'><center><img src=Banner.png></img><br><table border bordercolor=white><tr><th colspan=3><font color=#D3D3D3>Changelog</th></tr>[Changelog]</table></center></html>","window=Changelog;titlebar=0;border=0")
usr.ChangelogUp=1
else
winset(usr,"Changelog","is-visible=false")
usr.ChangelogUp=0

var
Changelog
new_changelog
Currenttime=time2text(world.realtime,"MM/DD/YYYY")

mob/Staff/verb
Set_Changelog()
set category = "Staff"
var/msg = input("Set changelog to?","Changelog") as text
if(!msg) return
new_changelog="<tr><td><font color=#D3D3D3><u><center>Author:</u><br>[src.name]</center></td><td><font color=#D3D3D3><u><center>Date:</u><br>[Currenttime]</center></td><td width=350><font color=#D3D3D3><center>[msg]</center></td></tr>"
Changelog=new_changelog+Changelog


Problem description:
Is there any more efficient way to handle a changelog in-game, meaning the saving and loading of it.
The way you're doing it, save files, external web page, sql database.

I'm not sure what you're looking for. Define "more efficient" for me. It all depends on what you're trying to accomplish.
In response to Lavitiz
Lavitiz wrote:
The way you're doing it, save files, external web page, sql database.

I'm not sure what you're looking for. Define "more efficient" for me. It all depends on what you're trying to accomplish.

Just saving it in a file server-side.
Best response
Text or save file works. Simplicity isn't a bad thing. =P

Are you having trouble with the one you use currently? Or were you just seeking an opinion?
In response to Lavitiz
Lavitiz wrote:
Text or save file works. Simplicity isn't a bad thing. =P

Are you having trouble with the one you use currently? Or were you just seeking an opinion?

It's working perfectly fine, I just wanted an opinion from other developers.
Yeah, every way is fine, really. I generally don't save stuff in raw text though. Using save files is my preferred method so it's not as simple as opening it up in a text editor to make changes.

Either way works though, and it's completely up to you.
I prefer MySQL saving due to the querying ability of it. When you look at logs, your usually looking for something, so it gives you the power to define it quickly.

For BYOND Server side saving, if the server crashes and Del() isn't called then you won't save your new changelog. I wouldn't pull back the entire change log into the game either.

I would probably instead append to the file as changes happen.
file("SystemFiles/Changelog.txt") << newchange


If it needs to be loaded, I would just browse(file("SystemFiles/Changelog.txt"))


Edit: Changed MSSQL to MySQL. MSSQL isn't as easy to access in BYOND.
SQL does have the benefit of you being able to paginate the changelog quite easily, which makes a fair amount of usability sense, as opposed to loading up the entire changelog for your game for the past X years or whatever as one huge text/save file.