当前位置: 首页>>代码示例>>C#>>正文


C# World.MyNetworkClient类代码示例

本文整理汇总了C#中Sandbox.Game.World.MyNetworkClient的典型用法代码示例。如果您正苦于以下问题:C# MyNetworkClient类的具体用法?C# MyNetworkClient怎么用?C# MyNetworkClient使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


MyNetworkClient类属于Sandbox.Game.World命名空间,在下文中一共展示了MyNetworkClient类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: OnUpdateShowerTarget

 static void OnUpdateShowerTarget(ref UpdateShowerTargetMsg msg, MyNetworkClient sender)
 {
     if (msg.HasTarget)
         MyMeteorShower.CurrentTarget = new BoundingSphere(msg.Center, msg.Radius);
     else
         MyMeteorShower.CurrentTarget = null;
 }
开发者ID:fluxit,项目名称:SpaceEngineers,代码行数:7,代码来源:MySyncMeteorShower.cs

示例2: ProxyExplosionSuccess

 static void ProxyExplosionSuccess(ref ProxyExplosionMsg msg, MyNetworkClient sender)
 {
     //Dont create explosion particles if message is bufferred, it is useless to create hundred explosion after scene load
     if (MySession.Ready)
     {
         //  Create explosion
         MyExplosionInfo info = new MyExplosionInfo()
         {
             PlayerDamage = 0,
             //Damage = m_ammoProperties.Damage,
             Damage = 200,
             ExplosionType = msg.Type,
             ExplosionSphere = new BoundingSphere(msg.Center, msg.Radius),
             LifespanMiliseconds = MyExplosionsConstants.EXPLOSION_LIFESPAN,
             CascadeLevel = 0,
             HitEntity = null,
             ParticleScale = msg.ParticleScale,
             OwnerEntity = null,
             Direction = Vector3.Forward,
             VoxelExplosionCenter = msg.VoxelCenter,
             ExplosionFlags = MyExplosionFlags.CREATE_DEBRIS | MyExplosionFlags.CREATE_DECALS | MyExplosionFlags.CREATE_PARTICLE_EFFECT | MyExplosionFlags.CREATE_SHRAPNELS,
             VoxelCutoutScale = 1.0f,
             PlaySound = true,
             ObjectsRemoveDelayInMiliseconds = 40
         };
         MyExplosions.AddExplosion(ref info, false);
     }
 }
开发者ID:fluxit,项目名称:SpaceEngineers,代码行数:28,代码来源:MySyncExplosion.cs

示例3: ChangeOreDetector

 static void ChangeOreDetector(ref ChangeOreDetectorMsg msg, MyNetworkClient sender)
 {
     MyEntity entity;
     if (MyEntities.TryGetEntityById(msg.EntityId, out entity))
         (entity as MyOreDetector).BroadcastUsingAntennas = msg.BroadcastUsingAntennas;
 
 }
开发者ID:Krulac,项目名称:SpaceEngineers,代码行数:7,代码来源:MySyncOreDetector.cs

示例4: OverrideGyroControlSuccess

 static void OverrideGyroControlSuccess(ref OverrideGyroControlMsg msg, MyNetworkClient sender)
 {
     MyEntity entity;
     MyEntities.TryGetEntityById(msg.EntityId, out entity);
     var block = entity as MyGyro;
     if (block != null)
         block.SetGyroOverride(msg.Override);
 }
开发者ID:Krulac,项目名称:SpaceEngineers,代码行数:8,代码来源:MySyncGyro.cs

示例5: ChangeGyroPowerSuccess

 static void ChangeGyroPowerSuccess(ref ChangeGyroPowerMsg msg, MyNetworkClient sender)
 {
     MyEntity entity;
     MyEntities.TryGetEntityById(msg.EntityId, out entity);
     var block = entity as MyGyro;
     if (block != null)
         block.GyroPower = msg.GyroPower;
 }
开发者ID:Krulac,项目名称:SpaceEngineers,代码行数:8,代码来源:MySyncGyro.cs

示例6: ChangeThrustOverrideSuccess

 static void ChangeThrustOverrideSuccess(ref ChangeThrustOverrideMsg msg, MyNetworkClient sender)
 {
     MyEntity entity;
     MyEntities.TryGetEntityById(msg.EntityId, out entity);
     var block = entity as MyThrust;
     if (block != null)
         block.SetThrustOverride(msg.ThrustOverride);
 }
开发者ID:Krulac,项目名称:SpaceEngineers,代码行数:8,代码来源:MySyncThruster.cs

示例7: StopManipulationCallback

 static void StopManipulationCallback(ref StopManipulationMsg msg, MyNetworkClient sender)
 {
     MyManipulationTool manipulationTool;
     if (MyEntities.TryGetEntityById(msg.EntityId, out manipulationTool))
     {
         manipulationTool.StopManipulation();
     }
 }
