This is the API server for the Playtomic tools.
Playtomic is a collection of open source tools for games like leaderboards, user created content and dynamic content.
Setup instructions and help are available at:
Playtomic API Server
License: Other
This is the API server for the Playtomic tools.
Playtomic is a collection of open source tools for games like leaderboards, user created content and dynamic content.
Setup instructions and help are available at:
There was a problem with the app.json file found at "https://github.com/playtomic/apiserver/tree/master":
The plan "sandbox" for the addon "mongohq" does not exist. Please ensure that the plan is spelled correctly.
Hi,
I am having some errors when trying to start the server on Heroku.
I followed the steps on the "Setup Server" page ("Nearly instant setup").
2016-07-21T09:26:23.092196+00:00 heroku[web.1]: Starting process with command `node web.js`
2016-07-21T09:26:25.473398+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2016-07-21T09:26:26.821527+00:00 app[web.1]: Listening on 36678, env: production, local: false
2016-07-21T09:26:26.908267+00:00 app[web.1]: EXCEPTION:
2016-07-21T09:26:27.735291+00:00 heroku[web.1]: Process exited with status 143
2016-07-21T09:26:27.473934+00:00 heroku[web.1]: State changed from starting to up
2016-07-21T09:26:29.142508+00:00 app[web.1]: { [MongoError: not authorized on heroku_mn3xtgkc to execute command { listCollections: true, filter: { name: "games" }, cursor: {} }]
2016-07-21T09:26:29.142520+00:00 app[web.1]: name: 'MongoError',
2016-07-21T09:26:29.150835+00:00 app[web.1]: name: 'MongoError',
2016-07-21T09:26:29.153312+00:00 app[web.1]: ok: 0,
2016-07-21T09:26:29.153313+00:00 app[web.1]: errmsg: 'not authorized on heroku_mn3xtgkc to execute command { listCollections: true, filter: { name: "playerlevel_levels" }, cursor: {} }',
2016-07-21T09:26:29.181467+00:00 app[web.1]: connectionId: 58716,
2016-07-21T09:26:29.186617+00:00 app[web.1]: err: 'not authorized on heroku_mn3xtgkc to execute command { createIndexes: "playerlevel_levels", indexes: [ { key: { publickey: 1, date: -1 }, name: "publickey_1_date_-1", unique: false } ] }',
2016-07-21T09:26:29.193902+00:00 app[web.1]: ok: 1 }
2016-07-21T09:26:29.211962+00:00 app[web.1]: ok: 1 }
2016-07-21T09:26:29.216330+00:00 app[web.1]: code: 13,
2016-07-21T09:26:29.216331+00:00 app[web.1]: n: 0,
2016-07-21T09:26:29.216332+00:00 app[web.1]: ok: 1 }
2016-07-21T09:26:29.221342+00:00 app[web.1]: { [MongoError: not authorized on heroku_mn3xtgkc to execute command { createIndexes: "achievements_players", indexes: [ { key: { publickey: 1, playerid: 1 }, name: "publickey_1_playerid_1", unique: false } ] }]
2016-07-21T09:26:29.221345+00:00 app[web.1]: name: 'MongoError',
2016-07-21T09:26:29.221347+00:00 app[web.1]: connectionId: 58719,
2016-07-21T09:26:29.221348+00:00 app[web.1]: err: 'not authorized on heroku_mn3xtgkc to execute command { createIndexes: "achievements_players", indexes: [ { key: { publickey: 1, playerid: 1 }, name: "publickey_1_playerid_1", unique: false } ] }',
2016-07-21T09:26:29.221349+00:00 app[web.1]: code: 13,
2016-07-21T09:26:29.221349+00:00 app[web.1]: n: 0,
2016-07-21T09:26:29.216330+00:00 app[web.1]: code: 13,
2016-07-21T09:26:29.216332+00:00 app[web.1]: ok: 1 }
2016-07-21T09:26:29.221342+00:00 app[web.1]: { [MongoError: not authorized on heroku_mn3xtgkc to execute command { createIndexes: "achievements_players", indexes: [ { key: { publickey: 1, playerid: 1 }, name: "publickey_1_playerid_1", unique: false } ] }]
2016-07-21T09:26:29.221345+00:00 app[web.1]: name: 'MongoError',
2016-07-21T09:26:29.221346+00:00 app[web.1]: lastOp: { _bsontype: 'Timestamp', low_: 0, high_: 0 },
2016-07-21T09:26:29.221348+00:00 app[web.1]: err: 'not authorized on heroku_mn3xtgkc to execute command { createIndexes: "achievements_players", indexes: [ { key: { publickey: 1, playerid: 1 }, name: "publickey_1_playerid_1", unique: false } ] }',
2016-07-21T09:26:29.221349+00:00 app[web.1]: n: 0,
2016-07-21T09:26:29.221350+00:00 app[web.1]: ok: 1 }
2016-07-21T09:26:29.216330+00:00 app[web.1]: code: 13,
2016-07-21T09:26:29.216331+00:00 app[web.1]: n: 0,
2016-07-21T09:26:29.221342+00:00 app[web.1]: { [MongoError: not authorized on heroku_mn3xtgkc to execute command { createIndexes: "achievements_players", indexes: [ { key: { publickey: 1, playerid: 1 }, name: "publickey_1_playerid_1", unique: false } ] }]
2016-07-21T09:26:29.221347+00:00 app[web.1]: connectionId: 58719,
2016-07-21T09:26:29.221348+00:00 app[web.1]: err: 'not authorized on heroku_mn3xtgkc to execute command { createIndexes: "achievements_players", indexes: [ { key: { publickey: 1, playerid: 1 }, name: "publickey_1_playerid_1", unique: false } ] }',
2016-07-21T09:26:29.221349+00:00 app[web.1]: code: 13,
2016-07-21T09:26:29.221349+00:00 app[web.1]: n: 0,
2016-07-21T09:26:29.216330+00:00 app[web.1]: code: 13,
2016-07-21T09:26:29.216331+00:00 app[web.1]: n: 0,
2016-07-21T09:26:29.216332+00:00 app[web.1]: ok: 1 }
2016-07-21T09:26:29.221342+00:00 app[web.1]: { [MongoError: not authorized on heroku_mn3xtgkc to execute command { createIndexes: "achievements_players", indexes: [ { key: { publickey: 1, playerid: 1 }, name: "publickey_1_playerid_1", unique: false } ] }]
2016-07-21T09:26:29.221345+00:00 app[web.1]: name: 'MongoError',
2016-07-21T09:26:29.221346+00:00 app[web.1]: lastOp: { _bsontype: 'Timestamp', low_: 0, high_: 0 },
2016-07-21T09:26:29.221348+00:00 app[web.1]: err: 'not authorized on heroku_mn3xtgkc to execute command { createIndexes: "achievements_players", indexes: [ { key: { publickey: 1, playerid: 1 }, name: "publickey_1_playerid_1", unique: false } ] }',
2016-07-21T09:26:29.221349+00:00 app[web.1]: code: 13,
2016-07-21T09:26:29.221349+00:00 app[web.1]: n: 0,
2016-07-21T09:26:29.221350+00:00 app[web.1]: ok: 1 }
2016-07-21T09:26:29.216330+00:00 app[web.1]: code: 13,
2016-07-21T09:26:29.216331+00:00 app[web.1]: n: 0,
2016-07-21T09:26:29.216332+00:00 app[web.1]: ok: 1 }
2016-07-21T09:26:29.221342+00:00 app[web.1]: { [MongoError: not authorized on heroku_mn3xtgkc to execute command { createIndexes: "achievements_players", indexes: [ { key: { publickey: 1, playerid: 1 }, name: "publickey_1_playerid_1", unique: false } ] }]
2016-07-21T09:26:29.221346+00:00 app[web.1]: lastOp: { _bsontype: 'Timestamp', low_: 0, high_: 0 },
2016-07-21T09:26:29.221348+00:00 app[web.1]: err: 'not authorized on heroku_mn3xtgkc to execute command { createIndexes: "achievements_players", indexes: [ { key: { publickey: 1, playerid: 1 }, name: "publickey_1_playerid_1", unique: false } ] }',
2016-07-21T09:26:29.221349+00:00 app[web.1]: n: 0,
2016-07-21T09:26:29.216330+00:00 app[web.1]: code: 13,
2016-07-21T09:26:29.216331+00:00 app[web.1]: n: 0,
2016-07-21T09:26:29.221345+00:00 app[web.1]: name: 'MongoError',
2016-07-21T09:26:29.221348+00:00 app[web.1]: err: 'not authorized on heroku_mn3xtgkc to execute command { createIndexes: "achievements_players", indexes: [ { key: { publickey: 1, playerid: 1 }, name: "publickey_1_playerid_1", unique: false } ] }',
2016-07-21T09:26:29.221349+00:00 app[web.1]: n: 0,
2016-07-21T09:26:29.221350+00:00 app[web.1]: ok: 1 }
2016-07-21T09:26:29.216330+00:00 app[web.1]: code: 13,
2016-07-21T09:26:29.216332+00:00 app[web.1]: ok: 1 }
2016-07-21T09:26:29.221345+00:00 app[web.1]: name: 'MongoError'
I have zero knowledge on Mongo or Heroku, if you require more informations just ask and I will do my best to find what you need.
Thank you.
Hi Ben
I am currently looking at the server scripts and I have a question regarding playerlevel rating. In the playerslevel.list function, there is an option to sort levels by player ratings that seems to sort levels using a "rating" field:
switch(options.mode) {
case "alltime":
case "popular": // legacy
query.sort = "-rating";
break;
.....
However, levels do not have a rating field (only a ratings one wich is an array) so I do not really understand how it is supposed to work (I am new to mongoDB thouth so maybe there is a subtility I do not understand). Looking at the playerlevels objects structure in mongodb, I would say the alltime rating can only be obtained doing: score/votes
Also, when retrieving player levels with the api, wich field of the returned level object should I look at to get the alltime rating? (is there a rating field return or should I do score/votes?)
Finnaly, I found a bug in the playerlevels.list script. In the rate function, you must change the line
db.PlayerLevel.findOneAndUpdate({_id: doc._id}, doc, { upsert: false }, function(error) {
var docid = doc._id;
delete doc._id;
db.PlayerLevel.findOneAndUpdate({_id: docid}, doc, { upsert: false }, function(error) {
else mongoose return an eror saying: MongoError Mod on _id not allowed
If a player's "alltime" rank is 31, and I try to filter using that player id to find their rank, it returns 1, not 31.
Package says to use Express 4 but this doesn't works.
Might I suggest using: https://github.com/zentuit/apiserver/commits/master fixes
I'm wondering why json string are being base64 encoded? At first, I thought it was for compression but it makes the data bigger.
No matter what is added to the games collection, the server always responds with:
Invalid game (router.js:52)
I've tried the Unity API
As well as directly in the browser using the following URI structure:
https://HEROKUAPPNAME.herokuapp.com/v1?publickey=PUBLICKEYINGAMESCOLLECTION
{
success: false,
errorcode: 1,
exceptionmessage: "Invalid game (router.js:52)"
}
What are the steps I should follow manually deploy the server?
The instructions in here: http://playtomic.org/server.html are only for an Heroku installation and I want to put it on openshift...
So once I have downloaded and copied the git source on my openshift application, what am I supposed to do? Is there any config file I must change or something?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.