Forum C# API support

API support

Postby snowman745 » August 28th, 2020, 2:29 pm

Does (or is) PlayerIO planning any support for API calls or something similar where a player can get data without a dedicated connection?

A dedicated connection from a mobile phone quickly consumes the users battery so many requests can be done via an API instead of over TCP/IP.

Just curious. I'm new to PlayerIO and looking at whether its a viable option for us.

Thanks,
--Mike
snowman745
 
Posts: 6
Joined: August 28th, 2020, 2:27 pm

Re: API support

Postby snowman745 » September 4th, 2020, 4:28 am

Anyone? Bueller?
snowman745
 
Posts: 6
Joined: August 28th, 2020, 2:27 pm

Re: API support

Postby Henrik » September 7th, 2020, 10:24 pm

All the API calls are already done over HTTP, and therefore don't require a persistent connection.

The only thing requiring a persistent connection is when you're connected to a Multiplayer room, because you're supposed to be continuously sending and receiving messages.
Henrik
.IO
 
Posts: 1864
Joined: January 4th, 2010, 1:53 pm

Re: API support

Postby snowman745 » September 8th, 2020, 5:41 pm

How do I upload and host my own custom APIs for my game then?

I only see the ability to upload game code for multiplayer, not for an API that I create.

Thanks again,
--Mike
snowman745
 
Posts: 6
Joined: August 28th, 2020, 2:27 pm

Re: API support

Postby Henrik » September 9th, 2020, 8:24 pm

Sorry, no, there's no "rpc" capability in PlayerIO, i.e. you can't make one-off calls to your own serverside code. We only support live, synchronous, multiplayer rooms, and those require a persistent connection.

You *could* of course quickly join a service room, fire off a single message, receive a single reply, and then disconnect from the room, which is effectively the same as what you want, but there's going to be a bit more handshaking overhead for each call.
Henrik
.IO
 
Posts: 1864
Joined: January 4th, 2010, 1:53 pm

Re: API support

Postby snowman745 » September 10th, 2020, 5:22 pm

Ah, that is too bad. If PlayerIO ever supported this, it would create an incredible E2E game hosting experience.

Thanks,
--Mike
snowman745
 
Posts: 6
Joined: August 28th, 2020, 2:27 pm

Re: API support

Postby Emalton » September 19th, 2020, 11:47 pm

Maybe when using CreateJoinRoom from the client you can specify stuff you in the JoinData parameter? This you read JoinData in serverside code in UserJoined method and then disconnect the player. You wouldn't even need to store a persistent connection this way either.
Emalton
 
Posts: 77
Joined: June 28th, 2013, 3:49 am


Return to C#



cron