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); }
public NetOutgoingMessage CreateEntityMessage() { NetOutgoingMessage message = _networkManager.CreateMessage(); message.Write((byte)NetMessages.EntityMessage); return(message); }
private void AckGameState(uint sequence) { NetOutgoingMessage ack = networkManager.CreateMessage(); ack.Write((byte)NetMessages.StateAck); ack.Write(sequence); networkManager.ClientSendMessage(ack, NetDeliveryMethod.ReliableUnordered); }
/// <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); }