Hello all,
I know it's been a long time. I've been extremely busy and didn't have any time to work on Me and My Shadow.
I'm still quite busy but at least I have got some time on my hands now.
Anyway, back on topic. The server side is almost done.
We can divide the upload system in three parts: uploading, moderating, downloading.
UploadingThis part will mostly be server side, the client only has to send the HTTP post request.
I try to keep the upload script on the server as simple as possible.
The only measure to prevent spamming at the moment is a maximum size for the moderation queue.
- Check if the queue isn't full.
- Validate the (user) input.
- Create queue file.
- Write header to the queue file.
- Write body to the queue file.
The layout of the queue file is pretty simple:
type = <TYPE>
name = <name>
description = "<description>" (encoded with json_encode( ... ) )
update = <1 or 0>
username = <username>
email = <email> (not verified)
-- (delimiter)
<BODY>
ModeratingThe moderation should be easy and straightforward.
I plan on making a few bash scripts that can handle each step, a GUI can always be made later.
The work flow should consist of:
- Receive the queue.
- Check a queue entry (header and body).
- Adjust entry if needed.
- Commit entry to the addon git repository.
- Remove the entry from the queue.
I think the biggest problem is going to be the removing of the queue entry on the server side.
We don't want anybody to be able to remove it, so there needs to be some form of authentication for the moderators.
I think a simple
username,passwordhash file will do the job.
Concurrency might be a problem, but I think adding a check to see if the local working copy of the git repository is up to date before commit will do the job.
DownloadingThis system is already present in the game but needs to be extended as described here:
http://forum.freegamedev.net/viewtopic.php?f=48&t=2959&p=29171&hilit=addon#p29138Also part of the downloading is the levelpack management.
If an user uploads its levelpack and it gets pushed to the addon repository, he will most likely test it out.
This means that he will have two identical levelpacks installed, one in the addon path, the other in the custom path.
At the moment the game doesn't handle this too well (not at all.
)
Feedback is welcome!