本文整理汇总了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;
}
示例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);
}
}
示例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;
}
示例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);
}
示例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;
}
示例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);
}
示例7: StopManipulationCallback
static void StopManipulationCallback(ref StopManipulationMsg msg, MyNetworkClient sender)
{
MyManipulationTool manipulationTool;
if (MyEntities.TryGetEntityById(msg.EntityId, out manipulationTool))
{
manipulationTool.StopManipulation();
}
}
示例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);
}
示例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);
}
}
示例10: EndShootSuccess
static void EndShootSuccess(ref EndShootMessage msg, MyNetworkClient sender)
{
MyUserControllableGun block = null;
MyEntities.TryGetEntityById(msg.EntityId, out block);
if (block != null)
{
block.EndShoot();
}
}
示例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);
}
}
示例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);
}
}
示例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;
}
}
示例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);
}
}
示例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);
}
}