Saturday, October 1, 2011

One person in one million may need this post.

For those of you who have installed PsychoStats and get the following error:
[FATAL] Called from main(320)->main(349)->main(397)->PS::Game(1252)->PS::DB(598) >>>
> Error executing DB query:
> UPDATE ps_plr p, ps_c_plr_data d SET p.lastactivity = 1317370731, p.activity = IF(432000 > 1317370731 - d.lasttime, LEAST(100, 100 / 432000 * (432000 - (1317370731 - d.lasttime)) ), 0) WHERE p.plrid=d.plrid AND 1317370731 > p.lastactivity
 >  (and here, possible, TABLE DOES NOT EXIST.)
> --end of error--


Here's the remedy. I searched for hours before I figured this out. Log into phpMyAdmin and run the following queries on your PsychoStats DB.


CREATE TABLE `ps_c_plr_data` ( `dataid` INT UNSIGNED NOT NULL DEFAULT '0', `plrid` INT UNSIGNED NOT NULL DEFAULT '0', `firstdate` DATE NOT NULL DEFAULT '0000-00-00', `lastdate` DATE NOT NULL DEFAULT '0000-00-00', `accuracy` FLOAT(10,2) NOT NULL DEFAULT '0.00', `banned` INT NOT NULL DEFAULT '0', `bombdefuseattempts` INT NOT NULL DEFAULT '0', `bombdefused` INT NOT NULL DEFAULT '0', `bombdefusedpct` FLOAT(10,2) NOT NULL DEFAULT '0.00', `bombexploded` INT NOT NULL DEFAULT '0', `bombexplodedpct` FLOAT(10,2) NOT NULL DEFAULT '0.00', `bombplanted` INT NOT NULL DEFAULT '0', `bombplantedpct` FLOAT(10,2) NOT NULL DEFAULT '0.00', `bombrunner` INT NOT NULL DEFAULT '0', `bombrunnerpct` FLOAT(10,2) NOT NULL DEFAULT '0.00', `bombspawned` INT NOT NULL DEFAULT '0', `cheated` INT NOT NULL DEFAULT '0', `connections` INT NOT NULL DEFAULT '0', `ctdeaths` INT NOT NULL DEFAULT '0', `ctkills` INT NOT NULL DEFAULT '0', `ctlost` INT NOT NULL DEFAULT '0', `ctwon` INT NOT NULL DEFAULT '0', `ctwonpct` FLOAT(10,2) NOT NULL DEFAULT '0.00', `damage` INT NOT NULL DEFAULT '0', `deaths` INT NOT NULL DEFAULT '0', `deaths_streak` INT NOT NULL DEFAULT '0', `ffdeaths` INT NOT NULL DEFAULT '0', `ffdeathspct` FLOAT(10,2) NOT NULL DEFAULT '0.00', `ffkills` INT NOT NULL DEFAULT '0', `ffkillspct` FLOAT(10,2) NOT NULL DEFAULT '0.00', `games` INT NOT NULL DEFAULT '0', `headshotdeaths` INT NOT NULL DEFAULT '0', `headshotkills` INT NOT NULL DEFAULT '0', `headshotpct` FLOAT(10,2) NOT NULL DEFAULT '0.00', `hits` INT NOT NULL DEFAULT '0', `joinedct` INT NOT NULL DEFAULT '0', `joinedspectator` INT NOT NULL DEFAULT '0', `joinedterrorist` INT NOT NULL DEFAULT '0', `kicked` INT NOT NULL DEFAULT '0', `killedhostages` INT NOT NULL DEFAULT '0', `kills` INT NOT NULL DEFAULT '0', `kills_streak` INT NOT NULL DEFAULT '0', `killsperdeath` FLOAT(10,2) NOT NULL DEFAULT '0.00', `killsperminute` FLOAT(10,2) NOT NULL DEFAULT '0.00', `lasttime` INT NOT NULL DEFAULT '0', `onlinetime` INT NOT NULL DEFAULT '0', `rescuedhostages` INT NOT NULL DEFAULT '0', `rescuedhostagespct` FLOAT(10,2) NOT NULL DEFAULT '0.00', `rounds` INT NOT NULL DEFAULT '0', `shots` INT NOT NULL DEFAULT '0', `shotsperkill` FLOAT(10,2) NOT NULL DEFAULT '0.00', `suicides` INT NOT NULL DEFAULT '0', `terroristdeaths` INT NOT NULL DEFAULT '0', `terroristkills` INT NOT NULL DEFAULT '0', `terroristlost` INT NOT NULL DEFAULT '0', `terroristwon` INT NOT NULL DEFAULT '0', `terroristwonpct` FLOAT(10,2) NOT NULL DEFAULT '0.00', `totalbonus` INT NOT NULL DEFAULT '0', `touchedhostages` INT NOT NULL DEFAULT '0', `vip` INT NOT NULL DEFAULT '0', `vipescaped` INT NOT NULL DEFAULT '0', `vipkilled` INT NOT NULL DEFAULT '0' ) DEFAULT CHARACTER SET utf8;

ALTER TABLE `ps_c_plr_data` ADD PRIMARY KEY ( `dataid` );

ALTER TABLE `ps_c_plr_data` ADD UNIQUE `plrid` ( `plrid` );

You're welcome.

Your mileage may vary.

No comments:

Post a Comment