Add libraries for EntityFramework

Stats plugin work
Allow plugins to dynamically add EF classes to the context
This commit is contained in:
RaidMax 2018-02-06 23:19:06 -06:00
parent 8ce8db5f30
commit 0b62cba52a
81 changed files with 113748 additions and 802 deletions

View File

@ -358,13 +358,11 @@ copy /Y "$(SolutionDir)_customcallbacks.gsc" "$(SolutionDir)BUILD\userraw\script
copy /Y "$(TargetDir)$(TargetName).exe" "$(SolutionDir)BUILD"
copy /Y "$(TargetDir)IW4MAdmin.exe.config" "$(SolutionDir)BUILD"
copy /Y "$(ProjectDir)lib\Kayak.dll" "$(SolutionDir)BUILD\lib"
xcopy /Y /I /E "$(SolutionDir)SharedLibrary\$(OutDir)*" "$(TargetDir)Lib"
xcopy /Y /I /E "$(SolutionDir)SharedLibrary\$(OutDir)*" "$(SolutionDir)Admin\Lib"
xcopy /Y /I /E "$(ProjectDir)webfront\*" "$(SolutionDir)BUILD\Webfront"
xcopy /Y /I /E "$(SolutionDir)Admin\Config\*" "$(SolutionDir)BUILD\Config"
if $(ConfigurationName) == Release-Nightly powershell.exe -file "$(SolutionDir)DEPLOY\publish_nightly.ps1" 1.6
if $(ConfigurationName) == Release-Stable powershell.exe -file "$(SolutionDir)DEPLOY\publish_stable.ps1" 1.6
</PostBuildEvent>
</PropertyGroup>

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

View File

