Skip to content

Commit

Permalink
shine->game
Browse files Browse the repository at this point in the history
  • Loading branch information
caohao-go committed Apr 22, 2020
1 parent c138f63 commit ea392da
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ class GameDao extends SuperDao
{
public function init()
{
$this->db_name = "shine_light";
$this->db_name = "game";
$this->util_log = $this->loader->logger('game_log');
}

Expand Down
24 changes: 12 additions & 12 deletions application/config/database.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,19 +53,19 @@
$util_db_config['default']['pool_size'] = 10;

if (GAME_ZONE_ID == 1) {
$util_db_config['shine_light']['host'] = '127.0.0.1';
$util_db_config['shine_light']['username'] = 'test';
$util_db_config['shine_light']['password'] = 'test';
$util_db_config['shine_light']['dbname'] = 'game_zone_1';
$util_db_config['shine_light']['char_set'] = 'utf8';
$util_db_config['shine_light']['dbcollat'] = 'utf8_general_ci';
$util_db_config['game']['host'] = '127.0.0.1';
$util_db_config['game']['username'] = 'test';
$util_db_config['game']['password'] = 'test';
$util_db_config['game']['dbname'] = 'game_zone_1';
$util_db_config['game']['char_set'] = 'utf8';
$util_db_config['game']['dbcollat'] = 'utf8_general_ci';
} else if (GAME_ZONE_ID == 2) {
$util_db_config['shine_light']['host'] = '127.0.0.1';
$util_db_config['shine_light']['username'] = 'test';
$util_db_config['shine_light']['password'] = 'test';
$util_db_config['shine_light']['dbname'] = 'game_zone_2';
$util_db_config['shine_light']['char_set'] = 'utf8';
$util_db_config['shine_light']['dbcollat'] = 'utf8_general_ci';
$util_db_config['game']['host'] = '127.0.0.1';
$util_db_config['game']['username'] = 'test';
$util_db_config['game']['password'] = 'test';
$util_db_config['game']['dbname'] = 'game_zone_2';
$util_db_config['game']['char_set'] = 'utf8';
$util_db_config['game']['dbcollat'] = 'utf8_general_ci';
}

/* End of file database.php */
Expand Down
2 changes: 1 addition & 1 deletion application/dao/GameDao.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class GameDao extends SuperDao
{
public function init()
{
$this->db_name = "shine_light";
$this->db_name = "game";
$this->util_log = $this->loader->logger('game_log');
}

Expand Down
4 changes: 2 additions & 2 deletions application/library/Task.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ class Task
static public function init_task()
{
/*
$datas = MySQLPool::instance("shine_light")->query("select * from task_config");
$datas = MySQLPool::instance("game")->query("select * from task_config");
foreach ($datas as $data) {
$id = $data['id'];
$type = $data['type'];
self::$task_configs[$type][$id] = $data;
}
//成就任务
$datas = MySQLPool::instance("shine_light")->query("select * from task_achieve");
$datas = MySQLPool::instance("game")->query("select * from task_achieve");
foreach ($datas as $data) {
$id_tmp = $data['id'];
self::$achieve_datas[$id_tmp] = $data;
Expand Down
2 changes: 1 addition & 1 deletion crontab/send_rewards.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

//奖品
$rewards = array();
$data = MySQLPool::instance("shine_light")->query("select * from copy_reward where copy_id in (10001, 20100)");
$data = MySQLPool::instance("game")->query("select * from copy_reward where copy_id in (10001, 20100)");

foreach ($data as $v) {
$copy_id = $v['copy_id'];
Expand Down
2 changes: 1 addition & 1 deletion system/Connector.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public static function connect_expire()
self::$conn_map[$fd]->close();
unset(self::$conn_map[$fd]);
//修改下线时间
//MySQLPool::instance('shine_light')->update('user_grade', ['user_id' => $fd], ['off_time' => date('Y-m-d H:i:s')]);
//MySQLPool::instance('game')->update('user_grade', ['user_id' => $fd], ['off_time' => date('Y-m-d H:i:s')]);
}
unset(self::$heartbeat_times_map[$fd]);
} else {
Expand Down

0 comments on commit ea392da

Please sign in to comment.