NOTE: I completed this work the week of October 28 - November 1. But I got behind on my blog posts so I just split up my previous work by weeks.
As mentioned back in the blog post about Database Design ( http://benvdevelopment.blogspot.com/2013/10/database-design.html ) Parse can only respond to requests and cannot directly send data to a player. This makes it difficult to build a responsive game by using Parse alone.
The solution is to have the clients take to each other through a peer to peer connection. This way when a player plays a card or ends their turn they can inform their opponent that they need to ask the server what has changed. This ensures that the game is responsive without removing the security of having a server validate all actions taken by players.
Unfortunately, in Unity the networking is not built to handle peer to peer networking so I had to write my own code using the C# TcpListener class and sockets. In order, for this networking code to work effectively I also had to make it threaded - so I created a thread utility heavily inspired by the Loom thread utility documented http://unitygems.com/threads/ .
No comments:
Post a Comment