Github双端同步

This commit is contained in:
kwiilh
2026-01-09 15:55:00 +08:00
parent 074cf234bd
commit 439216893d
9 changed files with 253 additions and 13 deletions

View File

@@ -11,11 +11,11 @@ selection: true
最近,在山头测试中,我们发现很多开发者的模组明明在单人游戏运行是非常正常的,但在山头、多人联机环境下就会出现功能无效或者异常的情况
只要遵循 ServerSystem ClientSystem 严格分离 的原则,大部分兼容性问题都能自然消失。
后面我们发现,实际上只要遵循 ServerSystem ClientSystem 分离的原则。基本上就能保证开发的模组兼容山头服和多人联机
## 开发范例
> 下方代码为错误示范。仅供参考和通俗化解释,并不能实际运行!
> 下方代码仅供参考和通俗化解释,并不能实际运行!
**modClient.py**
```python
@@ -36,12 +36,12 @@ class ModClient(clientApi.GetClientSystemCls()):
**modServer.py**
```python
import mod.client.extraClientApi as serverApi
from xxx.xxx.xxx import ModClient #错误引用客户端侧
from xxx.xxx.xxx import ModClient
class ModServer(serverApi.GetServerSystemCls()):
def ServerRegister(self):
ModClient.NoClientApiRegister() #在多人游戏出现功能无效或者异常
ModClient.NoClientApiRegister()
print("register successfully")
# TODO
```
@@ -56,4 +56,4 @@ class ModServer(serverApi.GetServerSystemCls()):
当你遵循上述开发原则,即客户端和服务端分离,您开发的模组基本天然兼容多人联机和我的山头的环境