liuhaopen / unitymmo Goto Github PK
View Code? Open in Web Editor NEWan unity mmo demo, base on ecs(game play), xlua(ui)
License: MIT License
an unity mmo demo, base on ecs(game play), xlua(ui)
License: MIT License
[:01000017] lua call [1000016 to :1000017 : 14 msgsz = 25] error : /root/u3d/skynet/lualib/skynet.lua:617: /root/u3d/skynet/lualib/skynet.lua:184: /root/u3d/lualib/Common/Util/sprotoloader.lua:21: nil sproto at index 1
stack traceback:
[C]: in function 'sproto.core.loadproto'
/root/u3d/lualib/Common/Util/sprotoloader.lua:21: in function 'Common.Util.sprotoloader.load'
/root/u3d/service/msgagent.lua:60: in local 'f'
/root/u3d/service/msgagent.lua:92: in upvalue 'f'
/root/u3d/skynet/lualib/skynet.lua:141: in function </root/u3d/skynet/lualib/skynet.lua:113>
stack traceback:
[C]: in function 'assert'
/root/u3d/skynet/lualib/skynet.lua:617: in function 'skynet.dispatch_message'
[:01000016] lua call [1000017 to :1000016 : 14 msgsz = 0] error : /root/u3d/skynet/lualib/skynet.lua:617: /root/u3d/skynet/lualib/skynet.lua:184: /root/u3d/skynet/lualib/skynet.lua:359: call failed
stack traceback:
[C]: in function 'error'
/root/u3d/skynet/lualib/skynet.lua:359: in upvalue 'yield_call'
/root/u3d/skynet/lualib/skynet.lua:376: in function 'skynet.call'
/root/u3d/service/gated.lua:42: in function </root/u3d/service/gated.lua:18>
(...tail calls...)
/root/u3d/skynet/lualib/snax/gateserver.lua:151: in upvalue 'f'
/root/u3d/skynet/lualib/skynet.lua:141: in function </root/u3d/skynet/lualib/skynet.lua:113>
stack traceback:
[C]: in function 'assert'
/root/u3d/skynet/lualib/skynet.lua:617: in function 'skynet.dispatch_message'
[:0100000d] invalid client (fd = 11) error = /root/u3d/skynet/lualib/snax/loginserver.lua:146: /root/u3d/skynet/lualib/skynet.lua:359: call failed
我在服务器部署了,但是客户端连接的时候提示这个错误.
我看到UnityMMOAccount库有数据写入
[:01000009] Server start
[:0100000a] LAUNCH snlua protoloader
[:0100000b] LAUNCH snlua console
[:0100000c] LAUNCH snlua debug_console 8000
[:0100000b] lua call [0 to :100000b : 0 msgsz = 56] error : �[31m/home/wlq/work/Server/skynet/lualib/skynet.lua:859: /home/wlq/work/Server/skynet/lualib/skynet.lua:330: /home/wlq/work/Server/skynet/lualib/skynet/socket.lua:358: assertion failed!
stack traceback:
[C]: in function 'assert'
/home/wlq/work/Server/skynet/lualib/skynet/socket.lua:358: in function 'skynet.socket.readline'
/home/wlq/work/Server/skynet/service/console.lua:16: in upvalue 'f'
/home/wlq/work/Server/skynet/lualib/skynet.lua:253: in function </home/wlq/work/Server/skynet/lualib/skynet.lua:252>
stack traceback:
[C]: in function 'assert'
/home/wlq/work/Server/skynet/lualib/skynet.lua:859: in function 'skynet.dispatch_message'�[0m
[:0100000c] Start debug console at 127.0.0.1:8000
[:0100000d] LAUNCH snlua logind
[:0100000e] LAUNCH snlua logind
首先感谢大佬的无私分享,我从中学习到了很多知识。
如果把Server和Lua合在一起是Ok的,可是如果单独把Server上传到服务器编译后,就发现少了很多脚本,例如Lua/Common/Util下的几个脚本,可见Server依赖Lua文件夹。
当然,服务器和客户端共用一些脚本是合理的,我提出来的意思就是标注一下依赖关系。
再次感谢大佬!
额,还有地面穿透问题。对于ECS,Sky net,Lua框架好多地方我还没有搞懂,希望大佬多多指教。
main里时Common.Util.Util,common大小写混乱了。
31/16:1:52:ResourceManager:Initialize() m_BaseDownloadingURL:file:///E:/work/Uni
tyLeaning/UnityMMO-master/StreamingAssets/
31/16:1:53:OnLoadAsset failed!--->>>StreamingAssets trace back : at XLuaFramew
ork.LogHandler.AddMessage (System.String message, UnityEngine.LogType type) [0x0
00ed] in <5a31560096d8420d8fc14c1c8bac16d8>:0
at XLuaFramework.LogHandler.HandleLog (System.String message, System.String st
ackTrace, UnityEngine.LogType type) [0x00001] in <5a31560096d8420d8fc14c1c8bac16
d8>:0
at UnityEngine.Application.CallLogCallback (System.String logString, System.St
ring stackTrace, UnityEngine.LogType type, System.Boolean invokedOnMainThread) [
0x00018] in <712d4fd831e148f0ba5124a22b81cac4>:0
at UnityEngine.DebugLogHandler.Internal_Log (UnityEngine.LogType level, System
.String msg, UnityEngine.Object obj) [0x00000] in <712d4fd831e148f0ba5124a22b81c
ac4>:0
at UnityEngine.DebugLogHandler.LogFormat (UnityEngine.LogType logType, UnityEn
gine.Object context, System.String format, System.Object[] args) [0x0000b] in <7
12d4fd831e148f0ba5124a22b81cac4>:0
at UnityEngine.Logger.Log (UnityEngine.LogType logType, System.Object message)
[0x00029] in <712d4fd831e148f0ba5124a22b81cac4>:0
at UnityEngine.Debug.LogError (System.Object message) [0x00008] in <712d4fd831
e148f0ba5124a22b81cac4>:0
at XLuaFramework.ResourceManager+d__19`1[T].MoveNext () [0x000ce]
in <5a31560096d8420d8fc14c1c8bac16d8>:0
at UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator e
numerator, System.IntPtr returnValueAddress) [0x00028] in <712d4fd831e148f0ba512
4a22b81cac4>:0
报错内容如下:
lua loader error : /root/Server/game/service/chat.lua:5: attempt to index a nil value (global 'ErrorCode')
stack traceback:
/root/Server/game/service/chat.lua:5: in local 'main'
/root/Server/skynet/lualib/loader.lua:48: in main chunk
[:01000024] KILL self
[:01000016] lua call [1000008 to :1000016 : 14 msgsz = 106] error : /root/Server/skynet/lualib/skynet.lua:617: /root/Server/skynet/lualib/skynet.lua:184: /root/Server/skynet/lualib/skynet.lua:628: /root/Server/skynet/service/service_mgr.lua:25: /root/Server/skynet/lualib/skynet.lua:359: call failed
stack traceback:
[C]: in function 'assert'
/root/Server/skynet/lualib/skynet.lua:628: in function 'skynet.uniqueservice'
/root/Server/service/gated.lua:105: in function </root/Server/service/gated.lua:95>
(...tail calls...)
/root/Server/skynet/lualib/snax/gateserver.lua:149: in upvalue 'f'
/root/Server/skynet/lualib/skynet.lua:141: in function </root/Server/skynet/lualib/skynet.lua:113>
stack traceback:
[C]: in function 'assert'
/root/Server/skynet/lualib/skynet.lua:617: in function 'skynet.dispatch_message'
[:01000009] init service failed: /root/Server/skynet/lualib/skynet.lua:359: call failed
stack traceback:
[C]: in function 'error'
/root/Server/skynet/lualib/skynet.lua:359: in upvalue 'yield_call'
/root/Server/skynet/lualib/skynet.lua:376: in function 'skynet.call'
/root/Server/service/main.lua:16: in local 'start'
/root/Server/skynet/lualib/skynet.lua:721: in function </root/Server/skynet/lualib/skynet.lua:718>
[C]: in function 'xpcall'
/root/Server/skynet/lualib/skynet.lua:725: in function 'skynet.pcall'
/root/Server/skynet/lualib/skynet.lua:729: in function 'skynet.init_service'
/root/Server/skynet/lualib/skynet.lua:742: in upvalue 'f'
/root/Server/skynet/lualib/skynet.lua:114: in function </root/Server/skynet/lualib/skynet.lua:113>
[:01000002] LAUNCH snlua bootstrap
[:01000003] LAUNCH snlua launcher
[:01000004] LAUNCH snlua cmaster
[:01000004] master listen socket 192.168.1.36:2013
[:01000005] LAUNCH snlua cslave
[:01000005] slave connect to master 192.168.1.36:2013
[:01000004] connect from 192.168.1.36:54473 4
[:01000006] LAUNCH harbor 1 16777221
[:01000004] Harbor 1 (fd=4) report 192.168.1.36:2526
[:01000005] Waiting for 0 harbors
[:01000005] Shakehand ready
[:01000007] LAUNCH snlua datacenterd
[:01000008] LAUNCH snlua service_mgr
[:01000009] LAUNCH snlua main
[:01000009] Server start
[:0100000a] LAUNCH snlua protoloader
[:0100000b] LAUNCH snlua console
[:0100000c] LAUNCH snlua debug_console 8000
[:0100000c] Start debug console at 127.0.0.1:8000
[:0100000d] LAUNCH snlua logind
[:0100000e] LAUNCH snlua logind
[:0100000f] LAUNCH snlua logind
[:01000010] LAUNCH snlua logind
[:01000011] LAUNCH snlua logind
[:01000012] LAUNCH snlua logind
[:01000013] LAUNCH snlua logind
[:01000014] LAUNCH snlua logind
[:01000015] LAUNCH snlua logind
[:0100000d] login server listen at : 0.0.0.0 8001
[:01000016] LAUNCH snlua gated 16777229 1 1
[:01000016] Listen on 0.0.0.0:8888
[:01000017] LAUNCH snlua msgagent
[:01000018] LAUNCH snlua msgagent
[:01000019] LAUNCH snlua msgagent
[:0100001a] LAUNCH snlua msgagent
[:0100001b] LAUNCH snlua msgagent
[:0100001c] LAUNCH snlua msgagent
[:0100001d] LAUNCH snlua msgagent
[:0100001e] LAUNCH snlua msgagent
[:0100001f] LAUNCH snlua msgagent
[:01000020] LAUNCH snlua msgagent
[:01000021] LAUNCH snlua world
[:01000022] LAUNCH snlua scene 16777249
[:01000023] LAUNCH snlua scene 16777249
[:01000024] LAUNCH snlua chat
[:01000025] LAUNCH snlua dbserver
[:01000026] LAUNCH snlua dbserver
[:01000027] LAUNCH snlua id_service
[:01000009] KILL self
[:01000002] KILL self
我改了好几个了,还是一直报错,全是大小写问题。
是否是skynet或者您的Linux终端有忽略大小写的设置呢?
Could not create asset from Assets/AssetBundleRes/scene/base_world/base_world_2001/ReflectionProbe-0.exr: Cube texture could not be created. Only Power of Two textures can be cubemaps.
下面是我做的测试(平台win7 x64 vs2017):
local ECSCore = require("ECSCore")
local chunk = ECSCore.CreateChunk(32)
local times = 100
local core_cost = 0
local lua_cost = 0
for n = 1,times do
local bt = microsecond()
for i = 0, 10000 do
ECSCore.WriteNumber(chunk, 0, 123)
ECSCore.WriteNumber(chunk, 4, 123)
ECSCore.ReadNumber(chunk, 0)
ECSCore.ReadNumber(chunk, 4)
end
core_cost = core_cost + microsecond() - bt
local t = {a = 0, b= 0}
bt = microsecond()
for i = 0, 10000 do
t.a = 123
t.b = 123
local v1 = t.a
local v2 = t.b
end
lua_cost = lua_cost + microsecond() - bt
end
print("ecs core cost", core_cost)
print("lua cost", lua_cost)
测试结果
ecs core cost 205641
lua cost 33294
我认为使用C存储数据层,造成无法直接使用lua原生指令操作基本类型的数据,只能通过lua虚拟栈操作。 而C#可以直接操作native指针,这个是lua不具备的。
环境 mac unity 2019.3
运行错误日志
xLua exception : luaopen_client_crypt at (wrapper managed-to-native) XLua.LuaDLL.Lua.luaopen_client_crypt(intptr
xLua exception : luaopen_sproto_core at (wrapper managed-to-native) XLua.LuaDLL.Lua.luaopen_sproto_core(intptr)
mac 相关的 lua 库 资源 有问题嘛?
另外 server 端 缺少文件
service/main.lua:2: module 'Common.Util.util' not fou
请教一下,运行报错了,如何解决这个问题呢?log如下:
17/16:11:50:resource manager start
17/16:11:50:new_state : CheckExtractResource
17/16:11:51:CheckExtraceResource AppConfig.DataPath:E:/Games/UnityMMO-master/UnityMMO_Data/StreamingAssets/ isExists:False debugmode : True
17/16:11:51:AssetsHotFixManager:CheckExtractResource ok
17/16:11:51:Main.cs CheckExtractResource OK!!!
17/16:11:51:new_state : UpdateResourceFromNet
17/16:11:51:Main.cs UpdateResourceFromNet OK!!!
17/16:11:51:new_state : InitAssetBundle
17/16:11:51:ResourceManager:Initialize() m_BaseDownloadingURL:file:///E:/Games/UnityMMO-master/UnityMMO_Data/StreamingAssets/
17/16:11:51:Main.cs ResourceManager Initialize OK!!!
17/16:11:51:new_state : StartLogin
17/16:11:51:System.RuntimeType not gen, using reflection instead
17/16:11:51:LUA: load event file!
17/16:11:51:LUA: Cat:UIGlobal.lua[4] UI.AlertView table: 000001FA70DCD480
17/16:11:51:LUA: logic start
17/16:11:51:LUA: update manager start up
17/16:11:51:LUA: Cat:Game.lua[Game.OnInitOK()]
17/16:11:51:UnityEngine.RectTransform+Edge not gen, using reflection instead
17/16:11:51:UnityEngine.RectTransform+Axis not gen, using reflection instead
17/16:11:51:LUA: Cat:Message.lua[Init]
17/16:11:51:LUA: Cat:UIWidgetPool.lua[16] AppConfig.DebugMode true table: 000001FA70E97B60 nil
17/16:11:51:LUA: Cat:TestController.lua[14] self.enable true
17/16:11:51:LUA: Cat:LoginController.lua[Init]
17/16:11:51:UnityEngine.Input not gen, using reflection instead
17/16:11:51:UnityEngine.KeyCode not gen, using reflection instead
17/16:11:51:OnLoadAsset failed!--->>>ui_common trace back : at XLuaFramework.LogHandler.AddMessage (System.String message, UnityEngine.LogType type) [0x00000] in <67971826de2d4123ac11abc59e868fb8>:0
at XLuaFramework.LogHandler.HandleLog (System.String message, System.String stackTrace, UnityEngine.LogType type) [0x00000] in <67971826de2d4123ac11abc59e868fb8>:0
at UnityEngine.Application.CallLogCallback (System.String logString, System.String stackTrace, UnityEngine.LogType type, System.Boolean invokedOnMainThread) [0x00000] in :0
at UnityEngine.DebugLogHandler.Internal_Log (UnityEngine.LogType level, System.String msg, UnityEngine.Object obj) [0x00000] in :0
at UnityEngine.DebugLogHandler.LogFormat (UnityEngine.LogType logType, UnityEngine.Object context, System.String format, System.Object[] args) [0x00000] in :0
at UnityEngine.Logger.Log (UnityEngine.LogType logType, System.Object message) [0x00000] in :0
at UnityEngine.Debug.LogError (System.Object message) [0x00000] in :0
at XLuaFramework.ResourceManager+d__191[T].MoveNext () [0x00000] in <67971826de2d4123ac11abc59e868fb8>:0 at UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) [0x00000] in <f2abf40b37c34cf19b7fd98865114d88>:0 17/16:11:51:OnLoadAsset failed!--->>>ui_login trace back : at XLuaFramework.LogHandler.AddMessage (System.String message, UnityEngine.LogType type) [0x00000] in <67971826de2d4123ac11abc59e868fb8>:0 at XLuaFramework.LogHandler.HandleLog (System.String message, System.String stackTrace, UnityEngine.LogType type) [0x00000] in <67971826de2d4123ac11abc59e868fb8>:0 at UnityEngine.Application.CallLogCallback (System.String logString, System.String stackTrace, UnityEngine.LogType type, System.Boolean invokedOnMainThread) [0x00000] in <f2abf40b37c34cf19b7fd98865114d88>:0 at UnityEngine.DebugLogHandler.Internal_Log (UnityEngine.LogType level, System.String msg, UnityEngine.Object obj) [0x00000] in <f2abf40b37c34cf19b7fd98865114d88>:0 at UnityEngine.DebugLogHandler.LogFormat (UnityEngine.LogType logType, UnityEngine.Object context, System.String format, System.Object[] args) [0x00000] in <f2abf40b37c34cf19b7fd98865114d88>:0 at UnityEngine.Logger.Log (UnityEngine.LogType logType, System.Object message) [0x00000] in <f2abf40b37c34cf19b7fd98865114d88>:0 at UnityEngine.Debug.LogError (System.Object message) [0x00000] in <f2abf40b37c34cf19b7fd98865114d88>:0 at XLuaFramework.ResourceManager+<OnLoadAsset>d__19
1[T].MoveNext () [0x00000] in <67971826de2d4123ac11abc59e868fb8>:0
at UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) [0x00000] in :0
有几个pthread的函数ndk已经不支持了,需要自己加回去,还有个别是其它函数,稳定性�真不好说
本项目为 lua 实现的 FlowCanvas,BehaviourTree,StateMachine 集合,支持此三大类的相互嵌套。可以在 unity 的 FlowCanvas+NodeCanvas插件编辑后导出 lua 脚本直接在本项目使用,当然需要用到本项目提供的导出脚本。尽管项目名叫 blueprint(参考UE的蓝图 blueprint)
Yo,
A question, does the server check the navmesh? Because I did not find the navmesh reading on the server, just the client.
Congratulations on the excellent work!
The referenced script (U3DExtends.LayoutInfo) on this Behaviour is missing!
(Filename: C:\buildslave\unity\build\Runtime/Scripting/ManagedReference/SerializableManagedRef.cpp Line: 199)
The referenced script on this Behaviour (Game Object 'MainUIMenuView_Canvas') is missing!
(Filename: C:\buildslave\unity\build\Runtime/Mono/ManagedMonoBehaviourRef.cpp Line: 334)
A scripted object (probably U3DExtends.LayoutInfo?) has a different serialization layout when loading. (Read 32 bytes but expected 112 bytes)
Did you #ifdef UNITY_EDITOR a section of your serialized properties in any of your scripts?
(Filename: C:\buildslave\unity\build\Runtime/Serialize/SerializedFile.cpp Line: 2136)
[:01000002] LAUNCH snlua bootstrap
[:01000003] LAUNCH snlua launcher
[:01000004] LAUNCH snlua cmaster
[:01000004] master listen socket 0.0.0.0:2013
[:01000005] LAUNCH snlua cslave
[:01000005] slave connect to master 127.0.0.1:2013
[:01000004] connect from 127.0.0.1:48326 4
[:01000006] LAUNCH harbor 1 16777221
[:01000004] Harbor 1 (fd=4) report 127.0.0.1:2526
[:01000005] Waiting for 0 harbors
[:01000005] Shakehand ready
[:01000007] LAUNCH snlua datacenterd
[:01000008] LAUNCH snlua service_mgr
[:01000009] LAUNCH snlua main
[:01000009] Server start
[:0100000a] LAUNCH snlua protoloader
[:0100000b] LAUNCH snlua console
[:0100000c] LAUNCH snlua debug_console 8000
[:0100000c] Start debug console at 127.0.0.1:8000
[:0100000d] LAUNCH snlua logind
[:0100000e] LAUNCH snlua logind
[:0100000f] LAUNCH snlua logind
[:01000010] LAUNCH snlua logind
[:01000011] LAUNCH snlua logind
[:01000012] LAUNCH snlua logind
[:01000013] LAUNCH snlua logind
[:01000014] LAUNCH snlua logind
[:01000015] LAUNCH snlua logind
[:0100000d] login server listen at : 0.0.0.0 8001
[:01000016] LAUNCH snlua gated 16777229 1 1
[:01000016] Listen on 0.0.0.0:8888
[:01000017] LAUNCH snlua msgagent
[:01000018] LAUNCH snlua msgagent
[:01000019] LAUNCH snlua msgagent
[:0100001a] LAUNCH snlua msgagent
[:0100001b] LAUNCH snlua msgagent
[:0100001c] LAUNCH snlua msgagent
[:0100001d] LAUNCH snlua msgagent
[:0100001e] LAUNCH snlua msgagent
[:0100001f] LAUNCH snlua msgagent
[:01000020] LAUNCH snlua msgagent
[:01000021] LAUNCH snlua world
[:01000022] LAUNCH snlua scene 16777249
[:01000023] LAUNCH snlua scene 16777249
[:01000024] LAUNCH snlua chat
[:01000025] LAUNCH snlua dbserver
[:01000026] LAUNCH snlua dbserver
[:01000027] LAUNCH snlua id_service
[:01000009] KILL self
[:01000002] KILL self
[:0100000e] connect from 192.168.100.211:53337 (fd = 11)
Cat:logind.lua[22] user, password 1 password DevelopServer
[:01000025] Table 'UnityMMOAccount.Account' doesn't exist
1@DevelopServer is login, secret is 447e22468b387c3d
Cat:msgagent.lua[50] user_info.agent 16777239
[:01000017] 1 is login
[:01000026] Table 'UnityMMOGame.RoleList' doesn't exist
[:01000026] Table 'UnityMMOGame.RoleList' doesn't exist
[:01000026] Table 'UnityMMOGame.RoleList' doesn't exist
[:01000026] Table 'UnityMMOGame.RoleList' doesn't exist
[:01000026] Table 'UnityMMOGame.RoleList' doesn't exist
[:01000026] Table 'UnityMMOGame.RoleList' doesn't exist
[:01000026] Table 'UnityMMOGame.RoleList' doesn't exist
请问数据库的表是需要自己手动添加吗
Please downgrade to 2018 coz it's LTS version.
请问下 为什么 项目中 有 2 个版本的sproto 保留1 个 会有问题吗
刚接触ECS这块,配置服务器跑了下,有点不太流畅,观摩了大佬的代码,发现ECS的好像都是丢出来外面处理渲染的混合的方式,想知道有没有Animator跟Particle也在ECS里面处理的方案,比如AnimationInstancing这种处理方式可行不
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.