Skip to content

Commit 2f2dd3e

Browse files
committed
v0.5.0
1 parent c55e59a commit 2f2dd3e

31 files changed

+328
-170
lines changed

CHANGELOG.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,25 @@
22

33
This project uses [semantic versioning](https://semver.org/spec/v2.0.0.html).
44

5+
## version 0.5.0
6+
7+
### **Added**
8+
9+
- Added `ServerBridge.OnServerInvoke` and `ClientBridge:InvokeServer()`
10+
- Added `.Connected` to connections
11+
12+
### **Fixes**
13+
14+
- Fixed a bug with `Bridge:Wait`
15+
16+
## **Improvements**
17+
18+
- Refactored the object-oriented programming pattern used w/ Bridges
19+
- Connections are now their own class
20+
- Calling methods with `.` instead of `:` will now error
21+
- Type improvements
22+
- `tostring()`-ing a bridge will now return its class type
23+
524
## [version 0.4.1](https://github.com/ffrostflame/BridgeNet2/releases/tag/v0.4.1): 6/11/2023
625

726
### **Fixes**

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
# BridgeNet2 v0.4.1
66

7-
A multi-paradigm, blazingly fast & highly equipped networking library for Roblox.
7+
Blazing fast & opinionated networking library designed to reduce bandwidth.
88

99
[Documentation](https://ffrostflame.github.io/BridgeNet2/)
1010

docs/Concepts.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
---
2+
sidebar_position: 3
3+
---

docs/Features.md

Lines changed: 0 additions & 31 deletions
This file was deleted.

docs/Identifiers.md

Lines changed: 0 additions & 7 deletions
This file was deleted.

docs/Installation.md

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,18 @@
11
---
2-
sidebar_position: 3
2+
sidebar_position: 2
33
---
44

55
# Installation
66

7-
## With Wally
7+
## Through Wally [Recommended]
8+
9+
If you're using Wally, you can simply drop this snippet in, except replace `latest` with the latest BridgeNet2 version.
810

9-
1. Install [Wally](https://wally.run)
10-
2. Put BridgeNet2 in the ``wally.toml`` file under ``[dependencies]``
1111
```toml title="wally.toml"
1212
[dependencies]
13-
BridgeNet2 = ffrostflame/bridgenet2@0.4.0
13+
BridgeNet2 = "ffrostflame/bridgenet2@latest"
1414
```
15-
3. Run ``wally install``
16-
17-
## Without Wally
1815

19-
## Option 1: Syncing with .rbxm:
20-
1. Get the ``.rbxm`` file from the latest [release](https://github.com/ffrostflame/BridgeNet2/releases).
21-
2. Sync manually or drop into studio manually
16+
## Standalone
2217

23-
## Option 2: copying source folder:
24-
1. Copy the `src` folder of the repository
25-
2. Drop into your project
26-
3. Rename the folder to `BridgeNet2`
18+
Download `standalone.rbxm` from the [latest release](https://github.com/ffrostflame/BridgeNet2/releases/latest), and then insert it into your Roblox game.

docs/Technical Details.md

Lines changed: 0 additions & 21 deletions
This file was deleted.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
---
2+
sidebar_position: 3
3+
---
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
---
2+
sidebar_position: 1
3+
---
4+
5+
# Identifiers
6+
7+
Identifiers are actually extremely simple: it's a shared key-value list. The key is the compressed identifier, the value is the string value. The list is stored as attributes under the BridgeNet2 RemoteEvent. Identifiers are actually just numbers compressed using `string.pack`- every time you create an identifier, it increments that number by one and creates the attribute.
8+
9+
```lua title="/src/Server/ServerIdentifiers.luau" showLineNumbers
10+
-- optimization for under 255 identifiers
11+
local packed = if identifierCount <= 255
12+
then string.pack("B", identifierCount)
13+
else string.pack("H", identifierCount)
14+
15+
identifierCount += 1
16+
identifierStorage:SetAttribute(identifierName, packed)
17+
18+
fullIdentifierMap[identifierName] = packed
19+
compressedIdentifierMap[packed] = identifierName
20+
```
21+
22+
On the client, the client listens for new attributes added and attribute changes. It then stores these identifiers locally- the `Serialize` and `Deserialize` functions just directly interface with that table. This is why the `ReferenceIdentifier` function yields- it basically just waits a bit to see if the attribute loads in. If it already exists, it just accesses that in the local table.
23+
24+
```lua title="/src/Client/ClientIdentifiers.luau" {2-3} showLineNumbers
25+
for id, value in identifierStorage:GetAttributes() do
26+
fullIdentifierMap[id] = value
27+
compressedIdentifierMap[value] = id
28+
end
29+
```
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
---
2+
sidebar_position: 2
3+
---

0 commit comments

Comments
 (0)