修改配置
This commit is contained in:
parent
553426e0d6
commit
035b8a89f5
@ -1,14 +1,18 @@
|
||||
db:
|
||||
host: "localhost"
|
||||
host: "rm-f8zd2030feam53n43.mysql.rds.aliyuncs.com"
|
||||
user: root
|
||||
password: "hef0YMId4DayV0XuGCLmjNjEAVg="
|
||||
password: "o0WEwc46C5mo1qhemU9cFTTIaMMHsoarsIdVhi6vyA=="
|
||||
port: 3306
|
||||
games:
|
||||
- name: "Merge_Pet_Local"
|
||||
topic: "Merge_Pet_Local"
|
||||
- name: "Merge_Pet"
|
||||
topic: "Merge_Pet"
|
||||
partition: 0
|
||||
db_name: "Merge_Pet_Local"
|
||||
- name: "Merge_Pet_Test"
|
||||
topic: "Merge_Pet_Test"
|
||||
partition: 0
|
||||
db_name: "Merge_Pet_Test"
|
||||
db_name: "Merge_Pet_Test"
|
||||
- name: "Merge_Pet_online"
|
||||
topic: "Merge_Pet_online"
|
||||
partition: 0
|
||||
db_name: "Merge_Pet_online"
|
||||
@ -4,8 +4,8 @@
|
||||
/* Created on: 2014-10-16 10:00:00 */
|
||||
/*==============================================================*/
|
||||
|
||||
create database if not exists Merge_Pet_Local CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
|
||||
use Merge_Pet_Local;
|
||||
create database if not exists Merge_Pet_online CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
|
||||
use Merge_Pet_online;
|
||||
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `log_var` (
|
||||
|
||||
4
pack.sh
4
pack.sh
@ -1,2 +1,4 @@
|
||||
cd /data/pet_home_server/src/server
|
||||
cd /data/docs
|
||||
python3 tool/cfg/tool_cfg_json.py
|
||||
cd /home/codes/pet_home_server/src/server
|
||||
GOOS=linux GOARCH=amd64 go build -o /data/pet_home_devops/source/main main.go
|
||||
|
||||
@ -22,7 +22,7 @@
|
||||
|
||||
# - name: copy config
|
||||
# copy:
|
||||
# src: /data/pet_homedocs/tool/out/
|
||||
# src: /data/docs/tool/out/
|
||||
# dest: /usr/local/Goleaf/gamedata/config/
|
||||
# mode: '0777'
|
||||
|
||||
|
||||
@ -6,22 +6,15 @@
|
||||
tasks:
|
||||
|
||||
|
||||
- name: copy config
|
||||
# - name: copy config
|
||||
# copy:
|
||||
# src: /data/docs/tool/out/
|
||||
# dest: /usr/local/Goleaf/config/
|
||||
# mode: '0777'
|
||||
- name: reload tool
|
||||
copy:
|
||||
src: /data/pet_homedocs/tool/out/
|
||||
dest: /usr/local/Goleaf/gamedata/config/
|
||||
mode: '0777'
|
||||
- name: reload config
|
||||
command: echo "1" > /usr/local/Goleaf/gamedata/config/reload
|
||||
register: reload_result
|
||||
|
||||
- name: copy config2
|
||||
copy:
|
||||
src: /data/pet_homedocs/tool/out/
|
||||
dest: /usr/local/game/gamedata/config/
|
||||
mode: '0777'
|
||||
- name: reload config
|
||||
command: echo "1" > /usr/local/game/gamedata/config/reload
|
||||
register: reload_result
|
||||
src: /data/pet_home_devops/Goleaf/tool/tool
|
||||
dest: /usr/local/Goleaf/tool/tool
|
||||
|
||||
|
||||
|
||||
|
||||
@ -5,22 +5,17 @@
|
||||
vars:
|
||||
goleaf_src: /data/pet_home_devops/source/main
|
||||
goleaf_dest: /usr/local/game
|
||||
config_src: /data/pet_homedocs/tool/out/
|
||||
config_src: /data/docs/tool/out/
|
||||
config_dest: /usr/local/game/gamedata/config/
|
||||
pack_script: /data/pet_home_devops/pack.sh
|
||||
tar_file: /usr/local/Goleaf.tar
|
||||
tar_dest: /usr/local/game
|
||||
|
||||
tasks:
|
||||
# - name: copy goleaf
|
||||
# command: tar -cvf /usr/local/Goleaf.tar -C /data/pet_home_devops/Goleaf .
|
||||
# delegate_to: localhost
|
||||
# - name: copy tar
|
||||
# copy:
|
||||
# src: /usr/local/Goleaf.tar
|
||||
# dest: /usr/local/game
|
||||
# - name : untar
|
||||
# command: tar -xvf /usr/local/game/Goleaf.tar -C /usr/local/game
|
||||
- name: change git branch
|
||||
shell: cd /home/codes/pet_home_server && git checkout online && git pull
|
||||
delegate_to: localhost
|
||||
register: git_result
|
||||
- name: sh pack.sh
|
||||
shell: sh /data/pet_home_devops/pack.sh
|
||||
delegate_to: localhost
|
||||
@ -34,7 +29,7 @@
|
||||
dest: "{{goleaf_dest}}"
|
||||
|
||||
- name: copy goleaf
|
||||
command: tar -cvf /usr/local/conf.tar -C /data/pet_homedocs/tool/out .
|
||||
command: tar -cvf /usr/local/conf.tar -C /data/docs/tool/out .
|
||||
delegate_to: localhost
|
||||
- name: copy tar
|
||||
copy:
|
||||
|
||||
@ -5,22 +5,17 @@
|
||||
vars:
|
||||
goleaf_src: /data/pet_home_devops/source/main
|
||||
goleaf_dest: /usr/local/game
|
||||
config_src: /data/pet_homedocs/tool/out/
|
||||
config_src: /data/docs/tool/out/
|
||||
config_dest: /usr/local/game/gamedata/config/
|
||||
pack_script: /data/pet_home_devops/pack.sh
|
||||
tar_file: /usr/local/Goleaf.tar
|
||||
tar_dest: /usr/local/game
|
||||
|
||||
tasks:
|
||||
# - name: copy goleaf
|
||||
# command: tar -cvf /usr/local/Goleaf.tar -C /data/pet_home_devops/Goleaf .
|
||||
# delegate_to: localhost
|
||||
# - name: copy tar
|
||||
# copy:
|
||||
# src: /usr/local/Goleaf.tar
|
||||
# dest: /usr/local/game
|
||||
# - name : untar
|
||||
# command: tar -xvf /usr/local/game/Goleaf.tar -C /usr/local/game
|
||||
- name: change git branch
|
||||
shell: cd /home/codes/pet_home_server && git checkout sdk && git pull
|
||||
delegate_to: localhost
|
||||
register: git_result
|
||||
- name: sh pack.sh
|
||||
shell: sh /data/pet_home_devops/pack.sh
|
||||
delegate_to: localhost
|
||||
@ -34,7 +29,7 @@
|
||||
dest: "{{goleaf_dest}}"
|
||||
|
||||
- name: copy goleaf
|
||||
command: tar -cvf /usr/local/conf.tar -C /data/pet_homedocs/tool/out .
|
||||
command: tar -cvf /usr/local/conf.tar -C /data/docs/tool/out .
|
||||
delegate_to: localhost
|
||||
- name: copy tar
|
||||
copy:
|
||||
|
||||
@ -1,41 +1,53 @@
|
||||
---
|
||||
- name: Deploy GoLeaf release
|
||||
hosts: test
|
||||
gather_facts: no
|
||||
remote_user: root
|
||||
vars:
|
||||
goleaf_src: /data/pet_home_devops/source/main
|
||||
goleaf_dest: /usr/local/Goleaf
|
||||
config_src: /data/docs/tool/out/
|
||||
config_dest: /usr/local/Goleaf/gamedata/config/
|
||||
pack_script: /data/pet_home_devops/pack.sh
|
||||
tar_file: /usr/local/Goleaf.tar
|
||||
tar_dest: /usr/local/Goleaf
|
||||
|
||||
tasks:
|
||||
# - name: restart goleaf
|
||||
# command: sh /usr/local/Goleaf/Restart.sh stop
|
||||
# register: restart_result
|
||||
- name: stop goleaf
|
||||
command: "{{ goleaf_dest }}/tool/tool stop node 1"
|
||||
register: stop_result
|
||||
|
||||
# - name: sh pack.sh
|
||||
# shell: sh /data/pet_home_devops/pack.sh
|
||||
# delegate_to: localhost
|
||||
|
||||
# - name: copy goleaf
|
||||
# copy:
|
||||
# src: /data/pet_home_devops/Goleaf/tool/tool
|
||||
# dest: /usr/local/Goleaf/tool
|
||||
# - name: copy goleaf
|
||||
# copy:
|
||||
# src: /data/pet_home_devops/source/main
|
||||
# dest: /usr/local/Goleaf
|
||||
- name: show stop_result
|
||||
debug:
|
||||
var: stop_result.stdout_lines
|
||||
- name: change git branch
|
||||
shell: cd /home/codes/pet_home_server && git checkout develop && git pull
|
||||
delegate_to: localhost
|
||||
register: git_result
|
||||
- name: sh pack.sh
|
||||
shell: sh /data/docs/pack.sh
|
||||
delegate_to: localhost
|
||||
|
||||
- name: copy goleaf
|
||||
command: tar -cvf /usr/local/conf.tar -C /data/pet_homedocs/tool/out .
|
||||
copy:
|
||||
src: "{{ goleaf_src }}"
|
||||
dest: "{{goleaf_dest}}"
|
||||
|
||||
- name: copy goleaf
|
||||
command: tar -cvf /usr/local/conf.tar -C /data/docs/tool/out .
|
||||
delegate_to: localhost
|
||||
- name: copy tar
|
||||
copy:
|
||||
src: /usr/local/conf.tar
|
||||
dest: /usr/local/Goleaf
|
||||
- name : untar
|
||||
command: tar -xvf /usr/local/Goleaf/conf.tar -C /usr/local/Goleaf/gamedata/config/
|
||||
command: tar -xvf /usr/local/Goleaf/conf.tar -C /usr/local/Goleaf/config/
|
||||
|
||||
|
||||
# - name: restart goleaf
|
||||
# command: sh /usr/local/Goleaf/Restart.sh start
|
||||
# register: restart_result
|
||||
|
||||
# - name: show restart result
|
||||
# debug:
|
||||
# var: restart_result.stdout_lines
|
||||
- name: start goleaf
|
||||
shell: nohup /usr/local/Goleaf/tool/tool start node 1 &
|
||||
register: restart_result
|
||||
|
||||
- name: show restart result
|
||||
debug:
|
||||
var: restart_result.stdout_lines
|
||||
|
||||
56
script/mysql copy.py
Normal file
56
script/mysql copy.py
Normal file
@ -0,0 +1,56 @@
|
||||
import pymysql
|
||||
from sshtunnel import SSHTunnelForwarder
|
||||
from pymysql.converters import escape_string
|
||||
from ruamel.yaml import YAML
|
||||
import math
|
||||
|
||||
|
||||
UUID = 600000500823
|
||||
|
||||
|
||||
|
||||
# ===================config===================
|
||||
|
||||
|
||||
server = SSHTunnelForwarder(
|
||||
ssh_address_or_host=("47.254.83.25", 22),
|
||||
ssh_username="root",
|
||||
ssh_password="ByWayStudios01!",
|
||||
remote_bind_address=("127.0.0.1",3306),
|
||||
local_bind_address=('127.0.0.1',5143)
|
||||
)
|
||||
server.start()
|
||||
db_host = server.local_bind_host
|
||||
db_port = server.local_bind_port
|
||||
print(db_host, db_port)
|
||||
RID = 100398
|
||||
MYRID = 100004
|
||||
|
||||
conn = pymysql.connect(
|
||||
host=db_host,
|
||||
port=db_port,
|
||||
user="root",
|
||||
password="Xijing1!",
|
||||
database="Merge_Pet_1"
|
||||
)
|
||||
cursor = conn.cursor()
|
||||
cursor.execute(("select * from t_player_mod where dwUin = {rid}").format(rid = RID))
|
||||
result1 = cursor.fetchone()
|
||||
|
||||
conn1 = pymysql.connect(
|
||||
host="127.0.0.1",
|
||||
port=3306,
|
||||
user="root",
|
||||
password="root",
|
||||
database='Merge_Pet'
|
||||
)
|
||||
cursor1 = conn1.cursor()
|
||||
sql = "UPDATE t_player_mod SET mData = %s WHERE dwUin = %s"
|
||||
cursor1.execute(sql, (result1[1], MYRID))
|
||||
conn1.commit()
|
||||
|
||||
cursor.close()
|
||||
conn.close()
|
||||
cursor1.close()
|
||||
conn1.close()
|
||||
exit()
|
||||
@ -23,7 +23,7 @@ server.start()
|
||||
db_host = server.local_bind_host
|
||||
db_port = server.local_bind_port
|
||||
print(db_host, db_port)
|
||||
RID = 200090
|
||||
RID = 100014
|
||||
MYRID = 100004
|
||||
|
||||
conn = pymysql.connect(
|
||||
@ -31,7 +31,7 @@ conn = pymysql.connect(
|
||||
port=db_port,
|
||||
user="root",
|
||||
password="Z4rf7eZZe500dxa",
|
||||
database="Merge_Pet_sdk"
|
||||
database="pet_home_1"
|
||||
)
|
||||
cursor = conn.cursor()
|
||||
cursor.execute(("select * from t_player_mod where dwUin = {rid}").format(rid = RID))
|
||||
|
||||
2290
script/tools.ipynb
2290
script/tools.ipynb
File diff suppressed because it is too large
Load Diff
@ -195,7 +195,7 @@ func createConfigFile(Id int, Type string) (map[string]interface{}, string) {
|
||||
|
||||
conf["GameName"] = app_name
|
||||
AppId, _ := cfg.Section("app").Key("app_id").Int()
|
||||
conf["GameId"] = AppId
|
||||
conf["AppID"] = AppId
|
||||
|
||||
conf["ServerType"] = Type
|
||||
conf["ServerID"] = Id
|
||||
|
||||
Loading…
Reference in New Issue
Block a user