<?xml version="1.0" encoding="UTF-8" ?>
<EventGhost Version="1610" Guid="{5D17D650-873C-48C2-A247-9B3BFEFC0393}" Time="1359887917.17">
    <Autostart Name="Autostart" Expanded="True">
        <Action Name="The following plugin starts the TCPEvents Server. Once started, eg is ready to receive connections from other clients">
            EventGhost.Comment()
        </Action>
        <Plugin Identifier="TCPEvents" Guid="{198090B7-0574-4F91-B2E7-1AF5BB37E2DE}" File="TCPEvents">
            gAIoTQAEWAQAAAAxMjM0cQBYAwAAAFRDUHEBiXRxAi4=
        </Plugin>
        <Action Name="Then, we just set 2 globals for testing purpose">
            EventGhost.Comment()
        </Action>
        <Action>
            EventGhost.PythonCommand(u'eg.globals.something="something"')
        </Action>
        <Action>
            EventGhost.PythonCommand(u'eg.globals.lse = "else"')
        </Action>
        <Action Name="Now let's add the goog Old Network event sender/receiver">
            EventGhost.Comment()
        </Action>
        <Plugin Identifier="NetworkReceiver" Guid="{8F35AE6D-AF12-4A94-AA91-4B63F0CBBE1C}" File="NetworkReceiver">
            gAJNAQRYBAAAADU2NzhxAFgGAAAAb2xkVENQcQGHcQIu
        </Plugin>
        <Action Name="One sender to speak withe the network event receiver">
            EventGhost.Comment()
        </Action>
        <Plugin Identifier="NetworkSender" Guid="{B4F0DAFE-2E0B-47F3-A155-ED72C7A4E270}" File="NetworkSender">
            gAJYCQAAADEyNy4wLjAuMXEATQEEWAQAAAA1Njc4cQGHcQIu
        </Plugin>
        <Action Name="And one other to speak with the TCPevents Server">
            EventGhost.Comment()
        </Action>
        <Plugin Identifier="NetworkSender2" Guid="{B4F0DAFE-2E0B-47F3-A155-ED72C7A4E270}" File="NetworkSender">
            gAJYCQAAADEyNy4wLjAuMXEATQAEWAQAAAAxMjM0cQGHcQIu
        </Plugin>
    </Autostart>
    <Folder Name="Test TCPEvents" Expanded="True">
        <Macro Name="TCP Events: Send an Event: 127.0.0.1" Expanded="True">
            <Action Name="The following action sends an event to a TCPEvents Server.">
                EventGhost.Comment()
            </Action>
            <Action Name="Here, the event is sent to the TCPEvents server that has been started in the Autostart macro">
                EventGhost.Comment()
            </Action>
            <Action>
                TCPEvents.SendEvent(u'127.0.0.1', 1024, u'1234', u'TCP', u'truc', u'1+2', None)
            </Action>
            <Action>
                EventGhost.DumpResult()
            </Action>
        </Macro>
        <Macro Name="TCP Events: Send Data: 127.0.0.1" Expanded="True">
            <Action Name="The following action sends data to the TCPEvents Server.">
                EventGhost.Comment()
            </Action>
            <Action Name="You can send complex data structures">
                EventGhost.Comment()
            </Action>
            <Action>
                TCPEvents.SendData(u'127.0.0.1', 1024, u'1234', u'data1', u"{'num':1,'array':[eg.globals.something,eg.globals.lse]}", None)
            </Action>
            <Action>
                EventGhost.DumpResult()
            </Action>
        </Macro>
        <Macro Name="TCP Events: Retrieve Received Data: data1" Expanded="True">
            <Action Name="This action gets the data sent with the previous macro">
                EventGhost.Comment()
            </Action>
            <Action>
                TCPEvents.GetData(u'data1')
            </Action>
            <Action>
                EventGhost.DumpResult()
            </Action>
        </Macro>
        <Macro Name="TCP Events: Request Data from a remote host: 127.0.0.1" Expanded="True">
            <Action Name="This action requests data from the TCPEvents Server">
                EventGhost.Comment()
            </Action>
            <Action Name="The python expression is evaluated at the server side, and the result is sent back to us. You can get it with eg.result.">
                EventGhost.Comment()
            </Action>
            <Action>
                TCPEvents.RequestData(u'127.0.0.1', 1024, u'1234', u'eg.globals.something')
            </Action>
            <Action>
                EventGhost.DumpResult()
            </Action>
        </Macro>
        <Macro Name="Python Script" Expanded="True">
            <Action Name="Just For Fun !">
                EventGhost.Comment()
            </Action>
            <Action>
                EventGhost.PythonScript(u'eg.plugins.TCPEvents.SendData(u\'127.0.0.1\', 1024, u\'1234\', u\'data1\', u"{\'num\':1,\'array\':[eg.globals.something,eg.globals.lse]}", None)\nprint eg.plugins.TCPEvents.RequestData(u\'127.0.0.1\', 1024, u\'1234\', u\'eg.plugins.TCPEvents.GetData("data1")\')\n')
            </Action>
        </Macro>
    </Folder>
    <Folder Name="Test with the Old Network event sender/receiver">
        <Macro Name="Network Event Sender: Map: FromNeS2Ner" Expanded="True">
            <Action Name="Sending from network event sender to the network event receiver">
                EventGhost.Comment()
            </Action>
            <Action>
                NetworkSender.Map(u'FromNeS2Ner')
            </Action>
        </Macro>
        <Macro Name="Network Event Sender #2: Map: FromNes2TCPEvents" Expanded="True">
            <Action Name="Sending from network event sender to the TCPEvents Server">
                EventGhost.Comment()
            </Action>
            <Action>
                NetworkSender2.Map(u'FromNes2TCPEvents')
            </Action>
        </Macro>
        <Macro Name="TCP Events: Send an Event: 127.0.0.1" Expanded="True">
            <Action Name="Sending an event from TCPEvents to the Network event Receiver">
                EventGhost.Comment()
            </Action>
            <Action>
                TCPEvents.SendEvent(u'127.0.0.1', 1025, u'5678', u'TCP', u'Event', u'"1"', None)
            </Action>
        </Macro>
        <Macro Name="TCP Events: Send Data: 127.0.0.1" Expanded="True">
            <Action Name="Sending Data from TCPEvents to the Network event Receiver">
                EventGhost.Comment()
            </Action>
            <Action>
                TCPEvents.SendData(u'127.0.0.1', 1025, u'5678', u'data1', u'"2"', None)
            </Action>
        </Macro>
        <Macro Name="TCP Events: Request Data from a remote host: 127.0.0.1" Expanded="True">
            <Action Name="Requesting Data with TCPEvents to the Network event Receiver">
                EventGhost.Comment()
            </Action>
            <Action>
                TCPEvents.RequestData(u'127.0.0.1', 1025, u'5678', u'eg.globals.lse')
            </Action>
        </Macro>
    </Folder>
</EventGhost>
