Interface ISocialService
Interface for Socially Distant's social and narrative API.
Namespace: SociallyDistant.Core.Social
Assembly: SociallyDistant.Framework.dll
Syntax
public interface ISocialService
Properties
News
Gets a reference to the game's News Article API.
Declaration
INewsManager News { get; }
Property Value
Type | Description |
---|---|
INewsManager |
PlayerProfile
Gets an implementation of Profiles representing the player.
Declaration
IProfile PlayerProfile { get; }
Property Value
Type | Description |
---|---|
IProfile |
Profiles
Gets a list of all human beings or other social profiles in Socially Distant.
Declaration
IEnumerable<IProfile> Profiles { get; }
Property Value
Type | Description |
---|---|
IEnumerable<IProfile> |
Methods
GetAllPosts()
Gets all posts of all types from all users in the game's world.
Declaration
IEnumerable<IUserMessage> GetAllPosts()
Returns
Type | Description |
---|---|
IEnumerable<IUserMessage> | An iteration of every single thing ever said in Socially Distant's universe during this playthrough, as implementations of IUserMessage |
GetBlockedProfiles(IProfile)
Gets a user's block list.
Declaration
IEnumerable<IProfile> GetBlockedProfiles(IProfile user)
Parameters
Type | Name | Description |
---|---|---|
IProfile | user | The user whose block list should be pulled. |
Returns
Type | Description |
---|---|
IEnumerable<IProfile> | An iteration of every user blocked by the given user. |
GetDirectConversations(IProfile)
Gets all direct message threads in which the given user is a member.
Declaration
IEnumerable<IDirectConversation> GetDirectConversations(IProfile user)
Parameters
Type | Name | Description |
---|---|---|
IProfile | user | The user whose direct message list should be pulled. |
Returns
Type | Description |
---|---|
IEnumerable<IDirectConversation> | An iteration of each direct message thread this user has access to. |
GetFollowers(IProfile)
Gets a list of every user who follows the given user on social media.
Declaration
IEnumerable<IProfile> GetFollowers(IProfile user)
Parameters
Type | Name | Description |
---|---|---|
IProfile | user | The user whose follower list should be pulled. |
Returns
Type | Description |
---|---|
IEnumerable<IProfile> | An iteration of the user's followers. |
GetFollowing(IProfile)
Gets a list of every user being followed by a given user on social media.
Declaration
IEnumerable<IProfile> GetFollowing(IProfile user)
Parameters
Type | Name | Description |
---|---|---|
IProfile | user | The user whose following list should be pulled. |
Returns
Type | Description |
---|---|
IEnumerable<IProfile> | An iteration of every user being followed. |
GetFriends(IProfile)
Gets a list of all friends of a user.
Declaration
IEnumerable<IProfile> GetFriends(IProfile user)
Parameters
Type | Name | Description |
---|---|---|
IProfile | user | The user whose friends list should be pulled. |
Returns
Type | Description |
---|---|
IEnumerable<IProfile> | An iteration of IProfile instances representing each friend. |
GetGuilds()
Gets a list of all chatservers.
Declaration
IGuildList GetGuilds()
Returns
Type | Description |
---|---|
IGuildList | An iteration of all chat servers in the world. |
GetNarrativeProfile(string)
Find, or create, a social profile with the given narrative identifier.
Declaration
IProfile GetNarrativeProfile(string narrativeIdentifier)
Parameters
Type | Name | Description |
---|---|---|
string | narrativeIdentifier | The profile's narrative identifier. |
Returns
Type | Description |
---|---|
IProfile | A IProfile instance representing the narrative user. |
Remarks
Narrative identifiers are arbitrary strings of human-readable text that are easy to remember and consistently map to a given in-game object used throughout the game's narrative playthrough.
Unlike world instance IDs (defined as numeric ObjectId values), narrative identifiers do not change across save files or playthroughs. This means that mods can use narrative identifiers to take control of objects in the base game.
Specifically when dealing with social profiles, passing a value of player
should always return the PlayerProfile property.
Blank values, and whitespace, are not valid as narrative identifiers.
Learn more about narrative identifiers: https://man.sociallydistantgame.com/docs/story-scripting/narrative-identifiers.html
GetNarrativeThread(NarrativeThread, string, string, bool, params string[])
Intentionally undocumented. Pending API changes.
Declaration
INarrativeThread? GetNarrativeThread(NarrativeThread threadType, string guildId, string channelId, bool create, params string[] nonPlayerActors)
Parameters
Type | Name | Description |
---|---|---|
NarrativeThread | threadType | |
string | guildId | |
string | channelId | |
bool | create | |
string[] | nonPlayerActors |
Returns
Type | Description |
---|---|
INarrativeThread |
GetProfileById(ObjectId)
Find a user profile by its world ObjectId value.
Declaration
IProfile GetProfileById(ObjectId id)
Parameters
Type | Name | Description |
---|---|---|
ObjectId | id | The unique world ID of the user. |
Returns
Type | Description |
---|---|
IProfile | An instance of IProfile representing the user. |
Remarks
<p>
Passing <xref href="SociallyDistant.Core.Core.ObjectId.Invalid" data-throw-if-not-resolved="false"></xref> will result in the player's profile being returned, since it is not
possible for any NPC to be assigned this ID. This is because the player's social orofile isn't defined in
the world's social profile table.
</p>
<p>
On the other hand, passing a valid <xref href="SociallyDistant.Core.Core.ObjectId" data-throw-if-not-resolved="false"></xref> value that just doesn't exist as an NPC,
will crash the game. That is, unless someone would like to fix this API so it uses nullable reference
types.
</p>
See Also
GetSocialPosts(IProfile)
Gets all social posts created by a given user.
Declaration
IEnumerable<IUserMessage> GetSocialPosts(IProfile profile)
Parameters
Type | Name | Description |
---|---|---|
IProfile | profile | The user whose social post list should be pulled. |
Returns
Type | Description |
---|---|
IEnumerable<IUserMessage> | An iteration of IUserMessage instances representing each social post made by the user, in chronological order, most recent first. |
GetTimeline(IProfile)
Gets all social posts in a user's chronological timeline, including their own posts and that of their followers, as well as random ads for in-game companies.
Declaration
IEnumerable<IUserMessage> GetTimeline(IProfile profile)
Parameters
Type | Name | Description |
---|---|---|
IProfile | profile | The user whose timeline is being viewed. |
Returns
Type | Description |
---|---|
IEnumerable<IUserMessage> | An iteration of every post in the user's timeline. |