Commands/Lua

Reference for console commands, Lua hooks and Lua commands in CS2D.

CS2D Command CS2D Console Commands

Lua Hook Lua Hooks

Category: all (79)

Lua Hook httpdata

Categories

Parameters

  • requestid: The ID of the TCP request the data belongs to
  • state: The result state (1 data received, 0 failed)
  • data: The received data (string or byte table)

Info

Called when HTTP data is received after requesting it with reqhttp.

requestid matches the ID which is also returned by the reqhttp command. This way you can match the request with the response.

state will be 0 if the request failed for whatever reason (data will be an empty string in that case) or 1 if data was received.

data can either be a simple string or a table with bytes/numbers. The type of data depends on what you requested with reqhttp.

Attention: Many/big HTTP requests can influence the performance of the server in a negative way and can lead to ping spikes for connected players. Use with care!

Return Values

none - related action(s) [if there are any] performed by CS2D cannot be altered/omitted

Lua Command Lua Commands