test(upserver): 归档存档迁移与玩法闭环回归工具
This commit is contained in:
16
CodexOutput/upserver/MapExitTests/generate.py
Normal file
16
CodexOutput/upserver/MapExitTests/generate.py
Normal file
@@ -0,0 +1,16 @@
|
||||
from pathlib import Path
|
||||
s=Path('Client/Assets/Scripts/Stages/FishingAct.cs').read_text(encoding='utf-8-sig')
|
||||
start=s.index('async System.Threading.Tasks.Task LoadMapByCurID()')
|
||||
end=s.index('mapObjPrefab = loadedMapPrefab;',start)+len('mapObjPrefab = loadedMapPrefab;')
|
||||
prefix=s[start:end].replace('async System.Threading.Tasks.Task LoadMapByCurID()', 'public async Task Run()')
|
||||
code='using System;using System.Threading.Tasks;public partial class Subject {\n'+prefix+'\nApplied=true; }\n}\n'
|
||||
s=Path('Client/Assets/Scripts/GampPlay/FishingB/FishingBehaviorB.cs').read_text(encoding='utf-8-sig')
|
||||
start=s.index('void SetIKTarget(Transform target)');a=s.index('{',start);n=1;end=a+1
|
||||
while n:
|
||||
n+=(s[end]=='{')-(s[end]=='}');end+=1
|
||||
code+='public partial class IkSubject {public '+s[start:end]+'\n}\n'
|
||||
s=Path('Client/Assets/Scripts/Stages/FishingStage.cs').read_text(encoding='utf-8-sig')
|
||||
start=s.index('try { await base.StartAsync(); }')
|
||||
end=s.index('//静默加载后续场景',start)
|
||||
code+='public partial class StageSubject : StageBase { public async Task Run(){ var loginLifetime=Lifetime.Token;\n'+s[start:end]+'\nCompleted=true; } }\n'
|
||||
Path('CodexOutput/upserver/MapExitTests/Generated.cs').write_text(code,encoding='utf-8')
|
||||
Reference in New Issue
Block a user