mirror of
https://github.com/imezx/Warp.git
synced 2025-04-24 15:10:03 +00:00
1.0.6
This commit is contained in:
parent
8cad93f2f5
commit
f5bb1df4b0
6 changed files with 30 additions and 2 deletions
BIN
Warp.rbxm
BIN
Warp.rbxm
Binary file not shown.
|
@ -150,6 +150,24 @@ Remote:Fires(true, "Hello World!")
|
||||||
```
|
```
|
||||||
:::
|
:::
|
||||||
|
|
||||||
|
## `:FireExcept` <Badge type="tip" text="Server Only" />
|
||||||
|
|
||||||
|
Fire the event to all clients but except a players.
|
||||||
|
|
||||||
|
::: code-group
|
||||||
|
```lua [Variable]
|
||||||
|
(
|
||||||
|
reliable: boolean,
|
||||||
|
except: { Player },
|
||||||
|
...: any
|
||||||
|
)
|
||||||
|
```
|
||||||
|
|
||||||
|
```lua [Example]
|
||||||
|
Remote:FireExcept(true, { Players.Eternity_Devs, Players.Player2 }, "Hello World!") -- this will sent to all players except { Players.Eternity_Devs, Players.Player2 }.
|
||||||
|
```
|
||||||
|
:::
|
||||||
|
|
||||||
## `:Invoke` <Badge type="warning" text="yield" />
|
## `:Invoke` <Badge type="warning" text="yield" />
|
||||||
|
|
||||||
Semiliar to `:InvokeClient`, its for Invoke to a client.
|
Semiliar to `:InvokeClient`, its for Invoke to a client.
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
--!strict
|
--!strict
|
||||||
|
--!native
|
||||||
local Client = {}
|
local Client = {}
|
||||||
Client.__index = Client
|
Client.__index = Client
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
--!strict
|
--!strict
|
||||||
|
--!native
|
||||||
local Server = {}
|
local Server = {}
|
||||||
Server.__index = Server
|
Server.__index = Server
|
||||||
|
|
||||||
|
@ -29,6 +30,13 @@ function Server:Fires(reliable: boolean, ...: any)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function Server:FireExcept(reliable: boolean, except: { Player }, ...: any)
|
||||||
|
for _, player: Player in ipairs(Players:GetPlayers()) do
|
||||||
|
if table.find(except, player) then continue end
|
||||||
|
ServerProcess.insertQueue(self.id, reliable, player, ...)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
function Server:Invoke(timeout: number, player: Player, ...: any): any
|
function Server:Invoke(timeout: number, player: Player, ...: any): any
|
||||||
return ServerProcess.insertRequest(self.id, timeout, player, ...)
|
return ServerProcess.insertRequest(self.id, timeout, player, ...)
|
||||||
end
|
end
|
||||||
|
|
|
@ -55,7 +55,8 @@ local function initializeEachPlayer(player: Player)
|
||||||
if not queueOut[player] then
|
if not queueOut[player] then
|
||||||
queueOut[player] = {}
|
queueOut[player] = {}
|
||||||
end
|
end
|
||||||
for Identifier: string,_ in serverQueue do
|
for Identifier: string in serverQueue do
|
||||||
|
if not player then break end
|
||||||
if not queueOut[player][Identifier] then
|
if not queueOut[player][Identifier] then
|
||||||
queueOut[player][Identifier] = {}
|
queueOut[player][Identifier] = {}
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
-- Warp Library (@Eternity_Devs)
|
-- Warp Library (@Eternity_Devs)
|
||||||
-- version 1.0.5
|
-- version 1.0.6
|
||||||
--!strict
|
--!strict
|
||||||
--!native
|
--!native
|
||||||
local Index = require(script.Index)
|
local Index = require(script.Index)
|
||||||
|
|
Loading…
Reference in a new issue