Skip to content

Instantly share code, notes, and snippets.

@vgheri
Created November 18, 2012 16:24
Show Gist options
  • Save vgheri/4106081 to your computer and use it in GitHub Desktop.
Save vgheri/4106081 to your computer and use it in GitHub Desktop.
Notifier
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