Skip to content

Commit

Permalink
Populate the readme with text and stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
TomDotBat authored Sep 21, 2020
1 parent c690058 commit b01d7d5
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1 +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 b01d7d5

Please sign in to comment.