-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
30a696d
commit 50a7896
Showing
43 changed files
with
1,058 additions
and
1,036 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
{ | ||
"robloxLsp.workspace.rojoProjectFile": "testing" | ||
"robloxLsp.workspace.rojoProjectFile": "testing", | ||
"luau-lsp.completion.imports.separateGroupsWithLine": true, | ||
"luau-lsp.completion.imports.enabled": true, | ||
"luau-lsp.sourcemap.rojoProjectFile": "testing.project.json", | ||
"luau-lsp.completion.imports.requireStyle": "alwaysRelative" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,23 @@ | ||
# Setup | ||
|
||
--- | ||
|
||
- Run `aftman install` | ||
- Run `wally install` | ||
- Start syncing `testing.project.json` for feature-related things, `stresstest.project.json` for performance-related things. | ||
|
||
# Contributing | ||
|
||
--- | ||
- Make sure you have selene, Roblox LSP, StyLua and wally (to prevent unnecessary lints / warns) | ||
|
||
- **Do not publicly export functions directly.** There should always be something in the middle- preferably a file that returns a function. | ||
- Make sure you format all edited files before finalizing a PR. I'll set up actions for this eventually. | ||
- All new files must end in .luau if they are in the Luau lang. That being said- avoid creating new files. It clutters the source directory. | ||
|
||
# What to look out for | ||
|
||
--- | ||
|
||
- When fixing a bug, make sure to comment the bugfix if necessary- if it's an edge case for example, that requires a few extra lines, make comment that explains why that bug fix is there. | ||
- Avoid placing anything remotely performance-intensive inside of things like callback runners, middleware, outbound bridges, etc. | ||
- Never intrude on user code, never iterate over it, never touch it. This is one main selling point of BridgeNet2. | ||
- Never intrude on user code, never iterate over it, never touch it. This is one main selling point of BridgeNet2. |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,6 +27,6 @@ | |
"fs-extra": "^11.1.0", | ||
"moonwave": "^1.0.1", | ||
"path": "^0.12.7", | ||
"rimraf": "^4.1.2" | ||
"rimraf": "^4.4.1" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{"name":"bridgenet2","className":"ModuleScript","filePaths":["src\\init.luau","default.project.json"],"children":[{"name":"ClientBridge","className":"ModuleScript","filePaths":["src\\ClientBridge.luau"]},{"name":"ClientProcess","className":"ModuleScript","filePaths":["src\\ClientProcess.luau"]},{"name":"Identifiers","className":"ModuleScript","filePaths":["src\\Identifiers.luau"]},{"name":"NetworkUtils","className":"ModuleScript","filePaths":["src\\NetworkUtils.luau"]},{"name":"Output","className":"ModuleScript","filePaths":["src\\Output.luau"]},{"name":"ServerBridge","className":"ModuleScript","filePaths":["src\\ServerBridge.luau"]},{"name":"ServerProcess","className":"ModuleScript","filePaths":["src\\ServerProcess.luau"]}]} | ||
{"name":"bridgenet2-test","className":"DataModel","filePaths":["testing.project.json"],"children":[{"name":"ReplicatedStorage","className":"ReplicatedStorage","children":[{"name":"Packages","className":"Folder","children":[{"name":"RemotePacketSizeCounter","className":"ModuleScript","filePaths":["Packages\\RemotePacketSizeCounter.lua"]},{"name":"TableKit","className":"ModuleScript","filePaths":["Packages\\TableKit.lua"]},{"name":"_Index","className":"Folder","children":[{"name":"[email protected]","className":"Folder","children":[{"name":"tablekit","className":"ModuleScript","filePaths":["Packages\\_Index\\[email protected]\\tablekit\\src\\init.luau","Packages\\_Index\\[email protected]\\tablekit\\default.project.json"]}]},{"name":"[email protected]","className":"Folder","children":[{"name":"remotepacketsizecounter","className":"ModuleScript","filePaths":["Packages\\_Index\\[email protected]\\remotepacketsizecounter\\src\\init.luau","Packages\\_Index\\[email protected]\\remotepacketsizecounter\\default.project.json"]}]}]},{"name":"bridgenet2","className":"ModuleScript","filePaths":["src\\init.luau"],"children":[{"name":"BridgeNet2","className":"ModuleScript","filePaths":["src\\BridgeNet2.luau"]},{"name":"Client","className":"ModuleScript","filePaths":["src\\Client\\init.luau"],"children":[{"name":"ClientBridge","className":"ModuleScript","filePaths":["src\\Client\\ClientBridge.luau"]},{"name":"ClientIdentifiers","className":"ModuleScript","filePaths":["src\\Client\\ClientIdentifiers.luau"]},{"name":"ClientProcess","className":"ModuleScript","filePaths":["src\\Client\\ClientProcess.luau"]}]},{"name":"Constants","className":"ModuleScript","filePaths":["src\\Constants.luau"]},{"name":"Server","className":"ModuleScript","filePaths":["src\\Server\\init.luau"],"children":[{"name":"HandleInvalidPlayer","className":"ModuleScript","filePaths":["src\\Server\\HandleInvalidPlayer.luau"]},{"name":"PlayerContainers","className":"ModuleScript","filePaths":["src\\Server\\PlayerContainers\\init.luau"],"children":[{"name":"All","className":"ModuleScript","filePaths":["src\\Server\\PlayerContainers\\All.luau"]},{"name":"Except","className":"ModuleScript","filePaths":["src\\Server\\PlayerContainers\\Except.luau"]},{"name":"Players","className":"ModuleScript","filePaths":["src\\Server\\PlayerContainers\\Players.luau"]},{"name":"Single","className":"ModuleScript","filePaths":["src\\Server\\PlayerContainers\\Single.luau"]}]},{"name":"ServerBridge","className":"ModuleScript","filePaths":["src\\Server\\ServerBridge.luau"]},{"name":"ServerIdentifiers","className":"ModuleScript","filePaths":["src\\Server\\ServerIdentifiers.luau"]},{"name":"ServerProcess","className":"ModuleScript","filePaths":["src\\Server\\ServerProcess.luau"]}]},{"name":"Types","className":"ModuleScript","filePaths":["src\\Types.luau"]},{"name":"Utilities","className":"Folder","children":[{"name":"NetworkUtils","className":"ModuleScript","filePaths":["src\\Utilities\\NetworkUtils.luau"]},{"name":"Output","className":"ModuleScript","filePaths":["src\\Utilities\\Output.luau"]},{"name":"RecycledSpawn","className":"ModuleScript","filePaths":["src\\Utilities\\RecycledSpawn.luau"]}]}]}]},{"name":"benches","className":"Folder","children":[{"name":"Hex.bench","className":"ModuleScript","filePaths":["benchmarks\\Hex.bench.luau"]}]},{"name":"framework","className":"ModuleScript","filePaths":["testing/framework\\init.luau"],"children":[{"name":"bootstrapper","className":"ModuleScript","filePaths":["testing/framework\\bootstrapper.luau"]},{"name":"expect","className":"ModuleScript","filePaths":["testing/framework\\expect.luau"]}]}]},{"name":"ServerScriptService","className":"ServerScriptService","children":[{"name":"featureTests","className":"Script","filePaths":["testing/tests/server\\featureTests\\init.server.luau"]}]},{"name":"StarterPlayer","className":"StarterPlayer","children":[{"name":"StarterPlayerScripts","className":"StarterPlayerScripts","children":[{"name":"featureTests","className":"LocalScript","filePaths":["testing/tests/client\\featureTests\\init.client.luau"]}]}]}]} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
--!strict | ||
local Types = require(script.Parent.Types) | ||
|
||
type ServerBridge = { | ||
Fire: (self: ServerBridge, target: Player | Types.PlayerContainer, content: Types.Content) -> (), | ||
Connect: (self: ServerBridge, callback: <T, K>(player: Player, content: Types.Content?) -> ()) -> (), | ||
} | ||
type ClientBridge = { | ||
Fire: (self: ClientBridge, content: Types.Content) -> (), | ||
Connect: (self: ClientBridge, callback: (content: Types.Content) -> ()) -> (), | ||
} | ||
|
||
type Connection = { | ||
Disconnect: () -> (), | ||
} | ||
|
||
export type Bridge = ServerBridge & ClientBridge | ||
|
||
export type BridgeNet2 = { | ||
ReferenceBridge: (name: string) -> Bridge, | ||
|
||
ReferenceIdentifier: (name: string, maxWaitTime: number) -> Types.Identifier, | ||
|
||
Serialize: (identifierName: string) -> Types.Identifier, | ||
Deserialize: (compressedIdentifier: string) -> Types.Identifier, | ||
|
||
ToHex: (regularString: string) -> string, | ||
ToReadableHex: (regularString: string) -> string, | ||
FromHex: (hexadecimal: string) -> string, | ||
|
||
Players: (players: Types.Array<Player>) -> Types.SetPlayerContainer, | ||
AllPlayers: () -> Types.AllPlayerContainer, | ||
PlayersExcept: (excludedPlayers: Types.Array<Player>) -> Types.ExceptPlayerContainer, | ||
|
||
CreateUUID: () -> string, | ||
|
||
HandleInvalidPlayer: (handler: (player: Player) -> ()) -> (), | ||
} | ||
|
||
return nil |
Oops, something went wrong.