Пример #1
0
 private static void OnRemapSuccess(ref RemapSeedMsg msg, MyNetworkClient sender)
 {
     MyEntity projectorEntity;
     MyEntities.TryGetEntityById(msg.EntityId, out projectorEntity);
     var projector = projectorEntity as MyProjector;
     if (projector != null)
     {
         projector.OnRemap(msg.Seed);
     }
 }
Пример #2
0
            private static void OnRemapRequest(ref RemapRequestMsg msg, MyNetworkClient sender)
            {
                MyEntity projectorEntity;
                MyEntities.TryGetEntityById(msg.EntityId, out projectorEntity);
                var projector = projectorEntity as MyProjector;
                if (projector != null)
                {
                    int randomSeed = MyRandom.Instance.CreateRandomSeed();
                    var seedMsg = new RemapSeedMsg();
                    seedMsg.EntityId = projector.EntityId;
                    seedMsg.Seed = randomSeed;

                    Sync.Layer.SendMessageToAllAndSelf(ref seedMsg, MyTransportMessageEnum.Success);
                }
            }