- Django 1.2, Redis, redis-py
- Optional (so far): NodeJS, node_redis, node-tyrant, Socket.IO, node-mongodb-native, angular.js, express
- Create a folder somewhere. By "ROOT", we'll be referring to that folder's full path.
- Put dotmuncher in ROOT
- Run
python dotmuncher/scripts/get-repos.py
, which will git clone these repos to ROOT:
cd ROOT/dev_deployment; mkdir -p tmpdir
cd ROOT/dev_deployment; env APP=dotmuncher python manage.py syncdb
cd ROOT/dev_deployment; redis-server conf/redis.conf
cd ROOT/dev_deployment; env APP=dotmuncher python manage.py runserver
env DJANGO_SETTINGS_MODULE=dev_deployment.settings python tests/all.py
GET /api/v0/..name....json?json=...input... ---> JSON response
phoneToken: ("i_" + UDID) if iOS, ("a_" + UUID) if Android
phone: an integer assigned by the server
{
phoneToken:
name:
}
{
phone: phone integer
}
{
"lat": string
"lng": string
"phoneToken": string
}
{
"phone": int
"items": [
{
"id": int
},
...
]
}
{
"lat": string
"lng": string
"phoneToken": string
}
{
"phone": int
"items": [
{
"id": int
},
...
]
}
{
"map": int id
"phone": int
}
{
"game": int id,
"gameToken": string
"mapInfo": {
"dotPoints": [...],
"basePoints": [...],
"powerPelletPoints": [...],
},
}
{
"game": int id
"phone": int
}
{
"mapInfo": ...see new_game...
}
{
lat: ""
lng: ""
hacc: ""
vacc: ""
game: int
phone: int
id__gte: int
}
{
phoneStates: [
// ordered by the official order in which the phones joined the game
{
phone: int,
// These will be included iff we've received a sample:
lat: "...lat...",
lng: "...lng...",
idle: ms since update,
alive: boolean,
},
...
],
powerMode: bool,
events: [
{...},
{...},
...
]
}
{// sent by server when handling {new_game,join_game}
type: OHHAI_EVENT = 2
phone: phone integer
name: string
i: event id,
t: timestamp (ms since epoch)
}
{
type: PHONE_EATEN_EVENT = 6
eater: phone integer
eatee: phone integer
i: event id,
t: timestamp (ms since epoch)
}
{
type: ITEM_EATEN_EVENT = 7
k: '["p","lat","lng"]' for power pellets, '["d","lat","lng"]' for path dots
i: event id,
t: timestamp (ms since epoch)
}
{
type: GAME_OVER = 8
reason: int
i: event id,
t: timestamp (ms since epoch)
}
GAMEOVER_PACMAN_WINS = 1
GAMEOVER_PACMAN_LOSES = 2