gpt4 book ai didi

iphone - 为回合制多人 iPhone 游戏构建我自己的游戏服务器

转载 作者:IT王子 更新时间:2023-10-29 08:20:45 26 4
gpt4 key购买 nike

来自Game Kit Programming Guide ...

Multiplayer allows players interested in playing an online multiplayer game to discover each other and be connected into a match. Depending on your needs, your application can have either use Game Kit to connect all the participants together, or have Game Kit deliver a list of players to you. In the latter case, you would provide your own network implementation that connects the players to a server you provide

我想为 Game Center 构建一个基于回合制的多人 iPhone 游戏,并且需要编写我自己的游戏服务器。我计划使用 Game Center API 进行玩家身份验证、记分板和玩家配对,但我仍然需要构建自己的回合制游戏服务器来控制多人游戏通信。这是一款基于时间的游戏,因此服务器将处理诸如同步游戏开始、游戏结束时通知玩家以及比赛结果等事情。在这一点上,我只是想弄清楚从哪里开始构建游戏服务器,我真的很难找到涵盖的任何好的资源......

  1. 回合制游戏服务器的结构和实现方式。理想情况下,我想找到一本书或在线文章,其中包含示例代码,但我读过的每本讨论 iPhone 多人游戏的书都说了同样的话,“开发 Web 服务器超出了本书的范围,但我们将专注于连接到此类服务器所需的客户端代码。”。我在哪里可以找到有关开发 Web 服务器的信息?!

  2. 好用的库/API

  3. 安全问题和常见解决方案
  4. 现有的开源包
  5. 我一直想为其他即将开展的项目学习 Ruby on Rails,我想一箭双雕,这个框架能否很好地实现回合制游戏服务器?

谁能帮助我找到一些涵盖该主题的好书或在线资源?还是直接回答我的问题?我不得不认为开发游戏服务器对于任何为 iOS Game Center 构建游戏的人来说都是一个非常普遍的问题,因为他们中的大多数都是多人游戏,但我不明白为什么没有资源涵盖它是如何完成的。

非常感谢您的帮助!

最佳答案

你问了几个不同的问题,所以我会给出简短的回答。

How turn-based game servers are structured and implemented
Like any other server it listens for connections, processes requests and sends responses.
It's quite easy to write a web service which uses JSON / XML. I think this will be the best and quickest solution to your problem (subjective)!

Good libraries/APIs to use Though there're several good frameworks and libraries on the desktop side of game programming, I can't think of any "web based" library.

Security concerns and common solutions
Basic Authentifcation and OAuth are two of several possibilities to secure your web service.

Existing open source packages
You already mentioned Ruby on Rails but I recommend Django for it's great documentation to get you started. I built my iPhone webservice around Django Piston, which is a great mini framework.

I've been wanting to Learn Ruby on Rails for other upcoming projects and I'd like to kill two birds with one stone, could this framework work well for implementing a turn-based game server? Yes, see my answer above.

关于iphone - 为回合制多人 iPhone 游戏构建我自己的游戏服务器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3856529/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com