2022-03-30 16:33:56 +08:00
|
|
|
---@meta
|
|
|
|
|
2022-03-31 13:29:23 +08:00
|
|
|
---@class fk.Player
|
2022-03-30 16:33:56 +08:00
|
|
|
FPlayer = {}
|
|
|
|
|
2022-04-01 20:51:01 +08:00
|
|
|
---@return integer id
|
2022-03-30 16:33:56 +08:00
|
|
|
function FPlayer:getId()end
|
|
|
|
|
2022-04-01 20:51:01 +08:00
|
|
|
---@param id integer
|
2022-03-30 16:33:56 +08:00
|
|
|
function FPlayer:setId(id)end
|
|
|
|
|
|
|
|
---@return string name
|
|
|
|
function FPlayer:getScreenName()end
|
|
|
|
|
|
|
|
---@param name string
|
|
|
|
function FPlayer:setScreenName(name)end
|
|
|
|
|
|
|
|
---@return string avatar
|
|
|
|
function FPlayer:getAvatar()end
|
|
|
|
|
|
|
|
---@param avatar string
|
|
|
|
function FPlayer:setAvatar(avatar)end
|
|
|
|
|
|
|
|
---@return string state
|
|
|
|
function FPlayer:getStateString()end
|
|
|
|
|
|
|
|
---@param state string
|
|
|
|
function FPlayer:setStateString(state)end
|
|
|
|
|
2022-03-31 13:29:23 +08:00
|
|
|
---@class fk.ServerPlayer : fk.Player
|
2022-03-30 16:33:56 +08:00
|
|
|
FServerPlayer = {}
|
|
|
|
|
2022-03-31 13:29:23 +08:00
|
|
|
---@return fk.Server
|
2022-03-30 16:33:56 +08:00
|
|
|
function FServerPlayer:getServer()end
|
|
|
|
|
2022-03-31 13:29:23 +08:00
|
|
|
---@return fk.Room
|
2022-03-30 16:33:56 +08:00
|
|
|
function FServerPlayer:getRoom()end
|
|
|
|
|
2022-03-31 13:29:23 +08:00
|
|
|
---@param room fk.Room
|
2022-03-30 16:33:56 +08:00
|
|
|
function FServerPlayer:setRoom(room)end
|
|
|
|
|
|
|
|
---@param msg string
|
|
|
|
function FServerPlayer:speak(msg)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
|
2022-04-01 20:51:01 +08:00
|
|
|
---@param timeout integer
|
2022-03-30 16:33:56 +08:00
|
|
|
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.
|
2022-04-02 21:39:44 +08:00
|
|
|
---@param timeout integer @ seconds to wait
|
|
|
|
---@return string @ JSON data
|
2022-03-30 16:33:56 +08:00
|
|
|
---@overload fun()
|
|
|
|
function FServerPlayer:waitForReply(timeout)end
|
|
|
|
|
|
|
|
--- Notice the client.
|
|
|
|
---@param command string
|
|
|
|
---@param jsonData string
|
|
|
|
function FServerPlayer:doNotify(command,jsonData)end
|