@ -0,0 +1,891 @@
<?xml version="1.0"?>
<doc>
<assembly>
<name>EntityFramework.SqlServerCompact</name>
</assembly>
<members>
<member name="T:System.Data.Entity.SqlServerCompact.SqlCeMigrationSqlGenerator">
<summary>
Provider to convert provider agnostic migration operations into SQL commands
that can be run against a Microsoft SQL Server Compact Edition database.
</summary>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeMigrationSqlGenerator.Generate(System.Collections.Generic.IEnumerable{System.Data.Entity.Migrations.Model.MigrationOperation},System.String)">
<summary>
Converts a set of migration operations into Microsoft SQL Server specific SQL.
</summary>
<param name="migrationOperations"> The operations to be converted. </param>
<param name="providerManifestToken"> Token representing the version of SQL Server being targeted (i.e. "2005", "2008"). </param>
<returns> A list of SQL statements to be executed to perform the migration operations. </returns>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeMigrationSqlGenerator.Generate(System.Data.Entity.Migrations.Model.UpdateDatabaseOperation)">
<summary>
Generates the specified update database operation which represents applying a series of migrations.
The generated script is idempotent, meaning it contains conditional logic to check if individual migrations
have already been applied and only apply the pending ones.
</summary>
<param name="updateDatabaseOperation">The update database operation.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeMigrationSqlGenerator.Generate(System.Data.Entity.Migrations.Model.MigrationOperation)">
<summary>
Generates SQL for a <see cref="T:System.Data.Entity.Migrations.Model.MigrationOperation"/>.
Allows derived providers to handle additional operation types.
Generated SQL should be added using the Statement method.
</summary>
<param name="migrationOperation"> The operation to produce SQL for. </param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeMigrationSqlGenerator.CreateConnection">
<summary>
Creates an empty connection for the current provider.
Allows derived providers to use connection other than <see cref="T:System.Data.SqlClient.SqlConnection"/>.
</summary>
<returns> An empty connection for the current provider. </returns>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeMigrationSqlGenerator.Generate(System.Data.Entity.Migrations.Model.CreateProcedureOperation)">
<summary>
Generates the specified create procedure operation.
</summary>
<param name="createProcedureOperation">The create procedure operation.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeMigrationSqlGenerator.Generate(System.Data.Entity.Migrations.Model.AlterProcedureOperation)">
<summary>
Generates the specified alter procedure operation.
</summary>
<param name="alterProcedureOperation">The alter procedure operation.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeMigrationSqlGenerator.Generate(System.Data.Entity.Migrations.Model.DropProcedureOperation)">
<summary>
Generates the specified drop procedure operation.
</summary>
<param name="dropProcedureOperation">The drop procedure operation.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeMigrationSqlGenerator.Generate(System.Data.Entity.Migrations.Model.CreateTableOperation)">
<summary>
Generates SQL for a <see cref="T:System.Data.Entity.Migrations.Model.CreateTableOperation"/>.
Generated SQL should be added using the Statement method.
</summary>
<param name="createTableOperation"> The operation to produce SQL for. </param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeMigrationSqlGenerator.Generate(System.Data.Entity.Migrations.Model.AlterTableOperation)">
<summary>
Override this method to generate SQL when the definition of a table or its attributes are changed.
The default implementation of this method does nothing.
</summary>
<param name="alterTableOperation"> The operation describing changes to the table. </param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeMigrationSqlGenerator.GenerateMakeSystemTable(System.Data.Entity.Migrations.Model.CreateTableOperation,System.Data.Entity.Migrations.Utilities.IndentedTextWriter)">
<summary>
Generates SQL to mark a table as a system table.
Generated SQL should be added using the Statement method.
</summary>
<param name="createTableOperation"> The table to mark as a system table. </param>
<param name="writer"> The <see cref="T:System.Data.Entity.Migrations.Utilities.IndentedTextWriter"/> to write the generated SQL to. </param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeMigrationSqlGenerator.Generate(System.Data.Entity.Migrations.Model.AddForeignKeyOperation)">
<summary>
Generates SQL for a <see cref="T:System.Data.Entity.Migrations.Model.AddForeignKeyOperation"/>.
Generated SQL should be added using the Statement method.
</summary>
<param name="addForeignKeyOperation"> The operation to produce SQL for. </param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeMigrationSqlGenerator.Generate(System.Data.Entity.Migrations.Model.DropForeignKeyOperation)">
<summary>
Generates SQL for a <see cref="T:System.Data.Entity.Migrations.Model.DropForeignKeyOperation"/>.
Generated SQL should be added using the Statement method.
</summary>
<param name="dropForeignKeyOperation"> The operation to produce SQL for. </param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeMigrationSqlGenerator.Generate(System.Data.Entity.Migrations.Model.CreateIndexOperation)">
<summary>
Generates SQL for a <see cref="T:System.Data.Entity.Migrations.Model.CreateIndexOperation"/>.
Generated SQL should be added using the Statement method.
</summary>
<param name="createIndexOperation"> The operation to produce SQL for. </param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeMigrationSqlGenerator.Generate(System.Data.Entity.Migrations.Model.DropIndexOperation)">
<summary>
Generates SQL for a <see cref="T:System.Data.Entity.Migrations.Model.DropIndexOperation"/>.
Generated SQL should be added using the Statement method.
</summary>
<param name="dropIndexOperation"> The operation to produce SQL for. </param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeMigrationSqlGenerator.Generate(System.Data.Entity.Migrations.Model.AddPrimaryKeyOperation)">
<summary>
Generates SQL for a <see cref="T:System.Data.Entity.Migrations.Model.AddPrimaryKeyOperation"/>.
Generated SQL should be added using the Statement method.
</summary>
<param name="addPrimaryKeyOperation"> The operation to produce SQL for. </param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeMigrationSqlGenerator.Generate(System.Data.Entity.Migrations.Model.DropPrimaryKeyOperation)">
<summary>
Generates SQL for a <see cref="T:System.Data.Entity.Migrations.Model.DropPrimaryKeyOperation"/>.
Generated SQL should be added using the Statement method.
</summary>
<param name="dropPrimaryKeyOperation"> The operation to produce SQL for. </param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeMigrationSqlGenerator.Generate(System.Data.Entity.Migrations.Model.AddColumnOperation)">
<summary>
Generates SQL for a <see cref="T:System.Data.Entity.Migrations.Model.AddColumnOperation"/>.
Generated SQL should be added using the Statement method.
</summary>
<param name="addColumnOperation"> The operation to produce SQL for. </param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeMigrationSqlGenerator.Generate(System.Data.Entity.Migrations.Model.DropColumnOperation)">
<summary>
Generates SQL for a <see cref="T:System.Data.Entity.Migrations.Model.DropColumnOperation"/>.
Generated SQL should be added using the Statement method.
</summary>
<param name="dropColumnOperation"> The operation to produce SQL for. </param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeMigrationSqlGenerator.Generate(System.Data.Entity.Migrations.Model.AlterColumnOperation)">
<summary>
Generates SQL for a <see cref="T:System.Data.Entity.Migrations.Model.AlterColumnOperation"/>.
Generated SQL should be added using the Statement method.
</summary>
<param name="alterColumnOperation"> The operation to produce SQL for. </param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeMigrationSqlGenerator.Generate(System.Data.Entity.Migrations.Model.DropTableOperation)">
<summary>
Generates SQL for a <see cref="T:System.Data.Entity.Migrations.Model.DropTableOperation"/>.
Generated SQL should be added using the Statement method.
</summary>
<param name="dropTableOperation"> The operation to produce SQL for. </param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeMigrationSqlGenerator.Generate(System.Data.Entity.Migrations.Model.SqlOperation)">
<summary>
Generates SQL for a <see cref="T:System.Data.Entity.Migrations.Model.SqlOperation"/>.
Generated SQL should be added using the Statement or StatementBatch methods.
</summary>
<param name="sqlOperation"> The operation to produce SQL for. </param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeMigrationSqlGenerator.Generate(System.Data.Entity.Migrations.Model.RenameColumnOperation)">
<summary>
Generates SQL for a <see cref="T:System.Data.Entity.Migrations.Model.RenameColumnOperation"/>.
Generated SQL should be added using the Statement method.
</summary>
<param name="renameColumnOperation"> The operation to produce SQL for. </param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeMigrationSqlGenerator.Generate(System.Data.Entity.Migrations.Model.RenameIndexOperation)">
<summary>
Generates SQL for a <see cref="T:System.Data.Entity.Migrations.Model.RenameIndexOperation"/>.
Generated SQL should be added using the Statement method.
</summary>
<param name="renameIndexOperation"> The operation to produce SQL for. </param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeMigrationSqlGenerator.Generate(System.Data.Entity.Migrations.Model.RenameTableOperation)">
<summary>
Generates SQL for a <see cref="T:System.Data.Entity.Migrations.Model.RenameTableOperation"/>.
Generated SQL should be added using the Statement method.
</summary>
<param name="renameTableOperation"> The operation to produce SQL for. </param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeMigrationSqlGenerator.Generate(System.Data.Entity.Migrations.Model.RenameProcedureOperation)">
<summary>
Generates the specified rename procedure operation.
</summary>
<param name="renameProcedureOperation">The rename procedure operation.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeMigrationSqlGenerator.Generate(System.Data.Entity.Migrations.Model.MoveProcedureOperation)">
<summary>
Generates the specified move procedure operation.
</summary>
<param name="moveProcedureOperation">The move procedure operation.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeMigrationSqlGenerator.Generate(System.Data.Entity.Migrations.Model.MoveTableOperation)">
<summary>
Generates SQL for a <see cref="T:System.Data.Entity.Migrations.Model.MoveTableOperation"/>.
Generated SQL should be added using the Statement method.
</summary>
<param name="moveTableOperation"> The operation to produce SQL for. </param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeMigrationSqlGenerator.Generate(System.Data.Entity.Migrations.Model.ColumnModel,System.Data.Entity.Migrations.Utilities.IndentedTextWriter)">
<summary>
Generates SQL for the given column model. This method is called by other methods that
process columns and can be overridden to change the SQL generated.
</summary>
<param name="column">The column for which SQL is being generated.</param>
<param name="writer">The writer to which generated SQL should be written.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeMigrationSqlGenerator.Generate(System.Data.Entity.Migrations.Model.HistoryOperation)">
<summary>
Generates SQL for a <see cref="T:System.Data.Entity.Migrations.Model.HistoryOperation"/>.
Generated SQL should be added using the Statement method.
</summary>
<param name="historyOperation"> The operation to produce SQL for. </param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeMigrationSqlGenerator.Generate(System.Byte[])">
<summary>
Generates SQL to specify a constant byte[] default value being set on a column.
This method just generates the actual value, not the SQL to set the default value.
</summary>
<param name="defaultValue"> The value to be set. </param>
<returns> SQL representing the default value. </returns>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeMigrationSqlGenerator.Generate(System.Boolean)">
<summary>
Generates SQL to specify a constant bool default value being set on a column.
This method just generates the actual value, not the SQL to set the default value.
</summary>
<param name="defaultValue"> The value to be set. </param>
<returns> SQL representing the default value. </returns>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeMigrationSqlGenerator.Generate(System.DateTime)">
<summary>
Generates SQL to specify a constant DateTime default value being set on a column.
This method just generates the actual value, not the SQL to set the default value.
</summary>
<param name="defaultValue"> The value to be set. </param>
<returns> SQL representing the default value. </returns>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeMigrationSqlGenerator.Generate(System.DateTimeOffset)">
<summary>
Generates SQL to specify a constant DateTimeOffset default value being set on a column.
This method just generates the actual value, not the SQL to set the default value.
</summary>
<param name="defaultValue"> The value to be set. </param>
<returns> SQL representing the default value. </returns>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeMigrationSqlGenerator.Generate(System.Guid)">
<summary>
Generates SQL to specify a constant Guid default value being set on a column.
This method just generates the actual value, not the SQL to set the default value.
</summary>
<param name="defaultValue"> The value to be set. </param>
<returns> SQL representing the default value. </returns>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeMigrationSqlGenerator.Generate(System.String)">
<summary>
Generates SQL to specify a constant string default value being set on a column.
This method just generates the actual value, not the SQL to set the default value.
</summary>
<param name="defaultValue"> The value to be set. </param>
<returns> SQL representing the default value. </returns>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeMigrationSqlGenerator.Generate(System.TimeSpan)">
<summary>
Generates SQL to specify a constant TimeSpan default value being set on a column.
This method just generates the actual value, not the SQL to set the default value.
</summary>
<param name="defaultValue"> The value to be set. </param>
<returns> SQL representing the default value. </returns>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeMigrationSqlGenerator.Generate(System.Data.Entity.Spatial.DbGeography)">
<summary>
Generates SQL to specify a constant geogrpahy default value being set on a column.
This method just generates the actual value, not the SQL to set the default value.
</summary>
<param name="defaultValue"> The value to be set. </param>
<returns> SQL representing the default value. </returns>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeMigrationSqlGenerator.Generate(System.Data.Entity.Spatial.DbGeometry)">
<summary>
Generates SQL to specify a constant geometry default value being set on a column.
This method just generates the actual value, not the SQL to set the default value.
</summary>
<param name="defaultValue"> The value to be set. </param>
<returns> SQL representing the default value. </returns>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeMigrationSqlGenerator.Generate(System.Object)">
<summary>
Generates SQL to specify a constant default value being set on a column.
This method just generates the actual value, not the SQL to set the default value.
</summary>
<param name="defaultValue"> The value to be set. </param>
<returns> SQL representing the default value. </returns>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeMigrationSqlGenerator.BuildColumnType(System.Data.Entity.Migrations.Model.ColumnModel)">
<summary>
Generates SQL to specify the data type of a column.
This method just generates the actual type, not the SQL to create the column.
</summary>
<param name="columnModel"> The definition of the column. </param>
<returns> SQL representing the data type. </returns>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeMigrationSqlGenerator.Name(System.String)">
<summary>
Generates a quoted name. The supplied name may or may not contain the schema.
</summary>
<param name="name"> The name to be quoted. </param>
<returns> The quoted name. </returns>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeMigrationSqlGenerator.Quote(System.String)">
<summary>
Quotes an identifier for SQL Server.
</summary>
<param name="identifier"> The identifier to be quoted. </param>
<returns> The quoted identifier. </returns>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeMigrationSqlGenerator.Statement(System.String,System.Boolean)">
<summary>
Adds a new Statement to be executed against the database.
</summary>
<param name="sql"> The statement to be executed. </param>
<param name="suppressTransaction"> Gets or sets a value indicating whether this statement should be performed outside of the transaction scope that is used to make the migration process transactional. If set to true, this operation will not be rolled back if the migration process fails. </param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeMigrationSqlGenerator.Writer">
<summary>
Gets a new <see cref="T:System.Data.Entity.Migrations.Utilities.IndentedTextWriter"/> that can be used to build SQL.
This is just a helper method to create a writer. Writing to the writer will
not cause SQL to be registered for execution. You must pass the generated
SQL to the Statement method.
</summary>
<returns> An empty text writer to use for SQL generation. </returns>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeMigrationSqlGenerator.Statement(System.Data.Entity.Migrations.Utilities.IndentedTextWriter)">
<summary>
Adds a new Statement to be executed against the database.
</summary>
<param name="writer"> The writer containing the SQL to be executed. </param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeMigrationSqlGenerator.StatementBatch(System.String,System.Boolean)">
<summary>
Breaks string into one or more statements, handling T-SQL utility statements as necessary.
</summary>
<param name="sqlBatch">The SQL to split into one ore more statements to be executed.</param>
<param name="suppressTransaction"> Gets or sets a value indicating whether this statement should be performed outside of the transaction scope that is used to make the migration process transactional. If set to true, this operation will not be rolled back if the migration process fails. </param>
</member>
<member name="P:System.Data.Entity.SqlServerCompact.SqlCeMigrationSqlGenerator.GuidColumnDefault">
<summary>
Returns the column default value to use for store-generated GUID columns when
no default value is explicitly specified in the migration.
Always returns newid() for SQL Compact.
</summary>
<value>The string newid().</value>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeProviderManifest.SupportsParameterOptimizationInSchemaQueries">
<summary>
Indicates if the provider supports the parameter optimization described in EntityFramework6 GitHub issue #195.
</summary>
<returns><c>True</c> since this provider supports the parameter optimization.</returns>
</member>
<member name="T:System.Data.Entity.SqlServerCompact.SqlCeProviderServices">
<summary>
The ProviderServices object for the Sql CE provider
</summary>
<remarks>
Note that instance of this type also resolves additional provider services for Microsoft SQL Server Compact Edition
when this type is registered as an EF provider either using an entry in the application's config file or through
code-based registration in <see cref="T:System.Data.Entity.DbConfiguration"/>.
The services resolved are:
Requests for <see cref="T:System.Data.Entity.Infrastructure.IDbConnectionFactory"/> are resolved to a Singleton instance of
<see cref="T:System.Data.Entity.Infrastructure.SqlCeConnectionFactory"/> to create connections to SQL Compact by default.
Requests for <see cref="T:System.Data.Entity.Migrations.Sql.MigrationSqlGenerator"/> for the invariant name "System.Data.SqlServerCe.4.0" are
resolved to <see cref="T:System.Data.Entity.SqlServerCompact.SqlCeMigrationSqlGenerator"/> instances to provide default Migrations SQL
generation for SQL Compact.
</remarks>
</member>
<member name="F:System.Data.Entity.SqlServerCompact.SqlCeProviderServices.ProviderInvariantName">
<summary>
This is the well-known string using in configuration files and code-based configuration as
the "provider invariant name" used to specify Microsoft SQL Server Compact Edition 4.0 for
ADO.NET and Entity Framework provider services.
</summary>
</member>
<member name="F:System.Data.Entity.SqlServerCompact.SqlCeProviderServices.Instance">
<summary>
Singleton object;
</summary>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeProviderServices.DbCreateDatabaseScript(System.String,System.Data.Entity.Core.Metadata.Edm.StoreItemCollection)">
<summary>
API for generating script for creating schema objects from the Store Item Collection.
</summary>
<param name="providerManifestToken"> Provider manifest </param>
<param name="storeItemCollection"> Store items </param>
<returns> T-SQL script for generating schema objects. </returns>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeProviderServices.DbDatabaseExists(System.Data.Common.DbConnection,System.Nullable{System.Int32},System.Data.Entity.Core.Metadata.Edm.StoreItemCollection)">
<summary>
API for checkin whether database exists or not.
This will internally only check whether the file that the connection points to exists or not.
Note: In case of SQLCE, timeout and storeItemCollection parameters are ignored.
</summary>
<param name="connection"> Connection </param>
<param name="timeOut"> Timeout for internal commands. </param>
<param name="storeItemCollection"> Item Collection. </param>
<returns> Bool indicating whether database exists or not. </returns>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeProviderServices.DbDatabaseExists(System.Data.Common.DbConnection,System.Nullable{System.Int32},System.Lazy{System.Data.Entity.Core.Metadata.Edm.StoreItemCollection})">
<summary>
API for checkin whether database exists or not.
This will internally only check whether the file that the connection points to exists or not.
Note: In case of SQLCE, timeout and storeItemCollection parameters are ignored.
</summary>
<param name="connection"> Connection </param>
<param name="timeOut"> Timeout for internal commands. </param>
<param name="storeItemCollection"> Item Collection. </param>
<returns> Bool indicating whether database exists or not. </returns>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeProviderServices.DbDeleteDatabase(System.Data.Common.DbConnection,System.Nullable{System.Int32},System.Data.Entity.Core.Metadata.Edm.StoreItemCollection)">
<summary>
API for deleting the database.
In SQLCE case, this will translate to File.Delete() call.
Note: Timeout and storeItemCollection parameters are ignored.
</summary>
<param name="connection"> Connection </param>
<param name="timeOut"> Timeout for internal commands. </param>
<param name="storeItemCollection"> Item Collection. </param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeProviderServices.DbCreateDatabase(System.Data.Common.DbConnection,System.Nullable{System.Int32},System.Data.Entity.Core.Metadata.Edm.StoreItemCollection)">
<summary>
API for creating the databse and schema objects given a StoreItemCollection.
This will do following things:
1. Create a new database using SqlCeEngine.CreateDatabase().
2. Generate scripts for creating schema objects.
3. Execute the scrip generated in step2.
</summary>
<param name="connection"> Connection </param>
<param name="timeOut"> Timeout for internal commands </param>
<param name="storeItemCollection"> Store Item Collection </param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeProviderServices.RegisterInfoMessageHandler(System.Data.Common.DbConnection,System.Action{System.String})">
<summary>
Registers a handler to process non-error messages coming from the database provider.
</summary>
<param name="connection">The connection to receive information for.</param>
<param name="handler">The handler to process messages.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeProviderServices.CreateDbCommandDefinition(System.Data.Entity.Core.Common.DbProviderManifest,System.Data.Entity.Core.Common.CommandTrees.DbCommandTree)">
<summary>
Create a Command Definition object, given the connection and command tree
</summary>
<param name="providerManifest"> provider manifest that was determined from metadata </param>
<param name="commandTree"> command tree for the statement </param>
<returns> an executable command definition object </returns>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeProviderServices.GetDbProviderManifestToken(System.Data.Common.DbConnection)">
<summary>
Returns provider manifest token for a given connection.
</summary>
<param name="connection">Connection to find manifest token from.</param>
<returns>The provider manifest token for the specified connection.</returns>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeProviderServices.GetDbProviderManifest(System.String)">
<summary>
Returns the provider manifest by using the specified version information.
</summary>
<returns> The provider manifest by using the specified version information. </returns>
<param name="versionHint"> The token information associated with the provider manifest. </param>
</member>
<member name="T:System.Data.Entity.SqlServerCompact.SqlCeFunctions">
<summary>
Contains function stubs that expose SqlServerCe methods in Linq to Entities.
</summary>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.CharIndex(System.String,System.String)">
<summary>Returns the starting position of one expression found within another expression.</summary>
<returns>The starting position of toFind if it is found in toSearch .</returns>
<param name="toFind">The string expression to be found.</param>
<param name="toSearch">The string expression to be searched.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.CharIndex(System.Byte[],System.Byte[])">
<summary>Returns the starting position of one expression found within another expression.</summary>
<returns>The starting position of toFind if it is found in toSearch .</returns>
<param name="toFind">The string expression to be found.</param>
<param name="toSearch">The string expression to be searched.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.CharIndex(System.String,System.String,System.Nullable{System.Int32})">
<summary>Returns the starting position of one expression found within another expression.</summary>
<returns>The starting position of toFind if it is found in toSearch .</returns>
<param name="toFind">The string expression to be found.</param>
<param name="toSearch">The string expression to be searched.</param>
<param name="startLocation">The character position in toSearch where searching begins.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.CharIndex(System.Byte[],System.Byte[],System.Nullable{System.Int32})">
<summary>Returns the starting position of one expression found within another expression.</summary>
<returns>The starting position of toFind if it is found in toSearch .</returns>
<param name="toFind">The string expression to be found.</param>
<param name="toSearch">The string expression to be searched.</param>
<param name="startLocation">The character position in toSearch where searching begins.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.CharIndex(System.String,System.String,System.Nullable{System.Int64})">
<summary>Returns the starting position of one expression found within another expression.</summary>
<returns>
A <see cref="T:System.Nullable`1" /> of <see cref="T:System.Int64" /> value that is the starting position of toFind if it is found in toSearch .
</returns>
<param name="toFind">The string expression to be found.</param>
<param name="toSearch">The string expression to be searched.</param>
<param name="startLocation">The character position in toSearch where searching begins.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.CharIndex(System.Byte[],System.Byte[],System.Nullable{System.Int64})">
<summary>Returns the starting position of one expression found within another expression.</summary>
<returns>The starting position of toFind if it is found in toSearch .</returns>
<param name="toFind">The string expression to be found.</param>
<param name="toSearch">The string expression to be searched.</param>
<param name="startLocation">The character position in toSearch where searching begins.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.NChar(System.Nullable{System.Int32})">
<summary>Returns the Unicode character with the specified integer code, as defined by the Unicode standard.</summary>
<returns>The character that corresponds to the input character code.</returns>
<param name="arg">A character code.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.PatIndex(System.String,System.String)">
<summary>Returns the starting position of the first occurrence of a pattern in a specified expression, or zeros if the pattern is not found, on all valid text and character data types.</summary>
<returns>The starting character position where the string pattern was found.</returns>
<param name="stringPattern">A string pattern to search for.</param>
<param name="target">The string to search.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.Replicate(System.String,System.Nullable{System.Int32})">
<summary>Repeats a string value a specified number of times.</summary>
<returns>The target string, repeated the number of times specified by count .</returns>
<param name="target">A valid string.</param>
<param name="count">The value that specifies how many time to repeat target .</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.Space(System.Nullable{System.Int32})">
<summary>Returns a string of repeated spaces.</summary>
<returns>A string that consists of the specified number of spaces.</returns>
<param name="arg1">The number of spaces. If negative, a null string is returned.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.StringConvert(System.Nullable{System.Double})">
<summary>Returns character data converted from numeric data.</summary>
<returns>The numeric input expression converted to a string.</returns>
<param name="number">A numeric expression.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.StringConvert(System.Nullable{System.Decimal})">
<summary>Returns character data converted from numeric data.</summary>
<returns>The input expression converted to a string.</returns>
<param name="number">A numeric expression.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.StringConvert(System.Nullable{System.Double},System.Nullable{System.Int32})">
<summary>Returns character data converted from numeric data.</summary>
<returns>The numeric input expression converted to a string.</returns>
<param name="number">A numeric expression.</param>
<param name="length">The total length of the string. This includes decimal point, sign, digits, and spaces. The default is 10.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.StringConvert(System.Nullable{System.Decimal},System.Nullable{System.Int32})">
<summary>Returns character data converted from numeric data.</summary>
<returns>The input expression converted to a string.</returns>
<param name="number">A numeric expression.</param>
<param name="length">The total length of the string. This includes decimal point, sign, digits, and spaces. The default is 10.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.StringConvert(System.Nullable{System.Double},System.Nullable{System.Int32},System.Nullable{System.Int32})">
<summary>Returns character data converted from numeric data.</summary>
<returns>The numeric input expression converted to a string.</returns>
<param name="number">A numeric expression.</param>
<param name="length">The total length of the string. This includes decimal point, sign, digits, and spaces. The default is 10.</param>
<param name="decimalArg">The number of places to the right of the decimal point. decimal must be less than or equal to 16. If decimal is more than 16 then the result is truncated to sixteen places to the right of the decimal point.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.StringConvert(System.Nullable{System.Decimal},System.Nullable{System.Int32},System.Nullable{System.Int32})">
<summary>Returns character data converted from numeric data.</summary>
<returns>The input expression converted to a string.</returns>
<param name="number">A numeric expression.</param>
<param name="length">The total length of the string. This includes decimal point, sign, digits, and spaces. The default is 10.</param>
<param name="decimalArg">The number of places to the right of the decimal point. decimal must be less than or equal to 16. If decimal is more than 16 then the result is truncated to sixteen places to the right of the decimal point.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.Stuff(System.String,System.Nullable{System.Int32},System.Nullable{System.Int32},System.String)">
<summary>Inserts a string into another string. It deletes a specified length of characters in the target string at the start position and then inserts the second string into the target string at the start position.</summary>
<returns>A string consisting of the two strings.</returns>
<param name="stringInput">The target string.</param>
<param name="start">The character position in stringinput where the replacement string is to be inserted.</param>
<param name="length">The number of characters to delete from stringInput . If length is longer than stringInput , deletion occurs up to the last character in stringReplacement .</param>
<param name="stringReplacement">The substring to be inserted into stringInput .</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.Unicode(System.String)">
<summary>Returns the integer value, as defined by the Unicode standard, for the first character of the input expression.</summary>
<returns>The character code for the first character in the input string.</returns>
<param name="arg">A valid string.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.Acos(System.Nullable{System.Double})">
<summary>A mathematical function that returns the angle, in radians, whose cosine is the specified numerical value. This angle is called the arccosine.</summary>
<returns>The angle, in radians, defined by the input cosine value.</returns>
<param name="arg1">The cosine of an angle.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.Acos(System.Nullable{System.Decimal})">
<summary>A mathematical function that returns the angle, in radians, whose cosine is the specified numerical value. This angle is called the arccosine.</summary>
<returns>An angle, measured in radians.</returns>
<param name="arg1">The cosine of an angle.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.Asin(System.Nullable{System.Double})">
<summary>A mathematical function that returns the angle, in radians, whose sine is the specified numerical value. This angle is called the arcsine.</summary>
<returns>An angle, measured in radians.</returns>
<param name="arg">The sine of an angle.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.Asin(System.Nullable{System.Decimal})">
<summary>A mathematical function that returns the angle, in radians, whose sine is the specified numerical value. This angle is called the arcsine.</summary>
<returns>An angle, measured in radians.</returns>
<param name="arg">The sine of an angle.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.Atan(System.Nullable{System.Double})">
<summary>A mathematical function that returns the angle, in radians, whose tangent is the specified numerical value. This angle is called the arctangent.</summary>
<returns>An angle, measured in radians.</returns>
<param name="arg">The tangent of an angle.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.Atan(System.Nullable{System.Decimal})">
<summary>A mathematical function that returns the angle, in radians, whose tangent is the specified numerical value. This angle is called the arctangent.</summary>
<returns>An angle, measured in radians.</returns>
<param name="arg">The tangent of an angle.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.Atan2(System.Nullable{System.Double},System.Nullable{System.Double})">
<summary>Returns the positive angle, in radians, between the positive x-axis and the ray from the origin through the point (x, y), where x and y are the two specified numerical values. The first parameter passed to the function is the y-value and the second parameter is the x-value.</summary>
<returns>An angle, measured in radians.</returns>
<param name="arg1">The y-coordinate of a point.</param>
<param name="arg2">The x-coordinate of a point.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.Atan2(System.Nullable{System.Decimal},System.Nullable{System.Decimal})">
<summary>Returns the positive angle, in radians, between the positive x-axis and the ray from the origin through the point (x, y), where x and y are the two specified numerical values. The first parameter passed to the function is the y-value and the second parameter is the x-value.</summary>
<returns>An angle, measured in radians.</returns>
<param name="arg1">The y-coordinate of a point.</param>
<param name="arg2">The x-coordinate of a point.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.Cos(System.Nullable{System.Double})">
<summary>Returns the trigonometric cosine of the specified angle, in radians, in the specified expression.</summary>
<returns>The trigonometric cosine of the specified angle.</returns>
<param name="arg">An angle, measured in radians.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.Cos(System.Nullable{System.Decimal})">
<summary>Returns the trigonometric cosine of the specified angle, in radians, in the specified expression.</summary>
<returns>The trigonometric cosine of the specified angle.</returns>
<param name="arg">An angle, measured in radians.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.Cot(System.Nullable{System.Double})">
<summary>A mathematical function that returns the trigonometric cotangent of the specified angle, in radians.</summary>
<returns>The trigonometric cotangent of the specified angle.</returns>
<param name="arg">An angle, measured in radians.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.Cot(System.Nullable{System.Decimal})">
<summary>A mathematical function that returns the trigonometric cotangent of the specified angle, in radians.</summary>
<returns>The trigonometric cotangent of the specified angle.</returns>
<param name="arg">An angle, measured in radians.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.Degrees(System.Nullable{System.Int32})">
<summary>Returns the corresponding angle in degrees for an angle specified in radians.</summary>
<returns>The specified angle converted to degrees.</returns>
<param name="arg1">An angle, measured in radians.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.Degrees(System.Nullable{System.Int64})">
<summary>Returns the corresponding angle in degrees for an angle specified in radians.</summary>
<returns>The specified angle converted to degrees.</returns>
<param name="arg1">An angle, measured in radians.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.Degrees(System.Nullable{System.Decimal})">
<summary>Returns the corresponding angle in degrees for an angle specified in radians.</summary>
<returns>The specified angle converted to degrees.</returns>
<param name="arg1">An angle, measured in radians.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.Degrees(System.Nullable{System.Double})">
<summary>Returns the corresponding angle in degrees for an angle specified in radians.</summary>
<returns>The specified angle converted to degrees.</returns>
<param name="arg1">An angle, measured in radians.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.Exp(System.Nullable{System.Double})">
<summary>Returns the exponential value of the specified float expression.</summary>
<returns>The constant e raised to the power of the input value.</returns>
<param name="arg">The input value.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.Exp(System.Nullable{System.Decimal})">
<summary>Returns the exponential value of the specified float expression.</summary>
<returns>The constant e raised to the power of the input value.</returns>
<param name="arg">The input value.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.Log(System.Nullable{System.Double})">
<summary>Returns the natural logarithm of the specified input value.</summary>
<returns>The natural logarithm of the input value.</returns>
<param name="arg">A numeric expression.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.Log(System.Nullable{System.Decimal})">
<summary>Returns the natural logarithm of the specified input value.</summary>
<returns>The natural logarithm of the input value.</returns>
<param name="arg">A numeric expression.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.Log10(System.Nullable{System.Double})">
<summary>Returns the base-10 logarithm of the specified input value.</summary>
<returns>The base-10 logarithm of the input value.</returns>
<param name="arg">A numeric expression.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.Log10(System.Nullable{System.Decimal})">
<summary>Returns the base-10 logarithm of the specified input value.</summary>
<returns>The base-10 logarithm of the input value.</returns>
<param name="arg">A numeric expression.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.Pi">
<summary>Returns the constant value of pi.</summary>
<returns>The numeric value of pi.</returns>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.Radians(System.Nullable{System.Int32})">
<summary>Returns the radian measure corresponding to the specified angle in degrees.</summary>
<returns>The radian measure of the specified angle.</returns>
<param name="arg">The angle, measured in degrees</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.Radians(System.Nullable{System.Int64})">
<summary>Returns the radian measure corresponding to the specified angle in degrees.</summary>
<returns>The radian measure of the specified angle.</returns>
<param name="arg">The angle, measured in degrees</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.Radians(System.Nullable{System.Decimal})">
<summary>Returns the radian measure corresponding to the specified angle in degrees.</summary>
<returns>The radian measure of the specified angle.</returns>
<param name="arg">The angle, measured in degrees.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.Radians(System.Nullable{System.Double})">
<summary>Returns the radian measure corresponding to the specified angle in degrees.</summary>
<returns>The radian measure of the specified angle.</returns>
<param name="arg">The angle, measured in degrees.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.Rand">
<summary>Returns a pseudo-random float value from 0 through 1, exclusive.</summary>
<returns>The pseudo-random value.</returns>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.Rand(System.Nullable{System.Int32})">
<summary>Returns a pseudo-random float value from 0 through 1, exclusive.</summary>
<returns>The pseudo-random value.</returns>
<param name="seed">The seed value. If seed is not specified, the SQL Server Database Engine assigns a seed value at random. For a specified seed value, the result returned is always the same.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.Sign(System.Nullable{System.Int32})">
<summary>Returns the positive (+1), zero (0), or negative (-1) sign of the specified expression.</summary>
<returns>The sign of the input expression.</returns>
<param name="arg">A numeric expression.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.Sign(System.Nullable{System.Int64})">
<summary>Returns the positive (+1), zero (0), or negative (-1) sign of the specified expression.</summary>
<returns>The sign of the input expression.</returns>
<param name="arg">A numeric expression.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.Sign(System.Nullable{System.Decimal})">
<summary>Returns the positive (+1), zero (0), or negative (-1) sign of the specified expression.</summary>
<returns>The sign of the input expression.</returns>
<param name="arg">A numeric expression.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.Sign(System.Nullable{System.Double})">
<summary>Returns the positive (+1), zero (0), or negative (-1) sign of the specified expression.</summary>
<returns>The sign of the input expression.</returns>
<param name="arg">A numeric expression.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.Sin(System.Nullable{System.Decimal})">
<summary>Returns the trigonometric sine of the specified angle.</summary>
<returns>The trigonometric sine of the input expression.</returns>
<param name="arg">An angle, measured in radians.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.Sin(System.Nullable{System.Double})">
<summary>Returns the trigonometric sine of the specified angle.</summary>
<returns>The trigonometric sine of the input expression.</returns>
<param name="arg">An angle, measured in radians.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.SquareRoot(System.Nullable{System.Double})">
<summary>Returns the square root of the specified number.</summary>
<returns>The square root of the input value.</returns>
<param name="arg">A numeric expression.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.SquareRoot(System.Nullable{System.Decimal})">
<summary>Returns the square root of the specified number.</summary>
<returns>The square root of the input value.</returns>
<param name="arg">A numeric expression.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.Tan(System.Nullable{System.Double})">
<summary>Returns the trigonometric tangent of the input expression.</summary>
<returns>The tangent of the input angle.</returns>
<param name="arg">An angle, measured in radians.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.Tan(System.Nullable{System.Decimal})">
<summary>Returns the trigonometric tangent of the input expression.</summary>
<returns>The tangent of the input angle.</returns>
<param name="arg">An angle, measured in radians.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.DateAdd(System.String,System.Nullable{System.Double},System.Nullable{System.DateTime})">
<summary>Returns a new datetime value based on adding an interval to the specified date.</summary>
<returns>The new date.</returns>
<param name="datePartArg">The part of the date to increment. </param>
<param name="number">The value used to increment a date by a specified amount.</param>
<param name="date">The date to increment.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.DateAdd(System.String,System.Nullable{System.Double},System.String)">
<summary>Returns a new datetime value based on adding an interval to the specified date.</summary>
<returns>
A <see cref="T:System.Nullable`1" /> of <see cref="T:System.DateTime" /> value that is the new date.
</returns>
<param name="datePartArg">The part of the date to increment.</param>
<param name="number">The value used to increment a date by a specified amount.</param>
<param name="date">The date to increment.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.DateDiff(System.String,System.Nullable{System.DateTime},System.Nullable{System.DateTime})">
<summary>Returns the count of the specified datepart boundaries crossed between the specified start date and end date.</summary>
<returns>The number of time intervals between the two dates.</returns>
<param name="datePartArg">The part of the date to calculate the differing number of time intervals.</param>
<param name="startDate">The first date.</param>
<param name="endDate">The second date.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.DateDiff(System.String,System.String,System.Nullable{System.DateTime})">
<summary>Returns the count of the specified datepart boundaries crossed between the specified start date and end date.</summary>
<returns>The number of time intervals between the two dates.</returns>
<param name="datePartArg">The part of the date to calculate the differing number of time intervals.</param>
<param name="startDate">The first date.</param>
<param name="endDate">The second date.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.DateDiff(System.String,System.Nullable{System.DateTime},System.String)">
<summary>Returns the count of the specified datepart boundaries crossed between the specified start date and end date.</summary>
<returns>The number of time intervals between the two dates.</returns>
<param name="datePartArg">The part of the date to calculate the differing number of time intervals.</param>
<param name="startDate">The first date.</param>
<param name="endDate">The second date.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.DateDiff(System.String,System.String,System.String)">
<summary>Returns the count of the specified datepart boundaries crossed between the specified start date and end date.</summary>
<returns>The number of time intervals between the two dates.</returns>
<param name="datePartArg">The part of the date to calculate the differing number of time intervals.</param>
<param name="startDate">The first date.</param>
<param name="endDate">The second date.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.DateName(System.String,System.Nullable{System.DateTime})">
<summary>Returns a character string that represents the specified datepart of the specified date.</summary>
<returns>The specified part of the specified date.</returns>
<param name="datePartArg">The part of the date to calculate the differing number of time intervals.</param>
<param name="date">The date.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.DateName(System.String,System.String)">
<summary>Returns a character string that represents the specified datepart of the specified date.</summary>
<returns>The specified part of the specified date.</returns>
<param name="datePartArg">The part of the date to calculate the differing number of time intervals.</param>
<param name="date">The date.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.DatePart(System.String,System.Nullable{System.DateTime})">
<summary>Returns an integer that represents the specified datepart of the specified date.</summary>
<returns>The the specified datepart of the specified date.</returns>
<param name="datePartArg">The part of the date to return the value.</param>
<param name="date">The date.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.DatePart(System.String,System.String)">
<summary>Returns an integer that represents the specified datepart of the specified date.</summary>
<returns>The specified datepart of the specified date.</returns>
<param name="datePartArg">The part of the date to return the value.</param>
<param name="date">The date.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.GetDate">
<summary>Returns the current database system timestamp as a datetime value without the database time zone offset. This value is derived from the operating system of the computer on which the instance of SQL Server is running.</summary>
<returns>The current database timestamp.</returns>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.DataLength(System.Nullable{System.Boolean})">
<summary>Returns the number of bytes used to represent any expression.</summary>
<returns>The number of bytes in the input value.</returns>
<param name="arg">The value to be examined for data length.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.DataLength(System.Nullable{System.Double})">
<summary>Returns the number of bytes used to represent any expression.</summary>
<returns>The number of bytes in the input value.</returns>
<param name="arg">The value to be examined for data length.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.DataLength(System.Nullable{System.Decimal})">
<summary>Returns the number of bytes used to represent any expression.</summary>
<returns>The number of bytes in the input value.</returns>
<param name="arg">The value to be examined for data length.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.DataLength(System.Nullable{System.DateTime})">
<summary>Returns the number of bytes used to represent any expression.</summary>
<returns>The number of bytes in the input value.</returns>
<param name="arg">The value to be examined for data length.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.DataLength(System.String)">
<summary>Returns the number of bytes used to represent any expression.</summary>
<returns>The number of bytes in the input value.</returns>
<param name="arg">The value to be examined for data length.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.DataLength(System.Byte[])">
<summary>Returns the number of bytes used to represent any expression.</summary>
<returns>The number of bytes in the input value.</returns>
<param name="arg">The value to be examined for length.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.DataLength(System.Nullable{System.Guid})">
<summary>Returns the number of bytes used to represent any expression.</summary>
<returns>The number of bytes in the input value.</returns>
<param name="arg">The value to be examined for data length.</param>
</member>
</members>
</doc>

Binary file not shown.

53236
Admin/Lib/EntityFramework.xml Normal file

File diff suppressed because it is too large Load Diff