开发者ID:austusross,项目名称:SpaceEngineers,代码行数:8,代码来源:MySyncManipulationTool.cs

示例8: OnCurrentAmmoCountChangedMsg

        static void OnCurrentAmmoCountChangedMsg(ref CurrentAmmoCountChangedMsg msg, MyNetworkClient sender)
        {
            Debug.Assert(!Sync.IsServer);

            var handler = AmmoCountChanged;
            if (handler != null)
                handler(msg.WeaponId, msg.AmmoCount);
        }
开发者ID:fluxit,项目名称:SpaceEngineers,代码行数:8,代码来源:MySyncGunBase.cs

示例9: OnRemoveEnvironmentItemMessage

 static void OnRemoveEnvironmentItemMessage(ref RemoveEnvironmentItemMsg msg, MyNetworkClient sender)
 {
     MyEntity entity;
     if (MyEntities.TryGetEntityById(msg.EntityId, out entity))
     {
         if (OnRemoveEnvironmentItem != null)
             OnRemoveEnvironmentItem(entity, msg.ItemInstanceId);
     }
 }
开发者ID:austusross,项目名称:SpaceEngineers,代码行数:9,代码来源:MySyncEnvironmentItems.cs

示例10: EndShootSuccess

 static void EndShootSuccess(ref EndShootMessage msg, MyNetworkClient sender)
 {
     MyUserControllableGun block = null;
     MyEntities.TryGetEntityById(msg.EntityId, out block);
     if (block != null)
     {
         block.EndShoot();
     }
 }
开发者ID:Krulac,项目名称:SpaceEngineers,代码行数:9,代码来源:MySyncUserControllableGun.cs

示例11: CapacitySyncSuccess

 static void CapacitySyncSuccess(ref CapacitySyncMsg msg, MyNetworkClient sender)
 {
     MyCharacter owner;
     MyEntities.TryGetEntityById(msg.EntityId, out owner);
     if (owner != null)
     {
         MyBattery.Friend.OnSyncCapacitySuccess(owner.SuitBattery, msg.RemainingCapacity);
     }
 }
开发者ID:fluxit,项目名称:SpaceEngineers,代码行数:9,代码来源:MySyncBattery.cs

示例12: ChangeGravityGeneratorRequest

 static void ChangeGravityGeneratorRequest(ref ChangeGravityGeneratorMsg msg, MyNetworkClient sender)
 {
     MyEntity entity;
     MyEntities.TryGetEntityById(msg.EntityId, out entity);
     if (entity is MyGravityGeneratorSphere)
     {
         Sync.Layer.SendMessageToAllAndSelf(ref msg, MyTransportMessageEnum.Success);
     }
 }
开发者ID:fluxit,项目名称:SpaceEngineers,代码行数:9,代码来源:MySyncGravityGeneratorSphere.cs

示例13: ChangeUseConveyorSystemSucess

 static void ChangeUseConveyorSystemSucess(ref ChangeUseConveyorsMsg msg, MyNetworkClient sender)
 {
     MyEntity entity;
     if (MyEntities.TryGetEntityById(msg.GetEntityId(), out entity))
     {
         if (entity as IMyInventoryOwner != null)
             (entity as IMyInventoryOwner).UseConveyorSystem = msg.Value;
     }
 }
开发者ID:Krulac,项目名称:SpaceEngineers,代码行数:9,代码来源:MySyncConveyors.cs

示例14: StartManipulationCallback

 static void StartManipulationCallback(ref StartManipulationMsg msg, MyNetworkClient sender)
 {
     MyManipulationTool manipulationTool;
     MyEntity otherEntity;
     if (MyEntities.TryGetEntityById(msg.EntityId, out manipulationTool) && MyEntities.TryGetEntityById(msg.OtherEntity, out otherEntity))
     {
         manipulationTool.StartManipulation(msg.ToolState, otherEntity, msg.HitPosition, ref msg.OwnerWorldHeadMatrix, true);
     }
 }
开发者ID:Krulac,项目名称:SpaceEngineers,代码行数:9,代码来源:MySyncManipulationTool.cs

示例15: ChangeRadioBroadcasterRequest

 static void ChangeRadioBroadcasterRequest(ref ChangeRadioAntennaMsg msg, MyNetworkClient sender)
 {
     MyEntity entity;
     MyEntities.TryGetEntityById(msg.EntityId, out entity);
     var broadcasterOwner = entity as IMyComponentOwner<MyDataBroadcaster>;
     if (broadcasterOwner != null)
     {
         Sync.Layer.SendMessageToAllAndSelf(ref msg, MyTransportMessageEnum.Success);
     }
 }
开发者ID:Krulac,项目名称:SpaceEngineers,代码行数:10,代码来源:MySyncRadioBroadcaster.cs


注:本文中的Sandbox.Game.World.MyNetworkClient类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。