public static void RaiseHandleEvent(DataPackages.Template.DataPackage dataPackage, Client client)
        {
            //Paket wird beim PacketAdministrator registriert
            PackageAdministrator.PacketReceived(dataPackage, client);

            //Event ClientPackageReceived wird getriggert
            Events.ClientEvents.PackageReceived.OnClientPackageReceived(new Events.Args.ClientEventArgs()
            {
                client = client
            });

            if (dataPackage.Packet == Template.PacketKind.DataExchange)
            {
                Evaluation.EvaluateDataExchangePacket.GetCommand(client, dataPackage);
            }
            else if (dataPackage.Packet == Template.PacketKind.DownloadRequest)
            {
                Handle.Download.EvaluateRequest.CreateRequest(new Events.Args.DataPackageEventArgs()
                {
                    client = client, dataPackage = dataPackage
                });
                Events.DataPackageEvent.DownloadRequest.OnDownloadRequestReceived(new Events.Args.DataPackageEventArgs()
                {
                    client = client, dataPackage = dataPackage
                });
            }
        }
Example #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);
 }