Binary file not shown.

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<noInheritable></noInheritable>
<assemblyIdentity type="win32" name="Microsoft.VC90.CRT" version="9.0.30729.4148" processorArchitecture="amd64" publicKeyToken="1fc8b3b9a1e18e3b"></assemblyIdentity>
<file name="msvcr90.dll" hashalg="SHA1" hash="1b065fdf0cb8516b0553128eae4af39c5f8eeb46"><asmv2:hash xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:dsig="http://www.w3.org/2000/09/xmldsig#"><dsig:Transforms><dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity"></dsig:Transform></dsig:Transforms><dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></dsig:DigestMethod><dsig:DigestValue>Vy8CgQgbu3qH5JHTK0op4kR8114=</dsig:DigestValue></asmv2:hash></file> <file name="msvcp90.dll" hashalg="SHA1" hash="45d3027d87eade77317e92994790598c755b3920"><asmv2:hash xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:dsig="http://www.w3.org/2000/09/xmldsig#"><dsig:Transforms><dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity"></dsig:Transform></dsig:Transforms><dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></dsig:DigestMethod><dsig:DigestValue>QTJu3Gttpt8hhCktGelNeXj4Yp8=</dsig:DigestValue></asmv2:hash></file> <file name="msvcm90.dll" hashalg="SHA1" hash="e77fd69f7c88f34329d8a95c3179f67ead330217"><asmv2:hash xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:dsig="http://www.w3.org/2000/09/xmldsig#"><dsig:Transforms><dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity"></dsig:Transform></dsig:Transforms><dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></dsig:DigestMethod><dsig:DigestValue>1ruqF7/L+m1tqnJVscaOtNRNHIE=</dsig:DigestValue></asmv2:hash></file>
</assembly>

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<noInheritable></noInheritable>
<assemblyIdentity type="win32" name="Microsoft.VC90.CRT" version="9.0.30729.4148" processorArchitecture="x86" publicKeyToken="1fc8b3b9a1e18e3b"></assemblyIdentity>
<file name="msvcr90.dll" hashalg="SHA1" hash="98e8006e0a4542e69f1a3555b927758bd76ca07d"><asmv2:hash xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:dsig="http://www.w3.org/2000/09/xmldsig#"><dsig:Transforms><dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity"></dsig:Transform></dsig:Transforms><dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></dsig:DigestMethod><dsig:DigestValue>+CXED+6HzJlSphyMNOn27ujadC0=</dsig:DigestValue></asmv2:hash></file> <file name="msvcp90.dll" hashalg="SHA1" hash="3aec3be680024a46813dee891a753bd58b3f3b12"><asmv2:hash xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:dsig="http://www.w3.org/2000/09/xmldsig#"><dsig:Transforms><dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity"></dsig:Transform></dsig:Transforms><dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></dsig:DigestMethod><dsig:DigestValue>MyKED+9DyS+1XcMeaC0Zlw2vFZ0=</dsig:DigestValue></asmv2:hash></file> <file name="msvcm90.dll" hashalg="SHA1" hash="0195dd0896d74b62531e4f3c771904a3d996450e"><asmv2:hash xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:dsig="http://www.w3.org/2000/09/xmldsig#"><dsig:Transforms><dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity"></dsig:Transform></dsig:Transforms><dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></dsig:DigestMethod><dsig:DigestValue>EeyDE7og6WoPd2oBhYbMEnpFHhY=</dsig:DigestValue></asmv2:hash></file>
</assembly>

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
Admin/Lib/x86/sqlceca40.dll Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
Admin/Lib/x86/sqlceme40.dll Normal file

Binary file not shown.

BIN
Admin/Lib/x86/sqlceqp40.dll Normal file

Binary file not shown.

BIN
Admin/Lib/x86/sqlcese40.dll Normal file

Binary file not shown.

View File

@ -5,10 +5,10 @@ using System.Runtime.InteropServices;
using SharedLibrary;
using System.Threading.Tasks;
using System.IO;
using SharedLibrary.Objects;
#if DEBUG
using SharedLibrary.Database;
using SharedLibrary.Objects;
#endif
namespace IW4MAdmin
@ -73,7 +73,15 @@ namespace IW4MAdmin
return;
}
ServerManager.Start();
try
{
ServerManager.Start();
}
catch (Exception e)
{
throw e;
}
}
static ConsoleEventDelegate handler;

View File

@ -197,11 +197,11 @@ namespace IW4MAdmin
for (int i = 0; i < TaskStatuses.Count; i++)
{
var Status = TaskStatuses[i];
if (Status.RequestedTask == null || Status.RequestedTask.IsCompleted)
if (Status.RequestedTask == null || Status.RequestedTask.Status == TaskStatus.RanToCompletion)
{
Status.Update(new Task(() => (Status.Dependant as Server).ProcessUpdatesAsync(Status.GetToken())));
Status.Update(new Task<bool>(() => { return (Status.Dependant as Server).ProcessUpdatesAsync(Status.GetToken()).Result; }));
if (Status.RunAverage > 1000 + UPDATE_FREQUENCY)
Logger.WriteWarning($"Update task average execution is longer than desired for {(Status.Dependant as Server).GetIP()}::{(Status.Dependant as Server).GetPort()} [{Status.RunAverage}ms]");
Logger.WriteWarning($"Update task average execution is longer than desired for {(Status.Dependant as Server)} [{Status.RunAverage}ms]");
}
}

View File

