예제 #1
0
 public static void ClearPacket(Template.DataPackage dataPacket)
 {
     dataPacket.Name   = string.Empty;
     dataPacket.Data   = string.Empty;
     dataPacket.Packet = 0;
     dataPacket.Params = string.Empty;
 }
예제 #2
0
 public static Template.DataPackage CreatePacket(string Data, string Parameter, DataPackages.Template.PacketKind packetKind)
 {
     Template.DataPackage dataPacket = new Template.DataPackage();
     dataPacket.Data   = Data;
     dataPacket.Params = Parameter;
     dataPacket.Packet = packetKind;
     dataPacket.Name   = PackageAdministrator.GetPacketName(dataPacket);
     return(dataPacket);
 }
예제 #3
0
 public static Template.DataPackage DecryptDataPackage(Template.DataPackage dataPackage, byte[] CryptoKey)
 {
     Template.DataPackage decryptedDataPackage = new Template.DataPackage()
     {
         Data   = Crypto.Decrypt.String(CryptoKey, dataPackage.Data),
         Params = Crypto.Decrypt.String(CryptoKey, dataPackage.Params),
         Name   = dataPackage.Name,
         Packet = dataPackage.Packet
     };
     return(decryptedDataPackage);
 }
예제 #4
0
 public static void PacketReceived(Template.DataPackage dataPackage, Client client)
 {
     PacketCounter++;
     //Statistische Auswertung der Datenpakete
 }
예제 #5
0
 public static Template.DataPackage EncryptDataPackage(Template.DataPackage dataPackage, byte[] CryptoKey)
 {
     return(CreatePacket(Crypto.Encrypt.String(CryptoKey, dataPackage.Data), Crypto.Encrypt.String(CryptoKey, dataPackage.Params), dataPackage.Packet));
 }