test(upserver): 归档存档迁移与玩法闭环回归工具
This commit is contained in:
22
CodexOutput/upserver/LogoutStorageTests/generate.py
Normal file
22
CodexOutput/upserver/LogoutStorageTests/generate.py
Normal file
@@ -0,0 +1,22 @@
|
||||
from pathlib import Path
|
||||
|
||||
s = Path('Client/Assets/Scripts/Core/PlayFabMgr.cs').read_text(encoding='utf-8-sig')
|
||||
def block(marker):
|
||||
start = s.index(marker)
|
||||
a = s.index('{', start)
|
||||
n, end = 1, a + 1
|
||||
while n:
|
||||
n += (s[end] == '{') - (s[end] == '}')
|
||||
end += 1
|
||||
return s[start:end]
|
||||
|
||||
code = '''using System;using System.Collections.Generic;using System.Threading;
|
||||
public class Subject {
|
||||
public LinkedList<Dictionary<string,string>> dataBuffer = new();
|
||||
public Dictionary<string,string> swapData = new();
|
||||
public CancellationTokenSource tokenSource = new();
|
||||
public void Flush()=>SyncData(); public void Destroy()=>OnDestroy();
|
||||
public void UpdateFaild(object error){}
|
||||
'''
|
||||
code += block('void OnDestroy()') + '\n' + block('private void SyncData()') + '\n}\n'
|
||||
Path('CodexOutput/upserver/LogoutStorageTests/Generated.cs').write_text(code, encoding='utf-8')
|
||||
Reference in New Issue
Block a user