Code Monkey home page Code Monkey logo

kbengine_hotfix's People

Contributors

ahffffffff avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

kbengine_hotfix's Issues

热更新成功之后,玩家下线再进入还是旧代码

  1. 触发热更后,在线玩家,Account 和 B 代码修改成功
  2. 玩家下线后,重新进入游戏,Account 和 B 执行的还是旧代码

感觉只更新了在线实体对象,但离线创建新的实体对象,并没有更新
请问下,我这边是还缺少什么步骤吗 ?

附:类结构如下

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()

如何热更实体中new的对象类

十分感谢大佬的分享,按着文档提示操作,遇到了几个问题,过来请教一下

  1. onTimer 中的定时器,似乎一起动就一直在回调,这个是否有性能的问题?
  2. 在实体类中new了类,实体更新了,但new的类没有更新,是我哪里写错了吗?

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("========")

使用Hotfix后无法登陆

Account继承Hotfix.Hotfix,定时器回调也加了,entities.xml也加了,在base下的kbemain.py也增加了KBEngine.createEntityLocally('Hotfix_Ent'),但是玩家无法登陆;是我的使用方法有问题吗?另外B_Hotfix_Hotfile怎么使用,在哪里调用?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.