Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

What technology would you use to communicate between a two-player,turn-based, board game (like checkers or Othello) running native on iOS, and a remote game server

The remote game server is just the artificial intelligence portion of the computer player and it is coded in Lua.

share|improve this question
add comment

3 Answers

One option is Websockets.

There's a Lua Websocket server. I'm pretty sure iOS will be able to communicate with that (at least with regular sockets)

share|improve this answer
    
Why would you use websockets for a native app and a server? Just use real sockets. –  coderanger Jan 29 '11 at 1:29
    
because websockets are firewall-friendlier. –  egarcia Jan 29 '11 at 2:19
    
How exactly is that the case? If you mean HTTP is usually allowed as an outbound port, then you can just run anything on port 80 (and usually 443) and be fine. If you mean that HTTP is usually allowed through protocol inspection, then that doesn't apply to websockets anyway. Websockets are a hack to create a highly restricted TCP-stream-like API for browsers that no one uses (indeed Firefox recently disabled it due to major security issues). –  coderanger Jan 29 '11 at 3:52
    
I didn't know about the security issue you mentioned. Thanks. I wouldn't call them a "hack" though. I can't answer the rest of your questions here. I'd suggest creating a question in Stack Overflow. –  egarcia Jan 29 '11 at 18:34
add comment

ZeroMQ is a great layer for taking care of the actual transport and has bindings available for both C# and Lua. For the actual messaging I would probably use either Protocol Buffers (again, available for both langs) or simply use JSON strings (available for everything ever).

share|improve this answer
    
I checked Protocol Buffers and there's no Lua implementation. –  Tokyo Dan Mar 16 '11 at 9:23
1  
github.com/indygreg/lua-protobuf –  coderanger Mar 16 '11 at 14:26
add comment

For a turn-based board game? I would use typical REST programming and make it act like a website, with the server taking in POST or GET requests and returning information back. I wouldn't even bother with sockets unless it was closer to being real-time.

See this answer for more information.

share|improve this answer
1  
It's bad style to have "EDIT:" parts of your post, since whilst you're editing you can just integrate the amendment with your post itself. This isn't like forums, where you need to preserve what was originally stated, since on Stack Exchange people can see the post's edit history. –  Jonathan Hobbs Oct 28 '12 at 0:01
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.