serialize a middleclass-class with binser

General discussion about LÖVE, Lua, game development, puns, and unicorns.
Post Reply
Posts: 5
Joined: Wed Dec 17, 2014 7:40 am

serialize a middleclass-class with binser

Post by Dudenheit » Mon Oct 30, 2017 7:13 pm


I am stucked in the use of binser and hoping someone can help me. I suppose it's not a big problem (therefore I'm worried about making a extra thread about it :death: )

Is there a quick example of an small middleclass-class and a serializing and deserializing per binser?
For example:

Code: Select all

--somewhere in the main:
Account = class('Account')
require "classes/Account"

--in classes/Account.lua:
function Account:initialize() = "test-id" = "test-name"
    self.level = 0
    self.xp = 0
--in an other file:
-- does not work, I don't catch it
local account_to_send = Account:new()
local myddata = binser.serialize(account_to_send)

Post Reply

Who is online

Users browsing this forum: No registered users and 15 guests