📡NetChannel

Table to work with game's net channel.

GetLatency(flow [?]: Enum.Flow): number

Name
Type
Description

flow [?]

flow to get latency of (default: Enum.Flow.FLOW_OUTGOING)

Returns the latency/ping of the net channel in seconds.


GetAvgLatency(flow [?]: Enum.Flow): number

Name
Type
Description

flow [?]

flow to get average latency of (default: Enum.Flow.FLOW_OUTGOING)

Returns the average latency/ping of the net channel in seconds.


SendNetMessage(name: string, json: string): nil

You can repeat the same message from OnSendNetMessage if you want to know the format of the message.

Name
Type
Description

name

string

name of the net message

json

string

json of the net message

Sends a protobuff message to the game server. List of messages,

Example

-- send_netmsg.lua
-- import json encoder
local JSON = require('assets.JSON');

-- https://github.com/SteamDatabase/GameTracking-Dota2/blob/master/Protobufs/dota_clientmessages.proto#L395
-- message CDOTAClientMsg_RollDice {
-- 	optional uint32 channel_type = 1;
-- 	optional uint32 roll_min = 2;
-- 	optional uint32 roll_max = 3;
-- }
NetChannel.SendNetMessage("CDOTAClientMsg_RollDice", JSON:encode({
    channel_type = 13,
    roll_min = 11,
    roll_max = 222
}));

Last updated