Merge pull request #24443 from Slessi/steam-client

Typings for steam-client
This commit is contained in:
Mine Starks
2018-03-23 10:27:28 -07:00
committed by GitHub
4 changed files with 3452 additions and 0 deletions
+3390
View File
File diff suppressed because it is too large Load Diff
+38
View File
@@ -0,0 +1,38 @@
import Steam = require("steam-client");
const steamClient = new Steam.CMClient(Steam.EConnectionProtocol.TCP);
steamClient.connect();
steamClient.connect(Steam.servers[0]);
steamClient.connect(Steam.servers[0], true);
steamClient.disconnect();
steamClient.on<'connected'>('connected', (serverLoad) => {
steamClient.logOn({
account_name: serverLoad,
password: "password"
});
});
Steam.servers.forEach((server) => server.host);
steamClient.on<'logOnResponse'>('logOnResponse', (details) => {
return details.eresult + details.webapi_authenticate_user_nonce;
});
steamClient.send({
msg: Steam.EMsg.ClientGetFinalPrice,
proto: {
eresult: Steam.EResult.AdministratorOK
}
}, new Buffer("lol"), (header, body) => {
return header.msg + body.reverse().toString();
});
steamClient.bind("127.0.0.1", 80);
if (steamClient.loggedOn) {
console.log(steamClient.steamID);
console.log(steamClient.remoteAddress);
}
+23
View File
@@ -0,0 +1,23 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"steam-client-tests.ts"
]
}
+1
View File
@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }