Clarify sample payloads in CultNet
This commit is contained in:
parent
c627200e4a
commit
73a30052c7
4 changed files with 91 additions and 23 deletions
38
src/GameCult.Networking/Samples/SamplePayloadMessages.cs
Normal file
38
src/GameCult.Networking/Samples/SamplePayloadMessages.cs
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
using MessagePack;
|
||||
|
||||
namespace GameCult.Networking
|
||||
{
|
||||
/// <summary>
|
||||
/// Sample authenticated payload for changing a player-visible name.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This is example application payload riding the shared networking contract,
|
||||
/// not a claim that CultNet itself is spiritually about chat lobbies forever.
|
||||
/// Keep the wire tag stable if other runtimes depend on it.
|
||||
/// </remarks>
|
||||
[MessagePackObject]
|
||||
public class ChangeNameMessage : Message
|
||||
{
|
||||
/// <summary>
|
||||
/// Requested new username.
|
||||
/// </summary>
|
||||
[Key(0)] public string Name = string.Empty;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sample plain chat payload.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This exists as a dead-simple reference payload for message extension and
|
||||
/// cross-runtime compatibility tests. Real applications should define their
|
||||
/// own domain messages and keep those contracts in sync across languages.
|
||||
/// </remarks>
|
||||
[MessagePackObject]
|
||||
public class ChatMessage : Message
|
||||
{
|
||||
/// <summary>
|
||||
/// Chat text content.
|
||||
/// </summary>
|
||||
[Key(0)] public string Text = string.Empty;
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue