SoC2012 Ivan Addon Server

From The Battle for Wesnoth Wiki
Revision as of 18:35, 26 March 2012 by IvanS (talk | contribs)


This page is related to Summer of Code 2012
See the list of Summer of Code 2012 Ideas



This is a Summer of Code 2012 student page


Contents

Description

Ivan Savenko - Addon Server

The goal of this project is to write a new add-on server for Wesnoth from scratch. Original draft in SVN (latex): http://svn.gna.org/viewcvs/wesnoth/trunk/doc/design/

Will be written in C++, networking part - boost::asio. From existing codebase I'm going to use WML parser (class "config") and forum integration (class "fuh" aka "forum user handler")

IRC

IvanSav

Detailed proposition

Protocol specification

  • Add to PBL field "status". Set by author (Complete, Beta, Incomplete, Unusable).
    • Unusable means that add-on is for testing purposes and should not be installed by regular user.
    • This field can be set by server to "Broken" if wmlint will fail (may happen when new version of Wesnoth or prerequisite add-on is out).
  • Field "uploader" - will be replaced by "uploaders" (probably automatically or by wmlint). List of usernames who can access this add-on, username must be valid
  • Field "authors" - will be displayed as it, no checks for username validness

Users authentication

This will remove any need to store password or e-mail in PBL and will make contacting author by administration easier (PM on forum or e-mail).

Unregistered users - needs discussion, easiest way is to disable uploading for unregistered users. Reasoning: even basic e-mail confirmation (as proposed by shadowm) is almost identical what we have at forum.wesnoth.org but will require notable amount of work.

Most of UMC authors have account anyway. I found ~20 UMC authors with add-ons on 1.8 server that don't have account with exactly same username, most of which are typos or a bit different username.

Behaviour will be similar to multiplayer server.

Add-ons updating

Server will keep history in this format:

[update]
	"uploader" = username of person who uploaded this version
	"timestamp" = unix timestamp of upload
	"ip_address" = ip address of uploader
[/update]

Wesnoth uses separate server for each major version so history size won't be significant.

Wescamp

Proposed behaviour:

1) When add-on is uploaded\updated it will be automatically uploaded to github.com/wescamp if field in WML "translate" set to true. This will be done by external tool (wescamp.py, probably will be modified).

2) Another tool running in background will either

a) check every %TIME% for any updates on github

b) wait for any post receive hooks to trigger. This is better but more complex solution.

If there are any changes in .po files - compile them via msgfmt tool from gettext.

Connect to add-on server, login as admin and send WML message "update_translation" with new .mo files.

NOTE: interaction with with add-on server via network won't create any notable lag in case of communications with localhost and easies one to implement. Such solution won't remove possibility of uploading translations remotely.

Dependencies

format is mostly described in draft.

  • "requires" - add-on must be installed before this one
  • "conflicts" - only one add-on of these two can be installed.
  • "recommends" - add-on have non-essential content that will be used by this one

Timeline

Summer of code timeline

Type Time Description
Docs June, week 1-2 Finish protocol specification draft.
Server June, week 1-2 Create basic server capable of receiving\sending WML.
Server June, week 3 Add-on upload\download support.
Server, Client June, week 4 Integration with existing database from forums.
Server, Client July, week 1 Add-on updating support. Finish any remaining tasks. SoC mid-term evaluation.
Server July, week 2 Implement hooks on server, enable content validation via wmlint
Wescamp July, week 3-4 Implement tools for receiving translations from github and for uploading add-ons on github
Server, Client August, week 1-2 Dependencies support
General August, week 2-3 Finish any remaining tasks. SoC "pencils down" date.

Possible post-GSOC tasks

Client-side improvements

  • Send add-on icons to client, probably with some caching. Reasoning: Currently some add-ons use icons from resources of not-yet-installed add-on. Estimated length: 1 week.
  • Merge "Remove Add-on" dialog into "Add-ons Manager", add filter "Installed add-ons". Reasoning: not intuitive, for example only way to see installed add-ons is to open "Remove Add-on" dialog. Estimated length: 2 weeks.
  • Remove "Connect to Server" dialog. Reasoning: selecting add-on server is (completely?) unused. May be kept in configuration file or as command line parameter for those rare cases. Estimated length: 1 week.
  • Improve "Add-ons Manager" dialog. Will describe this later.
  • In-game bug reporting by users. Wesnoth will collect required data (Wesnoth version, OS, add-on version) along with savegame and will send it to add-on author via e-mail along with bug description by user. Needs discussion.

Questionnaire

Basics

Write a small introduction to yourself.

My name is Ivan Savenko, I'm from Ukraine, Chernihiv, really interested in programming and computers in general, I am an avid gamer which makes games development even more interesting for me.

State your preferred email address.

Check Google application - I'll post it there

If you have chosen a nick for IRC and Wesnoth forums, what is it?

IvanSav on both IRC and forums

Why do you want to participate in summer of code?

I really love coding and I would like to spend summer on something that will be used in real world in quite big community.

