diff --git a/.gitignore b/.gitignore index 52d0191..3945c51 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,4 @@ __pycache__ *.pyc gitlab/repository +nohup.out \ No newline at end of file diff --git a/bin/protoc b/bin/protoc new file mode 100755 index 0000000..f057bfe Binary files /dev/null and b/bin/protoc differ diff --git a/gitlab/githelper.py b/gitlab/githelper.py index ac52ab5..1f48445 100644 --- a/gitlab/githelper.py +++ b/gitlab/githelper.py @@ -6,7 +6,7 @@ def httpGet(url, params={}): real_url = url + urllib.parse.urlencode(params) req = urllib.request.Request(real_url) req.add_header('Private-Token', 'cRjSP2EUx1SaQYcis9W7') - data = urllib.request.urlopen(req).readall() + data = urllib.request.urlopen(req).read() return json.loads(data.decode('utf-8')) projects = httpGet('http://git.kingsome.cn/api/v4/projects?', @@ -20,6 +20,8 @@ for proj in projects: path = proj['namespace']['path'] if path != 'publish': continue + if name == 'game1008_wsproxy': + continue if not os.path.exists('repository/%s' % path): os.mkdir('repository/%s' % (path)) if not os.path.exists('repository/%s/%s' % (path, name)): diff --git a/scripts/fabfile/fabfile.py b/scripts/fabfile/fabfile.py new file mode 100755 index 0000000..9fe1908 --- /dev/null +++ b/scripts/fabfile/fabfile.py @@ -0,0 +1,27 @@ +#!/usr/bin/env python3 + +import time +from fabric import Connection +from fabric import task +from optparse import OptionParser + +import serverlist_dev + +def execCmd(svr_conf, cmd): + c = Connection(host=svr_conf['host'], user='root', connect_kwargs = { + 'password': 'kingsome' + }) + print(svr_conf) + c.run(cmd.replace('$server_id', str(svr_conf['server_id']))) + +parser = OptionParser(usage="%prog [options]") +parser.add_option( + "-c", + "--cmd", + dest = "cmd", + help = "cmd" +) +(options, args) = parser.parse_args() +if options.cmd: + for a in map(lambda svr_conf : execCmd(svr_conf, options.cmd), serverlist_dev.server_list): + pass diff --git a/scripts/fabfile/serverlist_dev.py b/scripts/fabfile/serverlist_dev.py new file mode 100644 index 0000000..9a1e8eb --- /dev/null +++ b/scripts/fabfile/serverlist_dev.py @@ -0,0 +1,32 @@ +server_list = [ + { + #内网公共测试服 + 'server_id': 1, + 'host': '192.168.100.21', + }, + { + #数值测试服 + 'server_id': 2, + 'host': '192.168.100.37', + }, + { + #技术测试服 + 'server_id': 3, + 'host': '192.168.100.38', + }, + { + #研发一服 + 'server_id': 4, + 'host': '192.168.100.22', + }, + { + #研发二服 + 'server_id': 5, + 'host': '192.168.100.23', + }, + { + #研发三服 + 'server_id': 6, + 'host': '192.168.100.36', + } +] diff --git a/scripts/httprunner/cases/login/SelfSdk.py b/scripts/httprunner/cases/login/SelfSdk.py new file mode 100644 index 0000000..15c92b1 --- /dev/null +++ b/scripts/httprunner/cases/login/SelfSdk.py @@ -0,0 +1,20 @@ +import sys +import random + +sys.path.append('../../') + +import httprunner + +#注册账户 +class Case101: + + def __init__(self): + self.c = 'login' + self.params = { + 'account' : '', + 'passwd' : '', + 'nickname' : '', + 'phone' : '', + 'sms_auth_code' : '', + } + diff --git a/scripts/httprunner/httprunner.py b/scripts/httprunner/httprunner.py new file mode 100644 index 0000000..d82af7b --- /dev/null +++ b/scripts/httprunner/httprunner.py @@ -0,0 +1,8 @@ +# -*- coding: utf-8 -*- +import os +import sys +import json +import time +import urllib.parse +import urllib.request +from optparse import OptionParser diff --git a/scripts/httptest/httptest.py b/scripts/httptest/httptest.py new file mode 100644 index 0000000..228ae0a --- /dev/null +++ b/scripts/httptest/httptest.py @@ -0,0 +1,17 @@ +# -*- coding: utf-8 -*- +import os +import sys +import json +import time +import urllib.parse +import urllib.request +from optparse import OptionParser + +def do_test(): + req = urllib.request.Request('http://127.0.0.1:9002/webapp/index.php?c=Ops&a=selfChecking1') + data = urllib.request.urlopen(req).readall() + print(data) + +while True: + do_test() + time.sleep(.1) diff --git a/scripts/install-deps.sh b/scripts/install-deps.sh index 9b284c5..20ab15a 100644 --- a/scripts/install-deps.sh +++ b/scripts/install-deps.sh @@ -27,3 +27,8 @@ yum install python34-pip-8.1.2-6.el7.noarch pip3 install redis pip3 install pymysql pip3 install tornado +#pip3 install fabric +pip3 install ply +pip3 install pymongo +pip3 install PyYAML +pip3 install protobuf diff --git a/scripts/md_csv/dict.json b/scripts/md_csv/dict.json index d72d075..04196ed 100644 --- a/scripts/md_csv/dict.json +++ b/scripts/md_csv/dict.json @@ -1889,7 +1889,8 @@ "nickname", "localuuid", "button_name", - "button_param" + "button_param", + "button_subname" ], "account_id": { "desc": "\u8d26\u53f7id", @@ -1916,6 +1917,11 @@ "en_name": "button_param", "short_name": "button_param" }, + "button_subname": { + "desc": "\u6309\u94ae\u5b50\u540d\u79f0", + "en_name": "button_subname", + "short_name": "button_subname" + }, "channel": { "desc": "\u5e73\u53f0\u7f16\u53f7", "en_name": "channel", @@ -1937,6 +1943,88 @@ "short_name": "nickname" } }, + "11-32": { + "__keys__": [ + "channel", + "from_appid", + "account_id", + "account_register_utctime", + "account_register_date", + "nickname", + "localuuid", + "msg_id", + "msg_name", + "msg_error", + "req_content", + "rsp_content", + "msg_cosumetime" + ], + "account_id": { + "desc": "\u8d26\u53f7id", + "en_name": "account_id", + "short_name": "account_id" + }, + "account_register_date": { + "desc": "\u8d26\u53f7\u6ce8\u518c\u65f6\u95f4", + "en_name": "account_register_date", + "short_name": "account_register_date" + }, + "account_register_utctime": { + "desc": "\u8d26\u53f7\u6ce8\u518cutc\u65f6\u95f4", + "en_name": "account_register_utctime", + "short_name": "account_register_utctime" + }, + "channel": { + "desc": "\u5e73\u53f0\u7f16\u53f7", + "en_name": "channel", + "short_name": "channel" + }, + "from_appid": { + "desc": "\u6765\u6e90\u6e20\u9053", + "en_name": "from_appid", + "short_name": "from_appid" + }, + "localuuid": { + "desc": "\u672c\u5730\u751f\u6210\u7684uuid", + "en_name": "localuuid", + "short_name": "localuuid" + }, + "msg_cosumetime": { + "desc": "\u6d88\u606f\u8017\u65f6\uff08\u53d1\u9001->\u63a5\u6536\u7684\u65f6\u95f4\uff09", + "en_name": "msg_cosumetime", + "short_name": "msg_cosumetime" + }, + "msg_error": { + "desc": "\u6d88\u606f\u9519\u8bef\u7801\uff080\u4e3a\u65e0\u9519\u8bef\uff09", + "en_name": "msg_error", + "short_name": "msg_error" + }, + "msg_id": { + "desc": "\u6d88\u606fid", + "en_name": "msg_id", + "short_name": "msg_id" + }, + "msg_name": { + "desc": "\u6d88\u606f\u540d\u79f0", + "en_name": "msg_name", + "short_name": "msg_name" + }, + "nickname": { + "desc": "\u6635\u79f0", + "en_name": "nickname", + "short_name": "nickname" + }, + "req_content": { + "desc": "\u53d1\u9001\u7684\u6d88\u606f\u5185\u5bb9\uff08\u5982\u679c\u6709\u7684\u8bdd\uff09\uff1ajson\u683c\u5f0f\u5b57\u7b26\u4e32", + "en_name": "req_content", + "short_name": "req_content" + }, + "rsp_content": { + "desc": "\u63a5\u6536\u7684\u6d88\u606f\u5185\u5bb9\uff08\u5982\u679c\u6709\u7684\u8bdd\uff09\uff1ajson\u683c\u5f0f\u5b57\u7b26\u4e32", + "en_name": "rsp_content", + "short_name": "rsp_content" + } + }, "11-4": { "__keys__": [ "channel", @@ -2177,7 +2265,8 @@ "num3", "reason", "num4", - "reason_param" + "reason_param", + "level" ], "account_id": { "desc": "\u8d26\u53f7id", @@ -2214,6 +2303,11 @@ "en_name": "item_id", "short_name": "num1" }, + "level": { + "desc": "\u7528\u6237\u7b49\u7ea7", + "en_name": "level", + "short_name": "level" + }, "nickname": { "desc": "\u6635\u79f0", "en_name": "nickname", @@ -2271,7 +2365,9 @@ "num3", "reason", "num4", - "reason_param" + "reason_param", + "level", + "max_stage_id" ], "account_id": { "desc": "\u8d26\u53f7id", @@ -2308,6 +2404,16 @@ "en_name": "item_id", "short_name": "num1" }, + "level": { + "desc": "\u7528\u6237\u7b49\u7ea7", + "en_name": "level", + "short_name": "level" + }, + "max_stage_id": { + "desc": "\u6240\u5728\u6700\u9ad8\u5173\u5361", + "en_name": "max_stage_id", + "short_name": "max_stage_id" + }, "nickname": { "desc": "\u6635\u79f0", "en_name": "nickname", @@ -2439,6 +2545,7 @@ "11-28", "11-29", "11-30", - "11-31" + "11-31", + "11-32" ] } diff --git a/scripts/proxy/cliside.py b/scripts/proxy/cliside.py index 3a30e3b..80ee3df 100644 --- a/scripts/proxy/cliside.py +++ b/scripts/proxy/cliside.py @@ -39,6 +39,7 @@ class ClientSide: 'remoteConnIdx' : idx, 'data' : str(base64.b64encode(data)) }) + break except: print('qqqqq', flush=True) break @@ -52,10 +53,8 @@ class ClientSide: try: while True: data += yield self.remote_conn.read_message() - print(data, flush=True) if not data: continue - print(data, flush=True) lines = data.split('\n') if data[-1] == '\n': data = lines[-1] diff --git a/scripts/proxy/srvside.py b/scripts/proxy/srvside.py index ffce7f8..01988b0 100644 --- a/scripts/proxy/srvside.py +++ b/scripts/proxy/srvside.py @@ -165,7 +165,7 @@ class RemoteServer(tornado.tcpserver.TCPServer): if not app.addRemoteConn(conn): stream.close() return - await tornado.gen.sleep(2) + await tornado.gen.sleep(0.3) if not app.isConnectOk(conn.idx): stream.close() return diff --git a/scripts/publish_h5.sh b/scripts/publish_h5.sh new file mode 100644 index 0000000..eb28b25 --- /dev/null +++ b/scripts/publish_h5.sh @@ -0,0 +1,7 @@ +rm /root/game1008h5.zip +cd /root/game1008h5 +zip -r /root/game1008h5.zip * +cd /root +scp game1008h5.zip root@login-test.kingsome.cn:/var/data/game1008h5 +ssh root@login-test.kingsome.cn "cd /var/data/game1008h5 && unzip -o -d $1 game1008h5.zip" +echo 'publish ok'