AngryTanks.Server.Player.EndShot C# (CSharp) Méthode

EndShot() public méthode

Handles end shots by players and broadcasts that to all other Players.
public EndShot ( NetIncomingMessage incomingMessage ) : void
incomingMessage Lidgren.Network.NetIncomingMessage
Résultat void
        public void EndShot(NetIncomingMessage incomingMessage)
        {
            MsgEndShotPacket incomingShotEndPacket = MsgEndShotPacket.Read(incomingMessage);

            // create our shot end message and packet
            NetOutgoingMessage shotEndMessage = gameKeeper.Server.CreateMessage();

            MsgEndShotPacket shotEndPacket = new MsgEndShotPacket(incomingShotEndPacket.Slot, incomingShotEndPacket.ShotSlot, incomingShotEndPacket.Explode);

            // write to the message
            shotEndMessage.Write((Byte)shotEndPacket.MsgType);
            shotEndPacket.Write(shotEndMessage);

            // send the shot end message to everyone except the player who reported it
            gameKeeper.Server.SendToAll(shotEndMessage, this.Connection, NetDeliveryMethod.ReliableUnordered, 0);
        }