Class SQLitePlayerDatabase
Singleton. Interfaces for interacting with the database. Any SQL queries/updates should be made here. New functionality should be exposed via new functions here.
Maintains a list of currently online players and DB connection.
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: LlamaSoftware.Chat
Assembly: LlamaSoftware.Chat.dll
Syntax
public class SQLitePlayerDatabase : AbstractPlayerDatabase<SQLitePlayerDatabase>
Constructors
SQLitePlayerDatabase()
Do not call this directly. It will throw an exception AbstractPlayerDatabase(). Use Instance property instead instead Initializes database connection and adds a shutdown listener to disconnect.
Declaration
public SQLitePlayerDatabase()
Fields
Connection
Connection to the db. Created on instance creation. Automatically closed and disposed on app exit.
Declaration
protected SqliteConnection Connection
Field Value
| Type | Description |
|---|---|
| Mono.Data.Sqlite.SqliteConnection |
PathToDatabase
Path to the database. Update this if you move the db file.
Declaration
protected readonly string PathToDatabase
Field Value
| Type | Description |
|---|---|
| System.String |
Methods
DoSavePlayerData(Object)
Saves player data into the database.
Declaration
protected virtual void DoSavePlayerData(object state)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | state | Player fully instantiated |
FindBlockedPlayersFor(String)
Declaration
public override List<Player> FindBlockedPlayersFor(string PlayerId)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | PlayerId |
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.List<Player> |
Overrides
LlamaSoftware.Chat.AbstractPlayerDatabase<LlamaSoftware.Chat.SQLitePlayerDatabase>.FindBlockedPlayersFor(System.String)
FindFriendsFor(String)
Declaration
public override List<Player> FindFriendsFor(string PlayerId)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | PlayerId |
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.List<Player> |
Overrides
LlamaSoftware.Chat.AbstractPlayerDatabase<LlamaSoftware.Chat.SQLitePlayerDatabase>.FindFriendsFor(System.String)
FindPlayersWhoAreBlockedBy(String)
Declaration
public override List<Player> FindPlayersWhoAreBlockedBy(string PlayerId)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | PlayerId |
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.List<Player> |
Overrides
LlamaSoftware.Chat.AbstractPlayerDatabase<LlamaSoftware.Chat.SQLitePlayerDatabase>.FindPlayersWhoAreBlockedBy(System.String)
FindPlayersWhoHaveFriend(String)
Declaration
public override List<Player> FindPlayersWhoHaveFriend(string PlayerId)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | PlayerId |
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.List<Player> |
Overrides
LlamaSoftware.Chat.AbstractPlayerDatabase<LlamaSoftware.Chat.SQLitePlayerDatabase>.FindPlayersWhoHaveFriend(System.String)
FindSubscribedChannelsFor(String)
Declaration
public override List<ChatChannel> FindSubscribedChannelsFor(string PlayerId)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | PlayerId |
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.List<ChatChannel> |
Overrides
LlamaSoftware.Chat.AbstractPlayerDatabase<LlamaSoftware.Chat.SQLitePlayerDatabase>.FindSubscribedChannelsFor(System.String)
SavePlayerChatSettings(Player)
Calls DoSavePlayerData(Object) on a background thread.
Declaration
public override void SavePlayerChatSettings(Player Player)
Parameters
| Type | Name | Description |
|---|---|---|
| Player | Player | Player to save data for. |
Overrides
LlamaSoftware.Chat.AbstractPlayerDatabase<LlamaSoftware.Chat.SQLitePlayerDatabase>.SavePlayerChatSettings(LlamaSoftware.Chat.Model.Player)