コード例 #1
0
        public void HandleDeletion(IEntity entity)
        {
            if (!IsActive || !Eraser)
            {
                return;
            }

            NetOutgoingMessage message = NetworkManager.CreateMessage();

            message.Write((byte)NetMessages.RequestEntityDeletion);
            message.Write(entity.Uid);
            NetworkManager.ClientSendMessage(message, NetDeliveryMethod.ReliableUnordered);
        }
コード例 #2
0
        public NetOutgoingMessage CreateEntityMessage()
        {
            NetOutgoingMessage message = _networkManager.CreateMessage();

            message.Write((byte)NetMessages.EntityMessage);
            return(message);
        }
コード例 #3
0
        private void AckGameState(uint sequence)
        {
            NetOutgoingMessage ack = networkManager.CreateMessage();

            ack.Write((byte)NetMessages.StateAck);
            ack.Write(sequence);
            networkManager.ClientSendMessage(ack, NetDeliveryMethod.ReliableUnordered);
        }
コード例 #4
0
        /// <summary>
        /// Verb sender
        /// If UID is 0, it means its a global verb.
        /// </summary>
        /// <param name="verb">the verb</param>
        /// <param name="uid">a target entity's Uid</param>
        public void SendVerb(string verb, int uid)
        {
            NetOutgoingMessage message = _networkManager.CreateMessage();

            message.Write((byte)NetMessages.PlayerSessionMessage);
            message.Write((byte)PlayerSessionMessage.Verb);
            message.Write(verb);
            message.Write(uid);
            _networkManager.ClientSendMessage(message, NetDeliveryMethod.ReliableOrdered);
        }