Created
November 18, 2012 16:24
-
-
Save vgheri/4106081 to your computer and use it in GitHub Desktop.
Notifier
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Notifier | |
{ | |
// Synchronize clients with the new authoritative game status | |
public static void UpdateClients(Game game) | |
{ | |
var packet = new UpdatePacket() | |
{ | |
Game = game, | |
//Timestamp = DateTime.UtcNow.Subtract(new DateTime(1970,1,1,0,0,0,DateTimeKind.Utc)).TotalMilliseconds | |
Timestamp = DateTime.UtcNow | |
}; | |
var context = GlobalHost.ConnectionManager.GetHubContext<PongRHub>(); | |
context.Clients[game.GameId].updateGame(packet); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment