reanme 2005->2006

This commit is contained in:
aozhiwei 2021-12-21 18:03:25 +08:00
parent 94e1621905
commit c75994a858
6 changed files with 21 additions and 21 deletions

View File

@ -1,7 +1,7 @@
{ {
"name": "game2005api", "name": "game2006api",
"version": "0.1.0", "version": "0.1.0",
"description": "极乐精英", "description": "极乐精英",
"title": "极乐精英", "title": "极乐精英",
"url" : "https://game2005api-test.kingsome.cn/" "url" : "https://game2006api-test.kingsome.cn/"
} }

View File

@ -1,3 +1,3 @@
{ {
"name": "game2005api" "name": "game2006api"
} }

View File

@ -19,7 +19,7 @@ import functools
import test import test
CONFIG_DIR = '../config' if f7.isOnlineEnv() else '/var/data/conf_test/game2005api_rankserver/config' CONFIG_DIR = '../config' if f7.isOnlineEnv() else '/var/data/conf_test/game2006api_rankserver/config'
def _take_pass(elem): def _take_pass(elem):
return elem[3] return elem[3]
@ -96,7 +96,7 @@ def _updateScoreRank(r, channel, integral_list):
integral_rank = [] integral_rank = []
for integral_index in range(min(50, len(integral_list))): for integral_index in range(min(50, len(integral_list))):
integral_rank.append(integral_list[integral_index]) integral_rank.append(integral_list[integral_index])
r.set("game2005api:integral_rank_" + channel, json.dumps(integral_rank)) r.set("game2006api:integral_rank_" + channel, json.dumps(integral_rank))
def fullUpdateRank(): def fullUpdateRank():
f7.udplog.info('fullUpdateRank begin') f7.udplog.info('fullUpdateRank begin')
@ -107,7 +107,7 @@ def fullUpdateRank():
port = conf['port'], port = conf['port'],
user = conf['user'], user = conf['user'],
passwd = conf['passwd'], passwd = conf['passwd'],
db = 'gamedb2005_' + str(conf['instance_id']), db = 'gamedb2006_' + str(conf['instance_id']),
charset = 'utf8' charset = 'utf8'
) )
cursor = conn.cursor() cursor = conn.cursor()
@ -156,7 +156,7 @@ def incrementUpdateRank():
port = conf['port'], port = conf['port'],
user = conf['user'], user = conf['user'],
passwd = conf['passwd'], passwd = conf['passwd'],
db = 'gamedb2005_' + str(conf['instance_id']), db = 'gamedb2006_' + str(conf['instance_id']),
charset = 'utf8' charset = 'utf8'
) )
cursor = conn.cursor() cursor = conn.cursor()
@ -173,7 +173,7 @@ def incrementUpdateRank():
if checkchannel(channel): if checkchannel(channel):
#更新积分榜 #更新积分榜
if channel not in integral_hash: if channel not in integral_hash:
integral_list = r.get('game2005api:integral_rank_' + channel) integral_list = r.get('game2006api:integral_rank_' + channel)
integral_hash[channel] = [] if not integral_list else json.loads(integral_list) integral_hash[channel] = [] if not integral_list else json.loads(integral_list)
_delRepeatData(row, integral_hash[channel]) _delRepeatData(row, integral_hash[channel])
_refreshData(row, integral_hash[channel], take_integral_times) _refreshData(row, integral_hash[channel], take_integral_times)
@ -198,7 +198,7 @@ def _incrementUpdateRank(rushtime):
if __name__ == "__main__": if __name__ == "__main__":
q7.xPrint('pid %d' % os.getpid()) q7.xPrint('pid %d' % os.getpid())
test.say() test.say()
f7.app.init('/data/logs/game2005_rankserver/logs') f7.app.init('/data/logs/game2006_rankserver/logs')
f7.udplog.info('rankserver start pid:' + str(os.getpid())) f7.udplog.info('rankserver start pid:' + str(os.getpid()))
conf = json.loads(open(CONFIG_DIR + '/rankserver.json', 'r').read()) conf = json.loads(open(CONFIG_DIR + '/rankserver.json', 'r').read())

