diff --git a/webapp/controller/ActivityController.class.php b/webapp/controller/ActivityController.class.php index 510830e..f34e066 100644 --- a/webapp/controller/ActivityController.class.php +++ b/webapp/controller/ActivityController.class.php @@ -7,30 +7,7 @@ require_once 'metatable/draw.php'; class ActivityController extends BaseAuthedController { - protected function getMysql($account_id) - { - $mysql_conf = getMysqlConfig(crc32($account_id)); - $conn = new phpcommon\Mysql(array( - 'host' => $mysql_conf['host'], - 'port' => $mysql_conf['port'], - 'user' => $mysql_conf['user'], - 'passwd' => $mysql_conf['passwd'], - 'dbname' => DBNAME_PREFIX . $mysql_conf['instance_id'] - )); - return $conn; - } - protected function getRedis($shop_uuid) - { - $redis_conf = getRedisConfig(crc32($shop_uuid)); - $r = new phpcommon\Redis(array( - 'host' => $redis_conf['host'], - 'port' => $redis_conf['port'], - 'passwd' => $redis_conf['passwd'] - - )); - return $r; - } protected function getBox($box_id) { diff --git a/webapp/controller/AdditemController.class.php b/webapp/controller/AdditemController.class.php index 60daf68..6e62eb9 100644 --- a/webapp/controller/AdditemController.class.php +++ b/webapp/controller/AdditemController.class.php @@ -1,18 +1,6 @@ $mysql_conf['host'], - 'port' => $mysql_conf['port'], - 'user' => $mysql_conf['user'], - 'passwd' => $mysql_conf['passwd'], - 'dbname' => DBNAME_PREFIX . $mysql_conf['instance_id'] - )); - return $conn; - } protected function getItem($item_id) { diff --git a/webapp/controller/BagController.class.php b/webapp/controller/BagController.class.php index 26f40cb..13c3a0f 100644 --- a/webapp/controller/BagController.class.php +++ b/webapp/controller/BagController.class.php @@ -5,18 +5,6 @@ require 'classes/AddReward.php'; class BagController extends BaseAuthedController { - protected function getMysql($account_id) - { - $mysql_conf = getMysqlConfig(crc32($account_id)); - $conn = new phpcommon\Mysql(array( - 'host' => $mysql_conf['host'], - 'port' => $mysql_conf['port'], - 'user' => $mysql_conf['user'], - 'passwd' => $mysql_conf['passwd'], - 'dbname' => DBNAME_PREFIX . $mysql_conf['instance_id'] - )); - return $conn; - } protected function getBag($bag_id) { diff --git a/webapp/controller/EquipController.class.php b/webapp/controller/EquipController.class.php index 7aa36d0..42d84f7 100644 --- a/webapp/controller/EquipController.class.php +++ b/webapp/controller/EquipController.class.php @@ -5,18 +5,6 @@ require 'classes/AddReward.php'; class EquipController extends BaseAuthedController { - protected function getMysql($account_id) - { - $mysql_conf = getMysqlConfig(crc32($account_id)); - $conn = new phpcommon\Mysql(array( - 'host' => $mysql_conf['host'], - 'port' => $mysql_conf['port'], - 'user' => $mysql_conf['user'], - 'passwd' => $mysql_conf['passwd'], - 'dbname' => DBNAME_PREFIX . $mysql_conf['instance_id'] - )); - return $conn; - } protected function getItem($item_id) { diff --git a/webapp/controller/FesActivityController.class.php b/webapp/controller/FesActivityController.class.php index 8a36d34..edcf1f3 100644 --- a/webapp/controller/FesActivityController.class.php +++ b/webapp/controller/FesActivityController.class.php @@ -5,30 +5,7 @@ require_once 'metatable/activity.php'; class FesActivityController extends BaseAuthedController { - protected function getRedis($act_uuid) - { - $redis_conf = getRedisConfig(crc32($act_uuid)); - $r = new phpcommon\Redis(array( - 'host' => $redis_conf['host'], - 'port' => $redis_conf['port'], - 'passwd' => $redis_conf['passwd'] - )); - return $r; - } - - protected function getMysql($account_id) - { - $mysql_conf = getMysqlConfig(crc32($account_id)); - $conn = new phpcommon\Mysql(array( - 'host' => $mysql_conf['host'], - 'port' => $mysql_conf['port'], - 'user' => $mysql_conf['user'], - 'passwd' => $mysql_conf['passwd'], - 'dbname' => DBNAME_PREFIX . $mysql_conf['instance_id'] - )); - return $conn; - } protected function getParameter($para_id) { diff --git a/webapp/controller/FriendController.class.php b/webapp/controller/FriendController.class.php index 37fc2ed..1c470a0 100644 --- a/webapp/controller/FriendController.class.php +++ b/webapp/controller/FriendController.class.php @@ -5,18 +5,6 @@ require 'classes/AddReward.php'; require_once 'metatable/parameter.php'; class FriendController extends BaseAuthedController { - protected function getMysql($account_id) - { - $mysql_conf = getMysqlConfig(crc32($account_id)); - $conn = new phpcommon\Mysql(array( - 'host' => $mysql_conf['host'], - 'port' => $mysql_conf['port'], - 'user' => $mysql_conf['user'], - 'passwd' => $mysql_conf['passwd'], - 'dbname' => DBNAME_PREFIX . $mysql_conf['instance_id'] - )); - return $conn; - } protected function getAllMysql() { diff --git a/webapp/controller/GMController.class.php b/webapp/controller/GMController.class.php index ed4bab5..3f363c2 100644 --- a/webapp/controller/GMController.class.php +++ b/webapp/controller/GMController.class.php @@ -11,18 +11,6 @@ class GMController extends BaseController { } } - protected function getMysql($account_id) - { - $mysql_conf = getMysqlConfig(crc32($account_id)); - $conn = new phpcommon\Mysql(array( - 'host' => $mysql_conf['host'], - 'port' => $mysql_conf['port'], - 'user' => $mysql_conf['user'], - 'passwd' => $mysql_conf['passwd'], - 'dbname' => DBNAME_PREFIX . $mysql_conf['instance_id'] - )); - return $conn; - } public function clearDB() { diff --git a/webapp/controller/GameOverController.class.php b/webapp/controller/GameOverController.class.php index 304c5df..ec7daa7 100644 --- a/webapp/controller/GameOverController.class.php +++ b/webapp/controller/GameOverController.class.php @@ -5,30 +5,7 @@ require 'classes/AddReward.php'; require_once 'metatable/parameter.php'; class GameOverController extends BaseAuthedController { - protected function getMysql($account_id) - { - $mysql_conf = getMysqlConfig(crc32($account_id)); - $conn = new phpcommon\Mysql(array( - 'host' => $mysql_conf['host'], - 'port' => $mysql_conf['port'], - 'user' => $mysql_conf['user'], - 'passwd' => $mysql_conf['passwd'], - 'dbname' => DBNAME_PREFIX . $mysql_conf['instance_id'] - )); - return $conn; - } - protected function getRedis($shop_uuid) - { - $redis_conf = getRedisConfig(crc32($shop_uuid)); - $r = new phpcommon\Redis(array( - 'host' => $redis_conf['host'], - 'port' => $redis_conf['port'], - 'passwd' => $redis_conf['passwd'] - - )); - return $r; - } protected function getBox($box_id) diff --git a/webapp/controller/HangController.class.php b/webapp/controller/HangController.class.php index 826f4b9..ea7a740 100644 --- a/webapp/controller/HangController.class.php +++ b/webapp/controller/HangController.class.php @@ -6,18 +6,6 @@ require_once 'metatable/drop.php'; require 'classes/AddReward.php'; class HangController extends BaseAuthedController { - protected function getMysql($account_id) - { - $mysql_conf = getMysqlConfig(crc32($account_id)); - $conn = new phpcommon\Mysql(array( - 'host' => $mysql_conf['host'], - 'port' => $mysql_conf['port'], - 'user' => $mysql_conf['user'], - 'passwd' => $mysql_conf['passwd'], - 'dbname' => DBNAME_PREFIX . $mysql_conf['instance_id'] - )); - return $conn; - } protected function getExplode($string) { diff --git a/webapp/controller/PassController.class.php b/webapp/controller/PassController.class.php index 72cc910..f5fbc40 100644 --- a/webapp/controller/PassController.class.php +++ b/webapp/controller/PassController.class.php @@ -7,18 +7,6 @@ require_once 'metatable/season.php'; require_once 'metatable/seasoncard.php'; class PassController extends BaseAuthedController { - protected function getMysql($account_id) - { - $mysql_conf = getMysqlConfig(crc32($account_id)); - $conn = new phpcommon\Mysql(array( - 'host' => $mysql_conf['host'], - 'port' => $mysql_conf['port'], - 'user' => $mysql_conf['user'], - 'passwd' => $mysql_conf['passwd'], - 'dbname' => DBNAME_PREFIX . $mysql_conf['instance_id'] - )); - return $conn; - } protected function getExplode($string) { diff --git a/webapp/controller/PayActivityController.class.php b/webapp/controller/PayActivityController.class.php index b1fe59d..e4cd825 100644 --- a/webapp/controller/PayActivityController.class.php +++ b/webapp/controller/PayActivityController.class.php @@ -11,18 +11,6 @@ require_once 'metatable/parameter.php'; class PayActivityController extends BaseAuthedController { - protected function getMysql($account_id) - { - $mysql_conf = getMysqlConfig(crc32($account_id)); - $conn = new phpcommon\Mysql(array( - 'host' => $mysql_conf['host'], - 'port' => $mysql_conf['port'], - 'user' => $mysql_conf['user'], - 'passwd' => $mysql_conf['passwd'], - 'dbname' => DBNAME_PREFIX . $mysql_conf['instance_id'] - )); - return $conn; - } function getExplode($string) { diff --git a/webapp/controller/PayController.class.php b/webapp/controller/PayController.class.php index 335cff1..fe1bf7e 100644 --- a/webapp/controller/PayController.class.php +++ b/webapp/controller/PayController.class.php @@ -5,18 +5,6 @@ require 'classes/AddReward.php'; class PayController extends BaseAuthedController { - protected function getMysql($account_id) - { - $mysql_conf = getMysqlConfig(crc32($account_id)); - $conn = new phpcommon\Mysql(array( - 'host' => $mysql_conf['host'], - 'port' => $mysql_conf['port'], - 'user' => $mysql_conf['user'], - 'passwd' => $mysql_conf['passwd'], - 'dbname' => DBNAME_PREFIX . $mysql_conf['instance_id'] - )); - return $conn; - } protected function getItem($item_id) { diff --git a/webapp/controller/PayNotifyController.class.php b/webapp/controller/PayNotifyController.class.php index 9d0f8cd..9cb1028 100644 --- a/webapp/controller/PayNotifyController.class.php +++ b/webapp/controller/PayNotifyController.class.php @@ -4,18 +4,6 @@ require 'classes/AddReward.php'; class PayNotifyController extends BaseAuthedController { - protected function getMysql($account_id) - { - $mysql_conf = getMysqlConfig(crc32($account_id)); - $conn = new phpcommon\Mysql(array( - 'host' => $mysql_conf['host'], - 'port' => $mysql_conf['port'], - 'user' => $mysql_conf['user'], - 'passwd' => $mysql_conf['passwd'], - 'dbname' => DBNAME_PREFIX . $mysql_conf['instance_id'] - )); - return $conn; - } private function insertNewOrder($conn, $nowtime, $item_list) { diff --git a/webapp/controller/QuestController.class.php b/webapp/controller/QuestController.class.php index da3db0d..c935e29 100644 --- a/webapp/controller/QuestController.class.php +++ b/webapp/controller/QuestController.class.php @@ -5,18 +5,6 @@ require 'classes/AddReward.php'; class QuestController extends BaseAuthedController { - protected function getMysql($account_id) - { - $mysql_conf = getMysqlConfig(crc32($account_id)); - $conn = new phpcommon\Mysql(array( - 'host' => $mysql_conf['host'], - 'port' => $mysql_conf['port'], - 'user' => $mysql_conf['user'], - 'passwd' => $mysql_conf['passwd'], - 'dbname' => DBNAME_PREFIX . $mysql_conf['instance_id'] - )); - return $conn; - } protected function getQuest($quest_id) { diff --git a/webapp/controller/RankController.class.php b/webapp/controller/RankController.class.php index 816d26e..5bad7a9 100644 --- a/webapp/controller/RankController.class.php +++ b/webapp/controller/RankController.class.php @@ -2,30 +2,7 @@ require 'classes/AddReward.php'; class RankController extends BaseAuthedController { - protected function getMysql($account_id) - { - $mysql_conf = getMysqlConfig(crc32($account_id)); - $conn = new phpcommon\Mysql(array( - 'host' => $mysql_conf['host'], - 'port' => $mysql_conf['port'], - 'user' => $mysql_conf['user'], - 'passwd' => $mysql_conf['passwd'], - 'dbname' => DBNAME_PREFIX . $mysql_conf['instance_id'] - )); - return $conn; - } - protected function getRedis() - { - $key = 'game2005api'; - $redis_conf = getRedisConfig($key); - $r = new phpcommon\Redis(array( - 'host' => $redis_conf['host'], - 'port' => $redis_conf['port'], - 'passwd' => $redis_conf['passwd'], - )); - return $r; - } protected function getSeasonPoint($seaPoint_id) { @@ -121,7 +98,7 @@ class RankController extends BaseAuthedController { } ini_set('memory_limit','3072M'); //击杀榜 - $r = $this->getRedis(); + $r = $this->getRedis(''); //胜场榜 $channel = phpcommon\extractChannel($account_id); $win_rank_db = $r->get("game2005api:win_rank_" . $channel); diff --git a/webapp/controller/RoleController.class.php b/webapp/controller/RoleController.class.php index 24b0a6f..b85f1ab 100644 --- a/webapp/controller/RoleController.class.php +++ b/webapp/controller/RoleController.class.php @@ -5,30 +5,7 @@ require 'classes/AddReward.php'; class RoleController extends BaseAuthedController { - protected function getMysql($account_id) - { - $mysql_conf = getMysqlConfig(crc32($account_id)); - $conn = new phpcommon\Mysql(array( - 'host' => $mysql_conf['host'], - 'port' => $mysql_conf['port'], - 'user' => $mysql_conf['user'], - 'passwd' => $mysql_conf['passwd'], - 'dbname' => DBNAME_PREFIX . $mysql_conf['instance_id'] - )); - return $conn; - } - protected function getRedis($account_id) - { - $redis_conf = getRedisConfig(crc32($account_id)); - $r = new phpcommon\Redis(array( - 'host' => $redis_conf['host'], - 'port' => $redis_conf['port'], - 'passwd' => $redis_conf['passwd'] - - )); - return $r; - } protected function getParameter($para_id) { diff --git a/webapp/controller/ServerSwitchController.class.php b/webapp/controller/ServerSwitchController.class.php index 6cbce63..a1d41bf 100644 --- a/webapp/controller/ServerSwitchController.class.php +++ b/webapp/controller/ServerSwitchController.class.php @@ -2,18 +2,6 @@ class ServerSwitchController extends BaseAuthedController { - protected function getMysql($account_id) - { - $mysql_conf = getMysqlConfig(crc32($account_id)); - $conn = new phpcommon\Mysql(array( - 'host' => $mysql_conf['host'], - 'port' => $mysql_conf['port'], - 'user' => $mysql_conf['user'], - 'passwd' => $mysql_conf['passwd'], - 'dbname' => DBNAME_PREFIX . $mysql_conf['instance_id'] - )); - return $conn; - } private function isForbidCity() { diff --git a/webapp/controller/ShareController.class.php b/webapp/controller/ShareController.class.php index 45c2e72..0eafd7a 100644 --- a/webapp/controller/ShareController.class.php +++ b/webapp/controller/ShareController.class.php @@ -5,30 +5,7 @@ require 'classes/Quest.php'; class ShareController extends BaseAuthedController { - protected function getMysql($account_id) - { - $mysql_conf = getMysqlConfig(crc32($account_id)); - $conn = new phpcommon\Mysql(array( - 'host' => $mysql_conf['host'], - 'port' => $mysql_conf['port'], - 'user' => $mysql_conf['user'], - 'passwd' => $mysql_conf['passwd'], - 'dbname' => DBNAME_PREFIX . $mysql_conf['instance_id'] - )); - return $conn; - } - protected function getRedis($shop_uuid) - { - $redis_conf = getRedisConfig(crc32($shop_uuid)); - $r = new phpcommon\Redis(array( - 'host' => $redis_conf['host'], - 'port' => $redis_conf['port'], - 'passwd' => $redis_conf['passwd'] - - )); - return $r; - } protected function getDrop($drop_id) { diff --git a/webapp/controller/ShopController.class.php b/webapp/controller/ShopController.class.php index d7264ed..0e4c3e6 100644 --- a/webapp/controller/ShopController.class.php +++ b/webapp/controller/ShopController.class.php @@ -6,30 +6,7 @@ require_once 'metatable/shopGoods.php'; require_once 'metatable/parameter.php'; class ShopController extends BaseAuthedController { - protected function getRedis($shop_uuid) - { - $redis_conf = getRedisConfig(crc32($shop_uuid)); - $r = new phpcommon\Redis(array( - 'host' => $redis_conf['host'], - 'port' => $redis_conf['port'], - 'passwd' => $redis_conf['passwd'] - )); - return $r; - } - - protected function getMysql($account_id) - { - $mysql_conf = getMysqlConfig(crc32($account_id)); - $conn = new phpcommon\Mysql(array( - 'host' => $mysql_conf['host'], - 'port' => $mysql_conf['port'], - 'user' => $mysql_conf['user'], - 'passwd' => $mysql_conf['passwd'], - 'dbname' => DBNAME_PREFIX . $mysql_conf['instance_id'] - )); - return $conn; - } protected function getItem($item_id) { $g_conf_item_cluster = require('../res/item@item.php'); diff --git a/webapp/controller/SignController.class.php b/webapp/controller/SignController.class.php index 0031993..1a8e387 100644 --- a/webapp/controller/SignController.class.php +++ b/webapp/controller/SignController.class.php @@ -5,18 +5,6 @@ require 'classes/AddReward.php'; class SignController extends BaseAuthedController { - protected function getMysql($account_id) - { - $mysql_conf = getMysqlConfig(crc32($account_id)); - $conn = new phpcommon\Mysql(array( - 'host' => $mysql_conf['host'], - 'port' => $mysql_conf['port'], - 'user' => $mysql_conf['user'], - 'passwd' => $mysql_conf['passwd'], - 'dbname' => DBNAME_PREFIX . $mysql_conf['instance_id'] - )); - return $conn; - } protected function getSign($sign_id) { diff --git a/webapp/controller/TeamController.class.php b/webapp/controller/TeamController.class.php index 4639d93..ff5498c 100644 --- a/webapp/controller/TeamController.class.php +++ b/webapp/controller/TeamController.class.php @@ -3,30 +3,7 @@ class TeamController extends BaseAuthedController { - protected function getRedis($team_uuid) - { - $redis_conf = getRedisConfig(crc32($team_uuid)); - $r = new phpcommon\Redis(array( - 'host' => $redis_conf['host'], - 'port' => $redis_conf['port'], - 'passwd' => $redis_conf['passwd'] - )); - return $r; - } - - protected function getMysql($account_id) - { - $mysql_conf = getMysqlConfig(crc32($account_id)); - $conn = new phpcommon\Mysql(array( - 'host' => $mysql_conf['host'], - 'port' => $mysql_conf['port'], - 'user' => $mysql_conf['user'], - 'passwd' => $mysql_conf['passwd'], - 'dbname' => DBNAME_PREFIX . $mysql_conf['instance_id'] - )); - return $conn; - } public function createTeam() { diff --git a/webapp/controller/VoiceController.class.php b/webapp/controller/VoiceController.class.php index 21cf2dd..a89b11f 100644 --- a/webapp/controller/VoiceController.class.php +++ b/webapp/controller/VoiceController.class.php @@ -2,29 +2,7 @@ class VoiceController extends BaseAuthedController { - protected function getMysql($account_id) - { - $mysql_conf = getMysqlConfig(crc32($account_id)); - $conn = new phpcommon\Mysql(array( - 'host' => $mysql_conf['host'], - 'port' => $mysql_conf['port'], - 'user' => $mysql_conf['user'], - 'passwd' => $mysql_conf['passwd'], - 'dbname' => DBNAME_PREFIX . $mysql_conf['instance_id'] - )); - return $conn; - } - protected function getRedis($accountid) - { - $redis_conf = getRedisConfig(crc32($accountid)); - $r = new phpcommon\Redis(array( - 'host' => $redis_conf['host'], - 'port' => $redis_conf['port'], - 'passwd' => $redis_conf['passwd'] - )); - return $r; - } public function upload() {