Skip to content

Commit fb29478

Browse files
committed
Merge branch 'master' of github.com:TomDotBat/gmod-messagepack
2 parents 7b53293 + b01d7d5 commit fb29478

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# gmod-messagepack
2+
An edit of [lua-MessagePack](https://fperrad.frama.io/lua-MessagePack/) that works in Garry's Mod.
3+
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.
4+
5+
6+
## Example Usage
7+
```lua
8+
local msgPack = messagePack.new() --Create a copy of the messagepack object so we can use our own settings
9+
10+
local testData = {"one", 2, {3, 3.5}, false}
11+
PrintTable(testData)
12+
13+
local packedData = msgPack.pack(testData) --Pack the test data
14+
print(packedData)
15+
16+
PrintTable(msgPack.unpack(packedData)) --Unpack the test data, prints the same as the first PrintTable()
17+
```

0 commit comments

Comments
 (0)