Datastream 1.0 was an abomination; however, it did solve the issue of the size and data limitations of usermessages in a convenient manner.
Due to this, many developers used Datastream in their gamemodes, addons, and miscellaneous scripts.
If you run a server, it is highly likely you are worrying whether your gamemodes, addons and miscellaneous scripts will work when GMod 13 is released.
Worry no more!
Being the primary developer of Datastream (Janorkie/LuaBanana did nothing but rewrite it 20 times and then release it), I feel responsible for ensuring there is as little impact as possible when it is removed.
Hence, here is Datastream 2.0 to temporarily solve the issues by providing backwards compatibility for code that relies on Datastream.
If you are a server owner:
When GMod 13 is released, install Datastream 2.0, copy the Datastream 2.0 code into Notepad and save it as:
(current beta:) garry's mod beta/garrysmod/lua/includes/modules/datastream.lua (when released:) garrysmod/garrysmod/lua/includes/modules/datastream.lua
Then copy the following code into (a new blank) Notepad:
And save it as:
(current beta:) garry's mod beta/garrysmod/lua/autorun/datastream.lua (when released:) garrysmod/garrysmod/lua/autorun/datastream.lua
Datastream 2.0 is inefficient compared to proper usage of the new net library (in ANY situation).
You should attempt to find a coder to remove your code’s dependency on Datastream.
If you are a developer:
DO NOT USE THIS MODULE.
All new code should be using the new net library.
Datastream 2.0 is designed as solution for server owners who have existing systems.
If you are Garry:
I don’t recommend including this in the new version - as I’m sure you agree.
This module will not work properly until Garry finishes net.*Table.
I have performed little testing of this module; don’t be surprised if it doesn’t work.
Not all uses of Datastream are accounted for; don’t be surprised if it doesn’t work.
Streams larger than 64KB are not supported (if you are sending this much: you are doing it wrong).
GLON is not required unless your code uses the “encdata” argument (why the hell did Janorkie put that there?).
If all fails, copy Datastream 1.0 from a previous version of GMod and use it; it should still work.