Skip to content

Commit e86c3fa

Browse files
committed
Add new type to abstract away client id or client instance
Inspired by ruby on rails active record where you can also pass full instances or only integer ids and the framework will figure it out.
1 parent 9220da6 commit e86c3fa

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

library/ddnetpp.lua

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,12 +214,14 @@ ddnetpp = {
214214
},
215215
}
216216

217+
---@alias ClientId integer|Character|Player
218+
217219
---Sends a server chat message to everyone.
218220
---@param message string # The message to be displayed in chat
219221
function ddnetpp.send_chat(message) end
220222

221223
---Sends a server chat message to one specific client.
222-
---@param client_id integer # The recipient of the message
224+
---@param client_id ClientId # The recipient of the message
223225
---@param message string # The message to be displayed in chat
224226
function ddnetpp.send_chat_target(client_id, message) end
225227

0 commit comments

Comments
 (0)