Converting UMsg to Datastream.

My user messages have went passed the byte limit, so I was wondering how to convert the following into a datastream:

local function LoadInventory ( UMsg ) parseSaveString(UMsg:ReadString()); end
usermessage.Hook(“load_inventory”, LoadInventory );

umsg.Start(“load_inventory”, Player)


– When someone has too many items in their inventory, the size becomes too large for the usermessage, the data is stored in a SQL table. So I was wondering, what’s the best way to convert it into a datastream?


Send the whole table (I assume the inventory is saved as a table on the player for reference) via datastream. I do not suggest doing this though.

How much of a performance hit is there when using a datastream? The usermessage is called when a player first joins, however if too many items are in the inventory it will result in too large of a usermessage. I was thinking of just sending more usermessages, but the entire inventory is contained within one table of the database, I’m not sure if making two tables in the database for the inventory and sending two usermessages that way will be convenient.

umsg.String(PlayerInfo[1][7]); // [1] = SteamID table, [7] = Inventory Table, within the database.
So it matches those two so the player gets the inventory assigned to their steamID.

How would I go about sending the entire table through a datastream?

I suggest using Overv’s ‘Usermessages without a size limit’ code.

That did the trick. Amazing.

Thanks alot.