Hacking
|
Size: 5390
Comment:
|
Size: 5746
Comment:
|
| Deletions are marked like this. | Additions are marked like this. |
| Line 14: | Line 14: |
| == Core Ubuntu Accomplishments System == |
|
| Line 25: | Line 27: |
== Ubuntu Accomplishments Web Editor == This is the Django-based web editor for editing Ubuntu Accomplishments online. * Ubuntu Accomplishments Web Editor: * Code - https://code.launchpad.net/ubuntu-accomplishments-web-editor * Bugs - https://bugs.launchpad.net/ubuntu-accomplishments-web-editor |
Hacking on Ubuntu Accomplishments
This page provides some guidance for how you can contribute to the Ubuntu Accomplishments system, help fix bugs, and make it better. Thanks to every one of you who contributes to help make it better for our users.
Where We Live
You can see a general overview of the entire project at:
You can also see an overview of all bugs at https://bugs.launchpad.net/ubuntu-accomplishments
Core Ubuntu Accomplishments System
Here is where you can find the different resources as part of the project:
- Ubuntu Accomplishments System - this is the core system (the GUI and daemon).
Code - bzr branch lp:ubuntu-accomplishments-system
Bugs - https://bugs.launchpad.net/ubuntu-accomplishments-system
- Ubuntu Community Accomplishments - this is a set of accomplishments for the Ubuntu community.
Code - bzr branch lp:ubuntu-community-accomplishments
Bugs - https://bugs.launchpad.net/ubuntu-community-accomplishments
- Ubuntu Accomplishments Extra Information - a collection of translated files used to gather extra info for scripts.
Code - bzr branch lp:ubuntu-accomplishments-extra-information
Bugs - https://bugs.launchpad.net/ubuntu-accomplishments-extra-information
Ubuntu Accomplishments Web Editor
This is the Django-based web editor for editing Ubuntu Accomplishments online.
- Ubuntu Accomplishments Web Editor:
The Architecture
The Ubuntu Accomplishments system is inspired by accomplishments systems used in other systems such as the Sony Playstation 3 trophies, StackExchange Badges, and FitBit Badges. The goal here is to create an accomplishments system that is extensible enough to be used by by local applications on a computer and contributions made to the Ubuntu community.
In performing this work, these are some core goals:
Extensible - this system should be flexible enough that accomplishments at a desktop level (e.g. “Sent Email From Thunderbird” or “Sent First Tweet In Gwibber”) can be achieved, as well as project contributions (e.g. “Filed First Bug”).
Discoverable - the user should be able to see what trophies are available and find out how to achieve them.
Highly Distributed - the solution should be as de-centralized as possible so as to reduce the need for an extensive central service.
Integrated - the solution should be tightly integrated into Ubuntu itself and not just a series of disconnected web-pages.
there are two core types of accomplishments:
Local Accomplishments - accomplishments that are local to your specific computer and do not require verification elsewhere (e.g. completing a level in a game).
Global Accomplishments - accomplishments that require verification from a third party (e.g. filing your first bug in Ubuntu).
All accomplishments have the same kind of format and schema, but local and global accomplishments differ in how they generate trophies.
For local accomplishments (e.g. completing a level on a game on your system), the following files are involved:
.accomplishment - this file outlines some cosmetic details about the accomplishment such as the name (e.g. ‘Level 2 Completed’), an icon (e.g. ‘level2.png’) and what other accomplishments should be completed before this one can be unlocked (e.g. ‘mygame/level1complete’).
.trophy - this file is the generated trophy that represents the completed accomplishment. libaccomplishments-daemon generates it.
Here the .accomplishment file describes the accomplishment and when that accomplishment occurs (e.g. in a game you complete Level 2) the app would call the accomplishments system to process the .accomplishment file and generate the .trophy. This trophy would be added to the Ubuntu One Share for the local trophies.
For Global Accomplishments we need to poll external services to check if an accomplishment has been achieved (e.g. Filing Your First Bug in Launchpad). To perform this polling we need the following:
.accomplishment - this file outlines some cosmetic details about the accomplishment such as the title (e.g. ‘First Bug Filed’), an icon (e.g. ‘default.png’) and what other accomplishments should be completed before this one can be unlocked (e.g. ‘ubuntu-community/registered-on-launchpad’).
A script (for global accomplishments) - a file that contains the logic for determining if an accomplishment has been achieved (e.g. for a ‘First Bug Filed’ accomplishment this is a small Python script that connects to Launchpad to see if you have filed a bug yet).
At regular intervals, the daemon looks to see, for each user on the system, which global accomplishments they have not yet accomplished. For each accomplishment, the system then runs the corresponding script.
A script is expected to exit with a specific exit code:
- 0 - for “the accomplishment is now accomplished”
- 1 - for “the accomplishment is not yet accomplished”
- 2 - for “there was an error”.
If the logic script indicates that the accomplishment was successfully accomplished, the system creates the appropriate .trophy file. However, because this is a global accomplishment, it needs to be validated by a separate service to ensure the user isn’t faking it. As such, this separate hosted service has the same script and verifies it, and then signs it if successfully verified.
Accomplishments/GetInvolved/Hacking (last edited 2012-08-02 14:19:25 by ip72-218-233-75)
