Example #1
0
 private static void OnChangeGridOwner(MySyncGrid syncObject, ref ChangeGridOwnershipMsg message, MyNetworkClient sender)
 {
     foreach (var block in syncObject.Entity.GetBlocks())
     {
         if (block.FatBlock != null && block.BlockDefinition.RatioEnoughForOwnership(block.BuildLevelRatio))
         {
             block.FatBlock.ChangeOwner(message.Owner, message.ShareMode);
         }
     }
 }
Example #2
0
        internal static void ChangeGridOwner(MyCubeGrid grid, long playerId, MyOwnershipShareModeEnum shareMode)
        {
            var msg = new ChangeGridOwnershipMsg();
            msg.GridEntityId = grid.EntityId;
            msg.Owner = playerId;
            msg.ShareMode = shareMode;

            Sync.Layer.SendMessageToAllAndSelf(ref msg);
        }