What are you studying, subject, level and school?

I study system programming at Chernihiv State Technological University, 4th year of study.

What country are you from, at what time are you most likely to be able to join IRC?

I'm from Ukraine (GMT+2), can be on IRC from ~12:00 GMT and till ~24:00 GMT.

Do you have other commitments for the summer period ?

I only have exams in May, will be free for all 3 summer months.

Experience

I've been working on several small apps for fun, one of my goals usually were speed, usage of new features like C++11, trying to implement some complex algorithms (like SDL game that uses only runtime-generated images).

What programs/software have you worked on before?

Apart from small university tasks I'm working on VCMI project.

Have you developed software in a team environment before?

I think I can say yes. I've been working in team on VCMI but apart from some discussions on forums work is usually separate.

Have you participated to the Google Summer of Code before?

Nope. This is first time and most possibly the last time I'm trying to take part in GSoC - will be too busy with graduation next year.

Are you already involved with any open source development projects? If yes, please describe the project and the scope of your involvement.

VCMI, open-source engine for Heroes of Might and Magic III. (vcmi.eu) I've joined this project ~2 years ago. It's quite small project which turned out to be really good way to learn more about C++ after studying it in the university. Apart from some minor stuff I've been working on bringing support for 32-bit graphics in originally 256-colors only game and JSON-based configuration system.

Gaming experience - Are you a gamer?

Definitely :)

What type of games?

Either strategy games (Heroes of M&M, Civilization) or RPG's (Baldur's Gate, The Elder Scrolls)

What type of opponents do you prefer?

I'm playing singleplayer only so I prefer AI. Smart one, if possible.

Are you more interested in story or gameplay?

Good story mostly or gameplay where you need to think at least from time to time.

Have you played Wesnoth? If so, tell us roughly for how long and whether you lean towards single player or multiplayer.

Can't tell for how long but I've completed all campaigns that were in 1.8. Played single player games only.

If you have contributed any patches to Wesnoth, please list them below.

None so far.

Communication skills

Though most of our developers are not native English speakers, English is the project's working language. Describe your fluency level in written English.

Written English is probably good. Have no problems with understanding others and vice versa.

What spoken languages are you fluent in?

Russian and Ukrainian. Probably English, but I've never spoke with native English speakers so can't say for sure about this one.

Are you good at interacting with other players? Our developer community is friendly, but the player community can be a bit rough.

Shouldn't be a problem.

Do you give constructive advice?

So far there were no complains regarding my advices so I think that yes.

Do you receive advice well?

If somebody is trying to help me then why should I complain? If he is right I may learn something useful after all.

Are you good at sorting useful criticisms from useless ones?

I hope so.

How autonomous are you when developing ?

I definitely can code autonomously but I'd rather discuss all points I'm not sure about before working on them. So in general it will be a mix of both. At first - discuss all basics, then make some small proof-of-concept and go back to discussion. It's much more easier for me to explain something with small snippets of code instead of trying to this in words.

Project

Did you select a project from our list? If that is the case, what project did you select? What do you want to especially concentrate on?

I've took it from the list, Addon server. Considering that this should work as daemon I should foxus on stability and keep it extendable to implement all optional features Wesnoth may need.

Why did you choose this project?

It's (mostly) a standalone app, that have to be fast and stable, should use boost::asio (which I would like to learn). Addon server is something that I may need sooner or later myself.

Include an estimated timeline for your work on the project.

See SoC2012_Ivan_Addon_Server#Timeline

If anything won't be finished by August then I'll continue to work on it after GSoC.

Include as much technical detail about your implementation as you can

See SoC2012_Ivan_Addon_Server#Description

What do you expect to gain from this project?

Experience making actively used application, some networking knowledge. Working addon server that I can use myself apart from using it in Wesnoth.

What would make you stay in the Wesnoth community after the conclusion of SOC?

Basically any work on this project in case if I won't finish something in time or in case of new feature request.

Practical considerations

Are you familiar with any of the following tools or languages?

  • Subversion - basic commit\checkout via GUI
  • C++ and STL - good I think. Have been actively using it for at least 2 years.
  • Boost - I've used several libraries (filesystem, functions, algorithms...), but not asio
  • SDL - more-less familiar with SDL 1.2
  • build environments - used autotools, would like to learn cmake at some point
  • WML - Nope.
  • Python Lua - No experience with scripting languages, would like to learn Python though

Which tools do you normally use for development? Why do you use them?

  • Linux (Ubuntu) - It may not be perfect but it's really easy to use for developing.
  • C++ - Have some flaws but it is more-less portable and powerfull without notable speed loss.
  • CodeLite - quite small C++ IDE that have all functionality I need.

What programming languages are you fluent in?

I think I'm good in C++, decent in C, know a bit about Java\C# and Python.

Would you mind talking with your mentor on telephone / internet phone?

OK. But my spoken English is most possibly awful so I hope that this won't be necessary :) Will post it in Google application.

Links