@ -17,8 +17,18 @@ namespace IW4MAdmin
{
public IW4MServer(IManager mgr, ServerConfiguration cfg) : base(mgr, cfg) { }
public override int GetHashCode()
{
return IP.GetHashCode() + Port;
}
override public async Task<bool> AddPlayer(Player polledPlayer)
{
if (polledPlayer.Ping == 999 || polledPlayer.Ping < 1 || polledPlayer.ClientNumber > (MaxClients) || polledPlayer.ClientNumber < 0)
{
//Logger.WriteDebug($"Skipping client not in connected state {P}");
return true;
}
if (Players[polledPlayer.ClientNumber] != null &&
Players[polledPlayer.ClientNumber].NetworkId == polledPlayer.NetworkId)
{
@ -79,8 +89,8 @@ namespace IW4MAdmin
Players[player.ClientNumber] = player;
#endif
var ban = (await Manager.GetPenaltyService().Find(p => p.LinkId == player.AliasLink.AliasLinkId
&& p.Expires > DateTime.UtcNow)).FirstOrDefault();
var ban = Manager.GetPenaltyService().Find(p => p.LinkId == player.AliasLink.AliasLinkId
&& p.Expires > DateTime.UtcNow).Result.FirstOrDefault();
if (ban != null)
{
@ -103,7 +113,7 @@ namespace IW4MAdmin
// Do the player specific stuff
player.ClientNumber = polledPlayer.ClientNumber;
Players[player.ClientNumber] = player;
Logger.WriteInfo($"Client {player} connecting...");
Logger.WriteInfo($"Client {player} connecting...");
await ExecuteEvent(new Event(Event.GType.Connect, "", player, null, this));
@ -234,7 +244,7 @@ namespace IW4MAdmin
if (matchingPlayers.Count > 1)
{
await E.Origin.Tell("Multiple players match that name");
throw new SharedLibrary.Exceptions.CommandException($"{E.Origin} had multiple players found for {C.Name}");
throw new SharedLibrary.Exceptions.CommandException($"{E.Origin} had multiple players found for {C.Name}");
}
else if (matchingPlayers.Count == 1)
{
@ -251,7 +261,7 @@ namespace IW4MAdmin
await E.Origin.Tell("Multiple players match that name");
foreach (var p in matchingPlayers)
await E.Origin.Tell($"[^3{p.ClientNumber}^7] {p.Name}");
throw new SharedLibrary.Exceptions.CommandException($"{E.Origin} had multiple players found for {C.Name}");
throw new SharedLibrary.Exceptions.CommandException($"{E.Origin} had multiple players found for {C.Name}");
}
else if (matchingPlayers.Count == 1)
{
@ -278,11 +288,13 @@ namespace IW4MAdmin
foreach (IPlugin P in SharedLibrary.Plugins.PluginImporter.ActivePlugins)
{
#if !DEBUG
try
#endif
{
await P.OnEventAsync(E, this);
}
#if !DEBUG
catch (Exception Except)
{
Logger.WriteError(String.Format("The plugin \"{0}\" generated an error. ( see log )", P.Name));
@ -290,13 +302,14 @@ namespace IW4MAdmin
Logger.WriteDebug(String.Format("Error Trace: {0}", Except.StackTrace));
continue;
}
#endif
}
}
async Task<int> PollPlayersAsync()
{
#if DEBUG
return Players.Where(p => p != null).Count();
// return Players.Where(p => p != null).Count();
#endif
var CurrentPlayers = await this.GetStatusAsync();
@ -307,15 +320,9 @@ namespace IW4MAdmin
}
//polledPlayer.ClientNumber < 0 || polledPlayer.ClientNumber > (Players.Count - 1) || polledPlayer.Ping < 1 || polledPlayer.Ping == 999
foreach (var P in CurrentPlayers)
for (int i = 0; i < CurrentPlayers.Count; i++)
{
if (P.Ping == 999 || P.ClientNumber > MaxClients - 1 || P.ClientNumber < 0)
{
Logger.WriteDebug($"Skipping client not in connected state {P}");
continue;
}
await AddPlayer(P);
await AddPlayer(CurrentPlayers[i]);
}
return CurrentPlayers.Count;
@ -329,19 +336,18 @@ namespace IW4MAdmin
DateTime lastCount = DateTime.Now;
DateTime tickTime = DateTime.Now;
override public async Task ProcessUpdatesAsync(CancellationToken cts)
override public async Task<bool> ProcessUpdatesAsync(CancellationToken cts)
{
#if DEBUG == false
try
#endif
{
if ((DateTime.Now - LastPoll).TotalMinutes < 2 && ConnectionErrors >= 1)
return;
return true;
try
{
await PollPlayersAsync();
int polledPlayerCount = await PollPlayersAsync();
if (ConnectionErrors > 0)
{
@ -361,7 +367,7 @@ namespace IW4MAdmin
Logger.WriteDebug($"Internal Exception: {e.Data["internal_exception"]}");
Throttled = true;
}
return;
return true;
}
LastMessage = DateTime.Now - start;
@ -390,7 +396,7 @@ namespace IW4MAdmin
}
if (LogFile == null)
return;
return true;
if (l_size != LogFile.Length())
{
@ -434,11 +440,13 @@ namespace IW4MAdmin
}
oldLines = lines;
l_size = LogFile.Length();
return true;
}
#if DEBUG == false
catch (SharedLibrary.Exceptions.NetworkException)
{
Logger.WriteError($"Could not communicate with {IP}:{Port}");
return false;
}
catch (Exception E)
@ -446,6 +454,7 @@ namespace IW4MAdmin
Logger.WriteError($"Encountered error on {IP}:{Port}");
Logger.WriteDebug("Error Message: " + E.Message);
Logger.WriteDebug("Error Trace: " + E.StackTrace);
return false;
}
#endif
}

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

View File

@ -0,0 +1,891 @@
<?xml version="1.0"?>
<doc>
<assembly>
<name>EntityFramework.SqlServerCompact</name>
</assembly>
<members>
<member name="T:System.Data.Entity.SqlServerCompact.SqlCeMigrationSqlGenerator">
<summary>
Provider to convert provider agnostic migration operations into SQL commands
that can be run against a Microsoft SQL Server Compact Edition database.
</summary>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeMigrationSqlGenerator.Generate(System.Collections.Generic.IEnumerable{System.Data.Entity.Migrations.Model.MigrationOperation},System.String)">
<summary>
Converts a set of migration operations into Microsoft SQL Server specific SQL.
</summary>
<param name="migrationOperations"> The operations to be converted. </param>
<param name="providerManifestToken"> Token representing the version of SQL Server being targeted (i.e. "2005", "2008"). </param>
<returns> A list of SQL statements to be executed to perform the migration operations. </returns>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeMigrationSqlGenerator.Generate(System.Data.Entity.Migrations.Model.UpdateDatabaseOperation)">
<summary>
Generates the specified update database operation which represents applying a series of migrations.
The generated script is idempotent, meaning it contains conditional logic to check if individual migrations
have already been applied and only apply the pending ones.
</summary>
<param name="updateDatabaseOperation">The update database operation.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeMigrationSqlGenerator.Generate(System.Data.Entity.Migrations.Model.MigrationOperation)">
<summary>
Generates SQL for a <see cref="T:System.Data.Entity.Migrations.Model.MigrationOperation"/>.
Allows derived providers to handle additional operation types.
Generated SQL should be added using the Statement method.
</summary>
<param name="migrationOperation"> The operation to produce SQL for. </param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeMigrationSqlGenerator.CreateConnection">
<summary>
Creates an empty connection for the current provider.
Allows derived providers to use connection other than <see cref="T:System.Data.SqlClient.SqlConnection"/>.
</summary>
<returns> An empty connection for the current provider. </returns>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeMigrationSqlGenerator.Generate(System.Data.Entity.Migrations.Model.CreateProcedureOperation)">
<summary>
Generates the specified create procedure operation.
</summary>
<param name="createProcedureOperation">The create procedure operation.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeMigrationSqlGenerator.Generate(System.Data.Entity.Migrations.Model.AlterProcedureOperation)">
<summary>
Generates the specified alter procedure operation.
</summary>
<param name="alterProcedureOperation">The alter procedure operation.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeMigrationSqlGenerator.Generate(System.Data.Entity.Migrations.Model.DropProcedureOperation)">
<summary>
Generates the specified drop procedure operation.
</summary>
<param name="dropProcedureOperation">The drop procedure operation.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeMigrationSqlGenerator.Generate(System.Data.Entity.Migrations.Model.CreateTableOperation)">
<summary>
Generates SQL for a <see cref="T:System.Data.Entity.Migrations.Model.CreateTableOperation"/>.
Generated SQL should be added using the Statement method.
</summary>
<param name="createTableOperation"> The operation to produce SQL for. </param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeMigrationSqlGenerator.Generate(System.Data.Entity.Migrations.Model.AlterTableOperation)">
<summary>
Override this method to generate SQL when the definition of a table or its attributes are changed.
The default implementation of this method does nothing.
</summary>
<param name="alterTableOperation"> The operation describing changes to the table. </param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeMigrationSqlGenerator.GenerateMakeSystemTable(System.Data.Entity.Migrations.Model.CreateTableOperation,System.Data.Entity.Migrations.Utilities.IndentedTextWriter)">
<summary>
Generates SQL to mark a table as a system table.
Generated SQL should be added using the Statement method.
</summary>
<param name="createTableOperation"> The table to mark as a system table. </param>
<param name="writer"> The <see cref="T:System.Data.Entity.Migrations.Utilities.IndentedTextWriter"/> to write the generated SQL to. </param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeMigrationSqlGenerator.Generate(System.Data.Entity.Migrations.Model.AddForeignKeyOperation)">
<summary>
Generates SQL for a <see cref="T:System.Data.Entity.Migrations.Model.AddForeignKeyOperation"/>.
Generated SQL should be added using the Statement method.
</summary>
<param name="addForeignKeyOperation"> The operation to produce SQL for. </param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeMigrationSqlGenerator.Generate(System.Data.Entity.Migrations.Model.DropForeignKeyOperation)">
<summary>
Generates SQL for a <see cref="T:System.Data.Entity.Migrations.Model.DropForeignKeyOperation"/>.
Generated SQL should be added using the Statement method.
</summary>
<param name="dropForeignKeyOperation"> The operation to produce SQL for. </param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeMigrationSqlGenerator.Generate(System.Data.Entity.Migrations.Model.CreateIndexOperation)">
<summary>
Generates SQL for a <see cref="T:System.Data.Entity.Migrations.Model.CreateIndexOperation"/>.
Generated SQL should be added using the Statement method.
</summary>
<param name="createIndexOperation"> The operation to produce SQL for. </param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeMigrationSqlGenerator.Generate(System.Data.Entity.Migrations.Model.DropIndexOperation)">
<summary>
Generates SQL for a <see cref="T:System.Data.Entity.Migrations.Model.DropIndexOperation"/>.
Generated SQL should be added using the Statement method.
</summary>
<param name="dropIndexOperation"> The operation to produce SQL for. </param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeMigrationSqlGenerator.Generate(System.Data.Entity.Migrations.Model.AddPrimaryKeyOperation)">
<summary>
Generates SQL for a <see cref="T:System.Data.Entity.Migrations.Model.AddPrimaryKeyOperation"/>.
Generated SQL should be added using the Statement method.
</summary>
<param name="addPrimaryKeyOperation"> The operation to produce SQL for. </param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeMigrationSqlGenerator.Generate(System.Data.Entity.Migrations.Model.DropPrimaryKeyOperation)">
<summary>
Generates SQL for a <see cref="T:System.Data.Entity.Migrations.Model.DropPrimaryKeyOperation"/>.
Generated SQL should be added using the Statement method.
</summary>
<param name="dropPrimaryKeyOperation"> The operation to produce SQL for. </param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeMigrationSqlGenerator.Generate(System.Data.Entity.Migrations.Model.AddColumnOperation)">
<summary>
Generates SQL for a <see cref="T:System.Data.Entity.Migrations.Model.AddColumnOperation"/>.
Generated SQL should be added using the Statement method.
</summary>
<param name="addColumnOperation"> The operation to produce SQL for. </param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeMigrationSqlGenerator.Generate(System.Data.Entity.Migrations.Model.DropColumnOperation)">
<summary>
Generates SQL for a <see cref="T:System.Data.Entity.Migrations.Model.DropColumnOperation"/>.
Generated SQL should be added using the Statement method.
</summary>
<param name="dropColumnOperation"> The operation to produce SQL for. </param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeMigrationSqlGenerator.Generate(System.Data.Entity.Migrations.Model.AlterColumnOperation)">
<summary>
Generates SQL for a <see cref="T:System.Data.Entity.Migrations.Model.AlterColumnOperation"/>.
Generated SQL should be added using the Statement method.
</summary>
<param name="alterColumnOperation"> The operation to produce SQL for. </param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeMigrationSqlGenerator.Generate(System.Data.Entity.Migrations.Model.DropTableOperation)">
<summary>
Generates SQL for a <see cref="T:System.Data.Entity.Migrations.Model.DropTableOperation"/>.
Generated SQL should be added using the Statement method.
</summary>
<param name="dropTableOperation"> The operation to produce SQL for. </param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeMigrationSqlGenerator.Generate(System.Data.Entity.Migrations.Model.SqlOperation)">
<summary>
Generates SQL for a <see cref="T:System.Data.Entity.Migrations.Model.SqlOperation"/>.
Generated SQL should be added using the Statement or StatementBatch methods.
</summary>
<param name="sqlOperation"> The operation to produce SQL for. </param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeMigrationSqlGenerator.Generate(System.Data.Entity.Migrations.Model.RenameColumnOperation)">
<summary>
Generates SQL for a <see cref="T:System.Data.Entity.Migrations.Model.RenameColumnOperation"/>.
Generated SQL should be added using the Statement method.
</summary>
<param name="renameColumnOperation"> The operation to produce SQL for. </param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeMigrationSqlGenerator.Generate(System.Data.Entity.Migrations.Model.RenameIndexOperation)">
<summary>
Generates SQL for a <see cref="T:System.Data.Entity.Migrations.Model.RenameIndexOperation"/>.
Generated SQL should be added using the Statement method.
</summary>
<param name="renameIndexOperation"> The operation to produce SQL for. </param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeMigrationSqlGenerator.Generate(System.Data.Entity.Migrations.Model.RenameTableOperation)">
<summary>
Generates SQL for a <see cref="T:System.Data.Entity.Migrations.Model.RenameTableOperation"/>.
Generated SQL should be added using the Statement method.
</summary>
<param name="renameTableOperation"> The operation to produce SQL for. </param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeMigrationSqlGenerator.Generate(System.Data.Entity.Migrations.Model.RenameProcedureOperation)">
<summary>
Generates the specified rename procedure operation.
</summary>
<param name="renameProcedureOperation">The rename procedure operation.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeMigrationSqlGenerator.Generate(System.Data.Entity.Migrations.Model.MoveProcedureOperation)">
<summary>
Generates the specified move procedure operation.
</summary>
<param name="moveProcedureOperation">The move procedure operation.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeMigrationSqlGenerator.Generate(System.Data.Entity.Migrations.Model.MoveTableOperation)">
<summary>
Generates SQL for a <see cref="T:System.Data.Entity.Migrations.Model.MoveTableOperation"/>.
Generated SQL should be added using the Statement method.
</summary>
<param name="moveTableOperation"> The operation to produce SQL for. </param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeMigrationSqlGenerator.Generate(System.Data.Entity.Migrations.Model.ColumnModel,System.Data.Entity.Migrations.Utilities.IndentedTextWriter)">
<summary>
Generates SQL for the given column model. This method is called by other methods that
process columns and can be overridden to change the SQL generated.
</summary>
<param name="column">The column for which SQL is being generated.</param>
<param name="writer">The writer to which generated SQL should be written.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeMigrationSqlGenerator.Generate(System.Data.Entity.Migrations.Model.HistoryOperation)">
<summary>
Generates SQL for a <see cref="T:System.Data.Entity.Migrations.Model.HistoryOperation"/>.
Generated SQL should be added using the Statement method.
</summary>
<param name="historyOperation"> The operation to produce SQL for. </param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeMigrationSqlGenerator.Generate(System.Byte[])">
<summary>
Generates SQL to specify a constant byte[] default value being set on a column.
This method just generates the actual value, not the SQL to set the default value.
</summary>
<param name="defaultValue"> The value to be set. </param>
<returns> SQL representing the default value. </returns>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeMigrationSqlGenerator.Generate(System.Boolean)">
<summary>
Generates SQL to specify a constant bool default value being set on a column.
This method just generates the actual value, not the SQL to set the default value.
</summary>
<param name="defaultValue"> The value to be set. </param>
<returns> SQL representing the default value. </returns>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeMigrationSqlGenerator.Generate(System.DateTime)">
<summary>
Generates SQL to specify a constant DateTime default value being set on a column.
This method just generates the actual value, not the SQL to set the default value.
</summary>
<param name="defaultValue"> The value to be set. </param>
<returns> SQL representing the default value. </returns>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeMigrationSqlGenerator.Generate(System.DateTimeOffset)">
<summary>
Generates SQL to specify a constant DateTimeOffset default value being set on a column.
This method just generates the actual value, not the SQL to set the default value.
</summary>
<param name="defaultValue"> The value to be set. </param>
<returns> SQL representing the default value. </returns>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeMigrationSqlGenerator.Generate(System.Guid)">
<summary>
Generates SQL to specify a constant Guid default value being set on a column.
This method just generates the actual value, not the SQL to set the default value.
</summary>
<param name="defaultValue"> The value to be set. </param>
<returns> SQL representing the default value. </returns>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeMigrationSqlGenerator.Generate(System.String)">
<summary>
Generates SQL to specify a constant string default value being set on a column.
This method just generates the actual value, not the SQL to set the default value.
</summary>
<param name="defaultValue"> The value to be set. </param>
<returns> SQL representing the default value. </returns>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeMigrationSqlGenerator.Generate(System.TimeSpan)">
<summary>
Generates SQL to specify a constant TimeSpan default value being set on a column.
This method just generates the actual value, not the SQL to set the default value.
</summary>
<param name="defaultValue"> The value to be set. </param>
<returns> SQL representing the default value. </returns>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeMigrationSqlGenerator.Generate(System.Data.Entity.Spatial.DbGeography)">
<summary>
Generates SQL to specify a constant geogrpahy default value being set on a column.
This method just generates the actual value, not the SQL to set the default value.
</summary>
<param name="defaultValue"> The value to be set. </param>
<returns> SQL representing the default value. </returns>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeMigrationSqlGenerator.Generate(System.Data.Entity.Spatial.DbGeometry)">
<summary>
Generates SQL to specify a constant geometry default value being set on a column.
This method just generates the actual value, not the SQL to set the default value.
</summary>
<param name="defaultValue"> The value to be set. </param>
<returns> SQL representing the default value. </returns>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeMigrationSqlGenerator.Generate(System.Object)">
<summary>
Generates SQL to specify a constant default value being set on a column.
This method just generates the actual value, not the SQL to set the default value.
</summary>
<param name="defaultValue"> The value to be set. </param>
<returns> SQL representing the default value. </returns>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeMigrationSqlGenerator.BuildColumnType(System.Data.Entity.Migrations.Model.ColumnModel)">
<summary>
Generates SQL to specify the data type of a column.
This method just generates the actual type, not the SQL to create the column.
</summary>
<param name="columnModel"> The definition of the column. </param>
<returns> SQL representing the data type. </returns>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeMigrationSqlGenerator.Name(System.String)">
<summary>
Generates a quoted name. The supplied name may or may not contain the schema.
</summary>
<param name="name"> The name to be quoted. </param>
<returns> The quoted name. </returns>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeMigrationSqlGenerator.Quote(System.String)">
<summary>
Quotes an identifier for SQL Server.
</summary>
<param name="identifier"> The identifier to be quoted. </param>
<returns> The quoted identifier. </returns>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeMigrationSqlGenerator.Statement(System.String,System.Boolean)">
<summary>
Adds a new Statement to be executed against the database.
</summary>
<param name="sql"> The statement to be executed. </param>
<param name="suppressTransaction"> Gets or sets a value indicating whether this statement should be performed outside of the transaction scope that is used to make the migration process transactional. If set to true, this operation will not be rolled back if the migration process fails. </param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeMigrationSqlGenerator.Writer">
<summary>
Gets a new <see cref="T:System.Data.Entity.Migrations.Utilities.IndentedTextWriter"/> that can be used to build SQL.
This is just a helper method to create a writer. Writing to the writer will
not cause SQL to be registered for execution. You must pass the generated
SQL to the Statement method.
</summary>
<returns> An empty text writer to use for SQL generation. </returns>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeMigrationSqlGenerator.Statement(System.Data.Entity.Migrations.Utilities.IndentedTextWriter)">
<summary>
Adds a new Statement to be executed against the database.
</summary>
<param name="writer"> The writer containing the SQL to be executed. </param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeMigrationSqlGenerator.StatementBatch(System.String,System.Boolean)">
<summary>
Breaks string into one or more statements, handling T-SQL utility statements as necessary.
</summary>
<param name="sqlBatch">The SQL to split into one ore more statements to be executed.</param>
<param name="suppressTransaction"> Gets or sets a value indicating whether this statement should be performed outside of the transaction scope that is used to make the migration process transactional. If set to true, this operation will not be rolled back if the migration process fails. </param>
</member>
<member name="P:System.Data.Entity.SqlServerCompact.SqlCeMigrationSqlGenerator.GuidColumnDefault">
<summary>
Returns the column default value to use for store-generated GUID columns when
no default value is explicitly specified in the migration.
Always returns newid() for SQL Compact.
</summary>
<value>The string newid().</value>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeProviderManifest.SupportsParameterOptimizationInSchemaQueries">
<summary>
Indicates if the provider supports the parameter optimization described in EntityFramework6 GitHub issue #195.
</summary>
<returns><c>True</c> since this provider supports the parameter optimization.</returns>
</member>
<member name="T:System.Data.Entity.SqlServerCompact.SqlCeProviderServices">
<summary>
The ProviderServices object for the Sql CE provider
</summary>
<remarks>
Note that instance of this type also resolves additional provider services for Microsoft SQL Server Compact Edition
when this type is registered as an EF provider either using an entry in the application's config file or through
code-based registration in <see cref="T:System.Data.Entity.DbConfiguration"/>.
The services resolved are:
Requests for <see cref="T:System.Data.Entity.Infrastructure.IDbConnectionFactory"/> are resolved to a Singleton instance of
<see cref="T:System.Data.Entity.Infrastructure.SqlCeConnectionFactory"/> to create connections to SQL Compact by default.
Requests for <see cref="T:System.Data.Entity.Migrations.Sql.MigrationSqlGenerator"/> for the invariant name "System.Data.SqlServerCe.4.0" are
resolved to <see cref="T:System.Data.Entity.SqlServerCompact.SqlCeMigrationSqlGenerator"/> instances to provide default Migrations SQL
generation for SQL Compact.
</remarks>
</member>
<member name="F:System.Data.Entity.SqlServerCompact.SqlCeProviderServices.ProviderInvariantName">
<summary>
This is the well-known string using in configuration files and code-based configuration as
the "provider invariant name" used to specify Microsoft SQL Server Compact Edition 4.0 for
ADO.NET and Entity Framework provider services.
</summary>
</member>
<member name="F:System.Data.Entity.SqlServerCompact.SqlCeProviderServices.Instance">
<summary>
Singleton object;
</summary>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeProviderServices.DbCreateDatabaseScript(System.String,System.Data.Entity.Core.Metadata.Edm.StoreItemCollection)">
<summary>
API for generating script for creating schema objects from the Store Item Collection.
</summary>
<param name="providerManifestToken"> Provider manifest </param>
<param name="storeItemCollection"> Store items </param>
<returns> T-SQL script for generating schema objects. </returns>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeProviderServices.DbDatabaseExists(System.Data.Common.DbConnection,System.Nullable{System.Int32},System.Data.Entity.Core.Metadata.Edm.StoreItemCollection)">
<summary>
API for checkin whether database exists or not.
This will internally only check whether the file that the connection points to exists or not.
Note: In case of SQLCE, timeout and storeItemCollection parameters are ignored.
</summary>
<param name="connection"> Connection </param>
<param name="timeOut"> Timeout for internal commands. </param>
<param name="storeItemCollection"> Item Collection. </param>
<returns> Bool indicating whether database exists or not. </returns>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeProviderServices.DbDatabaseExists(System.Data.Common.DbConnection,System.Nullable{System.Int32},System.Lazy{System.Data.Entity.Core.Metadata.Edm.StoreItemCollection})">
<summary>
API for checkin whether database exists or not.
This will internally only check whether the file that the connection points to exists or not.
Note: In case of SQLCE, timeout and storeItemCollection parameters are ignored.
</summary>
<param name="connection"> Connection </param>
<param name="timeOut"> Timeout for internal commands. </param>
<param name="storeItemCollection"> Item Collection. </param>
<returns> Bool indicating whether database exists or not. </returns>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeProviderServices.DbDeleteDatabase(System.Data.Common.DbConnection,System.Nullable{System.Int32},System.Data.Entity.Core.Metadata.Edm.StoreItemCollection)">
<summary>
API for deleting the database.
In SQLCE case, this will translate to File.Delete() call.
Note: Timeout and storeItemCollection parameters are ignored.
</summary>
<param name="connection"> Connection </param>
<param name="timeOut"> Timeout for internal commands. </param>
<param name="storeItemCollection"> Item Collection. </param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeProviderServices.DbCreateDatabase(System.Data.Common.DbConnection,System.Nullable{System.Int32},System.Data.Entity.Core.Metadata.Edm.StoreItemCollection)">
<summary>
API for creating the databse and schema objects given a StoreItemCollection.
This will do following things:
1. Create a new database using SqlCeEngine.CreateDatabase().
2. Generate scripts for creating schema objects.
3. Execute the scrip generated in step2.
</summary>
<param name="connection"> Connection </param>
<param name="timeOut"> Timeout for internal commands </param>
<param name="storeItemCollection"> Store Item Collection </param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeProviderServices.RegisterInfoMessageHandler(System.Data.Common.DbConnection,System.Action{System.String})">
<summary>
Registers a handler to process non-error messages coming from the database provider.
</summary>
<param name="connection">The connection to receive information for.</param>
<param name="handler">The handler to process messages.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeProviderServices.CreateDbCommandDefinition(System.Data.Entity.Core.Common.DbProviderManifest,System.Data.Entity.Core.Common.CommandTrees.DbCommandTree)">
<summary>
Create a Command Definition object, given the connection and command tree
</summary>
<param name="providerManifest"> provider manifest that was determined from metadata </param>
<param name="commandTree"> command tree for the statement </param>
<returns> an executable command definition object </returns>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeProviderServices.GetDbProviderManifestToken(System.Data.Common.DbConnection)">
<summary>
Returns provider manifest token for a given connection.
</summary>
<param name="connection">Connection to find manifest token from.</param>
<returns>The provider manifest token for the specified connection.</returns>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeProviderServices.GetDbProviderManifest(System.String)">
<summary>
Returns the provider manifest by using the specified version information.
</summary>
<returns> The provider manifest by using the specified version information. </returns>
<param name="versionHint"> The token information associated with the provider manifest. </param>
</member>
<member name="T:System.Data.Entity.SqlServerCompact.SqlCeFunctions">
<summary>
Contains function stubs that expose SqlServerCe methods in Linq to Entities.
</summary>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.CharIndex(System.String,System.String)">
<summary>Returns the starting position of one expression found within another expression.</summary>
<returns>The starting position of toFind if it is found in toSearch .</returns>
<param name="toFind">The string expression to be found.</param>
<param name="toSearch">The string expression to be searched.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.CharIndex(System.Byte[],System.Byte[])">
<summary>Returns the starting position of one expression found within another expression.</summary>
<returns>The starting position of toFind if it is found in toSearch .</returns>
<param name="toFind">The string expression to be found.</param>
<param name="toSearch">The string expression to be searched.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.CharIndex(System.String,System.String,System.Nullable{System.Int32})">
<summary>Returns the starting position of one expression found within another expression.</summary>
<returns>The starting position of toFind if it is found in toSearch .</returns>
<param name="toFind">The string expression to be found.</param>
<param name="toSearch">The string expression to be searched.</param>
<param name="startLocation">The character position in toSearch where searching begins.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.CharIndex(System.Byte[],System.Byte[],System.Nullable{System.Int32})">
<summary>Returns the starting position of one expression found within another expression.</summary>
<returns>The starting position of toFind if it is found in toSearch .</returns>
<param name="toFind">The string expression to be found.</param>
<param name="toSearch">The string expression to be searched.</param>
<param name="startLocation">The character position in toSearch where searching begins.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.CharIndex(System.String,System.String,System.Nullable{System.Int64})">
<summary>Returns the starting position of one expression found within another expression.</summary>
<returns>
A <see cref="T:System.Nullable`1" /> of <see cref="T:System.Int64" /> value that is the starting position of toFind if it is found in toSearch .
</returns>
<param name="toFind">The string expression to be found.</param>
<param name="toSearch">The string expression to be searched.</param>
<param name="startLocation">The character position in toSearch where searching begins.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.CharIndex(System.Byte[],System.Byte[],System.Nullable{System.Int64})">
<summary>Returns the starting position of one expression found within another expression.</summary>
<returns>The starting position of toFind if it is found in toSearch .</returns>
<param name="toFind">The string expression to be found.</param>
<param name="toSearch">The string expression to be searched.</param>
<param name="startLocation">The character position in toSearch where searching begins.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.NChar(System.Nullable{System.Int32})">
<summary>Returns the Unicode character with the specified integer code, as defined by the Unicode standard.</summary>
<returns>The character that corresponds to the input character code.</returns>
<param name="arg">A character code.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.PatIndex(System.String,System.String)">
<summary>Returns the starting position of the first occurrence of a pattern in a specified expression, or zeros if the pattern is not found, on all valid text and character data types.</summary>
<returns>The starting character position where the string pattern was found.</returns>
<param name="stringPattern">A string pattern to search for.</param>
<param name="target">The string to search.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.Replicate(System.String,System.Nullable{System.Int32})">
<summary>Repeats a string value a specified number of times.</summary>
<returns>The target string, repeated the number of times specified by count .</returns>
<param name="target">A valid string.</param>
<param name="count">The value that specifies how many time to repeat target .</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.Space(System.Nullable{System.Int32})">
<summary>Returns a string of repeated spaces.</summary>
<returns>A string that consists of the specified number of spaces.</returns>
<param name="arg1">The number of spaces. If negative, a null string is returned.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.StringConvert(System.Nullable{System.Double})">
<summary>Returns character data converted from numeric data.</summary>
<returns>The numeric input expression converted to a string.</returns>
<param name="number">A numeric expression.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.StringConvert(System.Nullable{System.Decimal})">
<summary>Returns character data converted from numeric data.</summary>
<returns>The input expression converted to a string.</returns>
<param name="number">A numeric expression.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.StringConvert(System.Nullable{System.Double},System.Nullable{System.Int32})">
<summary>Returns character data converted from numeric data.</summary>
<returns>The numeric input expression converted to a string.</returns>
<param name="number">A numeric expression.</param>
<param name="length">The total length of the string. This includes decimal point, sign, digits, and spaces. The default is 10.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.StringConvert(System.Nullable{System.Decimal},System.Nullable{System.Int32})">
<summary>Returns character data converted from numeric data.</summary>
<returns>The input expression converted to a string.</returns>
<param name="number">A numeric expression.</param>
<param name="length">The total length of the string. This includes decimal point, sign, digits, and spaces. The default is 10.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.StringConvert(System.Nullable{System.Double},System.Nullable{System.Int32},System.Nullable{System.Int32})">
<summary>Returns character data converted from numeric data.</summary>
<returns>The numeric input expression converted to a string.</returns>
<param name="number">A numeric expression.</param>
<param name="length">The total length of the string. This includes decimal point, sign, digits, and spaces. The default is 10.</param>
<param name="decimalArg">The number of places to the right of the decimal point. decimal must be less than or equal to 16. If decimal is more than 16 then the result is truncated to sixteen places to the right of the decimal point.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.StringConvert(System.Nullable{System.Decimal},System.Nullable{System.Int32},System.Nullable{System.Int32})">
<summary>Returns character data converted from numeric data.</summary>
<returns>The input expression converted to a string.</returns>
<param name="number">A numeric expression.</param>
<param name="length">The total length of the string. This includes decimal point, sign, digits, and spaces. The default is 10.</param>
<param name="decimalArg">The number of places to the right of the decimal point. decimal must be less than or equal to 16. If decimal is more than 16 then the result is truncated to sixteen places to the right of the decimal point.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.Stuff(System.String,System.Nullable{System.Int32},System.Nullable{System.Int32},System.String)">
<summary>Inserts a string into another string. It deletes a specified length of characters in the target string at the start position and then inserts the second string into the target string at the start position.</summary>
<returns>A string consisting of the two strings.</returns>
<param name="stringInput">The target string.</param>
<param name="start">The character position in stringinput where the replacement string is to be inserted.</param>
<param name="length">The number of characters to delete from stringInput . If length is longer than stringInput , deletion occurs up to the last character in stringReplacement .</param>
<param name="stringReplacement">The substring to be inserted into stringInput .</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.Unicode(System.String)">
<summary>Returns the integer value, as defined by the Unicode standard, for the first character of the input expression.</summary>
<returns>The character code for the first character in the input string.</returns>
<param name="arg">A valid string.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.Acos(System.Nullable{System.Double})">
<summary>A mathematical function that returns the angle, in radians, whose cosine is the specified numerical value. This angle is called the arccosine.</summary>
<returns>The angle, in radians, defined by the input cosine value.</returns>
<param name="arg1">The cosine of an angle.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.Acos(System.Nullable{System.Decimal})">
<summary>A mathematical function that returns the angle, in radians, whose cosine is the specified numerical value. This angle is called the arccosine.</summary>
<returns>An angle, measured in radians.</returns>
<param name="arg1">The cosine of an angle.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.Asin(System.Nullable{System.Double})">
<summary>A mathematical function that returns the angle, in radians, whose sine is the specified numerical value. This angle is called the arcsine.</summary>
<returns>An angle, measured in radians.</returns>
<param name="arg">The sine of an angle.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.Asin(System.Nullable{System.Decimal})">
<summary>A mathematical function that returns the angle, in radians, whose sine is the specified numerical value. This angle is called the arcsine.</summary>
<returns>An angle, measured in radians.</returns>
<param name="arg">The sine of an angle.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.Atan(System.Nullable{System.Double})">
<summary>A mathematical function that returns the angle, in radians, whose tangent is the specified numerical value. This angle is called the arctangent.</summary>
<returns>An angle, measured in radians.</returns>
<param name="arg">The tangent of an angle.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.Atan(System.Nullable{System.Decimal})">
<summary>A mathematical function that returns the angle, in radians, whose tangent is the specified numerical value. This angle is called the arctangent.</summary>
<returns>An angle, measured in radians.</returns>
<param name="arg">The tangent of an angle.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.Atan2(System.Nullable{System.Double},System.Nullable{System.Double})">
<summary>Returns the positive angle, in radians, between the positive x-axis and the ray from the origin through the point (x, y), where x and y are the two specified numerical values. The first parameter passed to the function is the y-value and the second parameter is the x-value.</summary>
<returns>An angle, measured in radians.</returns>
<param name="arg1">The y-coordinate of a point.</param>
<param name="arg2">The x-coordinate of a point.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.Atan2(System.Nullable{System.Decimal},System.Nullable{System.Decimal})">
<summary>Returns the positive angle, in radians, between the positive x-axis and the ray from the origin through the point (x, y), where x and y are the two specified numerical values. The first parameter passed to the function is the y-value and the second parameter is the x-value.</summary>
<returns>An angle, measured in radians.</returns>
<param name="arg1">The y-coordinate of a point.</param>
<param name="arg2">The x-coordinate of a point.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.Cos(System.Nullable{System.Double})">
<summary>Returns the trigonometric cosine of the specified angle, in radians, in the specified expression.</summary>
<returns>The trigonometric cosine of the specified angle.</returns>
<param name="arg">An angle, measured in radians.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.Cos(System.Nullable{System.Decimal})">
<summary>Returns the trigonometric cosine of the specified angle, in radians, in the specified expression.</summary>
<returns>The trigonometric cosine of the specified angle.</returns>
<param name="arg">An angle, measured in radians.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.Cot(System.Nullable{System.Double})">
<summary>A mathematical function that returns the trigonometric cotangent of the specified angle, in radians.</summary>
<returns>The trigonometric cotangent of the specified angle.</returns>
<param name="arg">An angle, measured in radians.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.Cot(System.Nullable{System.Decimal})">
<summary>A mathematical function that returns the trigonometric cotangent of the specified angle, in radians.</summary>
<returns>The trigonometric cotangent of the specified angle.</returns>
<param name="arg">An angle, measured in radians.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.Degrees(System.Nullable{System.Int32})">
<summary>Returns the corresponding angle in degrees for an angle specified in radians.</summary>
<returns>The specified angle converted to degrees.</returns>
<param name="arg1">An angle, measured in radians.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.Degrees(System.Nullable{System.Int64})">
<summary>Returns the corresponding angle in degrees for an angle specified in radians.</summary>
<returns>The specified angle converted to degrees.</returns>
<param name="arg1">An angle, measured in radians.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.Degrees(System.Nullable{System.Decimal})">
<summary>Returns the corresponding angle in degrees for an angle specified in radians.</summary>
<returns>The specified angle converted to degrees.</returns>
<param name="arg1">An angle, measured in radians.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.Degrees(System.Nullable{System.Double})">
<summary>Returns the corresponding angle in degrees for an angle specified in radians.</summary>
<returns>The specified angle converted to degrees.</returns>
<param name="arg1">An angle, measured in radians.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.Exp(System.Nullable{System.Double})">
<summary>Returns the exponential value of the specified float expression.</summary>
<returns>The constant e raised to the power of the input value.</returns>
<param name="arg">The input value.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.Exp(System.Nullable{System.Decimal})">
<summary>Returns the exponential value of the specified float expression.</summary>
<returns>The constant e raised to the power of the input value.</returns>
<param name="arg">The input value.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.Log(System.Nullable{System.Double})">
<summary>Returns the natural logarithm of the specified input value.</summary>
<returns>The natural logarithm of the input value.</returns>
<param name="arg">A numeric expression.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.Log(System.Nullable{System.Decimal})">
<summary>Returns the natural logarithm of the specified input value.</summary>
<returns>The natural logarithm of the input value.</returns>
<param name="arg">A numeric expression.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.Log10(System.Nullable{System.Double})">
<summary>Returns the base-10 logarithm of the specified input value.</summary>
<returns>The base-10 logarithm of the input value.</returns>
<param name="arg">A numeric expression.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.Log10(System.Nullable{System.Decimal})">
<summary>Returns the base-10 logarithm of the specified input value.</summary>
<returns>The base-10 logarithm of the input value.</returns>
<param name="arg">A numeric expression.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.Pi">
<summary>Returns the constant value of pi.</summary>
<returns>The numeric value of pi.</returns>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.Radians(System.Nullable{System.Int32})">
<summary>Returns the radian measure corresponding to the specified angle in degrees.</summary>
<returns>The radian measure of the specified angle.</returns>
<param name="arg">The angle, measured in degrees</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.Radians(System.Nullable{System.Int64})">
<summary>Returns the radian measure corresponding to the specified angle in degrees.</summary>
<returns>The radian measure of the specified angle.</returns>
<param name="arg">The angle, measured in degrees</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.Radians(System.Nullable{System.Decimal})">
<summary>Returns the radian measure corresponding to the specified angle in degrees.</summary>
<returns>The radian measure of the specified angle.</returns>
<param name="arg">The angle, measured in degrees.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.Radians(System.Nullable{System.Double})">
<summary>Returns the radian measure corresponding to the specified angle in degrees.</summary>
<returns>The radian measure of the specified angle.</returns>
<param name="arg">The angle, measured in degrees.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.Rand">
<summary>Returns a pseudo-random float value from 0 through 1, exclusive.</summary>
<returns>The pseudo-random value.</returns>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.Rand(System.Nullable{System.Int32})">
<summary>Returns a pseudo-random float value from 0 through 1, exclusive.</summary>
<returns>The pseudo-random value.</returns>
<param name="seed">The seed value. If seed is not specified, the SQL Server Database Engine assigns a seed value at random. For a specified seed value, the result returned is always the same.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.Sign(System.Nullable{System.Int32})">
<summary>Returns the positive (+1), zero (0), or negative (-1) sign of the specified expression.</summary>
<returns>The sign of the input expression.</returns>
<param name="arg">A numeric expression.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.Sign(System.Nullable{System.Int64})">
<summary>Returns the positive (+1), zero (0), or negative (-1) sign of the specified expression.</summary>
<returns>The sign of the input expression.</returns>
<param name="arg">A numeric expression.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.Sign(System.Nullable{System.Decimal})">
<summary>Returns the positive (+1), zero (0), or negative (-1) sign of the specified expression.</summary>
<returns>The sign of the input expression.</returns>
<param name="arg">A numeric expression.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.Sign(System.Nullable{System.Double})">
<summary>Returns the positive (+1), zero (0), or negative (-1) sign of the specified expression.</summary>
<returns>The sign of the input expression.</returns>
<param name="arg">A numeric expression.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.Sin(System.Nullable{System.Decimal})">
<summary>Returns the trigonometric sine of the specified angle.</summary>
<returns>The trigonometric sine of the input expression.</returns>
<param name="arg">An angle, measured in radians.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.Sin(System.Nullable{System.Double})">
<summary>Returns the trigonometric sine of the specified angle.</summary>
<returns>The trigonometric sine of the input expression.</returns>
<param name="arg">An angle, measured in radians.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.SquareRoot(System.Nullable{System.Double})">
<summary>Returns the square root of the specified number.</summary>
<returns>The square root of the input value.</returns>
<param name="arg">A numeric expression.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.SquareRoot(System.Nullable{System.Decimal})">
<summary>Returns the square root of the specified number.</summary>
<returns>The square root of the input value.</returns>
<param name="arg">A numeric expression.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.Tan(System.Nullable{System.Double})">
<summary>Returns the trigonometric tangent of the input expression.</summary>
<returns>The tangent of the input angle.</returns>
<param name="arg">An angle, measured in radians.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.Tan(System.Nullable{System.Decimal})">
<summary>Returns the trigonometric tangent of the input expression.</summary>
<returns>The tangent of the input angle.</returns>
<param name="arg">An angle, measured in radians.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.DateAdd(System.String,System.Nullable{System.Double},System.Nullable{System.DateTime})">
<summary>Returns a new datetime value based on adding an interval to the specified date.</summary>
<returns>The new date.</returns>
<param name="datePartArg">The part of the date to increment. </param>
<param name="number">The value used to increment a date by a specified amount.</param>
<param name="date">The date to increment.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.DateAdd(System.String,System.Nullable{System.Double},System.String)">
<summary>Returns a new datetime value based on adding an interval to the specified date.</summary>
<returns>
A <see cref="T:System.Nullable`1" /> of <see cref="T:System.DateTime" /> value that is the new date.
</returns>
<param name="datePartArg">The part of the date to increment.</param>
<param name="number">The value used to increment a date by a specified amount.</param>
<param name="date">The date to increment.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.DateDiff(System.String,System.Nullable{System.DateTime},System.Nullable{System.DateTime})">
<summary>Returns the count of the specified datepart boundaries crossed between the specified start date and end date.</summary>
<returns>The number of time intervals between the two dates.</returns>
<param name="datePartArg">The part of the date to calculate the differing number of time intervals.</param>
<param name="startDate">The first date.</param>
<param name="endDate">The second date.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.DateDiff(System.String,System.String,System.Nullable{System.DateTime})">
<summary>Returns the count of the specified datepart boundaries crossed between the specified start date and end date.</summary>
<returns>The number of time intervals between the two dates.</returns>
<param name="datePartArg">The part of the date to calculate the differing number of time intervals.</param>
<param name="startDate">The first date.</param>
<param name="endDate">The second date.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.DateDiff(System.String,System.Nullable{System.DateTime},System.String)">
<summary>Returns the count of the specified datepart boundaries crossed between the specified start date and end date.</summary>
<returns>The number of time intervals between the two dates.</returns>
<param name="datePartArg">The part of the date to calculate the differing number of time intervals.</param>
<param name="startDate">The first date.</param>
<param name="endDate">The second date.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.DateDiff(System.String,System.String,System.String)">
<summary>Returns the count of the specified datepart boundaries crossed between the specified start date and end date.</summary>
<returns>The number of time intervals between the two dates.</returns>
<param name="datePartArg">The part of the date to calculate the differing number of time intervals.</param>
<param name="startDate">The first date.</param>
<param name="endDate">The second date.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.DateName(System.String,System.Nullable{System.DateTime})">
<summary>Returns a character string that represents the specified datepart of the specified date.</summary>
<returns>The specified part of the specified date.</returns>
<param name="datePartArg">The part of the date to calculate the differing number of time intervals.</param>
<param name="date">The date.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.DateName(System.String,System.String)">
<summary>Returns a character string that represents the specified datepart of the specified date.</summary>
<returns>The specified part of the specified date.</returns>
<param name="datePartArg">The part of the date to calculate the differing number of time intervals.</param>
<param name="date">The date.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.DatePart(System.String,System.Nullable{System.DateTime})">
<summary>Returns an integer that represents the specified datepart of the specified date.</summary>
<returns>The the specified datepart of the specified date.</returns>
<param name="datePartArg">The part of the date to return the value.</param>
<param name="date">The date.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.DatePart(System.String,System.String)">
<summary>Returns an integer that represents the specified datepart of the specified date.</summary>
<returns>The specified datepart of the specified date.</returns>
<param name="datePartArg">The part of the date to return the value.</param>
<param name="date">The date.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.GetDate">
<summary>Returns the current database system timestamp as a datetime value without the database time zone offset. This value is derived from the operating system of the computer on which the instance of SQL Server is running.</summary>
<returns>The current database timestamp.</returns>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.DataLength(System.Nullable{System.Boolean})">
<summary>Returns the number of bytes used to represent any expression.</summary>
<returns>The number of bytes in the input value.</returns>
<param name="arg">The value to be examined for data length.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.DataLength(System.Nullable{System.Double})">
<summary>Returns the number of bytes used to represent any expression.</summary>
<returns>The number of bytes in the input value.</returns>
<param name="arg">The value to be examined for data length.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.DataLength(System.Nullable{System.Decimal})">
<summary>Returns the number of bytes used to represent any expression.</summary>
<returns>The number of bytes in the input value.</returns>
<param name="arg">The value to be examined for data length.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.DataLength(System.Nullable{System.DateTime})">
<summary>Returns the number of bytes used to represent any expression.</summary>
<returns>The number of bytes in the input value.</returns>
<param name="arg">The value to be examined for data length.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.DataLength(System.String)">
<summary>Returns the number of bytes used to represent any expression.</summary>
<returns>The number of bytes in the input value.</returns>
<param name="arg">The value to be examined for data length.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.DataLength(System.Byte[])">
<summary>Returns the number of bytes used to represent any expression.</summary>
<returns>The number of bytes in the input value.</returns>
<param name="arg">The value to be examined for length.</param>
</member>
<member name="M:System.Data.Entity.SqlServerCompact.SqlCeFunctions.DataLength(System.Nullable{System.Guid})">
<summary>Returns the number of bytes used to represent any expression.</summary>
<returns>The number of bytes in the input value.</returns>
<param name="arg">The value to be examined for data length.</param>
</member>
</members>
</doc>

BIN
Lib/EntityFramework.dll Normal file

Binary file not shown.

53236
Lib/EntityFramework.xml Normal file

File diff suppressed because it is too large Load Diff

BIN
Lib/SQLite.Interop.dll Normal file

Binary file not shown.

BIN
Lib/SharedLibrary.dll Normal file

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<noInheritable></noInheritable>
<assemblyIdentity type="win32" name="Microsoft.VC90.CRT" version="9.0.30729.4148" processorArchitecture="amd64" publicKeyToken="1fc8b3b9a1e18e3b"></assemblyIdentity>
<file name="msvcr90.dll" hashalg="SHA1" hash="1b065fdf0cb8516b0553128eae4af39c5f8eeb46"><asmv2:hash xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:dsig="http://www.w3.org/2000/09/xmldsig#"><dsig:Transforms><dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity"></dsig:Transform></dsig:Transforms><dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></dsig:DigestMethod><dsig:DigestValue>Vy8CgQgbu3qH5JHTK0op4kR8114=</dsig:DigestValue></asmv2:hash></file> <file name="msvcp90.dll" hashalg="SHA1" hash="45d3027d87eade77317e92994790598c755b3920"><asmv2:hash xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:dsig="http://www.w3.org/2000/09/xmldsig#"><dsig:Transforms><dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity"></dsig:Transform></dsig:Transforms><dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></dsig:DigestMethod><dsig:DigestValue>QTJu3Gttpt8hhCktGelNeXj4Yp8=</dsig:DigestValue></asmv2:hash></file> <file name="msvcm90.dll" hashalg="SHA1" hash="e77fd69f7c88f34329d8a95c3179f67ead330217"><asmv2:hash xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:dsig="http://www.w3.org/2000/09/xmldsig#"><dsig:Transforms><dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity"></dsig:Transform></dsig:Transforms><dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></dsig:DigestMethod><dsig:DigestValue>1ruqF7/L+m1tqnJVscaOtNRNHIE=</dsig:DigestValue></asmv2:hash></file>
</assembly>

Binary file not shown.

Binary file not shown.

BIN
Lib/amd64/sqlceca40.dll Normal file

Binary file not shown.

Binary file not shown.

BIN
Lib/amd64/sqlceer40EN.dll Normal file

Binary file not shown.

BIN
Lib/amd64/sqlceme40.dll Normal file

Binary file not shown.

BIN
Lib/amd64/sqlceqp40.dll Normal file

Binary file not shown.

BIN
Lib/amd64/sqlcese40.dll Normal file

Binary file not shown.

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<noInheritable></noInheritable>
<assemblyIdentity type="win32" name="Microsoft.VC90.CRT" version="9.0.30729.4148" processorArchitecture="x86" publicKeyToken="1fc8b3b9a1e18e3b"></assemblyIdentity>
<file name="msvcr90.dll" hashalg="SHA1" hash="98e8006e0a4542e69f1a3555b927758bd76ca07d"><asmv2:hash xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:dsig="http://www.w3.org/2000/09/xmldsig#"><dsig:Transforms><dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity"></dsig:Transform></dsig:Transforms><dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></dsig:DigestMethod><dsig:DigestValue>+CXED+6HzJlSphyMNOn27ujadC0=</dsig:DigestValue></asmv2:hash></file> <file name="msvcp90.dll" hashalg="SHA1" hash="3aec3be680024a46813dee891a753bd58b3f3b12"><asmv2:hash xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:dsig="http://www.w3.org/2000/09/xmldsig#"><dsig:Transforms><dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity"></dsig:Transform></dsig:Transforms><dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></dsig:DigestMethod><dsig:DigestValue>MyKED+9DyS+1XcMeaC0Zlw2vFZ0=</dsig:DigestValue></asmv2:hash></file> <file name="msvcm90.dll" hashalg="SHA1" hash="0195dd0896d74b62531e4f3c771904a3d996450e"><asmv2:hash xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:dsig="http://www.w3.org/2000/09/xmldsig#"><dsig:Transforms><dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity"></dsig:Transform></dsig:Transforms><dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></dsig:DigestMethod><dsig:DigestValue>EeyDE7og6WoPd2oBhYbMEnpFHhY=</dsig:DigestValue></asmv2:hash></file>
</assembly>

Binary file not shown.

Binary file not shown.

BIN
Lib/x86/SQLite.Interop.dll Normal file

Binary file not shown.

BIN
Lib/x86/sqlceca40.dll Normal file

Binary file not shown.

BIN
Lib/x86/sqlcecompact40.dll Normal file

Binary file not shown.

BIN
Lib/x86/sqlceer40EN.dll Normal file

Binary file not shown.

BIN
Lib/x86/sqlceme40.dll Normal file

Binary file not shown.

BIN
Lib/x86/sqlceqp40.dll Normal file

Binary file not shown.

BIN
Lib/x86/sqlcese40.dll Normal file

Binary file not shown.

View File

@ -0,0 +1,22 @@
using SharedLibrary;
using StatsPlugin.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StatsPlugin.Helpers
{
public class ServerStats
{
public Dictionary<int, EFClientStatistics> PlayerStats { get; set; }
public EFServer Server { get; private set; }
public ServerStats(EFServer sv)
{
PlayerStats = new Dictionary<int, EFClientStatistics>();
Server = sv;
}
}
}

View File

@ -0,0 +1,165 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using SharedLibrary;
using SharedLibrary.Helpers;
using SharedLibrary.Interfaces;
using SharedLibrary.Objects;
using SharedLibrary.Services;
using StatsPlugin.Models;
namespace StatsPlugin.Helpers
{
public class StatManager
{
private Dictionary<int, ServerStats> Servers;
private ILogger Log;
private IManager Manager;
private GenericRepository<EFClientStatistics> ClientStatSvc;
private GenericRepository<EFServer> ServerSvc;
private GenericRepository<EFClientKill> KillSvc;
public StatManager(IManager mgr)
{
Servers = new Dictionary<int, ServerStats>();
Log = mgr.GetLogger();
Manager = mgr;
ClientStatSvc = new GenericRepository<EFClientStatistics>();
ServerSvc = new GenericRepository<EFServer>();
KillSvc = new GenericRepository<EFClientKill>();
}
~StatManager()
{
Servers.Clear();
Log.WriteInfo("Cleared StatManager servers");
Log = null;
Servers = null;
}
/// <summary>
/// Add a server to the StatManager server pool
/// </summary>
/// <param name="sv"></param>
public void AddServer(Server sv)
{
try
{
int serverId = sv.GetHashCode();
// get the server from the database if it exists, otherwise create and insert a new one
var server = ServerSvc.Find(c => c.ServerId == serverId).FirstOrDefault();
if (server == null)
{
server = new EFServer()
{
Port = sv.GetPort(),
Active = true,
ServerId = serverId
};
ServerSvc.Insert(server);
}
// this doesn't need to be async as it's during initialization
ServerSvc.SaveChanges();
Servers.Add(sv.GetHashCode(), new ServerStats(server));
}
catch (Exception e)
{
Log.WriteWarning($"Could not add server to ServerStats - {e.Message}");
}
}
/// <summary>
/// Add Player to the player stats
/// </summary>
/// <param name="pl">Player to add/retrieve stats for</param>
/// <returns>EFClientStatistic of specified player</returns>
public EFClientStatistics AddPlayer(Player pl)
{
int serverId = pl.CurrentServer.GetHashCode();
var playerStats = Servers[serverId].PlayerStats;
// get the client's stats from the database if it exists, otherwise create and attach a new one
// if this fails we want to throw an exception
var clientStats = ClientStatSvc.Find(c => c.ClientId == pl.ClientId && c.ServerId == serverId).FirstOrDefault();
if (clientStats == null)
{
clientStats = new EFClientStatistics()
{
Active = true,
ClientId = pl.ClientId,
Deaths = 0,
Kills = 0,
ServerId = serverId,
Skill = 0.0,
SPM = 0.0,
};
clientStats = ClientStatSvc.Insert(clientStats);
}
else
lock (playerStats)
playerStats.Add(pl.ClientNumber, clientStats);
return clientStats;
}
public async Task RemovePlayer(Player pl)
{
int serverId = pl.CurrentServer.GetHashCode();
var playerStats = Servers[serverId].PlayerStats;
// get individual client's stats
var clientStats = playerStats[pl.ClientNumber];
// remove the client from the stats dictionary as they're leaving
lock (playerStats)
playerStats.Remove(pl.ClientNumber);
// update in database
await ClientStatSvc.SaveChangesAsync();
}
/// <summary>
/// Process stats for kill event
/// </summary>
/// <returns></returns>
public async Task AddKill(Player attacker, Player victim, int serverId, string map, string hitLoc, string type,
string damage, string weapon, string killOrigin, string deathOrigin)
{
var attackerStats = Servers[serverId].PlayerStats[attacker.ClientNumber];
attackerStats.Kills += 1;
var victimStats = Servers[serverId].PlayerStats[victim.ClientNumber];
victimStats.Deaths += 1;
var kill = new EFClientKill()
{
Active = true,
AttackerId = attacker.ClientId,
VictimId = victim.ClientId,
ServerId = serverId,
Map = ParseEnum<IW4Info.MapName>.Get(map, typeof(IW4Info.MapName)),
DeathOrigin = Vector3.Parse(deathOrigin),
KillOrigin = Vector3.Parse(killOrigin),
DeathType = ParseEnum<IW4Info.MeansOfDeath>.Get(type, typeof(IW4Info.MeansOfDeath)),
Damage = Int32.Parse(damage),
HitLoc = ParseEnum<IW4Info.HitLocation>.Get(hitLoc, typeof(IW4Info.HitLocation)),
Weapon = ParseEnum<IW4Info.WeaponName>.Get(weapon, typeof(IW4Info.WeaponName))
};
KillSvc.Insert(kill);
await KillSvc.SaveChangesAsync();
}
private EFClientStatistics UpdateStats(EFClientStatistics cs)
{
// todo: everything
return cs;
}
}
}

View File

@ -0,0 +1,40 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using SharedLibrary.Database.Models;
using System.ComponentModel.DataAnnotations.Schema;
using SharedLibrary.Helpers;
using System.ComponentModel.DataAnnotations;
namespace StatsPlugin.Models
{
public class EFClientKill : SharedEntity
{
public EFClientKill() { }
[Key]
public long KillId { get; set; }
public int VictimId { get; set; }
[ForeignKey("VictimId")]
public virtual EFClient Victim { get; set; }
public int AttackerId { get; set; }
[ForeignKey("AttackerId")]
public virtual EFClient Attacker { get; set; }
public int ServerId { get; set; }
[ForeignKey("ServerId")]
public virtual EFServer Server { get; set; }
public IW4Info.HitLocation HitLoc { get; set; }
public IW4Info.MeansOfDeath DeathType { get; set; }
public int Damage { get; set; }
public IW4Info.WeaponName Weapon { get; set; }
public Vector3 KillOrigin { get; set; }
public Vector3 DeathOrigin { get; set; }
// http://wiki.modsrepository.com/index.php?title=Call_of_Duty_5:_Gameplay_standards for conversion to meters
[NotMapped]
public double Distance => Vector3.Distance(KillOrigin, DeathOrigin) * 0.0254;
public IW4Info.MapName Map { get; set; }
}
}

View File

@ -0,0 +1,38 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using SharedLibrary.Database.Models;
namespace StatsPlugin.Models
{
public class EFClientStatistics : SharedEntity
{
[Key, Column(Order = 0)]
public int ClientId { get; set; }
[ForeignKey("ClientId")]
public virtual EFClient Client { get; set; }
[Key, Column(Order = 1)]
public int ServerId { get; set; }
[ForeignKey("ServerId")]
public virtual EFServer Server { get; set; }
[Required]
public int Kills { get; set; }
[Required]
public int Deaths { get; set; }
[Required]
[NotMapped]
public double KDR
{
get => Deaths == 0 ? 0.0 : Math.Round((float)Kills / (float)Deaths, 2);
}
[Required]
public double SPM { get; set; }
[Required]
public double Skill { get; set; }
}
}

View File

@ -0,0 +1,16 @@

using SharedLibrary.Database.Models;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace StatsPlugin.Models
{
public class EFServer : SharedEntity
{
[Key]
[DatabaseGenerated(DatabaseGeneratedOption.None)]
public int ServerId { get; set; }
[Required]
public int Port { get; set; }
}
}

View File

@ -1,735 +1,91 @@
using SharedLibrary;
using SharedLibrary.Helpers;
using System;
using System;
using System.Collections.Generic;
using System.Data;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using SharedLibrary.Objects;
using SharedLibrary;
using SharedLibrary.Interfaces;
using StatsPlugin.Helpers;
namespace StatsPlugin
{
public class CViewStats : Command
class Plugin : IPlugin
{
public CViewStats() : base("stats", "view your stats", "xlrstats", Player.Permission.User, false, new CommandArgument[]
{
new CommandArgument()
{
Name = "player",
Required = false
}
})
{ }
public string Name => "Simple Stats";
public override async Task ExecuteAsync(Event E)
{
String statLine;
PlayerStats pStats;
if (E.Data.Length > 0 && E.Target == null)
{
await E.Origin.Tell("Cannot find the player you specified");
return;
}
if (E.Target != null)
{
pStats = Stats.statLists.Find(x => x.Port == E.Owner.GetPort()).playerStats.GetStats(E.Target);
statLine = String.Format("^5{0} ^7KILLS | ^5{1} ^7DEATHS | ^5{2} ^7KDR | ^5{3} ^7SKILL", pStats.Kills, pStats.Deaths, pStats.KDR, pStats.Skill);
}
else
{
pStats = Stats.statLists.Find(x => x.Port == E.Owner.GetPort()).playerStats.GetStats(E.Origin);
statLine = String.Format("^5{0} ^7KILLS | ^5{1} ^7DEATHS | ^5{2} ^7KDR | ^5{3} ^7SKILL", pStats.Kills, pStats.Deaths, pStats.KDR, pStats.Skill);
}
if (E.Message.IsBroadcastCommand())
{
string name = E.Target == null ? E.Origin.Name : E.Target.Name;
await E.Owner.Broadcast($"Stats for ^5{name}^7");
await E.Owner.Broadcast(statLine);
}
else
{
if (E.Target != null)
await E.Origin.Tell($"Stats for ^5{E.Target.Name}^7");
await E.Origin.Tell(statLine);
}
}
}
public class CViewTopStats : Command
{
public CViewTopStats() :
base("topstats", "view the top 5 players on this server", "ts", Player.Permission.User, false)
{ }
public override async Task ExecuteAsync(Event E)
{
List<KeyValuePair<String, PlayerStats>> pStats = Stats.statLists.Find(x => x.Port == E.Owner.GetPort()).playerStats.GetTopStats();
StringBuilder msgBlder = new StringBuilder();
await E.Origin.Tell("^5--Top Players--");
foreach (KeyValuePair<String, PlayerStats> pStat in pStats)
{
Player P = E.Owner.Manager.GetDatabase().GetClient(pStat.Key) as Player;
if (P == null)
continue;
await E.Origin.Tell(String.Format("^3{0}^7 - ^5{1} ^7KDR | ^5{2} ^7SKILL", P.Name, pStat.Value.KDR, pStat.Value.Skill));
}
}
}
public class CResetStats : Command
{
public CResetStats() : base("resetstats", "reset your stats to factory-new", "rs", Player.Permission.User, false) { }
public override async Task ExecuteAsync(Event E)
{
var stats = Stats.statLists.Find(x => x.Port == E.Owner.GetPort()).playerStats.GetStats(E.Origin);
stats.Deaths = 0;
stats.Kills = 0;
stats.scorePerMinute = 1.0;
stats.Skill = 1;
stats.KDR = 0.0;
await Task.Run(() => { Stats.statLists.Find(x => x.Port == E.Owner.GetPort()).playerStats.UpdateStats(E.Origin, stats); });
await E.Origin.Tell("Your stats have been reset");
}
}
public class CPruneAdmins : Command
{
public CPruneAdmins() : base("prune", "demote any admins that have not connected recently (defaults to 30 days)", "p", Player.Permission.Owner, false, new CommandArgument[]
{
new CommandArgument()
{
Name = "inactive days",
Required = false
}
})
{ }
public override async Task ExecuteAsync(Event E)
{
int inactiveDays = 30;
try
{
if (E.Data.Length > 0)
{
inactiveDays = Int32.Parse(E.Data);
if (inactiveDays < 1)
throw new FormatException();
}
}
catch (FormatException)
{
await E.Origin.Tell("Invalid number of inactive days");
return;
}
var inactiveAdmins = await E.Owner.Manager.GetDatabase().PruneInactivePrivilegedClients(inactiveDays);
await E.Origin.Tell($"Pruned inactive {inactiveAdmins.Count} privileged users");
}
}
/// <summary>
/// Each server runs from the same plugin ( for easier reloading and reduced memory usage ).
/// So, to have multiple stat tracking, we must store a stat struct for each server
/// </summary>
public class Stats : SharedLibrary.Interfaces.IPlugin
{
public static SharedLibrary.Interfaces.IManager ManagerInstance;
public static int MAX_KILLEVENTS = 1000;
public static Dictionary<int, ServerStatInfo> ServerStats { get; private set; }
public static ChatDatabase ChatDB { get; private set; }
public class ServerStatInfo
{
public ServerStatInfo()
{
KillQueue = new Queue<KillInfo>();
ServerStartTime = DateTime.Now;
}
public DateTime ServerStartTime { get; private set; }
public DateTime RoundStartTime { get; set; }
public string Uptime => Utilities.GetTimePassed(ServerStartTime, false);
public string ElapsedRoundTime => Utilities.GetTimePassed(RoundStartTime);
private Queue<KillInfo> KillQueue { get; set; }
public Queue<KillInfo> GetKillQueue() { return KillQueue; }
}
public class KillInfo
{
public IW4Info.HitLocation HitLoc { get; set; }
public string HitLocString => HitLoc.ToString();
public IW4Info.MeansOfDeath DeathType { get; set; }
public string DeathTypeString => DeathType.ToString();
public int Damage { get; set; }
public IW4Info.WeaponName Weapon { get; set; }
public string WeaponString => Weapon.ToString();
public Vector3 KillOrigin { get; set; }
public Vector3 DeathOrigin { get; set; }
// http://wiki.modsrepository.com/index.php?title=Call_of_Duty_5:_Gameplay_standards for conversion to meters
public double Distance => Vector3.Distance(KillOrigin, DeathOrigin) * 0.0254;
public string KillerPlayer { get; set; }
public int KillerPlayerID { get; set; }
public string VictimPlayer { get; set; }
public int VictimPlayerID { get; set; }
public IW4Info.MapName Map { get; set; }
public int ID => GetHashCode();
public KillInfo() { }
public KillInfo(int killer, int victim, string map, string hit, string type, string damage, string weapon, string kOrigin, string dOrigin)
{
KillerPlayerID = killer;
VictimPlayerID = victim;
Map = ParseEnum<IW4Info.MapName>.Get(map, typeof(IW4Info.MapName));
HitLoc = ParseEnum<IW4Info.HitLocation>.Get(hit, typeof(IW4Info.HitLocation));
DeathType = ParseEnum<IW4Info.MeansOfDeath>.Get(type, typeof(IW4Info.MeansOfDeath));
Damage = Int32.Parse(damage);
Weapon = ParseEnum<IW4Info.WeaponName>.Get(weapon, typeof(IW4Info.WeaponName));
KillOrigin = Vector3.Parse(kOrigin);
DeathOrigin = Vector3.Parse(dOrigin);
}
}
public static List<StatTracking> statLists;
public class StatTracking
{
public StatsDB playerStats;
public DateTime[] lastKill, connectionTime;
public int[] inactiveMinutes, Kills, deathStreaks, killStreaks;
public int Port;
public StatTracking(int port)
{
playerStats = new StatsDB("Database/stats_" + port + ".rm", ManagerInstance.GetLogger());
inactiveMinutes = new int[18];
Kills = new int[18];
deathStreaks = new int[18];
killStreaks = new int[18];
lastKill = new DateTime[18];
connectionTime = new DateTime[18];
Port = port;
}
}
public string Name => "Basic Stats";
public float Version => 1.1f;
public float Version => 1.0f;
public string Author => "RaidMax";
public async Task OnLoadAsync(SharedLibrary.Interfaces.IManager manager)
private StatManager Manager;
public async Task OnEventAsync(Event E, Server S)
{
statLists = new List<StatTracking>();
ServerStats = new Dictionary<int, ServerStatInfo>();
ManagerInstance = manager;
WebService.PageList.Add(new StatsPage());
WebService.PageList.Add(new KillStatsJSON());
WebService.PageList.Add(new Chat.WordCloudJSON());
WebService.PageList.Add(new Chat.ClientChatJSON());
WebService.PageList.Add(new Chat.ChatPage());
ManagerInstance.GetMessageTokens().Add(new MessageToken("TOTALKILLS", GetTotalKills));
ManagerInstance.GetMessageTokens().Add(new MessageToken("TOTALPLAYTIME", GetTotalPlaytime));
ChatDB = new ChatDatabase("Database/ChatHistory.rm", ManagerInstance.GetLogger());
try
switch (E.Type)
{
var minimapConfig = MinimapConfig.Read("Config/minimaps.cfg");
}
catch (SharedLibrary.Exceptions.SerializeException e)
{
MinimapConfig.Write("Config/minimaps.cfg", MinimapConfig.IW4Minimaps());
case Event.GType.Start:
Manager.AddServer(S);
break;
case Event.GType.Stop:
break;
case Event.GType.Connect:
Manager.AddPlayer(E.Origin);
break;
case Event.GType.Disconnect:
await Manager.RemovePlayer(E.Origin);
break;
case Event.GType.Say:
break;
case Event.GType.MapChange:
break;
case Event.GType.MapEnd:
break;
case Event.GType.Broadcast:
break;
case Event.GType.Tell:
break;
case Event.GType.Kick:
break;
case Event.GType.Ban:
break;
case Event.GType.Remote:
break;
case Event.GType.Unknown:
break;
case Event.GType.Report:
break;
case Event.GType.Flag:
break;
case Event.GType.Script:
break;
case Event.GType.Kill:
string[] killInfo = (E.Data != null) ? E.Data.Split(';') : new string[0];
if (killInfo.Length >= 9 && killInfo[0].Contains("ScriptKill"))
await Manager.AddKill(E.Origin, E.Target, S.GetHashCode(), S.CurrentMap.Name, killInfo[7], killInfo[8], killInfo[5], killInfo[6], killInfo[3], killInfo[4]);
break;
case Event.GType.Death:
break;
}
}
public async Task OnUnloadAsync()
public Task OnLoadAsync(IManager manager)
{
statLists.Clear();
return Task.FromResult(
Manager = new StatManager(manager)
);
}
public async Task OnTickAsync(Server S)
{
return;
}
public async Task OnEventAsync(Event E, Server S)
public Task OnUnloadAsync()
{
try
{
if (E.Type == Event.GType.Start)
{
statLists.Add(new StatTracking(S.GetPort()));
ServerStats.Add(S.GetPort(), new ServerStatInfo());
var config = new ConfigurationManager(S);
if (config.GetProperty("EnableTrusted") == null)
config.AddProperty(new KeyValuePair<string, object>("EnableTrusted", true));
}
if (E.Type == Event.GType.Stop)
{
statLists.RemoveAll(s => s.Port == S.GetPort());
ServerStats.Remove(S.GetPort());
}
if (E.Type == Event.GType.Connect)
{
ResetCounters(E.Origin.ClientNumber, S.GetPort());
var config = new ConfigurationManager(E.Owner);
if (!(bool)config.GetProperty("EnableTrusted"))
return;
PlayerStats checkForTrusted = statLists.Find(x => x.Port == S.GetPort()).playerStats.GetStats(E.Origin);
//todo: move this out of here!!
if (checkForTrusted.TotalPlayTime >= 4320 && E.Origin.Level < Player.Permission.Trusted && E.Origin.Level != Player.Permission.Flagged)
{
E.Origin.Level = Player.Permission.Trusted;
await E.Owner.Manager.GetDatabase().UpdateClient(E.Origin);
await E.Origin.Tell("Congratulations, you are now a ^5trusted ^7player! Type ^5!help ^7to view new commands.");
await E.Origin.Tell("You earned this by playing for ^53 ^7full days!");
}
}
if (E.Type == Event.GType.MapEnd || E.Type == Event.GType.Stop)
{
foreach (Player P in S.GetPlayersAsList())
{
if (P == null)
continue;
CalculateAndSaveSkill(P, statLists.Find(x => x.Port == S.GetPort()));
ResetCounters(P.ClientNumber, S.GetPort());
E.Owner.Logger.WriteInfo($"Updated skill for {P}");
//E.Owner.Log.Write(String.Format("\r\nJoin: {0}\r\nInactive Minutes: {1}\r\nnewPlayTime: {2}\r\nnewSPM: {3}\r\nkdrWeight: {4}\r\nMultiplier: {5}\r\nscoreWeight: {6}\r\nnewSkillFactor: {7}\r\nprojectedNewSkill: {8}\r\nKills: {9}\r\nDeaths: {10}", connectionTime[P.ClientNumber].ToShortTimeString(), inactiveMinutes[P.ClientNumber], newPlayTime, newSPM, kdrWeight, Multiplier, scoreWeight, newSkillFactor, disconnectStats.Skill, disconnectStats.Kills, disconnectStats.Deaths));
}
}
if (E.Type == Event.GType.MapChange)
{
ServerStats[S.GetPort()].GetKillQueue().Clear();
ServerStats[S.GetPort()].RoundStartTime = DateTime.Now;
}
if (E.Type == Event.GType.Disconnect)
{
CalculateAndSaveSkill(E.Origin, statLists.Find(x => x.Port == S.GetPort()));
ResetCounters(E.Origin.ClientNumber, S.GetPort());
E.Owner.Logger.WriteInfo($"Updated skill for disconnecting client {E.Origin}");
}
if (E.Type == Event.GType.Kill)
{
if (E.Origin == E.Target || E.Origin == null)
return;
string[] killInfo = (E.Data != null) ? E.Data.Split(';') : new string[0];
if (killInfo.Length >= 9 && killInfo[0].Contains("ScriptKill"))
{
var killEvent = new KillInfo(E.Origin.ClientNumber, E.Target.ClientNumber, S.CurrentMap.Name, killInfo[7], killInfo[8], killInfo[5], killInfo[6], killInfo[3], killInfo[4])
{
KillerPlayer = E.Origin.Name,
VictimPlayer = E.Target.Name,
};
if (ServerStats[S.GetPort()].GetKillQueue().Count > MAX_KILLEVENTS - 1)
ServerStats[S.GetPort()].GetKillQueue().Dequeue();
ServerStats[S.GetPort()].GetKillQueue().Enqueue(killEvent);
//S.Logger.WriteInfo($"{E.Origin.Name} killed {E.Target.Name} with a {killEvent.Weapon} from a distance of {Vector3.Distance(killEvent.KillOrigin, killEvent.DeathOrigin)} with {killEvent.Damage} damage, at {killEvent.HitLoc}");
var cs = statLists.Find(x => x.Port == S.GetPort());
cs.playerStats.AddKill(killEvent);
}
Player Killer = E.Origin;
StatTracking curServer = statLists.Find(x => x.Port == S.GetPort());
PlayerStats killerStats = curServer.playerStats.GetStats(Killer);
if (killerStats == null)
killerStats = new PlayerStats(0, 0, 0, 0, 0, 0);
curServer.lastKill[E.Origin.ClientNumber] = DateTime.Now;
curServer.Kills[E.Origin.ClientNumber]++;
if ((DateTime.Now - curServer.lastKill[E.Origin.ClientNumber]).TotalSeconds > 120)
curServer.inactiveMinutes[E.Origin.ClientNumber] += 2;
killerStats.Kills++;
killerStats.KDR = (killerStats.Deaths == 0) ? killerStats.Kills : killerStats.KDR = Math.Round((double)killerStats.Kills / (double)killerStats.Deaths, 2);
curServer.playerStats.UpdateStats(Killer, killerStats);
curServer.killStreaks[Killer.ClientNumber] += 1;
curServer.deathStreaks[Killer.ClientNumber] = 0;
await Killer.Tell(MessageOnStreak(curServer.killStreaks[Killer.ClientNumber], curServer.deathStreaks[Killer.ClientNumber]));
}
if (E.Type == Event.GType.Death)
{
if (E.Origin == E.Target || E.Origin == null)
return;
Player Victim = E.Origin;
StatTracking curServer = statLists.Find(x => x.Port == S.GetPort());
PlayerStats victimStats = curServer.playerStats.GetStats(Victim);
if (victimStats == null)
victimStats = new PlayerStats(0, 0, 0, 0, 0, 0);
victimStats.Deaths++;
victimStats.KDR = Math.Round(victimStats.Kills / (double)victimStats.Deaths, 2);
curServer.playerStats.UpdateStats(Victim, victimStats);
curServer.deathStreaks[Victim.ClientNumber] += 1;
curServer.killStreaks[Victim.ClientNumber] = 0;
await Victim.Tell(MessageOnStreak(curServer.killStreaks[Victim.ClientNumber], curServer.deathStreaks[Victim.ClientNumber]));
}
if (E.Type == Event.GType.Say)
{
ChatDB.AddChatHistory(E.Origin.ClientNumber, E.Owner.GetPort(), E.Data);
}
}
catch (Exception e)
{
S.Logger.WriteWarning("StatsPlugin::OnEventAsync failed to complete");
S.Logger.WriteDebug($"Server:{S}\r\nOrigin:{E.Origin}\r\nTarget:{E.Target}");
S.Logger.WriteDebug($"Exception: {e.Message}");
}
}
public static string GetTotalKills()
{
long Kills = 0;
foreach (var S in statLists)
Kills += S.playerStats.GetTotalServerKills();
return Kills.ToString("#,##0");
}
public static string GetTotalPlaytime()
{
long Playtime = 0;
foreach (var S in statLists)
Playtime += S.playerStats.GetTotalServerPlaytime();
return Playtime.ToString("#,##0");
}
private void CalculateAndSaveSkill(Player P, StatTracking curServer)
{
if (P == null)
return;
PlayerStats DisconnectingPlayerStats = curServer.playerStats.GetStats(P);
if (DisconnectingPlayerStats == null || curServer.Kills[P.ClientNumber] == 0)
return;
else if (curServer.lastKill[P.ClientNumber] > curServer.connectionTime[P.ClientNumber])
curServer.inactiveMinutes[P.ClientNumber] += (int)(DateTime.Now - curServer.lastKill[P.ClientNumber]).TotalMinutes;
int newPlayTime = (int)(DateTime.Now - curServer.connectionTime[P.ClientNumber]).TotalMinutes - curServer.inactiveMinutes[P.ClientNumber];
if (newPlayTime < 2)
return;
// calculate the players Score Per Minute for the current session
double SessionSPM = curServer.Kills[P.ClientNumber] * 100 / Math.Max(1, newPlayTime);
// calculate how much the KDR should way
// 1.637 is a Eddie-Generated number that weights the KDR nicely
double KDRWeight = Math.Round(Math.Pow(DisconnectingPlayerStats.KDR, 1.637 / Math.E), 3);
double SPMWeightAgainstAverage;
// if no SPM, weight is 1 else the weight is the current sessions spm / lifetime average score per minute
SPMWeightAgainstAverage = (DisconnectingPlayerStats.scorePerMinute == 1) ? 1 : SessionSPM / DisconnectingPlayerStats.scorePerMinute;
// calculate the weight of the new play time againmst lifetime playtime
double SPMAgainstPlayWeight = newPlayTime / Math.Min(600, DisconnectingPlayerStats.TotalPlayTime + newPlayTime);
// calculate the new weight against average times the weight against play time
double newSkillFactor = SPMWeightAgainstAverage * SPMAgainstPlayWeight * SessionSPM;
// if the weight is greater than 1, add, else subtract
DisconnectingPlayerStats.scorePerMinute += (SPMWeightAgainstAverage >= 1) ? newSkillFactor : -newSkillFactor;
DisconnectingPlayerStats.Skill = DisconnectingPlayerStats.scorePerMinute * KDRWeight * 10;
DisconnectingPlayerStats.TotalPlayTime += newPlayTime;
curServer.playerStats.UpdateStats(P, DisconnectingPlayerStats);
}
private void ResetCounters(int cID, int serverPort)
{
StatTracking selectedPlayers = statLists.Find(x => x.Port == serverPort);
if (selectedPlayers == null)
return;
selectedPlayers.Kills[cID] = 0;
selectedPlayers.connectionTime[cID] = DateTime.Now;
selectedPlayers.inactiveMinutes[cID] = 0;
selectedPlayers.deathStreaks[cID] = 0;
selectedPlayers.killStreaks[cID] = 0;
}
private String MessageOnStreak(int killStreak, int deathStreak)
{
String Message = "";
switch (killStreak)
{
case 5:
Message = "Great job! You're on a ^55 killstreak!";
break;
case 10:
Message = "Amazing! ^510 kills ^7without dying!";
break;
}
switch (deathStreak)
{
case 5:
Message = "Pick it up soldier, you've died ^55 times ^7in a row...";
break;
case 10:
Message = "Seriously? ^510 deaths ^7without getting a kill?";
break;
}
return Message;
return Task.FromResult(
Manager = null
);
}
}
public class StatsDB : _Database
{
public StatsDB(String FN, SharedLibrary.Interfaces.ILogger logger) : base(FN, logger) { }
public override void Init()
{
if (!File.Exists(FileName))
{
String Create = "CREATE TABLE [STATS] ( [npID] TEXT, [KILLS] INTEGER DEFAULT 0, [DEATHS] INTEGER DEFAULT 0, [KDR] REAL DEFAULT 0, [SKILL] REAL DEFAULT 0, [MEAN] REAL DEFAULT 0, [DEV] REAL DEFAULT 0, [SPM] REAL DEFAULT 0, [PLAYTIME] INTEGER DEFAULT 0);";
String createKillsTable = @"CREATE TABLE `KILLS` (
`KillerID` INTEGER NOT NULL,
`VictimID` INTEGER NOT NULL,
`MapID` INTEGER NOT NULL,
`DeathOrigin` TEXT NOT NULL,
`MeansOfDeath` INTEGER NOT NULL,
`Weapon` INTEGER NOT NULL,
`HitLocation` INTEGER NOT NULL,
`Damage` INTEGER,
`KillOrigin` TEXT NOT NULL
); ";
ExecuteNonQuery(Create);
ExecuteNonQuery(createKillsTable);
}
}
public void AddKill(Stats.KillInfo info)
{
var kill = new Dictionary<string, object>
{
{ "KillerID", info.KillerPlayerID },
{ "VictimID", info.VictimPlayerID },
{ "MapID", (int)info.Map },
{ "KillOrigin", info.KillOrigin.ToString() },
{ "DeathOrigin", info.DeathOrigin.ToString() },
{ "MeansOfDeath", (int)info.DeathType },
{ "Weapon", (int)info.Weapon },
{ "HitLocation", (int)info.HitLoc },
{ "Damage", info.Damage }
};
Insert("KILLS", kill);
}
public List<Stats.KillInfo> GetKillsByPlayer(int databaseID)
{
var queryResult = GetDataTable("KILLS", new KeyValuePair<string, object>("KillerID", databaseID));
var resultList = new List<Stats.KillInfo>();
if (queryResult?.Rows.Count > 0)
{
foreach (DataRow resultRow in queryResult.Rows)
{
resultList.Add(new Stats.KillInfo()
{
KillerPlayerID = Convert.ToInt32(resultRow["KillerID"]),
VictimPlayerID = Convert.ToInt32(resultRow["VictimID"]),
Map = (IW4Info.MapName)resultRow["MapID"],
HitLoc = (IW4Info.HitLocation)resultRow["HitLocation"],
DeathType = (IW4Info.MeansOfDeath)resultRow["MeansOfDeath"],
Damage = (int)resultRow["Damage"],
Weapon = (IW4Info.WeaponName)resultRow["Weapon"],
KillOrigin = Vector3.Parse(resultRow["KillOrigin"].ToString()),
DeathOrigin = Vector3.Parse(resultRow["DeathOrigin"].ToString())
});
}
}
return resultList;
}
public List<Stats.KillInfo> GetKillsByMap(Map map, int count)
{
var mapID = ParseEnum<IW4Info.MapName>.Get(map.Name, typeof(IW4Info.MapName));
var queryResult = GetDataTable($"select * from KILLS where MapID == {(int)mapID} LIMIT {count} OFFSET (SELECT COUNT(*) FROM KILLS) - {count}");
var resultList = new List<Stats.KillInfo>();
if (queryResult?.Rows.Count > 0)
{
foreach (DataRow resultRow in queryResult.Rows)
{
resultList.Add(new Stats.KillInfo()
{
KillerPlayerID = Convert.ToInt32(resultRow["KillerID"]),
VictimPlayerID = Convert.ToInt32(resultRow["VictimID"]),
Map = ParseEnum<IW4Info.MapName>.Get(resultRow["MapID"].ToString(), typeof(IW4Info.MapName)),
HitLoc = ParseEnum<IW4Info.HitLocation>.Get(resultRow["HitLocation"].ToString(), typeof(IW4Info.HitLocation)),
DeathType = ParseEnum<IW4Info.MeansOfDeath>.Get(resultRow["MeansOfDeath"].ToString(), typeof(IW4Info.MeansOfDeath)),
Damage = Convert.ToInt32(resultRow["Damage"]),
Weapon = ParseEnum<IW4Info.WeaponName>.Get(resultRow["Weapon"].ToString(), typeof(IW4Info.WeaponName)),
KillOrigin = Vector3.Parse(resultRow["KillOrigin"].ToString()),
DeathOrigin = Vector3.Parse(resultRow["DeathOrigin"].ToString())
});
}
}
return resultList;
}
public void AddPlayer(Player P)
{
Dictionary<String, object> newPlayer = new Dictionary<String, object>
{
{ "npID", P.NetworkId },
{ "KILLS", 0 },
{ "DEATHS", 0 },
{ "KDR", 0.0 },
{ "SKILL", 1.0 },
{ "SPM", 1.0 },
{ "PLAYTIME", 1.0 }
};
Insert("STATS", newPlayer);
}
public PlayerStats GetStats(Player P)
{
DataTable Result = GetDataTable("STATS", new KeyValuePair<string, object>("npID", P.NetworkId));
if (Result != null && Result.Rows.Count > 0)
{
DataRow ResponseRow = Result.Rows[0];
return new PlayerStats(
Convert.ToInt32(ResponseRow["KILLS"]),
Convert.ToInt32(ResponseRow["DEATHS"]),
Convert.ToDouble(ResponseRow["KDR"]),
Convert.ToDouble(ResponseRow["SKILL"]),
Convert.ToDouble(ResponseRow["SPM"]),
Convert.ToInt32(ResponseRow["PLAYTIME"])
);
}
else
{
AddPlayer(P);
return GetStats(P);
}
}
public long GetTotalServerKills()
{
var Result = GetDataTable("SELECT SUM(KILLS) FROM STATS");
return Result.Rows[0][0].GetType() == typeof(DBNull) ? 0 : Convert.ToInt64(Result.Rows[0][0]);
}
public long GetTotalServerPlaytime()
{
var Result = GetDataTable("SELECT SUM(PLAYTIME) FROM STATS");
return Result.Rows[0][0].GetType() == typeof(DBNull) ? 0 : Convert.ToInt64(Result.Rows[0][0]) / 60;
}
public void UpdateStats(Player P, PlayerStats S)
{
Dictionary<String, object> updatedPlayer = new Dictionary<String, object>
{
{ "KILLS", S.Kills },
{ "DEATHS", S.Deaths },
{ "KDR", Math.Round(S.KDR, 2) },
{ "SKILL", Math.Round(S.Skill, 2) },
{ "SPM", Math.Round(S.scorePerMinute, 2) },
{ "PLAYTIME", S.TotalPlayTime }
};
Update("STATS", updatedPlayer, new KeyValuePair<string, object>("npID", P.NetworkId));
}
public List<KeyValuePair<String, PlayerStats>> GetTopStats()
{
String Query = String.Format("SELECT * FROM STATS WHERE SKILL > 0 AND KDR < '{0}' AND KILLS > '{1}' AND PLAYTIME > '{2}' ORDER BY SKILL DESC LIMIT '{3}'", 10, 150, 60, 5);
DataTable Result = GetDataTable(Query);
List<KeyValuePair<String, PlayerStats>> pStats = new List<KeyValuePair<String, PlayerStats>>();
if (Result != null && Result.Rows.Count > 0)
{
foreach (DataRow ResponseRow in Result.Rows)
{
pStats.Add(new KeyValuePair<String, PlayerStats>(ResponseRow["npID"].ToString(),
new PlayerStats(
Convert.ToInt32(ResponseRow["KILLS"]),
Convert.ToInt32(ResponseRow["DEATHS"]),
Convert.ToDouble(ResponseRow["KDR"]),
Convert.ToDouble(ResponseRow["SKILL"]),
Convert.ToDouble(ResponseRow["SPM"]),
Convert.ToInt32(ResponseRow["PLAYTIME"])
)
));
}
}
return pStats;
}
}
public class PlayerStats
{
public PlayerStats(int K, int D, double DR, double S, double sc, int P)
{
Kills = K;
Deaths = D;
KDR = DR;
Skill = S;
scorePerMinute = sc;
TotalPlayTime = P;
}
public int Kills;
public int Deaths;
public double KDR;
public double Skill;
public double scorePerMinute;
public int TotalPlayTime;
}
}
}

