unity ipv6_Unity和IPv6支持

unity ipv6_Unity和IPv6支持

unity ipv6

Apple recently announced that beginning June 1, 2016, “all apps submitted to the App Store must support IPv6-only networking.” Since many of our users publish Unity games to the App Store, we wanted to take a moment to discuss Unity’s support for IPv6-only networks. Note that this requirement applies to both new app submissions and updates to existing apps.

苹果公司最近 宣布 ,从2016年6月1日开始,“ 提交给App Store的所有应用程序都必须支持IPv6联网。” 由于许多用户将Unity游戏发布到App Store,因此我们想花一点时间来讨论Unity对仅IPv6网络的支持。 请注意,此要求适用于新的应用程序提交和现有应用程序的更新。

What is IPv6?

什么是IPv6?

From the Wikipedia article: “Internet Protocol version 6 (IPv6) is the most recent version of the Internet Protocol (IP), the communications protocol that provides an identification and location system for computers on networks and routes traffic across the Internet.” Devices can operate on an IPv4-only network (the previous standard), and IPv6-only network, or a network with both protocols in use. Apple’s new requirement means that apps must be able to operate in an IPv6-only network.

摘自Wikipedia 文章 :“ Internet协议版本6(IPv6)是 Internet协议 (IP)的 最新版本 ,该 通信协议 为网络上的计算机提供标识和定位系统,并在 Internet 上路由 通信 。” 设备可以在仅IPv4的网络(以前的标准),仅IPv6的网络或同时使用两种协议的网络上运行。 苹果公司的新要求意味着应用程序必须能够在仅IPv6的网络中运行。

It is important to understand that IPv4 and IPv6 networks do not interoperate, although it is possible to pass traffic from one type of network over the other with tunnelling.

重要的是要理解IPv4和IPv6网络不能互操作,尽管可以通过 隧道 从一种类型的网络通过另一种类型的网络传递流量 。

Does Unity support IPv6?

Unity是否支持IPv6?

Yes! WWW and UnityWebRequest are IPv6 compatible on iOS out of the box because they are based on high level Apple networking APIs. And over the past few months we have been working to bring support for IPv6-only networks to Unity’s .NET/IL2CPP libraries. Our last known IPv6 bugs related to .NET/IL2CPP were corrected in the 5.3.4p4 patch release. There is one fix pending for UNET which is going to be shipped in coming weeks. Thanks to help from great members of our community (like Exit Games) we have been able root out a number of bugs in the Unity Engine code and provide support for IPv6-only networks on the following platforms:

是! WWW和UnityWebRequest在现成的iOS上与IPv6兼容,因为它们基于高级Apple网络API。 在过去的几个月中,我们一直在努力将对仅IPv6网络的支持引入Unity的.NET / IL2CPP库。 我们最近一次与.NET / IL2CPP相关的IPv6错误已在5.3.4p4 修补程序版本 中得到纠正 。 UNET有一个修补程序正在等待中,它将在未来几周内交付。 多亏了社区的杰出成员(例如 Exit Games )的帮助,我们才能够消除Unity Engine代码中的许多错误,并在以下平台上为仅IPv6网络提供支持:

  • Editor: All platforms

    编辑器:所有平台

  • Standalone player: All platforms

    独立播放器:所有平台

  • iOS

    的iOS

  • Android

    安卓系统

We’ll continue to add support for IPv6-only networks on other platforms in the future.

将来,我们将继续在其他平台上增加对仅IPv6网络的支持。

What about older versions of Unity?

那么旧版本的Unity呢?

If you are using only WWW or UnityWebRequest APIs to access network resources you should be fine, though please test your games carefully.

如果您仅使用WWW或UnityWebRequest API来访问网络资源,则应该可以,尽管请仔细测试游戏。

We are also planning to backport our .NET/IL2CPP fixes to selected older lines of Unity and release them as 4.7.2, 5.1.5 and 5.2.5 updates.

我们还计划将.NET / IL2CPP修复程序反向移植到选定的Unity旧版本,并将其作为4.7.2、5.1.5和5.2.5更新发布。

What should you do?

你该怎么办?

