ahffffffff / kbengine_hotfix Goto Github PK
View Code? Open in Web Editor NEWkbengine 脚本层热更新方案
kbengine 脚本层热更新方案
感觉只更新了在线实体对象,但离线创建新的实体对象,并没有更新
请问下,我这边是还缺少什么步骤吗 ?
附:类结构如下
class A(Hotfix.Hotfix):
def __init__(self):
Hotfix.Hotfix.__init__(self)
class B(A):
pass
class Account(KBEngine.Proxy,Hotfix.Hotfix):
def __init__(self):
KBEngine.Proxy.__init__(self)
Hotfix.Hotfix.__init__(self)
self.b = B()
十分感谢大佬的分享,按着文档提示操作,遇到了几个问题,过来请教一下
Account new MoneyPlayerData类
`
class Account(KBEngine.Proxy,Hotfix.Hotfix):
def __init__(self):
KBEngine.Proxy.__init__(self)
Hotfix.Hotfix.__init__(self)
self.moneyPlayerData = playerData.MoneyPlayerData.MoneyPlayerData()
`
MoneyPlayerData 继承 BasePlayerData
`
class MoneyPlayerData(playerData.BasePlayerData.BasePlayerData,Hotfix.Hotfix):
def initData(self,player):
# 基类初始化
super(MoneyPlayerData,self).initData(player)
Hotfix.Hotfix.__init__(self)
`
BasePlayerData
`
class BasePlayerData():
# 默认初始化
def initData(self,player):
#My_WARNING_MSG("BasePlayerData::__init__");
self.player = player;
# 初始化玩家数据
def initFirstData(self):
pass
# 重置玩家数据
def resetData(self):
pass
# 下发之前校验数据
def checkPlayerData(self):
pass
# 初始下发参数
def getInitParams(self,dict):
return dict
# 上传数据
def uploadData(self,dict):
pass
# 刷新每日数据
def refreshDayData(self):
pass
def getPlayerID(self):
return self.player.playerID;
`
文档里说
需要热更的类或实体继承 Hotfix.Hotfix 并增加 onTimer 回调。 公用类型的类不需要回调,只需要继承 Hotfix.Hotfix。
请教一下,那非对象的工具类该如何继承Hotfix.Hotfix
热更呢?
比如 . myUtils.py
def myPrint( content ):
print("========")
Account继承Hotfix.Hotfix,定时器回调也加了,entities.xml也加了,在base下的kbemain.py也增加了KBEngine.createEntityLocally('Hotfix_Ent'),但是玩家无法登陆;是我的使用方法有问题吗?另外B_Hotfix_Hotfile怎么使用,在哪里调用?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.