View File

@ -58,10 +58,8 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.ComponentModel.DataAnnotations" />
<Reference Include="System.Core" />
<Reference Include="System.Data.SQLite">
<HintPath>..\..\Admin\lib\System.Data.SQLite.dll</HintPath>
</Reference>
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
@ -69,15 +67,21 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Chat\ChatDatabase.cs" />
<Compile Include="Chat\ChatHistory.cs" />
<Compile Include="Chat\ChatHistoryPage.cs" />
<None Include="Chat\ChatDatabase.cs" />
<None Include="Chat\ChatHistory.cs" />
<None Include="Chat\ChatHistoryPage.cs" />
<Compile Include="Helpers\ServerStats.cs" />
<Compile Include="Helpers\StatManager.cs" />
<Compile Include="IW4Info.cs" />
<Compile Include="MinimapConfig.cs" />
<Compile Include="Models\EFClientKill.cs" />
<Compile Include="Models\EFServer.cs" />
<Compile Include="Models\EFClientStatistics.cs" />
<Compile Include="Plugin.cs" />
<None Include="_Plugin.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="StatsPage.cs" />
<Compile Include="TrustedGroupCommands.cs" />
<None Include="StatsPage.cs" />
<None Include="TrustedGroupCommands.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\SharedLibrary\SharedLibrary.csproj">

