Welcome, Guest. Please Login or Register.
Nov 23rd, 2024, 1:08am

Home Home Help Help Search Search Members Members Login Login Register Register
Arimaa Forum « server interface protocol. »


   Arimaa Forum
   Arimaa
   Site Discussion
(Moderator: supersamu)
   server interface protocol.
« Previous topic | Next topic »
Pages: 1  Reply Reply Notify of replies Notify of replies Send Topic Send Topic Print Print
   Author  Topic: server interface protocol.  (Read 764 times)
froody
Forum Guru
*****




I <3 nurpinar

  phm_42@yahoo.co.uk   anteater042


Gender: male
Posts: 103
server interface protocol.
« on: Nov 23rd, 2009, 2:45am »
Quote Quote Modify Modify

I'm trying to make a client. (This is a new project, starting from scratch in smalltalk. (My last attempt was never finished properly..))
 
My first aim is to deal only with postal games.
 
How often should I check for updates? To do so, do I have to go through each game doing action=reserveseat, action=sit then action=gamestate?
 
The sensible thing would be for the client to make one permanent connection to the server, then have the server send the client a message each time a move was made?
 
Any chance this will happen in the near future?
 
 
 
IP Logged

“Arimaa holds its master in its own bonds, shackling the mind and brain so that the inner freedom of the very strongest must suffer”
Janzert
Forum Guru
*****



Arimaa player #247

   


Gender: male
Posts: 1016
Re: server interface protocol.
« Reply #1 on: Nov 23rd, 2009, 9:13am »
Quote Quote Modify Modify

[Disclaimer: I couldn't find the protocol documentation just now so this is mostly from memory and looking at my bot interface which might vary in the names of a some variables.]
 
on Nov 23rd, 2009, 2:45am, froody wrote:
How often should I check for updates?

 
As long as you include the "lastchange" value and set "wait" to 1 the server won't return an update until something changes or your "maxwait" seconds has passed. So in general you either get new information back or you can immediately start another request (either because the timeout was reached or there was a network connection problem). In case something goes wrong though it's probably best to throttle requests to no more than one every few seconds so the server doesn't get hammered.
 
Quote:
To do so, do I have to go through each game doing action=reserveseat, action=sit then action=gamestate?

 
Yes, I'm pretty sure that is correct. If you are monitoring multiple games at the same time I think I would open a separate connection for each.
 
Quote:
The sensible thing would be for the client to make one permanent connection to the server, then have the server send the client a message each time a move was made?
 
Any chance this will happen in the near future?

 
While this would have possible advantages in easing the implementation, I have my doubts as to how much difference it would make in end result.
 
Janzert
IP Logged
froody
Forum Guru
*****




I <3 nurpinar

  phm_42@yahoo.co.uk   anteater042


Gender: male
Posts: 103
Re: server interface protocol.
« Reply #2 on: Nov 23rd, 2009, 11:30pm »
Quote Quote Modify Modify

http://arimaa.com/arimaa/protocol/
 
So if I have 10 postal games I should open a separate connection to each and use wait=1 ? Isn't this a bit inefficient? Does it matter?
IP Logged

“Arimaa holds its master in its own bonds, shackling the mind and brain so that the inner freedom of the very strongest must suffer”
Janzert
Forum Guru
*****



Arimaa player #247

   


Gender: male
Posts: 1016
Re: server interface protocol.
« Reply #3 on: Nov 24th, 2009, 8:36am »
Quote Quote Modify Modify

on Nov 23rd, 2009, 11:30pm, froody wrote:
http://arimaa.com/arimaa/protocol/

Thanks
 
Quote:
So if I have 10 postal games I should open a separate connection to each and use wait=1 ?

Probably.
 
Quote:
Isn't this a bit inefficient?

Yes.
 
Quote:
Does it matter?

Most likely not for tens of games. If it were hundreds or thousands it would become an issue.
 
The other option if you're just waiting for an opponent to make a move is to poll each game sequentially with a relatively short timeout. Your average delay in being notified of a move will be approximately the (number of games-1) / 2 * (maxwait length) and maximum delay is (n-1) * maxwait. So with 10 games and a 30 second maxwait average notification is less than 5 minutes after the opponent moves with the worst case being 9.5 minutes.
 
Janzert
IP Logged
froody
Forum Guru
*****




I <3 nurpinar

  phm_42@yahoo.co.uk   anteater042


Gender: male
Posts: 103
Re: server interface protocol.
« Reply #4 on: Nov 24th, 2009, 9:45am »
Quote Quote Modify Modify

Also with action=invitedmegames there is no wait option?
 
How often should the client poll the server for invites? Once a minute is OK?
 
It seems a bit crazy to be polling the server so much. And also it adds the problem that the client doesn't get the move or invite immediately.
IP Logged

“Arimaa holds its master in its own bonds, shackling the mind and brain so that the inner freedom of the very strongest must suffer”
Janzert
Forum Guru
*****



Arimaa player #247

   


Gender: male
Posts: 1016
Re: server interface protocol.
« Reply #5 on: Nov 24th, 2009, 11:11am »
Quote Quote Modify Modify

Invites aren't in the bot protocol for interacting with the server so I don't really know anything about them. But taking a quick look at what the gameroom is doing with firebug it looks like it polls every 30 seconds.
 
Janzert
 
* Actually it's using an undocumented, as far as I see, action "state" that returns the state for the overall gameroom including if you have an invite waiting or not.
IP Logged
omar
Forum Guru
*****



Arimaa player #2

   


Gender: male
Posts: 1003
Re: server interface protocol.
« Reply #6 on: Nov 24th, 2009, 4:25pm »
Quote Quote Modify Modify

on Nov 23rd, 2009, 2:45am, froody wrote:
I'm trying to make a client. (This is a new project, starting from scratch in smalltalk. (My last attempt was never finished properly..))
 
My first aim is to deal only with postal games.
 
How often should I check for updates? To do so, do I have to go through each game doing action=reserveseat, action=sit then action=gamestate?

I would suggest not building such a client. You would be building on a bad foundation. This server was not really built for such clients. What we really need is a better server similar to what FICS or ICC use and then we can build such clients around that.
 
Also if you are not careful you could cause a denial of service attack on the arimaa.com site if the client polls too fast during development.
 
Quote:

The sensible thing would be for the client to make one permanent connection to the server, then have the server send the client a message each time a move was made?

Exactly, but this would mean building a new server.
 
Quote:

Any chance this will happen in the near future?

Anyone interested in building a new server from scratch? I've been thinking this could be done as an open source project and if done in a general way the server could also be used by others for other games.  
 
IP Logged
Pages: 1  Reply Reply Notify of replies Notify of replies Send Topic Send Topic Print Print

« Previous topic | Next topic »

Arimaa Forum » Powered by YaBB 1 Gold - SP 1.3.1!
YaBB © 2000-2003. All Rights Reserved.