Social Game Architecture
Options
Comments
-
Hi, I am working on a dominos game - probably similar to your checkers game in many respects. Players can be in one or more matches, and get updates for all of them. (not just 1 connected room as Lite offers). So I am writing my own barebones Photon implementation. Just subclass Peerbase, and ApplicationBase. My peer simply does
protected override void OnDisconnect(DisconnectReason reasonCode, string reasonDetail) { App.executionFiber.Enqueue( () => App.PeerDisconnected( this, reasonCode, reasonDetail ) ); } protected override void OnOperationRequest(OperationRequest operationRequest, SendParameters sendParameters) { App.executionFiber.Enqueue( () => App.ExecuteOperation( this, operationRequest, sendParameters ) ); }
My App responds to the operation requests, and persists game states. It also keeps track of the connected peers and maps them to player id and subscribed games. It broadcasts events to subsets of the peers for game state updates. It also broadcasts events for leaderboard and statistics.0