Skip to content

Commit f76c8a9

Browse files
committed
Add custom C# network nodes
1 parent 119957e commit f76c8a9

29 files changed

+510
-424
lines changed

.gitmodules

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[submodule "addons/FracturalCommons"]
2+
path = addons/FracturalCommons
3+
url = https://github.com/Fractural/FracturalCommons.git
4+
branch = release

README.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ wrap around the existing GDScript code.
2323
To enable mono support, add the `res://addons/GodotRollbackNetcodeMono/SyncMonoInit.cs` script as an
2424
autoload singleton in **Project** -> **Project settings...** and the "Autoload" tab.
2525

26-
### Wrapper Classes ###
26+
### Wrapper Classes
2727

2828
To fetch GDScript nodes, you can use the `GetNodeAsWrapper` extension method provided by `GodotRollbackNetcode.Utils`. This will fetch the node at the given path and then wrap it in a C# wrapper class which you can then use like a normal C# class.
2929

@@ -169,7 +169,7 @@ public class CustomMessageSerializer : BaseMessageSerializer
169169

170170
and then go to **Projects** -> **Project Settings** -> **Network** -> **Rollback**, and replace `MessageSerializer` with the path to the C# class (ie. `res://SomePath/To/CustomMessageSerializer.cs`).
171171

172-
#### Custom MessageSerializer #####
172+
#### Custom MessageSerializer
173173

174174
For custom message serializers, certain values like the state hash (stored as the "$" key in the input dictionary of SerializeMessageInput) are 32-bit values stored in 64-bit ints in GDScript. However in C#, all GDScript ints are converted to C# ints, which are 32-bit. This means there will be overflow when these values are passed into your MessageSerializer code. and you may get a negative number, even though they were positive 32-bit integers on the GDScript side.
175175

@@ -199,6 +199,13 @@ public override GDDictionary UnserializeInput(byte[] serialized)
199199
}
200200
```
201201

202+
### C# Network Nodes
203+
204+
![csharp_network_nodes](assets\screenshots\csharp_network_nodes.png)
205+
206+
This addons also comes with C# network nodes for RNG, timing, and
207+
208+
202209
Logo credits
203210
------------
204211

addons/FracturalCommons

Submodule FracturalCommons added at 8ac4160
Lines changed: 7 additions & 0 deletions
Loading
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
[remap]
2+
3+
importer="texture"
4+
type="StreamTexture"
5+
path="res://.import/NetworkAnimationPlayer.svg-b9f1abd6e4960f415070966cc9f70f61.stex"
6+
metadata={
7+
"vram_texture": false
8+
}
9+
10+
[deps]
11+
12+
source_file="res://addons/GodotRollbackNetcodeMono/Assets/NetworkAnimationPlayer.svg"
13+
dest_files=[ "res://.import/NetworkAnimationPlayer.svg-b9f1abd6e4960f415070966cc9f70f61.stex" ]
14+
15+
[params]
16+
17+
compress/mode=0
18+
compress/lossy_quality=0.7
19+
compress/hdr_mode=0
20+
compress/bptc_ldr=0
21+
compress/normal_map=0
22+
flags/repeat=0
23+
flags/filter=true
24+
flags/mipmaps=false
25+
flags/anisotropic=false
26+
flags/srgb=2
27+
process/fix_alpha_border=true
28+
process/premult_alpha=false
29+
process/HDR_as_SRGB=false
30+
process/invert_color=false
31+
process/normal_map_invert_y=false
32+
stream=false
33+
size_limit=0
34+
detect_3d=true
35+
svg/scale=1.0
Lines changed: 8 additions & 0 deletions
Loading
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
[remap]
2+
3+
importer="texture"
4+
type="StreamTexture"
5+
path="res://.import/NetworkRNG.svg-84e211202dda55b261caf9e7897d039c.stex"
6+
metadata={
7+
"vram_texture": false
8+
}
9+
10+
[deps]
11+
12+
source_file="res://addons/GodotRollbackNetcodeMono/Assets/NetworkRNG.svg"
13+
dest_files=[ "res://.import/NetworkRNG.svg-84e211202dda55b261caf9e7897d039c.stex" ]
14+
15+
[params]
16+
17+
compress/mode=0
18+
compress/lossy_quality=0.7
19+
compress/hdr_mode=0
20+
compress/bptc_ldr=0
21+
compress/normal_map=0
22+
flags/repeat=0
23+
flags/filter=true
24+
flags/mipmaps=false
25+
flags/anisotropic=false
26+
flags/srgb=2
27+
process/fix_alpha_border=true
28+
process/premult_alpha=false
29+
process/HDR_as_SRGB=false
30+
process/invert_color=false
31+
process/normal_map_invert_y=false
32+
stream=false
33+
size_limit=0
34+
detect_3d=true
35+
svg/scale=1.0
Lines changed: 7 additions & 0 deletions
Loading
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
[remap]
2+
3+
importer="texture"
4+
type="StreamTexture"
5+
path="res://.import/NetworkTimer.svg-6a1956f6d277674cbcc37876d9932a17.stex"
6+
metadata={
7+
"vram_texture": false
8+
}
9+
10+
[deps]
11+
12+
source_file="res://addons/GodotRollbackNetcodeMono/Assets/NetworkTimer.svg"
13+
dest_files=[ "res://.import/NetworkTimer.svg-6a1956f6d277674cbcc37876d9932a17.stex" ]
14+
15+
[params]
16+
17+
compress/mode=0
18+
compress/lossy_quality=0.7
19+
compress/hdr_mode=0
20+
compress/bptc_ldr=0
21+
compress/normal_map=0
22+
flags/repeat=0
23+
flags/filter=true
24+
flags/mipmaps=false
25+
flags/anisotropic=false
26+
flags/srgb=2
27+
process/fix_alpha_border=true
28+
process/premult_alpha=false
29+
process/HDR_as_SRGB=false
30+
process/invert_color=false
31+
process/normal_map_invert_y=false
32+
stream=false
33+
size_limit=0
34+
detect_3d=true
35+
svg/scale=1.0

0 commit comments

Comments
 (0)