Giter Club home page Giter Club logo

poco-sdk's Introduction

poco-sdk for Unity3D poco-sdk for cocos2dx

poco-sdk

This repo contains all implememented poco-sdk, for most popular game engines.

Each directory is an engine specific poco-sdk implementation. You can simply copy the corresponding directory to your project and initialize the module/class from your game scripts.

sdk directory contains the unimplemented language specific base sdk, which can be used to implement an poco-sdk for other game engines

For more detailed integration steps, please refer to Integration Guide.

Issue title format

Feel free to open an issue if you are stuck at integrating the SDK module in your game/app.

The title format will be [<EngineName>-sdk] xxx. e.g. [cocos2dx-lua sdk] XXX Error occurs when...

Contribution

We welcome everyone to implement other 3rd party platforms/engines for poco-sdk.

Acknowledgement

Egret: By github.com/szzg

poco-sdk's People

Contributors

adolli avatar brantxiong avatar coeur avatar danand avatar defaultcyberid avatar dinghongyi avatar hboprc avatar kaluluosi avatar linzecong avatar mengjieli avatar meteorix avatar mtzhanglei avatar prife avatar szzg avatar trehack avatar wangcaiyong01 avatar xiaoguzhu avatar yimelia avatar

Stargazers

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

Watchers

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

poco-sdk's Issues

Error after embedding Poco in unity game "_Color"

Can't get the project tree directly in the game itself.

In the main menu everything works fine, but as soon as I go directly to the game, the developer console displays the error "Material dosen't have a color propery '_Color' "

The fact that we have in the material is not '_Color' and it is not clear what to do now

Windows platform game created on Unity

2019-03-22_08-37-24
2019-03-22_08-34-13

UGUI项目打出的apk无法获取ui渲染树

按照文档完成了pocosdk的接入

  • ngui的项目打出的包可以正常获取ui树 ✅
  • ugui的项目接入后
    • 在unityide里可以正常获取UI树 ✅
    • 打出的apk无法获取ui树 😭

[cocos2dx-js sdk 集成]将cocos-2dx-js/poco文件夹拷贝到项目脚本目录,在CocosCreator中编译报错

CocosCreator版本:1.8
报错信息:

