// ----------------------------------------------------------------------- // // Licensed under the MIT License. See LICENSE file in the project root for full license information. // // ----------------------------------------------------------------------- namespace MUnique.OpenMU.Interfaces; /// /// Defines some server ids which are used for some specific states. /// public enum SpecialServerId : byte { /// /// Gets the server id which represents being offline. /// Offline = 0xFF, /// /// Gets the server id which represents being invisible (=offline to other players). /// Invisible = 0xFE, } /// /// The friend server interface. /// public interface IFriendServer { /// /// Forwards the letter. /// /// The letter. ValueTask ForwardLetterAsync(LetterHeader letter); /// /// Handles the friend request response. /// /// The character name of the responder. /// The character name of the requester. /// Indicating whether the request got accepted. ValueTask FriendResponseAsync(string characterName, string friendName, bool accepted); /// /// Is called when a player entered the game. /// It will cause a response with /// and a state update for friends. /// /// The server identifier. /// The character identifier. /// Name of the character. ValueTask PlayerEnteredGameAsync(byte serverId, Guid characterId, string characterName); /// /// Is called when a player leaves the game. /// It will cause a state update for friends. /// /// The character identifier. /// Name of the character. ValueTask PlayerLeftGameAsync(Guid characterId, string characterName); /// /// Sets the online visibility state of a character. /// /// The server identifier. /// Id of the character. /// Name of the character. /// If set to true, the character is visible as online. Otherwise, it appears as offline for other players, but is still online. ValueTask SetPlayerVisibilityStateAsync(byte serverId, Guid characterId, string characterName, bool isVisible); /// /// Determines whether two players are friends (accepted friend relationship). /// /// The character name of the first player. /// The character name of the second player. /// True if the two players are friends; otherwise false. ValueTask IsFriendAsync(string characterName, string friendName); /// /// Sends a friend request to the friend, and adds a new friend view item to the players friend list. /// /// The name of the requesting player. /// The name of the requested friend. /// If a new friend view item got added to the players friend list. ValueTask FriendRequestAsync(string playerName, string friendName); /// /// Deletes the friend. /// /// The player who is deleting a friend from his friend list. /// Name of the friend who should be deleted. ValueTask DeleteFriendAsync(string name, string friendName); /// /// Creates a new chat room. /// /// Name of the player who is creating the chat room. /// Name of the friend who should be invited to the chat room. ValueTask CreateChatRoomAsync(string playerName, string friendName); /// /// Invites a friend to an existing chat room. /// /// Name of the selected character. /// Name of the friend. /// The room number. /// The success of the invitation. ValueTask InviteFriendToChatRoomAsync(string selectedCharacterName, string friendName, ushort roomNumber); }