Datasnap 是否适合最多 8 人的非通信密集型双向多人游戏?

发布于 2024-08-13 05:41:15 字数 323 浏览 5 评论 0原文

我正在构建一个小型多人游戏,需要以下内容:

  • 它必须用 Delphi 编写
  • 必须支持 Internet 连接(不仅是 LAN)
  • 通过 HTTP 工作
  • 支持数据包的某些加密(可能是自定义的)
  • 能够向服务器发送命令
  • 能够从服务器接收响应
  • 能够将最多 8 个玩家连接到一台服务器
  • 能够将复杂的对象(可能是 JSON 序列化)传递到服务器

您认为新的 Delphi 2010 Datasnap 可以在这种情况下成功使用吗?我使用普通的旧 TSocket 吗?

I am building a small multipliplayer which will need the following:

  • it must be written in Delphi
  • must support Internet connection (not only LAN)
  • work over HTTP
  • support some encryption of the packets (it may be custom)
  • be able to send commands to the server
  • be able to receive responses from the server
  • be able to connect up to 8 players to one server
  • be able to pass complex objects (maybe JSON serialized) to the servers

Do you think the new Delphi 2010 Datasnap can be used successfully in this scenario or should I go with the plain old TSocket?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

DataSnap 可以完成上面列出的所有操作:

  1. DataSnap 是用 Delphi 编写的。
  2. 它可以通过任何连接(本地、网络或远程)通过 HTTP 进行连接。
  3. 它将通过 HTTP 工作,包括支持 HTTP 连接隧道
  4. 您可以根据需要过滤数据流。该产品包括压缩过滤器。 Daniele Teti 编写了一些非常好的加密过滤器
  5. 您可以通过调用服务器方法向服务器发送命令
  6. 您可以通过服务器回调接收服务器的响应
  7. 您可以轻松地将八个人连接到服务器
  8. 您可以传递JSON对象。这是客户端和服务器之间发送的默认类型。

所以回答你的问题,是的,我认为新的 Delphi 2010 DataSnap 可以在你的场景中使用。

DataSnap can do all that you've listed above:

  1. DataSnap is written in Delphi.
  2. It can connect via HTTP over any connection, local, network, or remote.
  3. It will work over HTTP, including support for tunneling the HTTP connection
  4. You can filter the data stream however you like. The product includes a compression filter. Daniele Teti has written some very nice encryption filters.
  5. You can send commands to the server by calling server methods
  6. You can receive a response from the server via server callbacks
  7. You can easily connect eight people to a server
  8. You can pass JSON objects. That is the default type sent between client and server.

So to answer your question, yes, I think that the new Delphi 2010 DataSnap can be used in your scenario.

℉服软 2024-08-20 05:41:16

正如尼克所说,答案是肯定的。

Bob Swart 撰写了一份白皮书并制作了一些有关更新后的 Delphi 2010 中的 DataSnap< 的视频/a> 这可以帮助您入门。

As Nick said, the answer is Yes.

Bob Swart wrote a white paper and produced some videos on the updated DataSnap in Delphi 2010 that can help get you started.

锦欢 2024-08-20 05:41:16

如果您的多人游戏不发送太多数据,HTTP 和 Datasnap 可能会起作用。如果您需要快速通信,我会使用 UDP 和自定义二进制协议。除非您必须绕过公司防火墙,该防火墙会阻止除 HTTP 之外的几乎所有协议(而且公司通常不喜欢人们在工作时间玩游戏),否则防火墙会阻止传入连接,而不是传出连接。只是服务器需要打开端口来允许客户端连接。
我也会避免使用 JSON - 如果您不需要互操作性,则二进制序列化要快得多。

If your multiplayer game doesn't send much data HTTP and Datasnap may work. If you need a fast communication, I'd use UDP and custom binary protocol. Unless you have to bypass a company firewall that stops almost any protocol but HTTP - and companies usually don't like people playing in their working hours - a firewall blocks incoming connection, not outgoing. Just the server needs open ports to allow clients to connect.
And I'd avoid JSON as well - if you don't need interoperability a binary serialization is much faster.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文