Skip to content
acra5y edited this page Jul 26, 2020 · 2 revisions

csgo-mapvotes

websocket message interface

The sent messages contain a json string (apart from ping/pong messages). The structure of the messages is

[
	"type_of_message",
	{ "some": "data" }
]

Where the first entry of the array is the type of message being sent and the second entry contains the payload.

The types of messages a user can send to the server and their payloads are:

voted

{
	"maps": ["de_dust2"]
}

Which maps does one want to play?

vetoed

{
	"maps": ["de_dust2"]
}

Which maps does one not want to play?

reset_votes

Discard votes done beforehand.

reset_vetos

Discard vetos done beforehand.

show_result

No payload required. Only the admin (the first participant) can use this. A message containing all votes will be broadcasted to everyone.

reset

No payload required. Only the admin (the first participant) can use this. All votes will be reset.

participant_name_changed

{
	"name": "Fancy Nickname"
}

Modify the name displayed to all participants.

slider

{
	"items": [
		{
			"votesPerParticipant": 2,
			"vetosPerParticipant": 3
		}
	]
}

Change how many votes and vetos each participant can submit. Only the lobby admin can use this message.

The types of messages the server will send to the participants and their payloads are:

reset

No payload. The client should update the view do enable voting again.

participants

{
	"items": [
		{
			"name": 1,
			"voted": true,
			"vetoed": false
		}
	]
}

This message is broadcasted to everyone, every time someone joins or leaves or submits a vote or a veto.

result

{
	"items": [
		{
			"name": 1,
			"votes": ["de_dust2"],
			"vetos": ["de_anubis"]
		}
	]
}

This message is broadcasted after the admin sent the show_result message.

settings

{
	"votesPerParticipant": 3,
	"vetosPerParticiant": 2
}

This message is broadcasted after the admin sent a slider message.

Clone this wiki locally