public void SnapshotHandler(NetConnection connection, object data) { SnapShotData snap = GCli.Deserialize <SnapShotData>((byte[])data); Players.UpdatePlayerSyncData(snap.syncs); ui.AddBlocks(snap.pixels); }
static void SendSnapshot() { SnapShotData data = new SnapShotData(); Players.AddSyncs(data.syncs); data.pixels.AddRange(World.GetBuffer()); GSrv.SendToAll(MessageType.Snapshot, GSrv.Serialize <SnapShotData>(data), NetDeliveryMethod.ReliableUnordered); }