load script [C:\Users\Administrator\Desktop\AirTest\complete_project\temp\quick-scripts\assets\scripts\Poco\Cocos2dxDumper.js] failed : TypeError: Cannot read property 'prototype' of undefined
    at __define (C:\Users\Administrator\Desktop\AirTest\complete_project\temp\quick-scripts\assets\scripts\Poco\Cocos2dxDumper.js:18:48)
    at C:\Users\Administrator\Desktop\AirTest\complete_project\temp\quick-scripts\assets\scripts\Poco\Cocos2dxDumper.js:42:13
    at Object.<anonymous> (C:\Users\Administrator\Desktop\AirTest\complete_project\temp\quick-scripts\assets\scripts\Poco\Cocos2dxDumper.js:49:11)
    at Object.<anonymous> (C:\Users\Administrator\Desktop\AirTest\complete_project\temp\quick-scripts\assets\scripts\Poco\Cocos2dxDumper.js:52:3)
    at Module._compile  (module.js:571:32)
    at Object.Module._extensions..js  (module.js:580:10)
    at Module.load  (module.js:488:32)
    at tryModuleLoad  (module.js:447:12)
    at Function.Module._load  (module.js:439:3)
    at Module.require  (module.js:498:17

识别不到cocos2dx-lua 游戏中的UI元素

有一些问题请教:

1.尝试集成了pocosdk之后,提示找不到version.
在POCO_SDK_VERSION.lua硬写入 local VERSION = "1.0.1"--import('.POCO_SDK_VERSION')
打包成功。
2.集成以后如何确定是否集成成功?
3.在Airtest IDE或者 PocoHierarchyViewer中, 都没有识别cocos2dx-lua的选项, 如何识别UI元素?

[cocos2dx-js sdk 集成] PocoManager is not a constructor

已经将poco-sdk放入游戏目录,在main.js里 加入了

var PocoManager = window.PocoManager;
var poco = new PocoManager() ;
window.poco = poco;

执行后产生 PocoManager is not a constructor 此错误,想请教步骤是否有误?

project.json 也已经加入
"src/lib/Poco/sdk/AbstractDumper.js",
"src/lib/Poco/sdk/AbstractNode.js",
"src/lib/Poco/sdk/Attributor.js",
"src/lib/Poco/sdk/DefaultMatcher.js",
"src/lib/Poco/sdk/IScreen.js",
"src/lib/Poco/sdk/Selector.js",
"src/lib/Poco/Cocos2dxNode.js",
"src/lib/Poco/Cocos2dxDumper.js",
"src/lib/Poco/POCO_SDK_VERSION.js",
"src/lib/Poco/Poco.js"

[cocos2d-lua poco sdk(v1.0.6_2018-5-15)] issue

my game log shows error:

2018-05-29 15:25:20.153767+0800 XApp [LUA-print] stack traceback:
	...client/cocos/src/cocos/framework/init.lua:79: in function <...client/cocos/src/cocos/framework/init.lua:74>
	[string "-------------------------------------------..."]:15: in main chunk
	[C]: in function 'require'
	[string "-------------------------------------------..."]:11: in main chunk
	[C]: in function 'require'
	...client/cocos/src/app/poco/Cocos2dxScreen.lua:33: in function <.../client/cocos/src/app/poco/Cocos2dxScreen.lua:32>
	[C]

please help me to solve it
(我们游戏日志错误如上,帮忙看下这个bug)

[cocos2dx-js sdk integration] - Connection is not established using Python poco-sdk

http://top.gdl.netease.com/poco-res/poco-sdk-test-cocos2dx-js-demo-android.zip

I installed this demo cocos app. and ran below python command. It throws connection timeout error.

from poco.drivers.cocosjs import CocosJsPoco
poco = CocosJsPoco("ws://localhost:15003")

ERROR:
...
...
[rpc]waiting for connection...9
Traceback (most recent call last):
File "", line 1, in
File "/usr/local/lib/python2.7/site-packages/poco/drivers/cocosjs/init.py", line 102, in init
agent = CocosJsPocoAgent(port, device)
File "/usr/local/lib/python2.7/site-packages/poco/drivers/cocosjs/init.py", line 52, in init
self.c.connect()
File "/usr/local/lib/python2.7/site-packages/poco/utils/simplerpc/rpcclient.py", line 23, in connect
self._wait_connected(timeout)
File "/usr/local/lib/python2.7/site-packages/poco/utils/simplerpc/rpcclient.py", line 41, in _wait_connected
raise RpcConnectionError("Connecting Timeout")
RpcConnectionError: Connecting Timeout

Help me in understanding how to use this. Thanks.

Also, can someone share the source code of demo-cocos 2djs app. That will be helpful for me to integrate in my cocos2djs app. Thanks in advance!

【Unity3D FairyGUI-SDK】 client 远程主机强迫关闭一个现有连接

我是用的fairyGUI的官方例子,把SDK加进来,在写了poco的测试语句,用测试语句运行,语句没问题,finished,client会报错误:远程主机强迫关闭了一个现有的连接
image
刚开始以为是我们项目里面设置有问题,我在用demo测试也是一样的问题

IL2CPP兼容性问题导致JSON反序列化方法异常问题

(请尽量按照下面提示内容填写,有助于我们快速定位和解决问题,感谢配合。否则直接关闭。)

(重要!问题分类)

描述问题bug
(简洁清晰得概括一下遇到的问题是什么。或者是报错的traceback信息。)
项目植入了POCO的代码后在unity3D上运行正常,IDE也能正常获取UI渲染树。但是经IL2CPP编译打包成安卓包后就会发生异常。经排查后定位到这一行代码:
Dictionary<string,object> data = JsonConvert.DeserializeObject<Dictionary<string,object>> (json, settings);
查询资料后推断应该是IL2CPP的代码剥离会导致JSON等反射相关的功能会受影响。
然后尝试了在link.xml中将JSON相关代码库加入白名单的方法(link中的代码贴在下方),仍不奏效。
想求助一下有没有什么好的解决方法?








<type fullname="System.ComponentModel.TypeConverter" preserve="all"/>
<type fullname="System.ComponentModel.ArrayConverter" preserve="all"/>
<type fullname="System.ComponentModel.BaseNumberConverter" preserve="all"/>
<type fullname="System.ComponentModel.BooleanConverter" preserve="all"/>
<type fullname="System.ComponentModel.ByteConverter" preserve="all"/>
<type fullname="System.ComponentModel.CharConverter" preserve="all"/>
<type fullname="System.ComponentModel.CollectionConverter" preserve="all"/>
<type fullname="System.ComponentModel.ComponentConverter" preserve="all"/>
<type fullname="System.ComponentModel.CultureInfoConverter" preserve="all"/>
<type fullname="System.ComponentModel.DateTimeConverter" preserve="all"/>
<type fullname="System.ComponentModel.DecimalConverter" preserve="all"/>
<type fullname="System.ComponentModel.DoubleConverter" preserve="all"/>
<type fullname="System.ComponentModel.EnumConverter" preserve="all"/>
<type fullname="System.ComponentModel.ExpandableObjectConverter" preserve="all"/>
<type fullname="System.ComponentModel.Int16Converter" preserve="all"/>
<type fullname="System.ComponentModel.Int32Converter" preserve="all"/>
<type fullname="System.ComponentModel.Int64Converter" preserve="all"/>
<type fullname="System.ComponentModel.NullableConverter" preserve="all"/>
<type fullname="System.ComponentModel.SByteConverter" preserve="all"/>
<type fullname="System.ComponentModel.SingleConverter" preserve="all"/>
<type fullname="System.ComponentModel.StringConverter" preserve="all"/>
<type fullname="System.ComponentModel.TimeSpanConverter" preserve="all"/>
<type fullname="System.ComponentModel.UInt16Converter" preserve="all"/>
<type fullname="System.ComponentModel.UInt32Converter" preserve="all"/>
<type fullname="System.ComponentModel.UInt64Converter" preserve="all"/>
2019-03-05 12:21:48.663 5022-5039/com.haku.TEST E/Unity: System.NotSupportedException: C:\Program Files\Unity\Editor\Data\il2cpp\libil2cpp\icalls\mscorlib\System.Reflection.Emit\DynamicMethod.cpp(19) : Unsupported internal call for IL2CPP:DynamicMethod::create_dynamic_method - System.Reflection.Emit is not supported.
      at System.Reflection.Emit.DynamicMethod.CreateDynMethod () [0x00000] in <filename unknown>:0 
      at System.Reflection.Emit.DynamicMethod.CreateDelegate (System.Type delegateType) [0x00000] in <filename unknown>:0 
      at Newtonsoft.Json.Utilities.DynamicReflectionDelegateFactory.CreateDefaultConstructor[T] (System.Type type) [0x00000] in <filename unknown>:0 
      at Newtonsoft.Json.Serialization.DefaultContractResolver.GetDefaultCreator (System.Type createdType) [0x00000] in <filename unknown>:0 
      at Newtonsoft.Json.Serialization.DefaultContractResolver.InitializeContract (Newtonsoft.Json.Serialization.JsonContract contract) [0x00000] in <filename unknown>:0 
      at Newtonsoft.Json.Serialization.DefaultContractResolver.CreateDictionaryContract (System.Typ

相关截图
(贴出遇到问题时的截图内容,如果有的话)
(在AirtestIDE里产生的图像和设备相关的问题,请贴一些AirtestIDE控制台黑窗口相关报错信息)

复现步骤
项目经IL2CPP编译后应该都能复现

预期效果
(预期想要得到什么、见到什么)

python 版本: python3.5

airtest 版本: 1.0.69

airtest版本通过pip freeze可以命令可以查到

设备:

  • 型号: [e.g. google pixel 2]
  • 系统: [e.g. Android 8.1]
  • (别的信息)

其他相关环境信息
Unity3D上运行正常,在android上运行异常。)

ModuleNotFoundError: No module named 'poco'

Egret
DZ417deMac-mini:roh5 dream001$ egret build -e
您正在使用白鹭编译器 5.2.31 版本
扫描项目列表
项目共计编译耗时:26.941秒
DZ417deMac-mini:roh5 dream001$ python -m poco.utils.net.stdbroker ws://:5003 tcp://:15004
/Library/Frameworks/Python.framework/Versions/3.7/bin/python3.7: Error while finding module specification for 'poco.utils.net.stdbroker' (ModuleNotFoundError: No module named 'poco')
image

[cocos2d-lua] crash崩溃了几十次

堆栈信息如下:

...Bin/trunk/client/cocos/src/app/poco/poco_manager.lua:111: attempt to index local 'client_sock' (a nil value)
.../trunk/client/cocos/src/main.lua:23: in function <...ace/trunk/client/cocos/src/main.lua:16>
...Bin/trunk/client/cocos/src/app/poco/poco_manager.lua:111: in function 'server_loop'
...Bin/trunk/client/cocos/src/app/poco/poco_manager.lua:96: in function <...Bin/trunk/client/cocos/src/app/poco/poco_manager.lua:96>

昨天做了多台机子测试,共出现了几十次这个堆栈错误告警

sdk版本:cocos2d-lua poco sdk(v1.0.6_2018-5-15)

Where do put the cocos2dx lua poco sdk and where should paste the snippet code which you provided @question

Here, What actually i did based on my understanding is listed below.

  1. Create cocos2dx lua project.
  2. Paste the cocos2dx-lua/poco folder in the script folder after i have seached like 'script' folder in my project.
  3. Added the 2 lines of code in the Project/src/Myapp.lua which you given in the guide.
  4. Opened the above project with android studio.
  5. Build synz and build got successfully.
  6. And I ran the cocos2dx app to build in my android device through andrid studio
  7. I got the package name as attached in the screenshot in the guide.
  8. when selecting the package name, I couldnt see the any remote connection with Listening TCP kind of messages.
  • Please, Help me out whether i am going on the right path.
  • Thanks in advance.

[Unity3D] isVRSupported 有误

使用低版本 Unity 时(5.6.4),UnityEngine.XR.XRSettings 报错;
希望这里做个版本区分,低版本下还是 UnityEngine.VR.VRSettings.

cocos-lua可以识别出控件,但是脚本无法运行

from poco.drivers.std import StdPoco
poco = StdPoco()
poco("Button_bag").click()
-----------------------------------------------------------------------------------------------
> [Start running..]
> [02:20:36][DEBUG]<airtest.core.android.adb> E:\Airtest\airtest\core\android\static\adb\windows\adb.exe -P 5037 -s 42f64a0baa5cbf51 wait-for-device
> [02:20:36][DEBUG]<airtest.core.android.adb> E:\Airtest\airtest\core\android\static\adb\windows\adb.exe -P 5037 -s 42f64a0baa5cbf51 shell getprop ro.build.version.sdk
> [02:20:36][DEBUG]<airtest.utils.logwraper> main_script: {'script': u'E:\\rok_Script\\untitled.air'}
> [02:20:36][DEBUG]<airtest.core.android.adb> E:\Airtest\airtest\core\android\static\adb\windows\adb.exe -P 5037 -s 42f64a0baa5cbf51 shell netcfg ; echo ---$?---
==================================================================
ERROR: runTest (app.widgets.code_runner.ide_launcher.AirtestIDECase)

Traceback (most recent call last):
  File "airtest\cli\runner.py", line 84, in runTest
  File "E:\untitled.air\untitled.py", line 11, in <module>
    poco("Button_bag").click()
  File "poco\proxy.py", line 21, in wrapped
  File "poco\proxy.py", line 280, in click
  File "poco\proxy.py", line 404, in get_position
  File "poco\proxy.py", line 37, in wrapped
  File "poco\proxy.py", line 524, in attr
  File "poco\proxy.py", line 653, in _do_query
  File "poco\freezeui\hierarchy.py", line 89, in select
  File "poco\sdk\Selector.py", line 77, in select
  File "poco\sdk\Selector.py", line 70, in getRoot
  File "poco\freezeui\hierarchy.py", line 35, in getRoot
  File "poco\utils\simplerpc\utils.py", line 13, in new_func
  File "poco\utils\simplerpc\simplerpc.py", line 75, in wait
RuntimeError: <poco.utils.simplerpc.simplerpc.Callback object at 0x000000000472CE10> timeout error

[cocos2dx-lua sdk集成]pocosdk的嵌入

本人是测试人员自学ui自动化
对于基于UI控件搜索的方式进行自动化测试,
1.针对cocos 2d游戏 接入 poco sdk,这个是要开发同学的项目脚本接入这个sdk是吗?
2.如果项目游戏没有接入poco sdk的话 用aieIDE进行ui自动化是无法使用空间搜索的方式进行自动化测试的是吧?

js 无法看到ui树

AS 里面看log,发现websocketserver 已经启动
2019-10-21 14:10:04.951 4824-4963/com.ygqp.game1 D/cocos2d-x debug info: JS: Cocos2d-JS v3.10
2019-10-21 14:10:04.978 4824-4963/com.ygqp.game1 D/cocos2d-x debug info: try starting wss..
2019-10-21 14:10:04.979 4824-4963/com.ygqp.game1 D/WebSocketServer.cpp: [WebSocketServer::init] _port: 5003
2019-10-21 14:10:04.979 4824-5109/com.ygqp.game1 D/WebSocketServer.cpp: WebSocketServer thread start, helper instance: 0xca55f1c0
2019-10-21 14:10:04.979 4824-5109/com.ygqp.game1 D/libwebsockets: NOTICE: Initial logging level 1023
2019-10-21 14:10:04.979 4824-5109/com.ygqp.game1 D/libwebsockets: NOTICE: Libwebsockets version: 1.6.0 3ca4bac
2019-10-21 14:10:04.979 4824-5109/com.ygqp.game1 D/libwebsockets: NOTICE: IPV6 compiled in and enabled
2019-10-21 14:10:04.979 4824-5109/com.ygqp.game1 D/libwebsockets: NOTICE: libev support not compiled in
2019-10-21 14:10:04.980 4824-5109/com.ygqp.game1 D/libwebsockets: NOTICE: mem: platform fd map: 4096 bytes
2019-10-21 14:10:04.980 4824-5109/com.ygqp.game1 D/libwebsockets: NOTICE: mem: per-conn: 268 bytes + protocol rx buf
2019-10-21 14:10:05.006 4824-4963/com.ygqp.game1 D/cocos2d-x debug info: Network onServerUp...
2019-10-21 14:10:05.006 4824-4963/com.ygqp.game1 D/cocos2d-x debug info: {"type":"serverup"}

现在游戏基于 v3.10开发,好像不支持 require 语句,我加上 require(‘poco’)在 main.js
里面就报错,我把3.10里的websocket都用 3.13的替换了,所以现在可以编译成功,游戏也能跑起来,但到 airetest ide里面poco的 ui树就是无法刷新,log viewer里面报错 invalid select payload,

我现在没有加入 require(‘poco’)别的都是按照教程里面一步一步做的,请问这个如果require 是必须的话,如果 3.10没有支持,如何绕过?

UnityNode对 ScreenSpace Camera支持的不好,抓取的位置和size不对。

private float[] GameObjectPosInScreen (Vector3 objectPos, Renderer renderer, RectTransform rectTransform, Rect rect)
		{
			float[] pos = { 0f, 0f };
			if (renderer) { 
				// 3d object
				pos [0] = objectPos.x / (float)Screen.width;
				pos [1] = objectPos.y / (float)Screen.height;
			} else if (rectTransform) {
				// ui object (rendered on screen space, other render modes may be different)
				// use center pos for now
				pos [0] = rect.center.x / (float)Screen.width;
				pos [1] = rect.center.y / (float)Screen.height;
			}
			return pos;
		}

位置不对:Canvas如果是ScreenSpace Camera模式,并且设置的UICamera是独立的相机(不是主相机而是另外一个专门的UICamera)的情况下,用rect.center是不准确的,还要用RectTransformUtility做进一步的转换。
size不对:因为CanvasScaler的存在,所以获得的rect不是真实的屏幕上UI的rect大小,rect/rootCanvas.scale 才是真实屏幕上的rect大小。

[cocos-lua Airtest IDE v0.1.4 for MAC]脚本链接不上,怀疑内部脚本写死

这个 wjjn3033不是我的用户名

----------------------------------------------------------------------
ERROR: runTest (app.widgets.code_runner.ide_launcher.AirtestIDECase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/wjjn3033/dev/idestable/airtest/airtest/cli/runner.py", line 66, in runTest
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/six.py", line 693, in reraise
    raise value
  File "/Users/wjjn3033/dev/idestable/airtest/airtest/cli/runner.py", line 62, in runTest
  File "/Applications/AirtestIDE.app/Contents/MacOS/untitled.air/untitled.py", line 10, in <module>
    poco = StdPoco(15004)
  File "/Users/wjjn3033/dev/idestable/poco/poco/drivers/std/__init__.py", line 77, in __init__
socket.gaierror: [Errno 8] nodename nor servname provided, or not known

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.