Skip to content

Getting started

proepkes edited this page Jul 8, 2018 · 28 revisions
  1. Clone this repository to your computer
  2. Open "SpeedDate.sln" in Visual Studio
  3. Set "SpeedDate.Server.Console" as your startup-project
  4. Hit F5

The EchoPlugin provides a simple examples which echoes and incoming string back to the client. A simple usage of the EchoPlugin can be found in the class "TestEcho".

Instantiate a server with configuration-file

var server = new SpeedDateServer();
server.Start(new FileConfigProvider("ServerConfig.xml")); 

Instantiate a client with configuration-file

var client = new SpeedDateClient();
client.Started += () => { /* client connected, dome something */}; 
client.Start("ClientConfig.xml");

Custom configuration

To make a plugin configurable through Xml-Configuration, add a new class that holds the configurable variables and let it implement IConfig-interface:

class MyServerPluginConfig : IConfig
{
    public bool SettingWhatever { get; set; }
}

Next, inside the plugin add the corresponding field and apply the [Inject]-attribute to it:

[Inject] private MyServerPluginConfig _config;

To configure the plugin, add the corresponding tag inside the *.xml-configuration:

<MyServerPluginConfig SettingWhatever="false"/>

You can also configure your plugins from within the code, see "SpeedDate.Client.Spawner.Console" for an example.

Clone this wiki locally