Wednesday, January 26, 2011

26 January 2011

Continued from where Zac have stopped at yesterday, which is to send the model's current state from the server to the client that has just connected. This is to ensure both the server and the client are viewing the same thing at the same time. At first, we tried to add the last ModelTransformation of every node into an array and send it out to the client who has just connected. However, this didn't seem to work really well.

Then, we decided to use another approach. We would retrieve all the current transformation values for every node the moment a client has connected, and then send these information in an NSDictionary for every node to the client. However, we encountered an issue where the translation for the exploded view is not being applied. It is applied only when we debug step by step. We resolved this issue by performing the operation to explode the nodes after a delay of 0.5 seconds.

Next, we went on to work on locking. Locking here is to ensure that when one user interacts with the model, other connected users would not be able to interrupt until the interaction is complete. Whenever a user touches on the screen (touchesBegan), we would send a dictionary to all other connected users to disable their user interaction. Upon touchesEnded, we would once again send another dictionary to then enable their user interaction.

At first, we thought that this would work. However, it seems that our data that is being sent over to connected users for unlocking is always "stuck", which could be due to the data size being too small. Hence, the other users are always locked out. We tried looking for a solution but to no avail. Got to continue working on this tomorrow.

No comments:

Post a Comment