From de208b053b62a56fb3766d1082897c661053ecce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franti=C5=A1ek=20Boh=C3=A1=C4=8Dek?= Date: Tue, 21 Dec 2021 22:45:43 +0100 Subject: [PATCH] feat: add chat types skeleton --- Core/NosSmooth.Game/Data/Characters/Family.cs | 9 +++++ Core/NosSmooth.Game/Data/Chat/ChatMessage.cs | 17 +++++++++ .../NosSmooth.Game/Data/Chat/DirectMessage.cs | 15 ++++++++ Core/NosSmooth.Game/Data/Chat/Friend.cs | 35 +++++++++++++++++++ Core/NosSmooth.Game/Data/Dialogs/Dialog.cs | 18 ++++++++++ 5 files changed, 94 insertions(+) create mode 100644 Core/NosSmooth.Game/Data/Characters/Family.cs create mode 100644 Core/NosSmooth.Game/Data/Chat/ChatMessage.cs create mode 100644 Core/NosSmooth.Game/Data/Chat/DirectMessage.cs create mode 100644 Core/NosSmooth.Game/Data/Chat/Friend.cs create mode 100644 Core/NosSmooth.Game/Data/Dialogs/Dialog.cs diff --git a/Core/NosSmooth.Game/Data/Characters/Family.cs b/Core/NosSmooth.Game/Data/Characters/Family.cs new file mode 100644 index 0000000..af894f8 --- /dev/null +++ b/Core/NosSmooth.Game/Data/Characters/Family.cs @@ -0,0 +1,9 @@ +// +// Family.cs +// +// Copyright (c) Christofel authors. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +namespace NosSmooth.Game.Data.Character; + +public record Family(); \ No newline at end of file diff --git a/Core/NosSmooth.Game/Data/Chat/ChatMessage.cs b/Core/NosSmooth.Game/Data/Chat/ChatMessage.cs new file mode 100644 index 0000000..e1a3b66 --- /dev/null +++ b/Core/NosSmooth.Game/Data/Chat/ChatMessage.cs @@ -0,0 +1,17 @@ +// +// ChatMessage.cs +// +// Copyright (c) František Boháček. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using NosSmooth.Game.Entities; + +namespace NosSmooth.Game.Data.Chat; + +/// +/// Message received from user in chat. +/// +/// The id of the character. +/// The player +/// The message sent from the friend. +public record ChatMessage(long CharacterId, Player? Player, string Message); \ No newline at end of file diff --git a/Core/NosSmooth.Game/Data/Chat/DirectMessage.cs b/Core/NosSmooth.Game/Data/Chat/DirectMessage.cs new file mode 100644 index 0000000..7fac4bd --- /dev/null +++ b/Core/NosSmooth.Game/Data/Chat/DirectMessage.cs @@ -0,0 +1,15 @@ +// +// DirectMessage.cs +// +// Copyright (c) František Boháček. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +namespace NosSmooth.Game.Data.Chat; + +/// +/// Message received from a friend. +/// +/// The id of the character. +/// The friend from which the message is. May be null if the client did not receive friend packet. +/// The message sent from the friend. +public record DirectMessage(long CharacterId, Friend? Friend, string? Message); \ No newline at end of file diff --git a/Core/NosSmooth.Game/Data/Chat/Friend.cs b/Core/NosSmooth.Game/Data/Chat/Friend.cs new file mode 100644 index 0000000..2371658 --- /dev/null +++ b/Core/NosSmooth.Game/Data/Chat/Friend.cs @@ -0,0 +1,35 @@ +// +// Friend.cs +// +// Copyright (c) František Boháček. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using NosCore.Packets.Enumerations; + +namespace NosSmooth.Game.Data.Chat; + +/// +/// Represents character's friend. +/// +public class Friend +{ + /// + /// The id of the character. + /// + public long CharacterId { get; internal set; } + + /// + /// The type of the relation. + /// + public CharacterRelationType RelationType { get; internal set; } + + /// + /// The name of the character. + /// + public string? CharacterName { get; internal set; } + + /// + /// Whether the friend is connected to the server. + /// + public bool IsOnline { get; internal set; } +} \ No newline at end of file diff --git a/Core/NosSmooth.Game/Data/Dialogs/Dialog.cs b/Core/NosSmooth.Game/Data/Dialogs/Dialog.cs new file mode 100644 index 0000000..2657ff7 --- /dev/null +++ b/Core/NosSmooth.Game/Data/Dialogs/Dialog.cs @@ -0,0 +1,18 @@ +// +// Dialog.cs +// +// Copyright (c) František Boháček. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using NosCore.Packets.Enumerations; +using OneOf; + +namespace NosSmooth.Game.Data.Dialogs; + +/// +/// Represents dialog sent by the server +/// +/// +/// +/// +public record Dialog(string AcceptCommand, OneOf Message, IReadOnlyList Parameters); \ No newline at end of file -- 2.49.0