mirror of
https://github.com/imezx/Warp.git
synced 2025-04-24 07:00:03 +00:00
v1.0.14
This commit is contained in:
parent
d8526c7e25
commit
0b1304f4c5
5 changed files with 29 additions and 4 deletions
BIN
Warp.rbxm
BIN
Warp.rbxm
Binary file not shown.
|
@ -85,6 +85,29 @@ local function initializeEachPlayer(player: Player)
|
|||
end
|
||||
|
||||
Players.PlayerAdded:Connect(initializeEachPlayer)
|
||||
Players.PlayerRemoving:Connect(function(player: Player)
|
||||
if not player then return end
|
||||
if queueOut[player] then
|
||||
queueOut[player] = nil
|
||||
end
|
||||
for _, map in { serverQueue, unreliableServerQueue, serverRequestQueue } do
|
||||
for Identifier: string in map do
|
||||
map[Identifier][player] = nil
|
||||
end
|
||||
end
|
||||
for i=1,2 do
|
||||
for Identifier: string in queueInRequest[i] do
|
||||
if queueInRequest[i][Identifier][player] then
|
||||
queueInRequest[i][Identifier][player] = nil
|
||||
end
|
||||
end
|
||||
for Identifier: string in queueOutRequest[i] do
|
||||
if queueOutRequest[i][Identifier][player] then
|
||||
queueOutRequest[i][Identifier][player] = nil
|
||||
end
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
function ServerProcess.insertQueue(Identifier: string, reliable: boolean, player: Player, ...: any)
|
||||
if not reliable then
|
||||
|
|
|
@ -127,6 +127,7 @@ function DedicatedBuffer.wType(self: any, ref: number)
|
|||
end
|
||||
|
||||
function DedicatedBuffer.wRef(self: any, value: any, alloc: number?)
|
||||
if not value then return end
|
||||
self:alloc(alloc or 1)
|
||||
table.insert(self.ref, value)
|
||||
local index = #self.ref
|
||||
|
|
|
@ -27,7 +27,7 @@ local function readValue(b: buffer, position: number, ref: { any }?): (any, numb
|
|||
if not ref or #ref == 0 then
|
||||
return nil, position + 1
|
||||
end
|
||||
local value = table.remove(ref, readu8(b, position))
|
||||
local value = ref[readu8(b, position)]
|
||||
if typeof(value) == "Instance" then
|
||||
return value, position + 1
|
||||
end
|
||||
|
@ -142,6 +142,7 @@ function Buffer.read(b: buffer, ref: { any }?): any?
|
|||
value, position = readValue(b, position, ref)
|
||||
table.insert(result, value)
|
||||
end
|
||||
ref = nil
|
||||
return table.unpack(result)
|
||||
end
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ setmetatable(meta , {
|
|||
map[key] = 1
|
||||
return
|
||||
end
|
||||
if value >= 1e1 then -- 100
|
||||
if value >= 1e2 then -- 100
|
||||
Signal:Fire(key)
|
||||
return
|
||||
end
|
||||
|
@ -63,7 +63,7 @@ function RateLimit.create(Identifier: string, entrance: number?, interval: numbe
|
|||
end
|
||||
|
||||
function RateLimit.Protect()
|
||||
if not RunService:IsServer() or Reliable:GetAttribute("Protected") then return end
|
||||
if not RunService:IsServer() or Reliable:GetAttribute("Protected") or Unreliable:GetAttribute("Protected") or Request:GetAttribute("Protected") then return end
|
||||
Reliable:SetAttribute("Protected", true)
|
||||
Unreliable:SetAttribute("Protected", true)
|
||||
Request:SetAttribute("Protected", true)
|
||||
|
|
Loading…
Reference in a new issue