You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README_EN.md
+48-55Lines changed: 48 additions & 55 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,15 +9,21 @@ Use it when you need any of these:
9
9
1. a typed state model that can be saved and synced;
10
10
2. a packet with a stable id, version, and decode path;
11
11
3. a reusable serializer for one Java type;
12
-
4. runtime lookup from an authored class to its generated schema or packet binding.
12
+
4.direct runtime save/load helpers by type.
13
13
14
-
Most authors only touch three layers:
14
+
Most day-to-day code only touches three layers:
15
15
16
16
1. annotations such as `@PiSyncModel`, `@PiField`, and `@PiPacket`;
17
17
2. runtime entry points such as `PiSchemas`, `PiPackets`, and `PiSerializeServices`;
18
18
3. serializer APIs such as `PiSerializer` and `PiSerializers`.
19
19
20
-
You normally do not hand-reference `_PiSchema`, `_PiPacket`, or other generated companion names.
20
+
You normally do not hand-reference `_PiSchema`, `_PiPacket`, or other generated companion names, and the low-level `binding.codec()` path should not be the first example most users see.
21
+
22
+
The usual split is:
23
+
24
+
1.`api.*` contains the annotations and contracts you write against most of the time;
25
+
2.`PiSchemas` and `PiPackets` are the runtime lookup entry points;
26
+
3.`PiNet` consumes the packet ids, versions, and codecs generated here.
21
27
22
28
## Typical usage
23
29
@@ -34,18 +40,18 @@ public final class ManaState {
34
40
}
35
41
```
36
42
37
-
At runtime you resolve the binding from the authored class:
Again, runtime code resolves the binding from the authored class or stable id:
87
+
Most of the time, defining the class is the main job. `PiSerializeKit` gives the packet a stable id, version, and decode path, and `PiNet` consumes that result for registration and transport.
88
+
89
+
The `@PiField(sync = ...)` values on packet fields only reuse the shared field descriptor model. Delivery concepts such as tracking, broadcast, and reply are still chosen by the network layer above.
90
+
91
+
If you are debugging, bridging another transport, or wiring low-level runtime code, you can still encode and decode it directly:
0 commit comments