创建花子框架项目
├── 行为包
│ └── 脚本目录
│ └── framework (这里,框架代码)
│ ├── mod1 / mod2 / anyModName (业务代码)
│ ├── modMain.py新版框架采用业务分离思想,framework内是可复用代码,业务代码专注玩法。
modMain写法:
python
@Mod.Binding(name="hziBuiltInScript", version=ModDebugVersionStr)
class hziBuiltInScript(object):
@Mod.InitServer()
def serverInit(self):
BIServer.getSystem().loadSomeNeteaseSys([
'hziModScript.mod.AServer.AServer',
])
@Mod.InitClient()
def clientInit(self):
BIClient.getSystem().loadSomeNeteaseSys([
'hziModScript.mod.AClient.AClient'
])在任何地方,你都可以 import 并调用:
python
from ..framework.core.builtin.BIServer import BIServer
"""
Example:
BIServer.getSystem().loadSomeNeteaseSys([
"path.to.ClassA",
("custom_key", "path.to.ClassB"),
("other_namespace", "key", "path.to.ClassC")
])
"""
"""依然可以按以前的方法快速注册系统:
python
BIClient.getSystem().AddSys('tiso', 'Tiso')
# or
sa.BIClient.AddSys('tiso', 'Tiso')