First, test your game in IPv6-only setup to assess if all the game features work as intended. This guide from Apple goes through the setup of an IPv6-only testing network using a Mac with OS X 10.11 or later. This is the same testing that App Store reviewers will use, so it is a good place to start with IPv6 testing. Since IPv4 and IPv6 networks cannot interoperate, you must test on an IPv6-only network to ensure everything is working well. If your device has both IPv6 and IPv4 addresses, then socket operations could succeed using IPv4.

首先,在仅IPv6设置中测试您的游戏,以评估所有游戏功能是否按预期工作。 Apple的 本 指南 使用带有OS X 10.11或更高版本的Mac进行了仅IPv6测试网络的设置。 这与App Store审阅者将使用的测试相同,因此是从IPv6测试开始的好地方。 由于IPv4和IPv6网络无法互操作,因此您必须在仅IPv6的网络上进行测试以确保一切正常。 如果您的设备同时具有IPv6和IPv4地址,则使用IPv4可以成功进行套接字操作。

Second, audit your code for a few indicators of possible problems:

其次,审核您的代码以寻找一些可能出现问题的指标:

  • Look for the use of IPv4 addresses (e.g. 127.0.0.1, 8.8.4.4). Any use of such hardcoded addresses should be removed. Prefer host names, which can be used to look up the proper IPv4 or IPv6 address of a given device for the proper type of network.

    寻找IPv4地址的使用(例如127.0.0.1、8.8.4.4 )。 此类硬编码地址的任何使用都应删除。 首选主机名,可用于为特定类型的网络查找给定设备的正确IPv4或IPv6地址。

  • Look for the use of the IPAddress.AddressFamily property. If the code branches based on the value of the property, is there a branch that handles IPv6 properly?

    查找 IPAddress.AddressFamily 属性 的使用 。 如果代码根据属性的值进行分支,那么是否存在可以正确处理IPv6的分支?

  • Look for the use of the IPAddress.Any and IPAddress.Loopback fields. These fields work with IPv4 addresses, not IPv6 addresses. Use the IPAddress.IPv6Any and IPAddress.IPv6Loopback fields as well to ensure IPv6 support.

    查找 IPAddress.AnyIPAddress.Loopback 字段的使用。 这些字段适用于IPv4地址,而不适用于IPv6地址。 还要 使用 IPAddress.IPv6AnyIPAddress.IPv6Loopback 字段来确保IPv6支持。

If you encounter troubles beyond the ones mentioned above, please make sure you are using a build with the necessary fix in it. If a fix has not yet landed in your line (4.7.x, 5.1.x, 5.2.x), wait until we have released a patch with it. Then proceed to upgrade to this version.

如果您遇到上述问题之外的麻烦,请确保您使用 的构建中包含必要的修复程序。 如果尚未将修补程序放入您的产品线(4.7.x,5.1.x,5.2.x),请等待直到我们发布了修补程序。 然后继续升级到此版本。

Some of 3rd party native and managed networking plugins might also be not compatible with IPv6 networks, please consider reaching out plugin vendor for their compatibility status.

某些第三方的本地和托管网络插件也可能与IPv6网络不兼容,请考虑与插件供应商联系以获取其兼容性状态。

Finally, let us know if you encounter bugs in Unity related to IPv6. We will work hard to correct them as soon as possible. For issues specifically related to the App Store requirements, visit the iOS and tvOS development section of our forums. I’ll be hanging out there to help.

最后,让我们知道您是否在Unity中遇到与IPv6相关的错误。 我们将努力尽快纠正它们。 对于与App Store要求特别相关的问题,请访问我们 论坛 的iOS和tvOS开发部分 。 我会在那里帮忙。

Update: 4.7.2 is live now: http://unity3d.com/get-unity/download/archive Update #2: 5.2.5 is live too: http://unity3d.com/get-unity/download/archive (scroll down below 5.3.x updates). Update #3: 5.1.5 is live too: http://unity3d.com/get-unity/download/archive (scroll down below 5.2.x updates).

更新: 4.7.2现已上线: http : //unity3d.com/get-unity/download/archive更新#2: 5.2.5也在上线: http : //unity3d.com/get-unity/download/archive (向下滚动至5.3.x更新以下)。 更新#3: 5.1.5也已发布: http//unity3d.com/get-unity/download/archive (向下滚动至5.2.x更新以下)。

翻译自: https://blogs.unity3d.com/2016/05/10/unity-and-ipv6-support/

unity ipv6