{"id":24641036,"url":"https://github.com/nakira974/lkhsoft.dring","last_synced_at":"2025-03-20T11:48:54.620Z","repository":{"id":272055458,"uuid":"915102560","full_name":"nakira974/Lkhsoft.Dring","owner":"nakira974","description":"Extensible C# server using MEF for dynamic functionality and LUA for internal scripting. Ideal for creating flexible, extendable server applications","archived":false,"fork":false,"pushed_at":"2025-03-15T22:13:13.000Z","size":2129,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"trunk","last_synced_at":"2025-03-15T23:20:03.334Z","etag":null,"topics":["csharp","lua","mef","multithreading","socket"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nakira974.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-01-11T01:20:26.000Z","updated_at":"2025-02-27T22:20:32.000Z","dependencies_parsed_at":"2025-02-16T00:20:16.976Z","dependency_job_id":"9a2bea55-7ad7-46b7-95ac-66f013064f4f","html_url":"https://github.com/nakira974/Lkhsoft.Dring","commit_stats":null,"previous_names":["nakira974/lkhsoft.dring"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nakira974%2FLkhsoft.Dring","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nakira974%2FLkhsoft.Dring/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nakira974%2FLkhsoft.Dring/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nakira974%2FLkhsoft.Dring/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nakira974","download_url":"https://codeload.github.com/nakira974/Lkhsoft.Dring/tar.gz/refs/heads/trunk","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244609431,"owners_count":20480782,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["csharp","lua","mef","multithreading","socket"],"created_at":"2025-01-25T12:12:04.053Z","updated_at":"2025-03-20T11:48:54.613Z","avatar_url":"https://github.com/nakira974.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Extensible Server with MEF\n\n## Overview\n\nThis project demonstrates how to create an extensible server using the Managed Extensibility Framework (MEF). \nThe server is designed to be highly extensible, allowing developers to easily add new functionalities through MEF. \nAdditionally, the server supports the use of LUA as its internal language for creating batch scripts and other automation tasks.\n\n## Features\n\n- **Extensibility with MEF**: The server leverages MEF to allow for the dynamic discovery and composition of parts. This makes it easy to add new features and commands without modifying the core server code.\n- **LUA Scripting**: The server uses LUA as its internal scripting language. This allows users to create batch scripts, automate tasks, and extend the server's functionality using LUA scripts.\n- **Command-Line Interface (CLI)**: The server includes a robust CLI for interacting with the server, executing commands, and managing tasks.\n\n## Create a configuration file\nTo configure the server, you need to create an app.config file with the following structure:\n```xml\n\u003c?xml version=\"1.0\" encoding=\"utf-8\"?\u003e\n\u003cconfiguration\u003e\n    \u003cappSettings\u003e\n        \u003cadd key=\"CertificatePath\" value=\"C:\\\\Users\\\\octocat\\\\.ssl\\\\server_certificate.pfx\" /\u003e\n        \u003cadd key=\"CertificatePassword\" value=\"passwd\" /\u003e\n        \u003cadd key=\"PluginsPath\" value=\"C:\\\\Users\\\\octocat\\\\Server\\\\Plugins\" /\u003e\n        \u003cadd key=\"CommandsPath\" value=\"C:\\\\Users\\\\octocat\\\\Server\\\\Plugins\\\\Commands\" /\u003e\n        \u003cadd key=\"UdpPort\" value=\"60500\" /\u003e\n        \u003cadd key=\"TcpPort\" value=\"9091\" /\u003e\n        \u003cadd key=\"BatchConfigPath\" value=\"batch.config.yaml\"/\u003e\n        \u003cadd key=\"BatchDefaultLaunchTime\" value=\"0\"/\u003e\n        \u003cadd key=\"BatchOutputAllowed\" value=\"False\"/\u003e\n    \u003c/appSettings\u003e\n    \u003cconnectionStrings\u003e\n        \u003cadd name=\"ServerDB\" connectionString=\"Data Source=users.db;Version=3;\" providerName=\"System.Data.SqlClient\"/\u003e\n    \u003c/connectionStrings\u003e\n\u003c/configuration\u003e\n```\n- CertificatePath: The path to the server certificate file.\n- CertificatePassword: The password for the server certificate.\n- PluginsPath: The path to the directory containing the server plugins.\n- CommandsPath: The path to the directory containing the command plugins.\n- UdpPort: The UDP port number for the server.\n- TcpPort: The TCP port number for the server.\n- BatchConfigPath: The path to the batch configuration file.\n- BatchDefaultLaunchTime: The default launch time for batch jobs.\n- BatchOutputAllowed: A flag indicating whether Lua batch output is allowed.\n- ServerDB: The datasource for the server database.\n\n## Extending the Server with MEF\n\nTo add new commands or functionalities to the server, you can create new classes that implement the ICommand interface and export them using MEF. \nHere is an example of how to create a new command:\n\n```cs\nusing System;\nusing System.ComponentModel.Composition;\n\n[Export(typeof(ICommand))]\n[ExportMetadata(\"CommandName\", \"MYCOMMAND\")]\npublic class MyCommand : ICommand\n{\n    public void Execute(params object[] args)\n    {\n        Console.WriteLine(\"MyCommand executed.\");\n        // Add your command logic here\n    }\n}\n```\n\n## Using LUA Scripting\n\nThe server supports LUA as its internal scripting language. \nYou can use the CLI command called 'LUA' to launch an interpreter. \nUsing the server's LUA API (which you can extend by implementing ```cs public interface ILuaDelegate```), you can create batch scripts, automate tasks, and enhance the server's functionality. \nHere is an example of a simple LUA command:\n\n```lua\nprint(\"Hello, world!\")\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnakira974%2Flkhsoft.dring","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnakira974%2Flkhsoft.dring","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnakira974%2Flkhsoft.dring/lists"}