I’m running Visual Studio ’08 and using C# code. I am using forms however, but it is browser based. I’m using StreamReader and StreamWriter to read and write information to the server side file. The situation is a TicTacToe game, so the rules are clear, and there are 9 buttons, when a button is pressed, the text on it changes accordingly to the player’s X or O. The game is played on two browsers or tabs, so the browser must interact with the server.
I really want to know how I can keep track of the moves each players has taken by reading and writing data from server side file to so then I can check for winner. I am saving the game data into a text file, that’s the server side file I’m talking about.
Please keep environment to Visual Studio, no plugin can be used here solely to practice manually.
Thanks for your time.
Use a MessageBus to publish and subscribe messages: https://github.com/messagebus/messagebus_csharp_api
Here is a great article, right up your alley about how a system can deal with two player communication using the MessageBus: http://www.ronaldwidha.net/2010/05/31/a-simple-example-of-the-webformsmvp-cross-presenter-messaging/