IMIsle Modkit
Pages in this area

net

Client

Information about the script link, the TCP connection between the client mod and the server plugin. Sending and receiving events is part of events.

Client scripts only start after the link is open, so right after onClientReady the link is up. It can drop later, for example when the server kicks the link or the network fails. The client mod does not start the scripts a second time after a reconnect.

modkit.net.connected

modkit.net.connected()

Returns: true while the script link is open.

if not modkit.net.connected() then print("no link, the server will not hear us") end

modkit.net.playerId

modkit.net.playerId()

Returns: the id the server gave this link (integer). It is the same number as player.id on the server. 0 before the link was opened.

print("my link id is " .. modkit.net.playerId())

modkit.net.steamId

modkit.net.steamId()

Returns: the Steam ID the client mod sent to the server, as a string. It comes from the launcher login (steam.json), or from the Steam account that is signed in on this PC. "" when neither was found.

print("playing as " .. modkit.net.steamId())