4
\$\begingroup\$

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.

\$\endgroup\$

3 Answers 3

2
\$\begingroup\$

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)

\$\endgroup\$
4
  • \$\begingroup\$ Why would you use websockets for a native app and a server? Just use real sockets. \$\endgroup\$
    – coderanger
    Commented Jan 29, 2011 at 1:29
  • \$\begingroup\$ because websockets are firewall-friendlier. \$\endgroup\$
    – egarcia
    Commented Jan 29, 2011 at 2:19
  • \$\begingroup\$ 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). \$\endgroup\$
    – coderanger
    Commented Jan 29, 2011 at 3:52
  • \$\begingroup\$ 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. \$\endgroup\$
    – egarcia
    Commented Jan 29, 2011 at 18:34
1
\$\begingroup\$

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).

\$\endgroup\$
2
  • \$\begingroup\$ I checked Protocol Buffers and there's no Lua implementation. \$\endgroup\$
    – TokyoDan
    Commented Mar 16, 2011 at 9:23
  • 1
    \$\begingroup\$ github.com/indygreg/lua-protobuf \$\endgroup\$
    – coderanger
    Commented Mar 16, 2011 at 14:26
1
\$\begingroup\$

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.

\$\endgroup\$
1
  • 1
    \$\begingroup\$ 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. \$\endgroup\$ Commented Oct 28, 2012 at 0:01

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .