+ Reply to Thread
Results 1 to 5 of 5

Thread: SavedVariables Lua File Content broken/changed after a while?

  1. #1
    Suy
    Suy is offline
    Telaran Suy's Avatar
    Join Date
    Feb 2014
    Posts
    53

    Default SavedVariables Lua File Content broken/changed after a while?

    Hello there

    can anybody tell me if this is normal behaviour, a bug, or where the limit is?
    i made an addon, to log different things. so my savedvariables gets very big. about 3.5mb at the moment and growing. no problems so far, no lag nor crashes.

    yesterday, when i logged out, i've checked this SavedVariables lua file and seen that my nice Lua Array is gone, instead there is now a loop at the top to fill keys, and then... well see at your own...

    Here's how it should look like, shortened it a little bit for displaying here:
    Code:
    CFW_data = {
    	console = "v0000000000000003",
    	lastLoc = {
    		name = "The Canals",
    		x = 12774.989714457,
    		y = 861.38998074643,
    		z = 11679.969738932
    	},
    	logTotal = {
            ["1394130298_39.818477652522"] = {
                location = {
                    name = "Life Factory",
                    x = 1015.4699773025,
                    y = 72.019998390228,
                    z = 1022.0199771561
                }
    		},
            ...more more more...
           },
           player = {
    		alliance = "defiant",
    		name = "Ica"
    	},
    	winSessionX = 1518,
    	winSessionY = 1026
    }
    now, it looks like this after i logged out:
    Code:
    local ref = {}
    for k=1,49987 do ref[k] = {} end
    ref[1].diff = 6
    ref[1].stack = 11862
    ref[1].location = ref[36748]
    ...more more more...
    ref[20389].location = ref[22603]
    CFW_data = ref[8759]
    what happened? any ideas? i can load the old file, everything works, when i logout, it looks again like this. never had this "problem" before, i guess it happens around 3.8mb filesize.

    well, let me know please if you know anything about this issue, if it's an issue... would be cool if there is a workaround, cause i love my logging addon and love to gather lots of data.


    so long,
    greetings!

  2. #2
    RIFT Community Ambassador the_real_seebs's Avatar
    Join Date
    Jan 2011
    Posts
    16,859

    Default

    Do you actually see anything failing, or is it just that the file looks strange to you?

    If the latter: This is a feature. Lua will blow up if you try to initialize too large a structure with a literal, so it starts producing code to generate the values it wants to produce. As long as the result works when executed, all is well.
    You can play WoW in any MMO. You don't have to play WoW in RIFT. Oh, and no, RIFT is not a WoW clone. Not having fun any more? Learn to play, noob! I don't speak for Riftui, but I moderate stuff there. Just came back? Welcome back! Here's what's changed. (Updated for 2.5!)

  3. #3
    Suy
    Suy is offline
    Telaran Suy's Avatar
    Join Date
    Feb 2014
    Posts
    53

    Default

    ok, i can still loop tru the table. data seems to be still accessible.
    still creepy to look at. also, i have another problem now, i have to rewrite the lua parser... (i export data to a website)

    gonna search the internet for a better solution to save lots of data in lua. don't like it this way.

    well, thanks for your reply man!
    Last edited by Suy; 04-25-2014 at 01:43 AM.

  4. #4
    RIFT Community Ambassador the_real_seebs's Avatar
    Join Date
    Jan 2011
    Posts
    16,859

    Default

    Easiest way to parse it is going to be to use lua to parse it. Since it's lua code.

    Use loadfile on it, then dump the output in whatever format you want that doesn't have to be lua.
    You can play WoW in any MMO. You don't have to play WoW in RIFT. Oh, and no, RIFT is not a WoW clone. Not having fun any more? Learn to play, noob! I don't speak for Riftui, but I moderate stuff there. Just came back? Welcome back! Here's what's changed. (Updated for 2.5!)

  5. #5
    Suy
    Suy is offline
    Telaran Suy's Avatar
    Join Date
    Feb 2014
    Posts
    53

    Default

    Quote Originally Posted by the_real_seebs View Post
    Easiest way to parse it is going to be to use lua to parse it. Since it's lua code.

    Use loadfile on it, then dump the output in whatever format you want that doesn't have to be lua.
    yep, will look into this, thanks man

+ Reply to Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts