Esempio n. 1
0
        public void SnapshotHandler(NetConnection connection, object data)
        {
            SnapShotData snap = GCli.Deserialize <SnapShotData>((byte[])data);

            Players.UpdatePlayerSyncData(snap.syncs);
            ui.AddBlocks(snap.pixels);
        }
Esempio n. 2
0
        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);
        }