FreeKill/lua/lsp/player.lua
notify b75d8afe62
Scheduler (#194)
简单协程调度器的实现,详细说明请看 docs/dev/scheduler.rst
2023-06-16 10:56:33 +08:00

37 lines
956 B
Lua

-- SPDX-License-Identifier: GPL-3.0-or-later
---@meta
---@class fk.Player
FPlayer = {}
---@return integer id
function FPlayer:getId()end
---@return string name
function FPlayer:getScreenName()end
---@return string avatar
function FPlayer:getAvatar()end
--- Send a request to client, and allow client to reply within *timeout* seconds.
---
--- *timeout* must not be negative or **nil**.
---@param command string
---@param jsonData string
---@param timeout integer
function FServerPlayer:doRequest(command,jsonData,timeout)end
--- Wait for at most *timeout* seconds for reply from client.
---
--- If *timeout* is negative or **nil**, the function will wait forever until get reply.
---@param timeout integer @ seconds to wait
---@return string @ JSON data
---@overload fun()
function FServerPlayer:waitForReply(timeout)end
--- Notice the client.
---@param command string
---@param jsonData string
function FServerPlayer:doNotify(command,jsonData)end