Skip to content

Commit

Permalink
1.0.6
Browse files Browse the repository at this point in the history
  • Loading branch information
imezx committed Mar 2, 2024
1 parent 8cad93f commit f5bb1df
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 2 deletions.
Binary file modified Warp.rbxm
Binary file not shown.
18 changes: 18 additions & 0 deletions docs/api/1.0/server.md
Original file line number Diff line number Diff line change
Expand Up @@ -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" />

Semiliar to `:InvokeClient`, its for Invoke to a client.
Expand Down
1 change: 1 addition & 0 deletions src/Index/Client/Index.luau
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
--!strict
--!native
local Client = {}
Client.__index = Client

Expand Down
8 changes: 8 additions & 0 deletions src/Index/Server/Index.luau
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
--!strict
--!native
local Server = {}
Server.__index = Server

Expand Down Expand Up @@ -29,6 +30,13 @@ function Server:Fires(reliable: boolean, ...: any)
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
return ServerProcess.insertRequest(self.id, timeout, player, ...)
end
Expand Down
3 changes: 2 additions & 1 deletion src/Index/Server/ServerProcess.luau
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ local function initializeEachPlayer(player: Player)
if not queueOut[player] then
queueOut[player] = {}
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
queueOut[player][Identifier] = {}
end
Expand Down
2 changes: 1 addition & 1 deletion src/init.luau
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
-- Warp Library (@Eternity_Devs)
-- version 1.0.5
-- version 1.0.6
--!strict
--!native
local Index = require(script.Index)
Expand Down

0 comments on commit f5bb1df

Please sign in to comment.