首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >游戏不通过iOS上的套接字连接服务器,而是在其他设备上连接

游戏不通过iOS上的套接字连接服务器,而是在其他设备上连接
EN

Stack Overflow用户
提问于 2020-06-14 06:05:42
回答 1查看 423关注 0票数 1

有什么东西阻止我的游戏连接到服务器,它没有得到批准的应用程序审查小组。

这款游戏是在GooglePlay上发布的,并成功地在所有安卓设备上运行,甚至在Linux和Windows上也是如此。IPv6网络也在运行。游戏使用的是NetworkTransport,在我的例子中,它适用于Socket(而不是Websockets)。

我已经成功地测试、连接和玩了这个游戏:

  • 我的开发者iPhone 5 (iOS 12.4.6)在英国IPv4网络上(我没有IPv6运营商)
  • 小米红米笔记(安卓10)在IPv4和IPv6网络在莫斯科,俄罗斯。
  • IPv4和IPv6网络上的PC (Ubuntu20.04)
  • 在俄罗斯莫斯科的IPv4和IPv6网络上的PC (Windows 8)。
  • 英国IPv4上的PC (Windows 10)

我有3个VPS服务器:

  • 俄罗斯,莫斯科- IPv4和IPv6 (收听17777港口)
  • 德国、法兰克福- IPv4和IPv6 (收听17777端口)
  • 美国,纽约- IPv4和IP6 (收听端口17777)

客户端使用一些随机端口,由OS分配。

游戏总是连接到具有静态IP地址的服务器,它不使用对等,客户端总是启动连接,而不是服务器(...so NAT不应该是问题)。

连接直接通过IP地址,而不是DNS请求。不涉及SSL证书,也不涉及加密。Ping从我的办公室桌面到所有服务器(包括IPv4和IPv6 ping)都能正常工作。

如果没有互联网连接,游戏将被编码为弹出并暂停。但当AppStore评论团队推出这款游戏时,它不知何故认为存在着互联网连接。然而,当它试图建立连接时,IPv4和IPv6网络都只是超时。

也许,在XCode上编译项目时,我错过了一些构建选项?也许我需要添加一些许可/“能力”?

它怎么可能在任何地方都起作用,但在AppStore审查小组总部却不起作用?

我甚至将NSAllowArbitraryLoads键添加到.plist文件中,但似乎AppStore iPads无法与我的服务器对话。他们在iOS 13.5.1上运行Wi。

,这是我的plist:

代码语言:javascript
复制
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
  <dict>
    <key>CADisableMinimumFrameDuration</key>
    <false />
    <key>CFBundleDevelopmentRegion</key>
    <string>en</string>
    <key>CFBundleDisplayName</key>
    <string>Spider Planet</string>
    <key>CFBundleExecutable</key>
    <string>${EXECUTABLE_NAME}</string>
    <key>CFBundleIdentifier</key>
    <string>${PRODUCT_BUNDLE_IDENTIFIER}</string>
    <key>CFBundleInfoDictionaryVersion</key>
    <string>6.0</string>
    <key>CFBundleName</key>
    <string>${PRODUCT_NAME}</string>
    <key>CFBundlePackageType</key>
    <string>APPL</string>
    <key>CFBundleShortVersionString</key>
    <string>1.1</string>
    <key>CFBundleVersion</key>
    <string>24</string>
    <key>LSRequiresIPhoneOS</key>
    <true />
    <key>NSAllowArbitraryLoads</key>
    <true />
    <key>NSAppTransportSecurity</key>
    <dict>
      <key>NSAllowsArbitraryLoads</key>
      <true />
    </dict>
    <key>UIBackgroundModes</key>
    <array>
      <string>remote-notification</string>
    </array>
    <key>UILaunchStoryboardName~ipad</key>
    <string>LaunchScreen-iPad</string>
    <key>UILaunchStoryboardName~iphone</key>
    <string>LaunchScreen-iPhone</string>
    <key>UILaunchStoryboardName~ipod</key>
    <string>LaunchScreen-iPhone</string>
    <key>UIPrerenderedIcon</key>
    <false />
    <key>UIRequiredDeviceCapabilities</key>
    <array>
      <string>armv7</string>
      <string>gamekit</string>
      <string>metal</string>
    </array>
    <key>UIRequiresFullScreen</key>
    <true />
    <key>UIRequiresPersistentWiFi</key>
    <true />
    <key>UIStatusBarHidden</key>
    <true />
    <key>UIStatusBarStyle</key>
    <string>UIStatusBarStyleDefault</string>
    <key>UISupportedInterfaceOrientations</key>
    <array>
      <string>UIInterfaceOrientationLandscapeRight</string>
      <string>UIInterfaceOrientationLandscapeLeft</string>
    </array>
    <key>Unity_LoadingActivityIndicatorStyle</key>
    <integer>-1</integer>
    <key>UnityAddRemoteNotificationCapability</key>
    <true />
    <key>UnityCloudProjectID</key>
    <string></string>
    <key>UnityCrashSubmissionURL</key>
    <string></string>
    <key>UnityNotificationDefaultAuthorizationOptions</key>
    <integer>7</integer>
    <key>UnityNotificationRequestAuthorizationForRemoteNotificationsOnAppLaunch</key>
    <false />
    <key>UnityNotificationRequestAuthorizationOnAppLaunch</key>
    <true />
    <key>UnityRemoteNotificationForegroundPresentationOptions</key>
    <integer>-1</integer>
    <key>UnityUseAPSReleaseEnvironment</key>
    <false />
    <key>UnityUseLocationNotificationTrigger</key>
    <false />
    <key>FacebookAppID</key>
    <string>2895569510500725</string>
    <key>FacebookAutoLogAppEventsEnabled</key>
    <true />
    <key>FacebookAdvertiserIDCollectionEnabled</key>
    <true />
    <key>CFBundleURLTypes</key>
    <array>
      <dict>
        <key>CFBundleURLName</key>
        <string>facebook-unity-sdk</string>
        <key>CFBundleURLSchemes</key>
        <array>
          <string>fb2895569510500725</string>
        </array>
      </dict>
    </array>
    <key>LSApplicationQueriesSchemes</key>
    <array>
      <string>fbapi</string>
      <string>fb-messenger-api</string>
      <string>fbauth2</string>
      <string>fbshareextension</string>
    </array>
  </dict>
</plist>
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2020-06-23 13:07:00

结果发现,这是一个与团结有关的问题,于2020年3月开始出现。

LLAPI不适用于许多用户。解决方案是使用TCP套接字,我使用了远程感应器库,应用程序被接受了:)它的工作速度与NetworkTransport一样快。

这一讨论心灵感应

只需确保您的应用程序和服务器支持IPv6和IPv4,并与NAT一起工作。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/62368962

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档