Skip to content

Commit

Permalink
v1.0.14
Browse files Browse the repository at this point in the history
  • Loading branch information
imezx committed Dec 2, 2024
1 parent d8526c7 commit 0b1304f
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 4 deletions.
Binary file modified Warp.rbxm
Binary file not shown.
23 changes: 23 additions & 0 deletions src/Index/Server/ServerProcess/init.luau
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion src/Index/Util/Buffer/Dedicated.luau
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ function DedicatedBuffer.buildAndRemove(self: any): (buffer, (any)?)
local ref = #self.ref > 0 and table.clone(self.ref) or nil

copy(build, 0, self.buffer, 0, p)

self:remove()
return build, ref
end
Expand Down Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion src/Index/Util/Buffer/init.luau
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions src/Index/Util/RateLimit.luau
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 0b1304f

Please sign in to comment.