mirror of
https://github.com/imezx/Warp.git
synced 2026-06-02 12:18:32 +00:00
chore(server): disable player buffer history in studio environment
Some checks failed
Deploy / Build & Deploy (push) Has been cancelled
Some checks failed
Deploy / Build & Deploy (push) Has been cancelled
This commit is contained in:
parent
704942c979
commit
80646eeebb
2 changed files with 399 additions and 397 deletions
|
|
@ -37,7 +37,7 @@ Client.awaitReady = Replication.wait_for_ready
|
|||
--@schema Buffer.SchemaType
|
||||
-- Define a schema for strict data packing on a specific event.
|
||||
Client.useSchema = function(remoteName: string, schema: Buffer.SchemaType)
|
||||
local id = Replication.get_id(remoteName)
|
||||
local id = Replication.get_id[remoteName]
|
||||
if not id then
|
||||
warn(`[Warp]: ".useSchema"::"{remoteName}" does not exist, likely its not registered on the server yet.`)
|
||||
return
|
||||
|
|
@ -49,7 +49,7 @@ end
|
|||
--@fn function
|
||||
-- Connect to an event to receive incoming data from the server.
|
||||
Client.Connect = function(remoteName: string, fn: (Player, ...any?) -> ...any?): Connection
|
||||
local id = Replication.get_id(remoteName)
|
||||
local id = Replication.get_id[remoteName]
|
||||
if not id then
|
||||
warn(`[Warp]: ".Connect"::"{remoteName}" does not exist, likely its not registered on the server yet.`)
|
||||
return { Connected = false, Disconnect = function() return end } :: Connection
|
||||
|
|
@ -101,7 +101,7 @@ end
|
|||
--@remoteName string
|
||||
-- Disconnect all connections for a specific event.
|
||||
Client.DisconnectAll = function(remoteName: string)
|
||||
local id = Replication.get_id(remoteName)
|
||||
local id = Replication.get_id[remoteName]
|
||||
if not id then
|
||||
return
|
||||
end
|
||||
|
|
@ -120,10 +120,10 @@ Client.Destroy = Client.DisconnectAll
|
|||
--@reliable boolean
|
||||
-- Fire an event to the server.
|
||||
Client.Fire = function(remoteName: string, reliable: boolean, ...: any?)
|
||||
local id = Replication.get_id(remoteName)
|
||||
local id = Replication.get_id[remoteName]
|
||||
if id then
|
||||
table.insert(reliable and queueEvent or queueUnreliableEvent, {
|
||||
Replication.get_id(remoteName),
|
||||
Replication.get_id[remoteName],
|
||||
{ ... } :: any,
|
||||
})
|
||||
end
|
||||
|
|
@ -133,7 +133,7 @@ end
|
|||
--@timeout number?
|
||||
-- Invoke the server with timeout support. Yields the current thread. Returns nil if timeout occurs.
|
||||
Client.Invoke = function(remoteName: string, timeout: number?, ...: any?): ...any?
|
||||
local id = Replication.get_id(remoteName)
|
||||
local id = Replication.get_id[remoteName]
|
||||
if not id then
|
||||
return nil
|
||||
end
|
||||
|
|
|
|||
|
|
@ -186,9 +186,11 @@ if RunService:IsServer() then
|
|||
if type(b) ~= "buffer" then
|
||||
return
|
||||
end
|
||||
if not RunService:IsStudio() then
|
||||
local bytes: number = (player_bytes[player] or 0) + math.max(buffer.len(b), 800)
|
||||
if bytes > 8e3 then return end
|
||||
player_bytes[player] = bytes
|
||||
end
|
||||
|
||||
local contents = Buffer.readEvents(b, ref, eventSchemas)
|
||||
for _, content in contents do
|
||||
|
|
|
|||
Loading…
Reference in a new issue