question

jeremyswigart avatar image
jeremyswigart asked

PlayFabServerAPI.RegisterGame ServerHost

According to the documentation, ServerHost is supposed to be an ipv4 address.

https://api.playfab.com/documentation/Server/method/RegisterGame

Given the absence of a separate "user data" field, I thought I was not going to be able to register photon server based games with playfab for future match making.

Luckily though I gave it a try and there appears to be no validation on that field to verify that it is in fact an IP address.

My question is this.

Is this a deliberately unvalidated field for situations like these? I hope that is the case, so that in the future this doesn't change out from under and prevent me from registering photon based game servers with playfab.

If it is deliberate, may I suggest updating the documentation to mention that one could use ServerHost (ServerIPV6Address too?) in whatever way they want to in the context of external game server providers.

If it not deliberate, may I make a suggestion that an unvalidated user data string field be added to this structure for situations where an IP/host is not the information that a particular external game server needs, and that hopefully no IP validation comes before exposing such a field.

Thanks!

1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

jeremyswigart avatar image jeremyswigart commented ·

Just to clarify, joining photon "servers", or "rooms" in photon terms uses a guid, rather than IP/Port.

0 Likes 0 ·

1 Answer

·
brendan avatar image
brendan answered

Actually, that would be Photon Realtime or similar. Photon Server is specifically their server engine that you can use to write your own logic into, and then host somewhere (EC2, Rackspace, etc.).

But no, this API is intended to be used with IP Addresses. We can't guarantee that other uses will work, as they're not supported.

Can you describe in more detail why you're trying to use RegisterGame with Photon Realtime? There's already a matchmaker in Photon that you can use, and you wouldn't be able to use the player join/leave functionality in our service, since you don't have server authoritative logic running in their service.

4 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

jeremyswigart avatar image jeremyswigart commented ·

The preference for registering our photon servers with playfab is that it seems that the matchmaking functionality is more fleshed out, and that it would be easier to query via a web page that is to be served to the user, and that it seemed there might be benefits to be had in giving playfab awareness of servers for purposes of analytics and such, with the match level event streams and such.

We are running the photon server ourselves, implementing our server side logic via a Photon plugin. I already have the rooms registering/heartbeating with playfab via the plugin callbacks. The only thing out of the ordinary with the process is that the useful identifier for these photon games("rooms") is their GUID, not an ip/port combo. As of right now, playfab lets me stuff any old string as the ServerHost, but I'm reluctant to trust that this method would stay valid in the future. Would it be reasonable to request an optional "GameData" string field which one could use for custom server identification in situations like these? So long as I have a string field to stuff the guid into, and it's part of what is returned via matchmaking, I'd have all I need to do it this way.

0 Likes 0 ·
jeremyswigart avatar image jeremyswigart commented ·

Here's some Photon rooms I was publishing yesterday to tinker with what playfab allows me to use as the server host.

https://www.dropbox.com/s/4i7qz3uj1d6990t/archived_games.JPG?dl=0

Ultimately there appears to be some benefits to using playfab over photon for external game server lifetime tracking, matchmaking, etc. Does that seem reasonable?

0 Likes 0 ·
brendan avatar image brendan jeremyswigart commented ·

Ultimately, the Server Host field is intended for use with IP Addresses. As that information is stored as arbitrary strings, it's possible to put other things there - we don't expect that to change. But the only supported use case is using IP Addresses, so we can't really support other uses of that field. That said, the specifics of the field's behavior aren't likely to change, as we are committed to having no breaking changes.

But that said, my recommendation would be to open a Feature Request in that forum area for something specifically designed for your use case.

0 Likes 0 ·
jeremyswigart avatar image jeremyswigart commented ·

Thanks, I'll do that.

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.