View File

@ -0,0 +1,578 @@
using SharedLibrary;
using SharedLibrary.Helpers;
using System;
using System.Collections.Generic;
using System.Data;
using System.IO;
using System.Text;
using System.Threading.Tasks;
using SharedLibrary.Objects;
using System.Linq;
using StatsPlugin.Models;
namespace StatsPlugin
{
public class CViewStats : Command
{
public CViewStats() : base("stats", "view your stats", "xlrstats", Player.Permission.User, false, new CommandArgument[]
{
new CommandArgument()
{
Name = "player",
Required = false
}
})
{ }
public override async Task ExecuteAsync(Event E)
{
if (E.Origin.ClientNumber < 0)
{
await E.Origin.Tell("You must be ingame to view your stats");
return;
}
String statLine;
EFClientStatistics pStats;
if (E.Data.Length > 0 && E.Target == null)
{
await E.Origin.Tell("Cannot find the player you specified");
return;
}
if (E.Target != null)
{
pStats = Stats.statLists.Find(x => x.Port == E.Owner.GetPort()).clientStats[E.Origin.ClientNumber];
statLine = String.Format("^5{0} ^7KILLS | ^5{1} ^7DEATHS | ^5{2} ^7KDR | ^5{3} ^7SKILL", pStats.Kills, pStats.Deaths, pStats.KDR, pStats.Skill);
}
else
{
pStats = Stats.statLists.Find(x => x.Port == E.Owner.GetPort()).clientStats[E.Origin.ClientNumber];
statLine = String.Format("^5{0} ^7KILLS | ^5{1} ^7DEATHS | ^5{2} ^7KDR | ^5{3} ^7SKILL", pStats.Kills, pStats.Deaths, pStats.KDR, pStats.Skill);
}
if (E.Message.IsBroadcastCommand())
{
string name = E.Target == null ? E.Origin.Name : E.Target.Name;
await E.Owner.Broadcast($"Stats for ^5{name}^7");
await E.Owner.Broadcast(statLine);
}
else
{
if (E.Target != null)
await E.Origin.Tell($"Stats for ^5{E.Target.Name}^7");
await E.Origin.Tell(statLine);
}
}
}
public class CViewTopStats : Command
{
public CViewTopStats() :
base("topstats", "view the top 5 players on this server", "ts", Player.Permission.User, false)
{ }
public override async Task ExecuteAsync(Event E)
{
List<KeyValuePair<String, PlayerStats>> pStats = Stats.statLists.Find(x => x.Port == E.Owner.GetPort()).playerStats.GetTopStats();
StringBuilder msgBlder = new StringBuilder();
await E.Origin.Tell("^5--Top Players--");
foreach (KeyValuePair<String, PlayerStats> pStat in pStats)
{
/* Player P = E.Owner.Manager.GetDatabase().GetClient(pStat.Key) as Player;
if (P == null)
continue;
await E.Origin.Tell(String.Format("^3{0}^7 - ^5{1} ^7KDR | ^5{2} ^7SKILL", P.Name, pStat.Value.KDR, pStat.Value.Skill));*/
}
}
}
public class CResetStats : Command
{
public CResetStats() : base("resetstats", "reset your stats to factory-new", "rs", Player.Permission.User, false) { }
public override async Task ExecuteAsync(Event E)
{
if (E.Origin.ClientNumber >= 0)
{
var svc = new SharedLibrary.Services.GenericService<EFClientStatistics>();
var stats = Stats.statLists[E.Owner.GetPort()].clientStats[E.Origin.ClientNumber];
await svc.Delete(stats);
await E.Origin.Tell("Your stats have been reset");
}
else
{
await E.Origin.Tell("You must be connected to a server to reset your stats");
}
}
}
public class CPruneAdmins : Command
{
public CPruneAdmins() : base("prune", "demote any admins that have not connected recently (defaults to 30 days)", "p", Player.Permission.Owner, false, new CommandArgument[]
{
new CommandArgument()
{
Name = "inactive days",
Required = false
}
})
{ }
public override async Task ExecuteAsync(Event E)
{
int inactiveDays = 30;
try
{
if (E.Data.Length > 0)
{
inactiveDays = Int32.Parse(E.Data);
if (inactiveDays < 1)
throw new FormatException();
}
}
catch (FormatException)
{
await E.Origin.Tell("Invalid number of inactive days");
return;
}
var inactiveAdmins = await E.Owner.Manager.GetDatabase().PruneInactivePrivilegedClients(inactiveDays);
await E.Origin.Tell($"Pruned inactive {inactiveAdmins.Count} privileged users");
}
}
/// <summary>
/// Each server runs from the same plugin ( for easier reloading and reduced memory usage ).
/// So, to have multiple stat tracking, we must store a stat struct for each server
/// </summary>
public class Stats : SharedLibrary.Interfaces.IPlugin
{
public static SharedLibrary.Interfaces.IManager ManagerInstance;
public static int MAX_KILLEVENTS = 1000;
public static Dictionary<int, ServerStatInfo> ServerStats { get; private set; }
public static SharedLibrary.Services.GenericService<Models.EFClientStatistics> ClientStatsSvc;
public static SharedLibrary.Services.GenericService<Models.EFServer> ServerSvc;
public class ServerStatInfo
{
public ServerStatInfo()
{
KillQueue = new Queue<KillInfo>();
ServerStartTime = DateTime.Now;
}
public DateTime ServerStartTime { get; private set; }
public DateTime RoundStartTime { get; set; }
public string Uptime => Utilities.GetTimePassed(ServerStartTime, false);
public string ElapsedRoundTime => Utilities.GetTimePassed(RoundStartTime);
private Queue<KillInfo> KillQueue { get; set; }
public Queue<KillInfo> GetKillQueue() { return KillQueue; }
}
public class KillInfo
{
public IW4Info.HitLocation HitLoc { get; set; }
public string HitLocString => HitLoc.ToString();
public IW4Info.MeansOfDeath DeathType { get; set; }
public string DeathTypeString => DeathType.ToString();
public int Damage { get; set; }
public IW4Info.WeaponName Weapon { get; set; }
public string WeaponString => Weapon.ToString();
public Vector3 KillOrigin { get; set; }
public Vector3 DeathOrigin { get; set; }
// http://wiki.modsrepository.com/index.php?title=Call_of_Duty_5:_Gameplay_standards for conversion to meters
public double Distance => Vector3.Distance(KillOrigin, DeathOrigin) * 0.0254;
public string KillerPlayer { get; set; }
public int KillerPlayerID { get; set; }
public string VictimPlayer { get; set; }
public int VictimPlayerID { get; set; }
public IW4Info.MapName Map { get; set; }
public int ID => GetHashCode();
public KillInfo() { }
public KillInfo(int killer, int victim, string map, string hit, string type, string damage, string weapon, string kOrigin, string dOrigin)
{
KillerPlayerID = killer;
VictimPlayerID = victim;
Map = ParseEnum<IW4Info.MapName>.Get(map, typeof(IW4Info.MapName));
HitLoc = ParseEnum<IW4Info.HitLocation>.Get(hit, typeof(IW4Info.HitLocation));
DeathType = ParseEnum<IW4Info.MeansOfDeath>.Get(type, typeof(IW4Info.MeansOfDeath));
Damage = Int32.Parse(damage);
Weapon = ParseEnum<IW4Info.WeaponName>.Get(weapon, typeof(IW4Info.WeaponName));
KillOrigin = Vector3.Parse(kOrigin);
DeathOrigin = Vector3.Parse(dOrigin);
}
}
public static List<StatTracking> statLists;
public class StatTracking
{
public DateTime[] lastKill, connectionTime;
public int[] inactiveMinutes, Kills, deathStreaks, killStreaks;
public int Port;
public Models.EFClientStatistics[] clientStats;
public StatTracking(int port)
{
clientStats = new Models.EFClientStatistics[18];
inactiveMinutes = new int[18];
Kills = new int[18];
deathStreaks = new int[18];
killStreaks = new int[18];
lastKill = new DateTime[18];
connectionTime = new DateTime[18];
Port = port;
}
}
public string Name => "Basic Stats";
public float Version => 1.1f;
public string Author => "RaidMax";
public async Task OnLoadAsync(SharedLibrary.Interfaces.IManager manager)
{
statLists = new List<StatTracking>();
ServerStats = new Dictionary<int, ServerStatInfo>();
ManagerInstance = manager;
WebService.PageList.Add(new StatsPage());
WebService.PageList.Add(new KillStatsJSON());
WebService.PageList.Add(new Chat.WordCloudJSON());
WebService.PageList.Add(new Chat.ClientChatJSON());
WebService.PageList.Add(new Chat.ChatPage());
ManagerInstance.GetMessageTokens().Add(new MessageToken("TOTALKILLS", GetTotalKills));
ManagerInstance.GetMessageTokens().Add(new MessageToken("TOTALPLAYTIME", GetTotalPlaytime));
ClientStatsSvc = new SharedLibrary.Services.GenericService<Models.EFClientStatistics>();
ServerSvc = new SharedLibrary.Services.GenericService<Models.EFServer>()
ChatDB = new ChatDatabase("Database/ChatHistory.rm", ManagerInstance.GetLogger());
try
{
var minimapConfig = MinimapConfig.Read("Config/minimaps.cfg");
}
catch (SharedLibrary.Exceptions.SerializeException e)
{
MinimapConfig.Write("Config/minimaps.cfg", MinimapConfig.IW4Minimaps());
}
}
public async Task OnUnloadAsync()
{
statLists.Clear();
}
public async Task OnTickAsync(Server S)
{
return;
}
public async Task OnEventAsync(Event E, Server S)
{
try
{
if (E.Type == Event.GType.Start)
{
statLists.Add(new StatTracking(S.GetPort()));
ServerStats.Add(S.GetPort(), new ServerStatInfo());
var config = new ConfigurationManager(S);
if (config.GetProperty("EnableTrusted") == null)
config.AddProperty(new KeyValuePair<string, object>("EnableTrusted", true));
}
if (E.Type == Event.GType.Stop)
{
statLists.RemoveAll(s => s.Port == S.GetPort());
ServerStats.Remove(S.GetPort());
}
if (E.Type == Event.GType.Connect)
{
ResetCounters(E.Origin.ClientNumber, S.GetPort());
var serverStats = statLists.First(s => s.Port == E.Owner.GetPort());
var clientStats = await ClientStatsSvc.Get(new int[] { E.Origin.ClientNumber });
var server = (await ServerSvc.Find(s => s.Port == E.Owner.GetPort())).First();
// create stats if not exist already
serverStats.clientStats[E.Origin.ClientNumber] = clientStats ?? await ClientStatsSvc.Create(new Models.EFClientStatistics()
{
Active = false,
Client = E.Target,
ClientId = E.Target.ClientId,
Deaths = 0,
KDR = 0,
Kills = 0,
Server = (await ServerSvc.Find(s => s.Port == E.Owner.GetPort())).First(),
ServerId = server.ServerId,
Skill = 0,
SPM = 0,
});
/* var config = new ConfigurationManager(E.Owner);
if (!(bool)config.GetProperty("EnableTrusted"))
return;
PlayerStats checkForTrusted = statLists.Find(x => x.Port == S.GetPort()).playerStats.GetStats(E.Origin);
//todo: move this out of here!!
if (checkForTrusted.TotalPlayTime >= 4320 && E.Origin.Level < Player.Permission.Trusted && E.Origin.Level != Player.Permission.Flagged)
{
E.Origin.Level = Player.Permission.Trusted;
await E.Owner.Manager.GetDatabase().UpdateClient(E.Origin);
await E.Origin.Tell("Congratulations, you are now a ^5trusted ^7player! Type ^5!help ^7to view new commands.");
await E.Origin.Tell("You earned this by playing for ^53 ^7full days!");
}*/
}
if (E.Type == Event.GType.MapEnd || E.Type == Event.GType.Stop)
{
foreach (Player P in S.GetPlayersAsList())
{
if (P == null)
continue;
CalculateAndSaveSkill(P, statLists.Find(x => x.Port == S.GetPort()));
ResetCounters(P.ClientNumber, S.GetPort());
E.Owner.Logger.WriteInfo($"Updated skill for {P}");
//E.Owner.Log.Write(String.Format("\r\nJoin: {0}\r\nInactive Minutes: {1}\r\nnewPlayTime: {2}\r\nnewSPM: {3}\r\nkdrWeight: {4}\r\nMultiplier: {5}\r\nscoreWeight: {6}\r\nnewSkillFactor: {7}\r\nprojectedNewSkill: {8}\r\nKills: {9}\r\nDeaths: {10}", connectionTime[P.ClientNumber].ToShortTimeString(), inactiveMinutes[P.ClientNumber], newPlayTime, newSPM, kdrWeight, Multiplier, scoreWeight, newSkillFactor, disconnectStats.Skill, disconnectStats.Kills, disconnectStats.Deaths));
}
}
if (E.Type == Event.GType.MapChange)
{
ServerStats[S.GetPort()].GetKillQueue().Clear();
ServerStats[S.GetPort()].RoundStartTime = DateTime.Now;
}
if (E.Type == Event.GType.Disconnect)
{
CalculateAndSaveSkill(E.Origin, statLists.Find(x => x.Port == S.GetPort()));
ResetCounters(E.Origin.ClientNumber, S.GetPort());
E.Owner.Logger.WriteInfo($"Updated skill for disconnecting client {E.Origin}");
}
if (E.Type == Event.GType.Kill)
{
if (E.Origin == E.Target || E.Origin == null)
return;
string[] killInfo = (E.Data != null) ? E.Data.Split(';') : new string[0];
if (killInfo.Length >= 9 && killInfo[0].Contains("ScriptKill"))
{
var killEvent = new KillInfo(E.Origin.ClientNumber, E.Target.ClientNumber, S.CurrentMap.Name, killInfo[7], killInfo[8], killInfo[5], killInfo[6], killInfo[3], killInfo[4])
{
KillerPlayer = E.Origin.Name,
VictimPlayer = E.Target.Name,
};
if (ServerStats[S.GetPort()].GetKillQueue().Count > MAX_KILLEVENTS - 1)
ServerStats[S.GetPort()].GetKillQueue().Dequeue();
ServerStats[S.GetPort()].GetKillQueue().Enqueue(killEvent);
//S.Logger.WriteInfo($"{E.Origin.Name} killed {E.Target.Name} with a {killEvent.Weapon} from a distance of {Vector3.Distance(killEvent.KillOrigin, killEvent.DeathOrigin)} with {killEvent.Damage} damage, at {killEvent.HitLoc}");
var cs = statLists.Find(x => x.Port == S.GetPort());
cs.playerStats.AddKill(killEvent);
}
Player Killer = E.Origin;
StatTracking curServer = statLists.Find(x => x.Port == S.GetPort());
var killerStats = curServer.clientStats[]
if (killerStats == null)
killerStats = new PlayerStats(0, 0, 0, 0, 0, 0);
curServer.lastKill[E.Origin.ClientNumber] = DateTime.Now;
curServer.Kills[E.Origin.ClientNumber]++;
if ((DateTime.Now - curServer.lastKill[E.Origin.ClientNumber]).TotalSeconds > 120)
curServer.inactiveMinutes[E.Origin.ClientNumber] += 2;
killerStats.Kills++;
killerStats.KDR = (killerStats.Deaths == 0) ? killerStats.Kills : killerStats.KDR = Math.Round((double)killerStats.Kills / (double)killerStats.Deaths, 2);
curServer.playerStats.UpdateStats(Killer, killerStats);
curServer.killStreaks[Killer.ClientNumber] += 1;
curServer.deathStreaks[Killer.ClientNumber] = 0;
await Killer.Tell(MessageOnStreak(curServer.killStreaks[Killer.ClientNumber], curServer.deathStreaks[Killer.ClientNumber]));
}
if (E.Type == Event.GType.Death)
{
if (E.Origin == E.Target || E.Origin == null)
return;
Player Victim = E.Origin;
StatTracking curServer = statLists.Find(x => x.Port == S.GetPort());
PlayerStats victimStats = curServer.playerStats.GetStats(Victim);
if (victimStats == null)
victimStats = new PlayerStats(0, 0, 0, 0, 0, 0);
victimStats.Deaths++;
victimStats.KDR = Math.Round(victimStats.Kills / (double)victimStats.Deaths, 2);
curServer.playerStats.UpdateStats(Victim, victimStats);
curServer.deathStreaks[Victim.ClientNumber] += 1;
curServer.killStreaks[Victim.ClientNumber] = 0;
await Victim.Tell(MessageOnStreak(curServer.killStreaks[Victim.ClientNumber], curServer.deathStreaks[Victim.ClientNumber]));
}
if (E.Type == Event.GType.Say)
{
ChatDB.AddChatHistory(E.Origin.ClientNumber, E.Owner.GetPort(), E.Data);
}
}
catch (Exception e)
{
S.Logger.WriteWarning("StatsPlugin::OnEventAsync failed to complete");
S.Logger.WriteDebug($"Server:{S}\r\nOrigin:{E.Origin}\r\nTarget:{E.Target}");
S.Logger.WriteDebug($"Exception: {e.Message}");
}
}
public static string GetTotalKills()
{
long Kills = 0;
foreach (var S in statLists)
Kills += S.playerStats.GetTotalServerKills();
return Kills.ToString("#,##0");
}
public static string GetTotalPlaytime()
{
long Playtime = 0;
foreach (var S in statLists)
Playtime += S.playerStats.GetTotalServerPlaytime();
return Playtime.ToString("#,##0");
}
private void CalculateAndSaveSkill(Player P, StatTracking curServer)
{
if (P == null)
return;
var DisconnectingPlayerStats = curServer.clientStats[P.ClientNumber];
if (curServer.Kills[P.ClientNumber] == 0)
return;
//else if (curServer.lastKill[P.ClientNumber] > curServer.connectionTime[P.ClientNumber])
// curServer.inactiveMinutes[P.ClientNumber] += (int)(DateTime.Now - curServer.lastKill[P.ClientNumber]).TotalMinutes;
int newPlayTime = (int)(DateTime.Now - P.LastConnection).TotalMinutes;
// (int)(DateTime.Now - curServer.connectionTime[P.ClientNumber]).TotalMinutes - curServer.inactiveMinutes[P.ClientNumber];
// calculate the players Score Per Minute for the current session
double SessionSPM = curServer.Kills[P.ClientNumber] * 100 / Math.Max(1, newPlayTime);
// calculate how much the KDR should way
// 1.637 is a Eddie-Generated number that weights the KDR nicely
double KDRWeight = Math.Round(Math.Pow(DisconnectingPlayerStats.KDR, 1.637 / Math.E), 3);
double SPMWeightAgainstAverage;
// if no SPM, weight is 1 else the weight is the current sessions spm / lifetime average score per minute
SPMWeightAgainstAverage = (DisconnectingPlayerStats.SPM == 1) ? 1 : SessionSPM / DisconnectingPlayerStats.SPM;
// calculate the weight of the new play time againmst lifetime playtime
double SPMAgainstPlayWeight = newPlayTime / Math.Min(600, P.TotalConnectionTime + newPlayTime);
// calculate the new weight against average times the weight against play time
double newSkillFactor = SPMWeightAgainstAverage * SPMAgainstPlayWeight * SessionSPM;
// if the weight is greater than 1, add, else subtract
DisconnectingPlayerStats.SPM += (SPMWeightAgainstAverage >= 1) ? newSkillFactor : -newSkillFactor;
DisconnectingPlayerStats.Skill = DisconnectingPlayerStats.SPM * KDRWeight * 10;
ClientStatsSvc.Update(DisconnectingPlayerStats);
}
private void ResetCounters(int cID, int serverPort)
{
StatTracking selectedPlayers = statLists.Find(x => x.Port == serverPort);
if (selectedPlayers == null)
return;
selectedPlayers.Kills[cID] = 0;
selectedPlayers.connectionTime[cID] = DateTime.Now;
selectedPlayers.inactiveMinutes[cID] = 0;
selectedPlayers.deathStreaks[cID] = 0;
selectedPlayers.killStreaks[cID] = 0;
}
private String MessageOnStreak(int killStreak, int deathStreak)
{
String Message = "";
switch (killStreak)
{
case 5:
Message = "Great job! You're on a ^55 killstreak!";
break;
case 10:
Message = "Amazing! ^510 kills ^7without dying!";
break;
}
switch (deathStreak)
{
case 5:
Message = "Pick it up soldier, you've died ^55 times ^7in a row...";
break;
case 10:
Message = "Seriously? ^510 deaths ^7without getting a kill?";
break;
}
return Message;
}
}
public class PlayerStats
{
public PlayerStats(int K, int D, double DR, double S, double sc, int P)
{
Kills = K;
Deaths = D;
KDR = DR;
Skill = S;
scorePerMinute = sc;
TotalPlayTime = P;
}
public int Kills;
public int Deaths;
public double KDR;
public double Skill;
public double scorePerMinute;
public int TotalPlayTime;
}
}

