From 5b9db74d12fcd0b408701972ad00068eae700131 Mon Sep 17 00:00:00 2001 From: Cronick Date: Fri, 14 Oct 2016 15:12:12 +0200 Subject: [PATCH] Update - 0.6.0 -> 0.6.1 - Candies is saved in MySQL now. - Changed candies varchar(64 -> 1024). --- package.json | 2 +- src/commands.js | 4 ++-- src/db/tables/users.table | 2 +- src/models/Player/CandyBag/index.js | 12 ++++++++++++ 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index b878320..a280de6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "POGOServer", - "version": "0.6.0", + "version": "0.6.1", "description": "", "repository": { "type": "git", diff --git a/src/commands.js b/src/commands.js index cde59bb..dccb439 100644 --- a/src/commands.js +++ b/src/commands.js @@ -55,11 +55,11 @@ export function getUserQueryData(obj) { 0, //obj.contact.sendMarketingEmails, 0, //obj.contact.sendPushNotifications, // inventory - '{}', //obj.candyBag, + obj.candyBag.querify(), //obj.candyBag, obj.bag.querify(), //obj.bag, obj.avatar.querify(), //obj.avatar, '{"0":1,"1":1,"3":1,"4":1,"7":1}', //obj.tutorial, // WHERE obj.email ]); -} \ No newline at end of file +} diff --git a/src/db/tables/users.table b/src/db/tables/users.table index 30ea09e..7f87071 100644 --- a/src/db/tables/users.table +++ b/src/db/tables/users.table @@ -11,7 +11,7 @@ longitude double NULL DEFAULT NULL, altitude double NULL DEFAULT NULL, send_marketing_emails tinyint(1) NULL DEFAULT NULL, send_push_notifications tinyint(1) NULL DEFAULT NULL, -candies varchar(64) NOT NULL DEFAULT '{}', +candies varchar(1024) NOT NULL DEFAULT '{}', items varchar(255) NOT NULL DEFAULT '{}', avatar varchar(128) NOT NULL DEFAULT '{}', pokedex varchar(64) NOT NULL DEFAULT '{}', diff --git a/src/models/Player/CandyBag/index.js b/src/models/Player/CandyBag/index.js index a277348..195d68a 100644 --- a/src/models/Player/CandyBag/index.js +++ b/src/models/Player/CandyBag/index.js @@ -115,6 +115,18 @@ export default class CandyBag { return (out); } + /** + * @return {String} + */ + querify() { + let buffer = {}; + for (let key in this.candies) { + let candy = this.candies[key].amount; + buffer[key] = candy; + }; + return (JSON.stringify(buffer)); + } + /** * @param {String} str */