P2P网络游戏/应用程序:类似"battle.net"的匹配服务器的不错选择 [英] P2P network games/apps: Good choice for a "battle.net"-like matching server

查看:109
本文介绍了P2P网络游戏/应用程序:类似"battle.net"的匹配服务器的不错选择的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在制作一款网络游戏(1v1),在游戏中使用它的p2p-无需游戏服务器.

但是,为了使玩家能够互相查找",而无需在另一种媒体中进行协调并输入IP地址(类似于网络游戏的现代时代),我需要有一台协调/匹配服务器.

我不能使用常规的虚拟主机,因为:

  • 客户端将以UDP通讯.
  • 因此,我需要进行UDP打孔才能通过NAT
  • 这将要求服务器使用UDP进行通信并知道客户端的IP和端口
  • 具有常规虚拟主机(php/etc)的afaik我只能获取客户端的IP地址,并且只能通过TCP(HTTP)进行通信.

我目前正在考虑的选项:

  • 使用一个托管解决方案,让我的程序可以接受UDP连接. (有什么建议吗?)

  • UDPonNAT 似乎可以做到这一点,但它使用GTalk,并且要求每个客户端都拥有一个GTalk帐户(可能使其成为不合适的解决方案)

有什么想法吗?谢谢:)

解决方案

首先,我说这超出了我的专业领域,但是我发现自己非常感兴趣,因此我一直在进行一些搜索和阅读

似乎最常见的UDP NAT遍历解决方案是使用 STUN 服务器.我进行了一些快速搜索,以查看是否有任何一家公司可以直接为您提供STUN托管解决方案,但即使有,它们也被大量的广告掩埋了,用于简单的虚拟主机.

幸运的是,似乎已经有几台STUN服务器已经启动并正在运行,并且可以免费供公众使用. voip-info.org 中有公共STUN服务器的列表. /p>

此外,如果您探索标记为"nat"的SO问题,那么还有更多的信息.

>

I'm making a network game (1v1) where in-game its p2p - no need for a game server.

However, for players to be able to "find each other", without the need to coordinate in another medium and enter IP addresses (similar to the modem days of network games), I need to have a coordination/matching server.

I can't use regular web hosting because:

  • The clients will communicate in UDP.
  • Therefore I'll need to do UDP Hole Punching to be able to go through the NAT
  • That would require the server to talk in UDP and know the client's IP and port
  • afaik with regular web hosting (php/etc) I can only get the client's IP address and can only communicate in TCP (HTTP).

Options I am currently considering:

  • Use a hosting solution where my program can accept UDP connection. (any recommendations?)

  • UDPonNAT seems to do this but uses GTalk and requires each client to have a GTalk account for this (which probably makes it an unsuitable solution)

Any ideas? Thanks :)

解决方案

First, let me say that this is well out of my realm of expertise, but I found myself very interested, so I've been doing some searching and reading.

It seems that the most commonly prescribed solution for UDP NAT traversal is to use a STUN server. I did some quick searches to see if there are any companies that will just straight-up provide you with a STUN hosting solution, but if there even were any, they were buried in piles of ads for simple web hosting.

Fortunately, it seems there are several STUN servers that are already up and running and free for public use. There is a list of public STUN servers at voip-info.org.

In addition, there is plenty more information to be had if you explore SO questions tagged "nat".

这篇关于P2P网络游戏/应用程序:类似"battle.net"的匹配服务器的不错选择的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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