Ejemplo n.º 1
0
            static void DetonateRequest(ref DetonateMsg msg, MyNetworkClient sender)
            {
                MyEntity entity;

                MyEntities.TryGetEntityById(msg.EntityId, out entity);
                var warhead = entity as MyWarhead;

                if (warhead != null)
                {
                    warhead.Detonate();
                }
            }
Ejemplo n.º 2
0
            public static void Detonate(MyWarhead warhead)
            {
                // Armed state is checked only locally. Otherwise, it could happen that server does not detonate the warhead even though it was armed on the client
                if (!warhead.IsArmed)
                {
                    return;
                }

                DetonateMsg msg = new DetonateMsg();

                msg.EntityId = warhead.EntityId;

                Sync.Layer.SendMessageToServer(ref msg);
            }
Ejemplo n.º 3
0
 static void DetonateRequest(ref DetonateMsg msg, MyNetworkClient sender)
 {
     MyEntity entity;
     MyEntities.TryGetEntityById(msg.EntityId, out entity);
     var warhead = entity as MyWarhead;
     if (warhead != null)
     {
         warhead.Detonate();
     }
 }
Ejemplo n.º 4
0
            public static void Detonate(MyWarhead warhead)
            {
                // Armed state is checked only locally. Otherwise, it could happen that server does not detonate the warhead even though it was armed on the client
                if (!warhead.IsArmed) return;

                DetonateMsg msg = new DetonateMsg();
                msg.EntityId = warhead.EntityId;

                Sync.Layer.SendMessageToServer(ref msg);
            }