View File

@ -63,7 +63,7 @@ namespace IW4MAdmin.Plugins
if (File.Exists("import_clients.csv"))
{
var clients = new List<Player>();
manager.GetLogger().WriteInfo("Beginning import of existing clients");
manager.GetLogger().WriteVerbose("Beginning import of existing clients");
var lines = File.ReadAllLines("import_clients.csv").Skip(1);
foreach (string line in lines)
@ -109,7 +109,7 @@ namespace IW4MAdmin.Plugins
.Select(c => c.FirstOrDefault())
.ToList();
manager.GetLogger().WriteInfo($"Read {clients.Count} clients for import");
manager.GetLogger().WriteVerbose($"Read {clients.Count} clients for import");
try
{
@ -125,9 +125,8 @@ namespace IW4MAdmin.Plugins
#region PENALTIES
if (File.Exists("import_penalties.csv"))
{
int importedPenalties = 0;
var penalties = new List<Penalty>();
manager.GetLogger().WriteInfo("Beginning import of existing penalties");
manager.GetLogger().WriteVerbose("Beginning import of existing penalties");
foreach (string line in File.ReadAllLines("import_penalties.csv").Skip(1))
{
string comma = Regex.Match(line, "\".*,.*\"").Value.Replace(",", "");
@ -170,19 +169,19 @@ namespace IW4MAdmin.Plugins
catch (Exception e)
{
manager.GetLogger().WriteWarning($"Could not import client with line {line}");
manager.GetLogger().WriteVerbose($"Could not import penalty with line {line}");
}
}
SharedLibrary.Database.Importer.ImportPenalties(penalties);
manager.GetLogger().WriteInfo($"Imported {penalties.Count} clients");
manager.GetLogger().WriteVerbose($"Imported {penalties.Count} penalties");
}
#endregion
}
public async Task OnTickAsync(Server S)
{
return;
if ((DateTime.Now - Interval).TotalSeconds > 5)
if ((DateTime.Now - Interval).TotalSeconds > 1)
{
var rand = new Random();
int index = rand.Next(0, 17);
@ -197,8 +196,8 @@ namespace IW4MAdmin.Plugins
if (S.Players.ElementAt(index) != null)
await S.RemovePlayer(index);
await S.AddPlayer(p);
/*
// await S.AddPlayer(p);
Interval = DateTime.Now;
if (S.ClientNum > 0)
@ -258,7 +257,7 @@ namespace IW4MAdmin.Plugins
var _event = Event.ParseEventString(eventLine, S);
await S.ExecuteEvent(_event);
}
}*/
}
}
}

