Example #1
0
 private void CreateReplicableForObject(object obj)
 {
     if ((obj != null) && !(obj is MyInventoryAggregate))
     {
         MyEntity entity = obj as MyEntity;
         if ((entity == null) || !entity.IsPreview)
         {
             Type type = this.m_factory.FindTypeFor(obj);
             if ((type != null) && this.ReplicationLayer.IsTypeReplicated(type))
             {
                 MyExternalReplicable replicable = (MyExternalReplicable)Activator.CreateInstance(type);
                 replicable.Hook(obj);
                 this.ReplicationLayer.Replicate(replicable);
                 replicable.OnServerReplicate();
             }
         }
     }
 }