Jogos
Generic HTTP bridge
Como conectar Generic HTTP bridge ao valkyr: instale a bridge, configure e veja quais eventos e ações ela suporta.
- Método
- Plain HTTP and JSON
- Status
- experimental
- Eventos
frameshotabilityeconomyitemsoundspawnprofiledecoymatch_end client- Ações
kickrestrictban- Origem
integrations/http-bridge
Any game server that can make HTTP requests can use valkyr without a dedicated plugin. This page is the whole protocol; the full reference is the valkyr-server API (v1).
Protocol in five rules
- Transport: HTTP/
1.1, JSON bodies in UTF-8, default base URL http://127.0.0.1:7420. Authenticate withAuthorization: Bearer <key>(roleingestfor everything on this page). - Units: meters, Y up. Yaw in degrees around Y, 0 looks along +Z and 90 along +X. Pitch in degrees, positive looks up. Times are integer milliseconds:
server_on your server clock (monotonic), andtime_ms client_as reported by the client (use the server time when you do not have one).time_ms - Players are unsigned 64 bit integers chosen by you (account ids). Write them as JSON integers, not strings or floats.
- Events are objects with a
type:frame,shot,spawn,sound,ability,economy,item,profile,decoy,match_,end client. Send them in time order, in batches of at most 5000, toPOST /v1/. The match is created on first use; end it withmatches/ {match_ id}/ events POST /v1/.matches/ {match_ id}/ end - Enforcement: poll
GET /v1/every few seconds, apply each action (actions ?since=<cursor> &limit=100 kick,restrict,banif you enabled it) to the matching player, and pass the returnedcursorassincenext time. Or configure a webhook on the valkyr-server instead of polling.
Event shapes
{"type":"spawn","player":7,"server_time_ms":0,"position":{"x":0,"y":0,"z":0},"team":1}{"type":"frame","player":7,"seq":1,"client_time_ms":10,"server_time_ms":30, "position":{"x":0,"y":0,"z":0},"yaw":90,"pitch":0,"on_ground":true,"jump":false}{"type":"shot","player":7,"client_time_ms":500,"server_time_ms":520,"weapon":1, "yaw":90,"pitch":-2,"target":8,"bone":"head","latency_ms":25}{"type":"sound","player":8,"server_time_ms":530,"position":{"x":4,"y":0,"z":9},"radius":20}{"type":"ability","player":7,"server_time_ms":900,"ability":3}{"type":"match_end","server_time_ms":600000}
Optional fields can be left out (target, bone, latency_ms, team, on_, jump).
curl examples
KEY=replace-with-an-ingest-keyBASE=http://127.0.0.1:7420 ## Health (no key needed)curl -s $BASE/v1/health ## Level geometry (optional, enables line of sight and noclip checks)curl -s -X PUT $BASE/v1/matches/m1/world \ -H "Authorization: Bearer $KEY" -H "Content-Type: application/json" \ -d '{"colliders":[{"min":{"x":-1,"y":0,"z":9},"max":{"x":1,"y":3,"z":10}}],"occluders":[],"floor_y":0.0}' ## A batch of eventscurl -s -X POST $BASE/v1/matches/m1/events \ -H "Authorization: Bearer $KEY" -H "Content-Type: application/json" \ -d '{"events":[ {"type":"spawn","player":7,"server_time_ms":0,"position":{"x":0,"y":0,"z":0},"team":1}, {"type":"frame","player":7,"seq":1,"client_time_ms":0,"server_time_ms":50, "position":{"x":0,"y":0,"z":1},"yaw":0,"pitch":0,"on_ground":true,"jump":false} ]}'## -> {"accepted":2,"verdicts":[]} ## Enforcement queuecurl -s "$BASE/v1/actions?since=0&limit=100" -H "Authorization: Bearer $KEY"## -> {"actions":[{"id":12,"player":7,"action":"kick","reason":"...","match_id":"m1","at_ms":123}],"cursor":12} ## End of matchcurl -s -X POST $BASE/v1/matches/m1/end -H "Authorization: Bearer $KEY"
Errors come back as HTTP 4xx or 5xx with {"error":{"code":"snake_.
Guidelines
- Send what the server knows: positions after your own movement code ran, shots your server accepted. Do not trust client claims more than your server does.
- Batch every 100 to 500 ms; one request per event wastes CPU on both sides.
- Keep the valkyr-server on localhost or a private network. It speaks plain
http://; put a TLS terminating reverse proxy in front of it if traffic has to cross a public network. - Use one match id per match (or per server session for persistent worlds), and one id prefix per game server when several share a valkyr-server, because the action queue is shared.
WebSocket
valkyr-server does not offer a WebSocket endpoint. Batched HTTP requests are enough for telemetry; if you need push delivery of actions, use the signed webhooks instead of polling.
Status: the protocol above follows the valkyr-server v1 contract; the curl lines were not run against a live server here.
Os nomes de jogos e plataformas pertencem aos seus donos e são usados apenas para descrever compatibilidade. O valkyr não tem vínculo com eles.