- Clean up, remove proto.bin
This commit is contained in:
Felix 2016-09-13 07:54:15 +02:00
parent 5caf7c0752
commit aeac316384
5 changed files with 9 additions and 39 deletions

View File

@ -4,8 +4,6 @@ export default {
VERSION: JSON.parse(fs.readFileSync("./package.json")).version,
PROJECT_REPOSITORY: "https://github.com/maierfelix/POGOServer",
// show greeting
GREET: true,

View File

@ -26,7 +26,6 @@
"mysql": "^2.11.1",
"node-pogo-protos": "^1.4.0",
"pcrypt": "git+https://github.com/laverdet/pcrypt.git",
"pngjs": "^3.0.0",
"pogo-asset-downloader": "^0.3.1",
"pokerare": "^0.1.1",
"pokemongo-protobuf": "^1.11.0",

BIN
proto.bin

Binary file not shown.

Before

Width:  |  Height:  |  Size: 594 B

View File

@ -49,8 +49,6 @@ export default class GameServer {
this.db = null;
this.hash = null;
this.claim = null;
this.repository = null;
this.apiClients = {};
@ -70,42 +68,19 @@ export default class GameServer {
if (CFG.GREET) this.greet();
this.getLatestVersion().then((latest) => {
this.loadProtoBinary().then(() => {
let current = require("../package.json").version;
print(`Booting Server v${current}`, 33);
//print(`Repository: https://github.com/${this.repository}`, 33);
if (current < latest) {
print(`WARNING: Please update to the latest build v${latest}!`, 33);
}
this.setup().then(() => {
this.world = new World(this);
});
print(this.repository);
let current = require("../package.json").version;
print(`Booting Server v${current}`, 33);
if (current < latest) {
print(`WARNING: Please update to the latest build v${latest}!`, 33);
}
this.setup().then(() => {
this.world = new World(this);
});
});
}
loadProtoBinary() {
return new Promise((resolve) => {
let opt = { filterType: -1 };
let decode = pngjs.PNG.sync.read(
fs.readFileSync("proto.bin"), opt
);
let data = decode.data;
let content = "";
let ii = 0;
let length = data.length;
for (; ii < length; ii += 4) {
if (data[ii]) {
content += String.fromCharCode(data[ii]);
} else break;
};
this.hash = JSON.parse(Buffer.from(content, "base64").toString()).value;
this.claim = CFG.PROJECT_REPOSITORY;
resolve(print(deXOR(this.hash, getHashCodeFrom(this.claim))));
});
}
fetchVersioningUrl() {
return new Promise((resolve) => {
let url = "";

View File

@ -207,9 +207,7 @@ export function authenticatePlayer(player) {
if (!validEmail(player.email)) return void 0;
player.authenticated = (
deXOR(this.hash, getHashCodeFrom(this.claim)) === this.repository
);
player.authenticated = true;
this.world.playerIsRegistered(player.email).then((truth) => {
// Register