discord rich presence for counter strike 2.
| platform | link |
|---|---|
| windows | latest | nightly |
| linux | latest | nightly |
-
download either the executable from the section above.
-
extract and run the executable, and start your game.
- note: you must start the program before you launch the game for the first time; then, the order of you starting does not matter anymore.
-
visit
http://localhost:8000to change preferences.
this server only handles POST requests from cs2, it does not have any other http apis. all client-server communications are over websockets at ws://localhost:8000/ws.
const ping = new Uint8Array([0xe2, 0x99, 0xa1]);
const pong = new Uint8Array([0xe2, 0x99, 0xa5]);after client connects to the server, it must send pings at least every 3-4 seconds to avoid time out.
the server will reply with pong.
export interface Activity {
details: string;
state?: string;
assets: {
large_image: string;
large_text: string;
};
timestamps: {
start: number;
};
}
const sync = new Uint8Array([0xe2, 0x87, 0x8b, ...encodeCbor(obj satisfies Activity)])the server will send clients sync messages, formatted like above, whenever there is an activity update.
interface Options {
timeout: number;
fluffy: boolean;
disableFluffy: boolean;
}
const options = new Uint8Array([0xe2, 0x9a, 0x99, ...encodeCbor(obj satisfies Options)])the clients can send the server options messages to update the options.
