diff --git a/sql/gamedb.sql b/sql/gamedb.sql index 82a3eed..c811830 100644 --- a/sql/gamedb.sql +++ b/sql/gamedb.sql @@ -41,7 +41,7 @@ CREATE TABLE `user` ( `accountid` varchar(60) NOT NULL DEFAULT '' COMMENT '账号id(channel + "_" + gameid + "_" + openid)', `user_name` tinyblob COMMENT '用户名字', `avatar_url` varchar(256) NOT NULL DEFAULT '' COMMENT '用户头像', - `coin_num` bigint NOT NULL DEFAULT '0' COMMENT '角色金币', + `coin_num` varchar(256) NOT NULL DEFAULT '' COMMENT '角色金币', `diamond_num` bigint NOT NULL DEFAULT '0' COMMENT '角色钻石', `energy` int(11) NOT NULL DEFAULT '0' COMMENT '角色体力', `create_time` int(11) NOT NULL DEFAULT '0'COMMENT '创建时间', @@ -50,32 +50,15 @@ CREATE TABLE `user` ( `kefu_status` int(11) NOT NULL DEFAULT '0' COMMENT '客服奖励状态(0:未领取,1:已领取)', `pass_status` int(11) NOT NULL DEFAULT '0'COMMENT '浮窗状态(0:未领取,1:已领取)', `sign_sum` int(11) NOT NULL DEFAULT '0' COMMENT '签到总天数', - `box_num` int(11) NOT NULL DEFAULT '0' COMMENT '空投宝箱数量', `pass` int(11) NOT NULL DEFAULT '0' COMMENT '当前关卡', + `buy_data` mediumblob NOT NULL COMMENT '购买次数信息', + `tank_data` mediumblob NOT NULL COMMENT '坦克信息', + `daily_reward` int(11) NOT NULL DEFAULT '0' COMMENT '每日奖励次数', PRIMARY KEY (`idx`), UNIQUE KEY `accountid` (`accountid`) ) ENGINE=InnoDB AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8 COLLATE=utf8_bin; --- --- Table structure for table `tank` --- - -DROP TABLE IF EXISTS `tank`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `tank` ( - `idx` int(11) NOT NULL AUTO_INCREMENT COMMENT '自增id', - `accountid` varchar(60) NOT NULL DEFAULT '' COMMENT '账号id', - `tank_id` int(11) NOT NULL DEFAULT '0' COMMENT '坦克位置id', - `tank_level` int(11) NOT NULL DEFAULT '0' COMMENT '坦克等级', - `create_time` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间', - `modify_time` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间', - PRIMARY KEY (`idx`), - UNIQUE KEY `tank_uuid` (`accountid`, `tank_id`) -) ENGINE=InnoDB AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8 COLLATE=utf8_bin; - - -- -- Table structure for table `sign` -- @@ -96,25 +79,6 @@ CREATE TABLE `sign` ( ) ENGINE=InnoDB AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8 COLLATE=utf8_bin; --- --- Table structure for table `hang` --- - -DROP TABLE IF EXISTS `hang`;· -/*!40101 SET @saved_cs_client = @@character_set_client*/; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `hang` ( - `idx` int(11) NOT NULL AUTO_INCREMENT COMMENT '自增id', - `accountid` varchar(60) NOT NULL DEFAULT '' COMMENT '账号id', - `hang_time` int(11) NOT NULL DEFAULT '0' COMMENT '领取时间', - `num` int(11) NOT NULL DEFAULT '0' COMMENT '每秒产生金币数量', - `speed_time` int(11) NOT NULL DEFAULT '0' COMMENT '加速截止时间', - `create_time` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间', - `modify_time` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间', - PRIMARY KEY (`idx`), - UNIQUE KEY `accountid` (`accountid`) -) ENGINE=InnoDB AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8 COLLATE=utf8_bin; - -- -- Table structure for table `share_achievement` -- @@ -134,6 +98,44 @@ CREATE TABLE `share_achievement` ( ) ENGINE=InnoDB AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8 COLLATE=utf8_bin; +-- +-- Table structrure for table `quest` +-- + +DROP TABLE IF EXISTS `quest`; +/*!40101 SET @saved_cs_client = @@character_set_client*/; +/*!40101 SET character_set_client = utf8*/; +CREATE TABLE `quest` ( + `idx` int(11) NOT NULL AUTO_INCREMENT COMMENT '自增id', + `accountid` varchar(60) NOT NULL DEFAULT '' COMMENT '账号id', + `quest_id` int(11) NOT NULL DEFAULT '0' COMMENT '任务id', + `quest_num` int(11) NOT NULL DEFAULT '0' COMMENT '任务进度', + `quest_type` int(11) NOT NULL DEFAULT '0' COMMENT '任务类型', + `quest_status` int(11) NOT NULL DEFAULT '0' COMMENT '任务状态', + `create_time` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间', + `modify_time` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间', + PRIMARY KEY (`idx`), + UNIQUE KEY `quest_uuid` (`accountid`, `quest_id`) +) ENGINE=InnoDB AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8 COLLATE=utf8_bin; + +-- +-- Table structrure for table `try_play` +-- + +DROP TABLE IF EXISTS `try_play`; +/*!40101 SET @saved_cs_client = @@character_set_client*/; +/*!40101 SET character_set_client = utf8*/; +CREATE TABLE `try_play` ( + `idx` int(11) NOT NULL AUTO_INCREMENT COMMENT '自增id', + `accountid` varchar(60) NOT NULL DEFAULT '' COMMENT '账号id', + `appid` varchar(256) NOT NULL DEFAULT '0' COMMENT 'appid', + `status` int(11) NOT NULL DEFAULT '0' COMMENT '领取状态', + `create_time` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间', + `modify_time` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间', + PRIMARY KEY (`idx`), + UNIQUE KEY `try_uuid` (`accountid`, `appid`) +) ENGINE=InnoDB AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8 COLLATE=utf8_bin; + /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; diff --git a/third_party/phpcommon b/third_party/phpcommon index d00056a..8453d4b 160000 --- a/third_party/phpcommon +++ b/third_party/phpcommon @@ -1 +1 @@ -Subproject commit d00056a7ea77d281991ae4f826a1d13b5ddd990b +Subproject commit 8453d4b26e65ad7cee91d26b1a2ede39910c7117 diff --git a/tools/rankserver/app.py b/tools/rankserver/app.py deleted file mode 100644 index e69de29..0000000 diff --git a/webapp/bootstrap/config_loader.php b/webapp/bootstrap/config_loader.php index 4d6544e..b8b3451 100644 --- a/webapp/bootstrap/config_loader.php +++ b/webapp/bootstrap/config_loader.php @@ -53,5 +53,37 @@ function getRedisConfig($hash_value) $idx = $hash_value % count($g_conf_redis_cluster); return $g_conf_redis_cluster[$idx]; } + +function getTankConfig($tank_table, $tank_id) +{ + $tank_id = (int)$tank_id; + return array_key_exists($tank_id, $tank_table) ? $tank_table[$tank_id] : null; +} + +function getSignConfig($sign_table, $sign_id) +{ + $sign_id = (int)$sign_id; + return array_key_exists($sign_id, $sign_table) ? $sign_table[$sign_id] : null; +} + +function getParameterConfig($para_table, $para_id) +{ + $para_id = (int)$para_id; + return array_key_exists($para_id, $para_table) ? $para_table[$para_id] : null; +} + +function getItemConfig($item_table, $item_id) +{ + $item_id = (int)$item_id; + return array_key_exists($item_id, $item_table) ? $item_table[$item_id] : null; +} + +function getRobotConfig($robot_table, $robot_id) +{ + $robot_id = (int)$robot_id; + return array_key_exists($robot_id, $robot_table) ? $robot_table[$robot_id] : null; +} + + checkMysqlConfig(); checkRedisConfig(); diff --git a/webapp/bootstrap/init.php b/webapp/bootstrap/init.php index d541af1..f8fcfc0 100644 --- a/webapp/bootstrap/init.php +++ b/webapp/bootstrap/init.php @@ -2,4 +2,13 @@ ini_set('date.timezone','Asia/Shanghai'); require 'phpcommon/common.php'; +require 'phpcommon/bignumber.php'; + +//常量定义 +define('SIGNREWARD_TIMES', 12); //签到额外奖励倍数 +define('AIRDROPREWARD_TIMES', 8); //空投额外奖励倍数 +define('COLLECT_REWARDS', 25); //收藏奖励 +define('WINDOWS_REWARDS', 26); //浮窗奖励 +define('FREE_DIAMOND', 23); //每日免费钻石数量 +define('NEWGAME_REWARDS', 28); //试玩奖励 require 'config_loader.php';