是否可以在Unity3D中的NetworkManager(HLAPI)和套接字服务器之间进行连接? [英] Is it possible to connect between NetworkManager (HLAPI) in Unity3D and socket server?

查看:347
本文介绍了是否可以在Unity3D中的NetworkManager(HLAPI)和套接字服务器之间进行连接?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试在Unity3D中的NetworkManager(HLAPI)和套接字服务器之间进行连接.

I try to connect between NetworkManager (HLAPI) in Unity3D and Socket server.

我已经尝试使用HLAPI或LLAPI连接两个Unity应用程序.它运作良好.但是HLAPI或LLAPI Unity客户端无法连接到Socket服务器(python).

I have already tried to connect two Unity applications using HLAPI or LLAPI. It works well. But HLAPI or LLAPI Unity client can't connect to Socket server (python).

我认为HLAPI或LLAPI支持在Unity3D应用程序之间进行连接.是吗?

I think that HLAPI or LLAPI supports to connect among Unity3D applications. Is it right?

推荐答案

是否可以在Unity3D中的NetworkManager(HLAPI)之间进行连接 和套接字服务器?

Is it possible to connect between NetworkManager (HLAPI) in Unity3D and socket server?

简短的回答是.

这是两种不同的协议.

我曾经尝试过.它似乎在秘密连接,然后立即断开连接.我不记得我是否尝试过使用TCP或UDP,但是您不能只是这样做.

I once tried it. It seems to connect secretly then immediately disconnect. I can't remember if I tried it with TCP or UDP but you can't just do that.

HLAPI LLAPI 建立在UDP协议之上,在更高的Unity版本中也可能基于TCP.为了使用Unity制作的应用程序连接到该应用程序,您将不得不对HLAPI或LLAPI协议进行反向工程,并了解它们如何相互连接(握手),然后为使用原始套接字的python.

HLAPI or LLAPI are built on on top of the UDP protocol and possibly TCP too in newer Unity version. In order to connect to it with an application not made with Unity, you will have to reverse engineer the HLAPI or LLAPI protocol and understand how they both connect to each other(Handshake) then build a custom API for python using raw socket.

如果要在Unity和使用python编写的程序之间进行通信,建议您使用标准套接字(TCP/UPD).这样更省事,并且可以让您的应用程序支持任何支持套接字的语言.

If you want to communicate between Unity and a program made with python, I suggest you use standard socket (TCP/UPD). This is more less hassle and will allow your app to work with any language that supports socket.

这篇关于是否可以在Unity3D中的NetworkManager(HLAPI)和套接字服务器之间进行连接?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