source_server 0.1.4 source_server: ^0.1.4 copied to clipboard
A library to connect to Source Dedicate Servers like CS:GO, CSS, TF2, ...
SourceSerer #
A library to connect to Source Dedicated Servers [CS:GO, CSS, TF2, ...]
Get started #
Import the library (make sure to check for the latest version).
depedencies:
source_server: ^0.0.3
Then Construct our class.
var server = new SourceServer('foo', ip: 'localhost', port: 27015);
The only required parameter is the first, password, the ip and port by default are: localhost:27015
Now we can estabilish a connection to server:
var server;
server.connect();
Here you can optionally provive an onDone callback to know when the connection closes.
Sending commands #
Use
var reply = await server.command('status');
the method command
will return a Future
string holding the server reply.
TODO #
- If packet is split in multiple requests return it properly.
- Allow to get more info about the server and connected players.
- Add a
status
command parser.