争霸测试
This commit is contained in:
parent
4f66ebbe64
commit
d4a0e5dcfc
1
create_database.sql
Normal file
1
create_database.sql
Normal file
@ -0,0 +1 @@
|
||||
create database zhengba;
|
@ -6,7 +6,7 @@ class Config:
|
||||
'send_receive_timeout': 30}
|
||||
|
||||
# 每个游戏不一样 游戏上报 kafka 主题
|
||||
SUBSCRIBE_TOPIC = 'test2'
|
||||
SUBSCRIBE_TOPIC = 'zhengba_test'
|
||||
|
||||
KAFKA_CONSUMER_CONF = {
|
||||
'bootstrap_servers': ["192.168.0.30:9092", "192.168.0.71:9092", "192.168.0.229:9092"],
|
||||
@ -14,10 +14,10 @@ class Config:
|
||||
'auto_offset_reset': 'earliest',
|
||||
|
||||
# 每个游戏不一样
|
||||
'group_id': 'legu_group3'
|
||||
'group_id': 'zhengba_consumer_group'
|
||||
}
|
||||
# 游戏数据库名
|
||||
GAME = 'shjy'
|
||||
GAME = 'zhengba'
|
||||
|
||||
REDIS_CONF = {
|
||||
'host': '192.168.0.161',
|
||||
|
@ -31,7 +31,7 @@ def run():
|
||||
for topic, msg in consumer():
|
||||
# print(msg)
|
||||
type_ = msg['#type']
|
||||
if msg['#app_id']!='c3e0409ac18341149877b08f087db640':
|
||||
if msg['#app_id']!='e903ab24ad8f4bfca8a3ce7e122cd102':
|
||||
print(msg)
|
||||
del msg['#type']
|
||||
ts = int(time.time())
|
||||
|
@ -1,4 +1,4 @@
|
||||
create view shjy.user_view as select *
|
||||
from shjy.user
|
||||
create view zhengba.user_view as select *
|
||||
from zhengba.user
|
||||
order by `#reg_time` desc
|
||||
LIMIT 1 by `#account_id`
|
@ -17,6 +17,8 @@ def create_consumer(partition=-1):
|
||||
# print(msg)
|
||||
topic = msg.topic
|
||||
val = msg.value
|
||||
if val.get('owner_name') not in ('gmhdgdt', 'gmhdtt'):
|
||||
continue
|
||||
yield topic, val
|
||||
|
||||
return consumer
|
||||
|
@ -1,4 +1,4 @@
|
||||
create table shjy.event
|
||||
create table zhengba.event
|
||||
(
|
||||
`#ip` Nullable(IPv4),
|
||||
`#country` Nullable(String),
|
||||
|
@ -1,4 +1,4 @@
|
||||
create table shjy.user
|
||||
create table zhengba.user
|
||||
(
|
||||
|
||||
`#reg_time` DateTime('UTC'),
|
||||
|
Loading…
Reference in New Issue
Block a user