node-steam-game-coordinator
v0.0.4
Published
Minimal Steam Game Coordinator implementation using `node-steam`
Downloads
4
Readme
SteamGameCoordinator
This is a handler for game coordinator related functionality, to be used with the node-steam
module. It is basically a straight copy of Seishun's module here.
Initialize it by passing a SteamClient instance and AppID to the constructor.
var Steam = require('node-steam'),
SteamGameCoordinator = require('node-steam-game-coordinator');
var client = new Steam.SteamClient();
Steam.SteamGameCoordinator = new SteamGameCoordinator(client, 730);
It's intended to have the same API as SteamClient's 'message'/send except it uses a different CMsgProtoBufHeader
.
'message'/send
Sending and receiving Game Coordinator messages is designed to be symmetrical, so the event and the method are documented together. Both have the following arguments:
header
- an object representing the message header. It has the following properties:msg
- the game-specific "type" of the message (no protomask).proto
- aCMsgProtoBufHeader
object if this message is protobuf-backed, otherwiseheader.proto
is falsy. The fieldsjob_id_source
andjob_id_target
are reserved for internal use and shall be ignored. (Note: pass an empty object if you don't need to set any fields)
body
- a Buffer containing the rest of the message. (Note: in SteamKit2's terms, this is "Body" plus "Payload")callback
(optional) - if not falsy, then this message is a request, andcallback
shall be called with any response to it instead of 'message'/send.callback
has the same arguments as 'message'/send.
The 'message' event is only emitted by a SteamGameCoordinator instance if it was initialized with the same AppID as that of the incoming message. When sending a message, it uses the AppID it was initialized with.