You've already forked lidgren-network-gen3
mirror of
https://github.com/lidgren/lidgren-network-gen3.git
synced 2026-05-16 15:16:33 +09:00
37 lines
765 B
C#
37 lines
765 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
|
|
namespace Lidgren.Network
|
|
{
|
|
/// <summary>
|
|
/// Interface for an encryption algorithm
|
|
/// </summary>
|
|
public abstract class NetEncryption
|
|
{
|
|
/// <summary>
|
|
/// NetPeer
|
|
/// </summary>
|
|
protected NetPeer m_peer;
|
|
|
|
/// <summary>
|
|
/// Constructor
|
|
/// </summary>
|
|
public NetEncryption(NetPeer peer)
|
|
{
|
|
if (peer == null)
|
|
throw new NetException("Peer must not be null");
|
|
m_peer = peer;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Encrypt an outgoing message in place
|
|
/// </summary>
|
|
public abstract bool Encrypt(NetOutgoingMessage msg);
|
|
|
|
/// <summary>
|
|
/// Decrypt an incoming message in place
|
|
/// </summary>
|
|
public abstract bool Decrypt(NetIncomingMessage msg);
|
|
}
|
|
}
|