View File

@ -15,7 +15,7 @@ import redis
import os import os
if f7.isOnlineEnv(): if f7.isOnlineEnv():
import game2005_rankserver as app import game2006_rankserver as app
else: else:
import app import app
@ -29,9 +29,9 @@ def _clearRank_cmd(debug_info):
password = conf['passwd'], password = conf['passwd'],
charset = 'utf8' charset = 'utf8'
) )
kill_keys = f7.scanRedisKey(r, "game2005api:kill_rank_*") kill_keys = f7.scanRedisKey(r, "game2006api:kill_rank_*")
win_keys = f7.scanRedisKey(r, "game2005api:win_rank_*") win_keys = f7.scanRedisKey(r, "game2006api:win_rank_*")
integral_keys = f7.scanRedisKey(r, "game2005api:integral_rank_*") integral_keys = f7.scanRedisKey(r, "game2006api:integral_rank_*")
for key in kill_keys : for key in kill_keys :
r.delete(key) r.delete(key)
for key in win_keys : for key in win_keys :
@ -67,7 +67,7 @@ if __name__ == "__main__":
pass pass
else: else:
q7.xPrint('pid:' + str(os.getpid())) q7.xPrint('pid:' + str(os.getpid()))
f7.app.init('/data/logs/game2005_rankserver_cmd/logs') f7.app.init('/data/logs/game2006_rankserver_cmd/logs')
f7.udplog.info('game2005_rankserver_cmd start pid:' + str(os.getpid())) f7.udplog.info('game2006_rankserver_cmd start pid:' + str(os.getpid()))
processCmdLine(sys.argv[1]) processCmdLine(sys.argv[1])
f7.app.start() f7.app.start()

View File

@ -1,7 +1,7 @@
<?php <?php
$g_conf_mysql_cluster = require('../config/game2005api.mysql.cluster.php'); $g_conf_mysql_cluster = require('../config/game2006api.mysql.cluster.php');
$g_conf_redis_cluster = require('../config/game2005api.redis.cluster.php'); $g_conf_redis_cluster = require('../config/game2006api.redis.cluster.php');
$g_metatables = array(); $g_metatables = array();
function checkMysqlConfig() function checkMysqlConfig()
@ -10,7 +10,7 @@ function checkMysqlConfig()
global $g_conf_mysql_cluster; global $g_conf_mysql_cluster;
foreach ($g_conf_mysql_cluster as $instance) { foreach ($g_conf_mysql_cluster as $instance) {
if ($instance_id != $instance['instance_id']) { if ($instance_id != $instance['instance_id']) {
error_log('game2005api.mysql.cluster.php config error'); error_log('game2006api.mysql.cluster.php config error');
die(); die();
} }
$instance_id++; $instance_id++;
@ -23,7 +23,7 @@ function checkRedisConfig()
global $g_conf_redis_cluster; global $g_conf_redis_cluster;
foreach ($g_conf_redis_cluster as $instance) { foreach ($g_conf_redis_cluster as $instance) {
if ($instance_id != $instance['instance_id']) { if ($instance_id != $instance['instance_id']) {
error_log('game2005api.redis.cluster.php config error'); error_log('game2006api.redis.cluster.php config error');
die(); die();
} }
$instance_id++; $instance_id++;

View File

@ -23,7 +23,7 @@ class NameService extends BaseService {
't_used_name', 't_used_name',
array( array(
'name_base64' => $nameBase64, 'name_base64' => $nameBase64,
'key' => '2005' 'key' => '2006'
) )
); );
return !empty($row); return !empty($row);
@ -39,7 +39,7 @@ class NameService extends BaseService {
array( array(
'name' => $name, 'name' => $name,
'name_base64' => $nameBase64, 'name_base64' => $nameBase64,
'key' => '2005', 'key' => '2006',
'account_id' => myself()->_getAccountId(), 'account_id' => myself()->_getAccountId(),
'createtime' => myself()->_getNowTime(), 'createtime' => myself()->_getNowTime(),
'modifytime' => myself()->_getNowTime() 'modifytime' => myself()->_getNowTime()