View File

@ -236,7 +236,7 @@ namespace SharedLibrary.Commands
public override async Task ExecuteAsync(Event E)
{
String You = String.Format("{0} [^3#{1}^7] {2} [^3@{3}^7] [{4}^7] IP: {5}", E.Origin.Name, E.Origin.ClientNumber, E.Origin.NetworkId, E.Origin.ClientNumber, Utilities.ConvertLevelToColor(E.Origin.Level), E.Origin.IPAddress);
String You = String.Format("{0} [^3#{1}^7] {2} [^3@{3}^7] [{4}^7] IP: {5}", E.Origin.Name, E.Origin.ClientNumber, E.Origin.NetworkId, E.Origin.ClientId, Utilities.ConvertLevelToColor(E.Origin.Level), E.Origin.IPAddress);
await E.Origin.Tell(You);
}
}
@ -351,7 +351,7 @@ namespace SharedLibrary.Commands
await E.Owner.Broadcast($"Fast restarting in ^53 ^7seconds [^5{E.Origin.Name}^7]");
else
await E.Owner.Broadcast($"Fast restarting in ^53 ^7seconds [^5Masked Admin^7]");
await Task.Delay(3000);
Task.Delay(3000).Wait();
await E.Owner.ExecuteCommandAsync("fast_restart");
}
}
@ -368,7 +368,7 @@ namespace SharedLibrary.Commands
await E.Owner.Broadcast($"Map rotating in ^55 ^7seconds [^5{E.Origin.Name}^7]");
else
await E.Owner.Broadcast($"Map rotating in ^55 ^7seconds [^5Masked Admin^7]");
await Task.Delay(5000);
Task.Delay(5000).Wait();
await E.Owner.ExecuteCommandAsync("map_rotate");
}
}
@ -497,14 +497,14 @@ namespace SharedLibrary.Commands
if (m.Name.ToLower() == newMap || m.Alias.ToLower() == newMap)
{
await E.Owner.Broadcast("Changing to map ^2" + m.Alias);
await Task.Delay(5000);
Task.Delay(5000).Wait();
await E.Owner.LoadMap(m.Name);
return;
}
}
await E.Owner.Broadcast("Attempting to change to unknown map ^1" + newMap);
await Task.Delay(5000);
Task.Delay(5000).Wait();
await E.Owner.LoadMap(newMap);
}
}

View File

@ -7,6 +7,7 @@ using System.Threading.Tasks;
using SharedLibrary.Database.Models;
using System.Data.SqlServerCe;
using System.Data.Entity.ModelConfiguration.Conventions;
using System.Reflection;
namespace SharedLibrary.Database
{
@ -31,7 +32,6 @@ namespace SharedLibrary.Database
.HasForeignKey(c => c.OffenderId)
.WillCascadeOnDelete(false);
modelBuilder.Entity<EFPenalty>()
.HasRequired(p => p.Punisher)
.WithMany(c => c.AdministeredPenalties)
@ -44,18 +44,35 @@ namespace SharedLibrary.Database
.HasForeignKey(a => a.LinkId)
.WillCascadeOnDelete(true);
/* modelBuilder.Entity<EFAlias>()
.HasIndex(a => new { a.IP, a.Name })
.IsUnique();
modelBuilder.Entity<EFAlias>()
.HasIndex(p => new { p.Name, p.IPAddress }).IsUnique();*/
modelBuilder.Conventions.Remove<OneToManyCascadeDeleteConvention>();
// todo: custom load DBSets from plugins
// https://aleemkhan.wordpress.com/2013/02/28/dynamically-adding-dbset-properties-in-dbcontext-for-entity-framework-code-first/
foreach (string dllPath in System.IO.Directory.GetFiles($"{Environment.CurrentDirectory}{System.IO.Path.DirectorySeparatorChar}Plugins"))
{
Assembly library;
try
{
library = Assembly.LoadFile(dllPath);
}
// not a valid assembly, ie plugin files
catch (Exception)
{
continue;
}
foreach(var type in library.ExportedTypes)
{
if (type.IsClass && type.IsSubclassOf(typeof(SharedEntity)))
{
var method = modelBuilder.GetType().GetMethod("Entity");
method = method.MakeGenericMethod(new Type[] { type });
method.Invoke(modelBuilder, null);
}
}
}
base.OnModelCreating(modelBuilder);
}
}

View File

@ -37,9 +37,10 @@ namespace SharedLibrary.Helpers
return (DateTime.Now - StartTime).TotalMilliseconds;
}
public void Update(Task T)
public void Update(Task<bool> T)
{
RequestedTask = T;
Console.WriteLine($"Starting Task {T.Id} ");
RequestedTask.Start();
if (TimesRun > 25)

View File

@ -1,4 +1,5 @@
using System;
using System.Reflection;
namespace SharedLibrary
{

View File

@ -22,8 +22,13 @@ namespace SharedLibrary.Network
COMMAND,
}
static string[] SendQuery(QueryType Type, Server QueryServer, string Parameters = "")
private static DateTime LastQuery;
static string[] SendQuery(QueryType Type, Server QueryServer, string Parameters = "")
{
if ((DateTime.Now - LastQuery).TotalMilliseconds < 30)
Task.Delay(30).Wait();
LastQuery = DateTime.Now;
var ServerOOBConnection = new UdpClient();
ServerOOBConnection.Client.SendTimeout = 5000;
ServerOOBConnection.Client.ReceiveTimeout = 5000;
@ -91,7 +96,7 @@ namespace SharedLibrary.Network
}
Thread.Sleep(1000);
goto retry;
goto retry;
}
}
@ -134,7 +139,11 @@ namespace SharedLibrary.Network
public static async Task<List<Player>> GetStatusAsync(this Server server)
{
#if DEBUG
string[] response = await Task.Run(() => System.IO.File.ReadAllLines("players.txt"));
#else
string[] response = await Task.FromResult(SendQuery(QueryType.DVAR, server, "status"));
#endif
return Utilities.PlayersFromStatus(response);
}

View File

@ -115,7 +115,7 @@ namespace SharedLibrary
/// <returns></returns>
abstract public Task<Command> ValidateCommand(Event E);
virtual public Task ProcessUpdatesAsync(CancellationToken cts)
virtual public Task<bool> ProcessUpdatesAsync(CancellationToken cts)
{
return null;
}

View File

@ -54,11 +54,15 @@ namespace SharedLibrary.Services
public async Task<IList<EFAlias>> Find(Func<EFAlias, bool> expression)
{
using (var context = new DatabaseContext())
return await Task.Run(() => context.Aliases
.AsNoTracking()
.Include(a => a.Link.Children)
.Where(expression).ToList());
return await Task.Run(() =>
{
using (var context = new DatabaseContext())
return context.Aliases
.AsNoTracking()
.Include(a => a.Link.Children)
.Where(expression)
.ToList();
});
}
public async Task<EFAlias> Get(int entityID)

View File

@ -88,12 +88,15 @@ namespace SharedLibrary.Services
public async Task<IList<EFClient>> Find(Func<EFClient, bool> e)
{
using (var context = new DatabaseContext())
return await Task.Run(() => context.Clients
.AsNoTracking()
.Include(c => c.CurrentAlias)
.Include(c => c.AliasLink.Children)
.Where(e).ToList());
return await Task.Run(() =>
{
using (var context = new DatabaseContext())
return context.Clients
.AsNoTracking()
.Include(c => c.CurrentAlias)
.Include(c => c.AliasLink.Children)
.Where(e).ToList();
});
}
public async Task<EFClient> Get(int entityID)
@ -125,7 +128,7 @@ namespace SharedLibrary.Services
// grab the context version of the entity
var client = context.Clients
.Include(c => c.AliasLink)
.Include(c=> c.CurrentAlias)
.Include(c => c.CurrentAlias)
.Single(e => e.ClientId == entity.ClientId);
// if their level has been changed
@ -167,12 +170,12 @@ namespace SharedLibrary.Services
// this is set so future updates don't trigger a new alias add
if (entity.CurrentAlias.AliasId == 0)
entity.CurrentAlias.AliasId = client.CurrentAlias.AliasId;
entity.CurrentAlias.AliasId = client.CurrentAlias.AliasId;
return client;
}
}
#region ServiceSpecific
#region ServiceSpecific
public async Task<IList<EFClient>> GetOwners()
{
using (var context = new DatabaseContext())
@ -230,6 +233,6 @@ namespace SharedLibrary.Services
{
throw new NotImplementedException();
}
#endregion
#endregion
}
}

View File

@ -0,0 +1,146 @@
using SharedLibrary.Database;
using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;
namespace SharedLibrary.Services
{
// https://stackoverflow.com/questions/43677906/crud-operations-with-entityframework-using-generic-type
public class GenericRepository<TEntity> where TEntity : class
{
private dynamic _context;
private DbSet<TEntity> _dbSet;
protected DbContext Context
{
get
{
if (_context == null)
{
_context = new DatabaseContext();
}
return _context;
}
}
protected DbSet<TEntity> DBSet
{
get
{
if (_dbSet == null)
{
_dbSet = this.Context.Set<TEntity>();
}
return _dbSet;
}
}
public virtual IEnumerable<TEntity> Find(Expression<Func<TEntity, bool>> predicate, Func<IQueryable<TEntity>, IOrderedQueryable<TEntity>> orderExpression = null)
{
return this.GetQuery(predicate, orderExpression).AsEnumerable();
}
public virtual IQueryable<TEntity> GetQuery(Expression<Func<TEntity, bool>> predicate = null, Func<IQueryable<TEntity>, IOrderedQueryable<TEntity>> orderExpression = null)
{
IQueryable<TEntity> qry = this.DBSet;
if (predicate != null)
qry = qry.Where(predicate);
if (orderExpression != null)
return orderExpression(qry);
return qry;
}
public virtual void Insert<T>(T entity) where T : class
{
DbSet<T> dbSet = this.Context.Set<T>();
dbSet.Add(entity);
}
public virtual TEntity Insert(TEntity entity)
{
return this.DBSet.Add(entity);
}
public virtual void Update<T>(T entity) where T : class
{
DbSet<T> dbSet = this.Context.Set<T>();
dbSet.Attach(entity);
this.Context.Entry(entity).State = EntityState.Modified;
}
public virtual void Update(TEntity entity)
{
this.Attach(entity);
this.Context.Entry(entity).State = EntityState.Modified;
}
public virtual void Delete<T>(T entity) where T : class
{
DbSet<T> dbSet = this.Context.Set<T>();
if (this.Context.Entry(entity).State == EntityState.Detached)
dbSet.Attach(entity);
dbSet.Remove(entity);
}
public virtual void Delete(TEntity entity)
{
if (this.Context.Entry(entity).State == EntityState.Detached)
this.Attach(entity);
this.DBSet.Remove(entity);
}
public virtual void Delete<T>(object[] id) where T : class
{
DbSet<T> dbSet = this.Context.Set<T>();
T entity = dbSet.Find(id);
dbSet.Attach(entity);
dbSet.Remove(entity);
}
public virtual void Delete(object id)
{
TEntity entity = this.DBSet.Find(id);
this.Delete(entity);
}
public virtual void Attach(TEntity entity)
{
if (this.Context.Entry(entity).State == EntityState.Detached)
this.DBSet.Attach(entity);
}
public virtual void SaveChanges()
{
this.Context.SaveChanges();
}
public virtual async Task SaveChangesAsync()
{
try
{
await this.Context.SaveChangesAsync();
}
catch (Exception e)
{
throw e;
}
}
}
}

View File

@ -0,0 +1,68 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using SharedLibrary.Database;
namespace SharedLibrary.Services
{
public class GenericService<T> : Interfaces.IEntityService<T>
{
public async Task<T> Create(T entity)
{
using (var context = new DatabaseContext())
{
var dbSet = context.Set(entity.GetType());
T addedEntity = (T)dbSet.Add(entity);
await context.SaveChangesAsync();
return addedEntity;
}
}
public Task<T> CreateProxy()
{
throw new NotImplementedException();
}
public Task<T> Delete(T entity)
{
throw new NotImplementedException();
}
public Task<IList<T>> Find(Func<T, bool> expression)
{
throw new NotImplementedException();
}
public async Task<T> Get(int entityID)
{
using (var context = new DatabaseContext())
{
var dbSet = context.Set(typeof(T));
return (T)(await dbSet.FindAsync(entityID));
}
}
public async Task<T> Get(params object[] entityKeys)
{
using (var context = new DatabaseContext())
{
var dbSet = context.Set(typeof(T));
return (T)(await dbSet.FindAsync(entityKeys));
}
}
public Task<T> GetUnique(string entityProperty)
{
throw new NotImplementedException();
}
public Task<T> Update(T entity)
{
throw new NotImplementedException();
}
}
}

View File

@ -56,15 +56,16 @@ namespace SharedLibrary.Services
public async Task<IList<EFPenalty>> Find(Func<EFPenalty, bool> expression)
{
using (var context = new DatabaseContext())
return await Task.Run(() =>
{
return await Task.Run(() => context.Penalties
.Include(p => p.Offender)
.Include(p => p.Punisher)
.Where(expression)
.Where(p => p.Active)
.ToList());
}
using (var context = new DatabaseContext())
return context.Penalties
.Include(p => p.Offender)
.Include(p => p.Punisher)
.Where(expression)
.Where(p => p.Active)
.ToList();
});
}
public Task<EFPenalty> Get(int entityID)

View File

@ -137,6 +137,8 @@
<Compile Include="ServerConfiguration.cs" />
<Compile Include="Services\AliasService.cs" />
<Compile Include="Services\ClientService.cs" />
<Compile Include="Services\GenericRepository.cs" />
<Compile Include="Services\GenericService.cs" />
<Compile Include="Services\PenaltyService.cs" />
<Compile Include="Utilities.cs" />
<Compile Include="WebService.cs" />
@ -152,10 +154,6 @@
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>move "$(TargetDir)Newtonsoft.Json.dll" "$(TargetDir)lib\Newtonsoft.Json.dll"
copy /Y "$(TargetDir)SQLite.Interop.dll" "$(SolutionDir)BUILD\lib"
copy /Y "$(TargetDir)System.Data.SQLite.dll" "$(SolutionDir)BUILD\lib"
copy /Y "$(TargetDir)SQLite.Interop.dll" "$(SolutionDir)Admin\lib"
copy /Y "$(TargetDir)System.Data.SQLite.dll" "$(SolutionDir)Admin\lib"
copy /Y "$(TargetDir)$(TargetName).dll" "$(SolutionDir)BUILD\lib"
copy /Y "$(TargetDir)$(TargetName).dll" "$(SolutionDir)Admin\lib"
copy /Y "$(TargetDir)Newtonsoft.Json.dll" "$(SolutionDir)BUILD\lib"

View File

@ -318,7 +318,8 @@ namespace SharedLibrary
IPAddress = client.CurrentAlias.IPAddress,
Level = client.Level,
LastConnection = DateTime.UtcNow,
CurrentAlias = client.CurrentAlias
CurrentAlias = client.CurrentAlias,
CurrentAliasId = client.CurrentAlias.AliasId
};
}
}