Skip to content
This repository was archived by the owner on Dec 23, 2022. It is now read-only.

Commit ae97b7e

Browse files
committed
Initialized README
1 parent eb8b6c9 commit ae97b7e

File tree

1 file changed

+44
-2
lines changed

1 file changed

+44
-2
lines changed

README.md

Lines changed: 44 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,44 @@
1-
# source-rcon-library
2-
A source RCON (https://developer.valvesoftware.com/wiki/Source_RCON_Protocol) server library
1+
# Source RCON Library
2+
3+
Source RCON Library is a single class solution to create a [source](https://developer.valvesoftware.com/wiki/Source_RCON_Protocol) compatible RCON Server
4+
5+
# Examples
6+
7+
## Minimum setup server
8+
```csharp
9+
var server = new RemoteConServer(IPAddress.Any, 27015);
10+
server.StartListening();
11+
```
12+
13+
## Adding a command as LAMBDA expression
14+
15+
```csharp
16+
server.CommandManager.Add("hello", "Echos back world", (command, arguments) => {
17+
return "world";
18+
});
19+
```
20+
21+
## Adding a command as method
22+
23+
```csharp
24+
public static class Program
25+
{
26+
public static int Main(string[] args)
27+
{
28+
var server = new RemoteConServer(IPAddress.Any, 27015) {SendAuthImmediately = true};
29+
server.CommandManager.Add("hello", "", Hello_Command);
30+
31+
server.StartListening();
32+
while (true)
33+
{
34+
}
35+
36+
return 0;
37+
}
38+
39+
public string Hello_Command(string command, IList<string> args)
40+
{
41+
return "world";
42+
}
43+
}
44+
```

0 commit comments

Comments
 (0)