Code Monkey home page Code Monkey logo

Comments (6)

chexiongsheng avatar chexiongsheng commented on September 28, 2024

你概念上搞混了。
JsEnv是一个虚拟机,多个虚拟机间相互隔离,和你nodejs启动了多个进程一样。
继承引擎类功能会自己启动一个虚拟机,和你在gameinstance启动的虚拟机不是一个虚拟机。

from puerts.

pheyahu avatar pheyahu commented on September 28, 2024

有没有办法解决这种情况呢?能在游戏中只存在一个虚拟机么?在很多情况下是需要actor创建完成后通知脚本层做一些逻辑的。

from puerts.

chexiongsheng avatar chexiongsheng commented on September 28, 2024

有没有办法解决这种情况呢?能在游戏中只存在一个虚拟机么?在很多情况下是需要actor创建完成后通知脚本层做一些逻辑的。

什么叫解决?你不启动多个不就只有一个了吗?
你用node a.js启动一个进程,node b.js启动一个进程,然后问为啥a.js的变量在b.js那访问不了?你别启动两个,把逻辑都加载到一个进程,或者两个进程间通过ipc交流。

from puerts.

chexiongsheng avatar chexiongsheng commented on September 28, 2024

demo中gameinstance启动jsenv这是示例,不是必要的,正如helloworld示例程序不是让你在每个程序都打印一下helloworld。

继承引擎类功能也可以不开,不开就没有虚拟机。

from puerts.

chexiongsheng avatar chexiongsheng commented on September 28, 2024

仔细看文档最新的提交内容。

from puerts.

pheyahu avatar pheyahu commented on September 28, 2024

好的,我大概知道了,还以为必须要初始化一个虚拟机。感谢!

from puerts.

Related Issues (20)

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.