• Datastream 2.0
    40 replies, posted
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. [B]Worry no more![/B] 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. [B]If you are a server owner:[/B] When GMod 13 is released, install Datastream 2.0, copy the [URL="http://codepad.org/2iYZge58"]Datastream 2.0 code[/URL] into Notepad and save it as: [code] (current beta:) garry's mod beta/garrysmod/lua/includes/modules/datastream.lua (when released:) garrysmod/garrysmod/lua/includes/modules/datastream.lua [/code] Then copy the following code into (a new blank) Notepad: [code] require"datastream" [/code] And save it as: [code] (current beta:) garry's mod beta/garrysmod/lua/autorun/datastream.lua (when released:) garrysmod/garrysmod/lua/autorun/datastream.lua [/code] 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. [B]If you are a developer:[/B] [U]DO NOT USE THIS MODULE. [/U] All new code should be using the new net library. Datastream 2.0 is designed as solution for server owners who have existing systems. [B]If you are Garry:[/B] I don't recommend including this in the new version - as I'm sure you agree. [B]Note:[/B] 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?). [b]If all fails, copy Datastream 1.0 from a previous version of GMod and use it; it should still work.[/b]
net.*Table was fixed, you can put any datatype in it now.
I'm glad you don't recommend this. It's a good initiative to get projects to work that the developer abandoned.
-i should read-
nice
[QUOTE=Science;33520763]This aint a good idea, if datastream is removed it will force people to use a more optimised system, surely that is what you want? We have the [url]http://wiki.garrysmod.com/?title=Net[/url] library now, no need for this.[/QUOTE] Did you actually read a [highlight]single[/highlight] line from the OP? Geez..
GJ reading the post. Not every server owner has your spectacular L.U.A. prowess and may not in fact be able to update their shit. This allows them to continue to have a server while waiting for someone to turn up who can.
[QUOTE=Science;33520763]This aint a good idea, if datastream is removed it will force people to use a more optimised system, surely that is what you want? We have the [url]http://wiki.garrysmod.com/?title=Net[/url] library now, no need for this.[/QUOTE] This new datastream uses the net library, it also ensures backwards compatibility for older addons that used datastream. This is useful for non-developers who want to use old addons but don't know how to code to update the addons. [editline]:([/editline] damnit lexic
Sorry about that. I read little bits and skipped the net part.
I don't see the point in even releasing a Datastream 2.0. Being a person who used datastream in previous projects, i found it a lot easier to just rewrite the code that used datastream (if you're doing it right, then the amount of times you've used datastream can be counted on one hand). People would be better off simply optimizing their old code instead of using backwards compatibility crutches.
[QUOTE=Deco Da Man;33519220]Datastream 2.0 is designed as solution for server owners who have existing systems.[/QUOTE]
So change them then? It literally doesn't take long at all seeing as the new net library functions almost on the same level as datastream. And like i said, if you're doing it properly then you'll only have a few situations where you actually use datastream anyhow. It took me all of 30 minutes to convert all my old scripts to use the net library, and it also gave me an opportunity to optimize them in the process.
Server owners =/= lua coders.
Hmm yes, instead of getting dumbass server owners to update their scripts let's toss them an inefficient lazy workaround.
[QUOTE=ralle105;33523692]Server owners =/= lua coders.[/QUOTE]Sadly.
[QUOTE=twoski;33523731]Hmm yes, instead of getting dumbass server owners to update their scripts let's toss them an inefficient lazy workaround.[/QUOTE] What part are you not understanding? They [u]can't[/u] update their scripts because they [u]don't know[/u] how.
Well their script came from somewhere didn't it? Whoever wrote it can surely fix it. Instead of enabling bad server hosts we could instead just force them to fix their problems the right way.
[QUOTE=twoski;33524252]Well their script came from somewhere didn't it? Whoever wrote it can surely fix it.[/QUOTE] And maybe those scripters aren't active anymore, or maybe they are too busy with another project.
Or maybe server owners just want their shit to work until the scripters have updated their scripts.
No more CRecipientFilters in the new net library?
[QUOTE=Science;33523734]Sadly.[/QUOTE] You could own a dedicated server for Call of Duty or Battlefield, but you wouldn't be a programmer for those games, you instead depend on the developers and programmers to maintain the engine and mods. "Sadly." my ass. I don't understand people's logic on these forums sometimes.
I'd imagine he said "Sadly" because if all server owners knew lua then gmod would be a lot more diverse and entertaining, rather than a sea of darkrp. Also (though hypothetical), a server owned by the kind of person who enjoys lua scripting would likely be in more competent and sensible hands than a "typical" server owner. I like the idea of this module. We shouldn't decrease the pool of available gmod content when upgrading the efficiency of new gmod content. This is a good compromise.
[QUOTE=Remscar;33527113]No more CRecipientFilters in the new net library?[/QUOTE]No. Just stick a table of entities directly into net.Send
[QUOTE=ralle105;33523692]Server owners =/= lua coders.[/QUOTE] I'm an abomination? D:
[QUOTE=twoski;33524252]Well their script came from somewhere didn't it? Whoever wrote it can surely fix it. Instead of enabling bad server hosts we could instead just force them to fix their problems the right way.[/QUOTE] Someone who wrote addon!=slave/someone who still plays/someone who cares. "Instead of enabling bad server hosts we could instead just force them to fix their problems the right way." -- since when people who can't do shit in lua can't be server hosters? Get out. Now. (please)
[QUOTE=Python1320;33557131]I'm an abomination? D:[/QUOTE] You're the missing link.
So this "script" can fix my broken gamemode using datastream? Or, I still need to remove this fucking datastream in my GM?
[QUOTE=sperm;33858796]So this "script" can fix my broken gamemode using datastream? Or, I still need to remove this fucking datastream in my GM?[/QUOTE] Techincally, yes. And it should work better than the regular datastream.
[QUOTE=sperm;33858796]So this "script" can fix my broken gamemode using datastream? Or, I still need to remove this fucking datastream in my GM?[/QUOTE] JoTheShmo's GM*
[QUOTE=ralle105;33523692]Server owners =/= lua coders.[/QUOTE] I used to own a server. and coded it. was always full. 24/7. Then I ran out of money :saddowns:
Sorry, you need to Log In to post a reply to this thread.