This commit is contained in:
wuaho 2021-07-02 11:14:50 +08:00
parent faf732c093
commit 80a18c8f04
5 changed files with 92 additions and 0 deletions

View File

@ -0,0 +1,15 @@
import json
res = {}
with open('artifact.json', 'r', encoding='utf8') as f:
j = json.load(f)
data = j['data']
keys = [j['keys']] * len(data)
for k_array, v_array in zip(keys, data):
tmp = {}
for k, v in zip(k_array, v_array):
tmp[k] = v
res[tmp['id']] = tmp
with open('artifact.json', 'w', encoding='utf8') as f:
json.dump(res, f)

View File

@ -0,0 +1,15 @@
import json
res = {}
with open('ornaments.json', 'r', encoding='utf8') as f:
j = json.load(f)
data = j['data']
keys = [j['keys']] * len(data)
for k_array, v_array in zip(keys, data):
tmp = {}
for k, v in zip(k_array, v_array):
tmp[k] = v
res[tmp['id']] = tmp
with open('ornaments.json', 'w', encoding='utf8') as f:
json.dump(res, f)

View File

@ -0,0 +1,30 @@
---
- name: 下载 equip
local_action: subversion
args:
repo: "{{svn}}/shanhai0625/client/res/samejson/artifact.json"
dest: "{{ansible_role_name}}/files/artifact.json"
username: "{{username}}"
password: "{{password}}"
export: yes
force: yes
- name: 适配结构
local_action: shell
args:
chdir: "{{ansible_role_name}}/files/"
cmd: "python3 artifact.py"
- name: 拷贝到gm
copy:
src: equip.json
dest: "{{gmdir}}/{{gmgame}}"
- name: 拷贝到gc
copy:
src: equip.json
dest: "{{gcdir}}/{{gmgame}}"

View File

@ -7,4 +7,6 @@
- include: pay.yml - include: pay.yml
#- include: pet.yml #- include: pet.yml
- include: shipin.yml - include: shipin.yml
- include: ornaments.yml
- include: artifact.yml
#- include: wuhun.yml #- include: wuhun.yml

View File

@ -0,0 +1,30 @@
---
- name: 下载 equip
local_action: subversion
args:
repo: "{{svn}}/shanhai0625/client/res/samejson/ornaments.json"
dest: "{{ansible_role_name}}/files/ornaments.json"
username: "{{username}}"
password: "{{password}}"
export: yes
force: yes
- name: 适配结构
local_action: shell
args:
chdir: "{{ansible_role_name}}/files/"
cmd: "python3 ornaments.py"
- name: 拷贝到gm
copy:
src: equip.json
dest: "{{gmdir}}/{{gmgame}}"
- name: 拷贝到gc
copy:
src: equip.json
dest: "{{gcdir}}/{{gmgame}}"