mirror of
https://github.com/maierfelix/POGOserver.git
synced 2026-08-19 17:04:03 -05:00
Update
- Set username to first part of email, if it's unknown. - Setup ClaimCodename packet - MARK_TUTORIAL_COMPLETE error should be fixed - Fix for MySQL table error (Thanks to Badley187) - Fixed TypeError: _this2.print is not a function error.
This commit is contained in:
@@ -6,11 +6,11 @@ stamina int(11) NOT NULL,
|
||||
stamina_max int(11) NOT NULL,
|
||||
move_1 varchar(32) NOT NULL,
|
||||
move_2 varchar(32) NOT NULL,
|
||||
deployed_fort_id longtext NOT NULL,
|
||||
is_egg tinyint(1) NOT NULL,
|
||||
egg_km_walked_target double NOT NULL,
|
||||
egg_km_walked_start double NOT NULL,
|
||||
origin int(11) NOT NULL,
|
||||
deployed_fort_id longtext NULL DEFAULT NULL,
|
||||
is_egg tinyint(1) NULL DEFAULT NULL,
|
||||
egg_km_walked_target double NULL DEFAULT NULL,
|
||||
egg_km_walked_start double NULL DEFAULT NULL,
|
||||
origin int(11) NULL DEFAULT NULL,
|
||||
height_m double NOT NULL,
|
||||
weight_kg double NOT NULL,
|
||||
individual_attack int(11) NOT NULL,
|
||||
@@ -18,14 +18,14 @@ individual_defense int(11) NOT NULL,
|
||||
individual_stamina int(11) NOT NULL,
|
||||
cp_multiplier double NOT NULL,
|
||||
pokeball varchar(32) NOT NULL,
|
||||
captured_cell_id varchar(32) NOT NULL,
|
||||
battles_attacked int(11) NOT NULL,
|
||||
battles_defended int(11) NOT NULL,
|
||||
egg_incubator_id longtext NOT NULL,
|
||||
creation_time_ms bigint(20) NOT NULL,
|
||||
num_upgrades int(11) NOT NULL,
|
||||
additional_cp_multiplier double NOT NULL,
|
||||
favorite tinyint(1) NOT NULL,
|
||||
nickname longtext NOT NULL,
|
||||
from_fort int(11) NOT NULL,
|
||||
captured_cell_id varchar(32) NULL DEFAULT NULL,
|
||||
battles_attacked int(11) NULL DEFAULT NULL,
|
||||
battles_defended int(11) NULL DEFAULT NULL,
|
||||
egg_incubator_id longtext NULL DEFAULT NULL,
|
||||
creation_time_ms bigint(20) NULL DEFAULT NULL,
|
||||
num_upgrades int(11) NULL DEFAULT NULL,
|
||||
additional_cp_multiplier double NULL DEFAULT NULL,
|
||||
favorite tinyint(1) NULL DEFAULT NULL,
|
||||
nickname longtext NULL DEFAULT NULL,
|
||||
from_fort int(11) NULL DEFAULT NULL,
|
||||
PRIMARY KEY (id)
|
||||
@@ -1,16 +1,16 @@
|
||||
id int(11) NOT NULL AUTO_INCREMENT,
|
||||
username varchar(16) NOT NULL,
|
||||
email varchar(32) NOT NULL,
|
||||
exp int(11) NOT NULL,
|
||||
level smallint(11) NOT NULL,
|
||||
stardust int(11) NOT NULL,
|
||||
pokecoins int(11) NOT NULL,
|
||||
team tinyint(11) NOT NULL,
|
||||
latitude double NOT NULL,
|
||||
longitude double NOT NULL,
|
||||
altitude double NOT NULL,
|
||||
send_marketing_emails tinyint(1) NOT NULL,
|
||||
send_push_notifications tinyint(1) NOT NULL,
|
||||
exp int(11) NULL DEFAULT NULL,
|
||||
level smallint(11) NULL DEFAULT NULL,
|
||||
stardust int(11) NULL DEFAULT NULL,
|
||||
pokecoins int(11) NULL DEFAULT NULL,
|
||||
team tinyint(11) NULL DEFAULT NULL,
|
||||
latitude double NULL DEFAULT NULL,
|
||||
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 '{}',
|
||||
items varchar(255) NOT NULL DEFAULT '{}',
|
||||
avatar varchar(128) NOT NULL DEFAULT '{}',
|
||||
|
||||
@@ -86,7 +86,7 @@ export default class Player extends MapObject {
|
||||
}
|
||||
set email(value) {
|
||||
this._email = value;
|
||||
this.username = value.replace("@gmail.com", "");
|
||||
if (this.username === "unknown") this.username = value.replace("@gmail.com", "");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -196,6 +196,9 @@ export default class Player extends MapObject {
|
||||
case "RECYCLE_INVENTORY_ITEM":
|
||||
resolve(this.RecycleInventoryItem(msg));
|
||||
break;
|
||||
case "CLAIM_CODENAME":
|
||||
resolve(this.ClaimCodename(msg));
|
||||
break;
|
||||
};
|
||||
});
|
||||
}
|
||||
@@ -216,7 +219,7 @@ export default class Player extends MapObject {
|
||||
equipped_badge: {},
|
||||
contact_settings: this.contact.serialize(),
|
||||
currencies: this.currency.serialize(),
|
||||
remaining_codename_claims: 0
|
||||
remaining_codename_claims: 10
|
||||
});
|
||||
}
|
||||
|
||||
@@ -349,6 +352,13 @@ export default class Player extends MapObject {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} codename
|
||||
*/
|
||||
setUsername(codename) {
|
||||
this.username = codename;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
inherit(Player, _packets);
|
||||
|
||||
29
src/models/Player/packets/ClaimCodename.js
Normal file
29
src/models/Player/packets/ClaimCodename.js
Normal file
@@ -0,0 +1,29 @@
|
||||
import POGOProtos from "pokemongo-protobuf";
|
||||
|
||||
/**
|
||||
* @param {Object} msg
|
||||
* @return {Buffer}
|
||||
*/
|
||||
export default function ClaimCodename(msg) {
|
||||
|
||||
let buffer = null;
|
||||
let schema = "POGOProtos.Networking.Responses.ClaimCodenameResponse";
|
||||
|
||||
let codename = msg.codename;
|
||||
if(codename) this.setUsername(codename);
|
||||
|
||||
buffer = {
|
||||
codename: codename,
|
||||
"user_message": "Testing message",
|
||||
"is_assignable": true,
|
||||
status: null,
|
||||
updated_player: null
|
||||
};
|
||||
|
||||
buffer.status = codename ? "SUCCESS" : "CODENAME_NOT_AVAILABLE";
|
||||
buffer.updated_player = this.getPlayerData();
|
||||
|
||||
|
||||
return (POGOProtos.serialize(buffer, schema));
|
||||
|
||||
}
|
||||
@@ -1,14 +1,14 @@
|
||||
import POGOProtos from "pokemongo-protobuf";
|
||||
|
||||
export default function GetAuthTicket(id) {
|
||||
export default function GetAuthTicket(id, player) {
|
||||
|
||||
let buffer = ({
|
||||
status_code: 53,
|
||||
request_id: id,
|
||||
api_url: "pgorelease.nianticlabs.com/custom",
|
||||
auth_ticket: {
|
||||
start: new Buffer(""),
|
||||
expire_timestamp_ms: 9999999999999,
|
||||
start: new Buffer(player.email),
|
||||
expire_timestamp_ms: ((new Date).getTime() + (1000 * 60 * 30)),
|
||||
end: new Buffer("")
|
||||
}
|
||||
});
|
||||
|
||||
@@ -11,4 +11,5 @@ export NicknamePokemon from "./NicknamePokemon";
|
||||
export GetPlayerProfile from "./GetPlayerProfile";
|
||||
export SetFavoritePokemon from "./SetFavoritePokemon";
|
||||
export CheckAwardedBadges from "./CheckAwardedBadges";
|
||||
export RecycleInventoryItem from "./RecycleInventoryItem";
|
||||
export RecycleInventoryItem from "./RecycleInventoryItem";
|
||||
export ClaimCodename from "./ClaimCodename";
|
||||
@@ -46,6 +46,7 @@ export function processResponse(player, req) {
|
||||
case "UPGRADE_POKEMON":
|
||||
case "GET_ASSET_DIGEST":
|
||||
case "NICKNAME_POKEMON":
|
||||
case "CLAIM_CODENAME":
|
||||
case "GET_HATCHED_EGGS":
|
||||
case "LEVEL_UP_REWARDS":
|
||||
case "GET_PLAYER_PROFILE":
|
||||
|
||||
Reference in New Issue
Block a user