Hello Everyone, I didn't see anything quite similar to this floating around, so I spent a few hours and threw this together, its my first gmod / wire, Mod I've made so hopefully I didn't screw up anything.
The Mod Contains two new Entities and the Tools to create them.
Wireless Hub
The Wireless Hub acts as a Wireless router, it automatically connects to Receivers and can send and receive data from them. The Hub can connect to any number of Receivers.
Wireless Receiver
The Wireless Receiver automatically connects to the nearest Hub and can send and receive data with it.
Both Entities Maintain an Internal 'buffer' of data that has been received and acts as a Queue which you can pop and view the first element of.
here is some simple logic to see how to read from the queues on the Devices.
Code:
While ( Count > 0 )
{
Out=Message;
Pop();
...Message Processing...
}
Shared Inputs
Key - This lets you limit which Hubs can communicate with Which Receivers, a Hub with a Key of 1 cannot connect to a Receiver with a Key of 2, 0 is the default.
Reset - When True will trigger a disconnect, this is useful if you need to connect to a different Hub, or reset the connections with the Receivers.
Pop - Lets you Pop the first value off the Input Queue.
Message - Lets you specify the Value are are preparing to Send.
Send - Sends the Current 'Message' to the Other end of the connection.
Hub Input
Next - This cycles to the next connected Receiver.
Shared Outputs
Connected - 1 or 0
Count - Number of Messages in Queue
Message - Current Message on Front of Queue
Hub Outputs
Clients - The Number of Clients currently connected.
ID - Unique ID that identifies a specific Connection, will not change unless connection is lost with this receiver.
See thumbnails for a screen shot of a Wireless Keyboard, I made as one of my tests.
This should be usable to create anything from a simple system with 1 client to a much more advanced system, where a server can manage many clients all connecting to a central hub.
I've tested in in Single-Player, Multi-Player and with the Adv-Duplicator and I haven't seen any issues.
Let me know what you think, and/or if you find any problems.
Heres an External Download Link Too, ( also available in the UWSVN )
Bookmarks