Skip to content

Commit

Permalink
Merge branch 'master' of github.com:TomDotBat/gmod-messagepack
Browse files Browse the repository at this point in the history
  • Loading branch information
TomDotBat committed Sep 21, 2020
2 parents 7b53293 + b01d7d5 commit fb29478
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# gmod-messagepack
An edit of [lua-MessagePack](https://fperrad.frama.io/lua-MessagePack/) that works in Garry's Mod.
Using the library works almost exactly the same as the [original](https://fperrad.frama.io/lua-MessagePack/messagepack/#reference), except instead of requiring the library you create a localised copy of the object for your addon. This is so you can set addon specific configurations on the library without the worry of causing any interference.


## Example Usage
```lua
local msgPack = messagePack.new() --Create a copy of the messagepack object so we can use our own settings

local testData = {"one", 2, {3, 3.5}, false}
PrintTable(testData)

local packedData = msgPack.pack(testData) --Pack the test data
print(packedData)

PrintTable(msgPack.unpack(packedData)) --Unpack the test data, prints the same as the first PrintTable()
```

0 comments on commit fb29478

Please sign in to comment.