Dateien

> > CS2D > Lua Scripts > [DEV] Table Serialization 1.3
DateiübersichtCS2D-ÜbersichtLua Scripts-Übersicht

Englisch [DEV] Table Serialization 1.3 >

6 Kommentare2 kb, 432 Downloads

alt [DEV] Table Serialization 1.3

VADemon
User Off Offline

[Developer Tools] Table Serialization

∗ Description
Basically it allows you to output a whole table as a single string; for example, to write it to a file and load later.

∗ Features
• Saves any datatype except functions, threads and userdata (it's impossible)
• Multidimensional array support
• Tabulated human-friendly output

illegal Caution! To serialize such tables as /_G/ you will need to manipulate the function yourself else you will run into an infinite loop! (happened to me, 2GB text file FTW!)


∗ Installation
Basic installation:Extract the archive into CS2D folder.

Execute the lua file with dofile() which will return the function
1
somevariablenamehere = dofile("/sys/lua/vademon/serialize/serialize.lua")
After that you can access this function under the given name.


∗ How to use ∗
> Function: funcName(name, object [, tabs])
> name: type the name of the original table (in most cases same as /object/ but it's a string)
> object: the table you want to serialize
> [Optional] tabs: used internally to pass tabulators as a string (e.g.: "\t\t" will increase the tabulators by 2)

Examples >


Changelog >


° Also check out user MikuAuahDark's work: file cs2d table.uneval

∗ Bugs?
> Yea, there's one, try to find it Yet I hope nobody will run into it.


∗ MIT License ∗
9× editiert, zuletzt 25.06.14 00:01:52
Zugelassen von Sparty

Download Download

2 kb, 432 Downloads

Kommentare

6 Kommentare
Zum Anfang Vorherige 1 Nächste Zum Anfang

Logge dich ein!

Du musst dich einloggen, um selber Kommentare verfassen zu können!Einloggen

alt

pro CS2D
BANNED Off Offline

i cant Like this shitt

alt

Necr0
User Off Offline

Mehr >

lol, happened to me once because i tried to print every single varriable of a lua instance and forgot that "_G" contains itself

Awesome script
Ich mag es!

alt

Infinite Rain
Reviewer Off Offline

I prefer using my own version, much simplier and no useless functions.

Script >

alt

EngiN33R
Moderator Off Offline

Well, I did find a bug from looking at the image, though I'm not sure if it's the one you tasked us with finding. See, even though "Welcome, %username%" in randomStrings is assigned the index 18, your serialization assigns it the index 3. That might produce some very nasty errors.

alt

MikuAuahDark
User Off Offline

Okay it's simply faster than mine.
1
2
executionTime(table.uneval,entitylist())
executionTime(table.serialize,"a",entitylist())
And it output:
1
2
0.514		-- table.uneval
0.510		-- table.serialize
That's why i give you a like.
Ich mag es!

alt

I_am_an_idiot
BANNED Off Offline

Like you are nmooobcvobjopfj'gmsd!!
Ich mag es!
Zum Anfang Vorherige 1 Nächste Zum Anfang