mirror of
				https://github.com/imezx/Warp.git
				synced 2025-11-03 19:49:16 +00:00 
			
		
		
		
	fixes
This commit is contained in:
		
							parent
							
								
									739e13537d
								
							
						
					
					
						commit
						8fd9573b8a
					
				
					 3 changed files with 66 additions and 28 deletions
				
			
		| 
						 | 
				
			
			@ -78,17 +78,37 @@ end
 | 
			
		|||
 | 
			
		||||
function ClientProcess.add(Identifier: any, originId: string)
 | 
			
		||||
	if not clientQueue[Identifier] then
 | 
			
		||||
		clientRatelimit[Identifier] = RateLimit.create(originId)
 | 
			
		||||
		clientQueue[Identifier] = {}
 | 
			
		||||
		unreliableClientQueue[Identifier] = {}
 | 
			
		||||
		clientRequestQueue[Identifier] = {}
 | 
			
		||||
		clientCallback[Identifier] = {}
 | 
			
		||||
		if not clientRatelimit[Identifier] then
 | 
			
		||||
			clientRatelimit[Identifier] = RateLimit.create(originId)
 | 
			
		||||
		end
 | 
			
		||||
		if not clientQueue[Identifier] then
 | 
			
		||||
			clientQueue[Identifier] = {}
 | 
			
		||||
		end
 | 
			
		||||
		if not unreliableClientQueue[Identifier] then
 | 
			
		||||
			unreliableClientQueue[Identifier] = {}
 | 
			
		||||
		end
 | 
			
		||||
		if not clientRequestQueue[Identifier] then
 | 
			
		||||
			clientRequestQueue[Identifier] = {}
 | 
			
		||||
		end
 | 
			
		||||
		if not clientCallback[Identifier] then
 | 
			
		||||
			clientCallback[Identifier] = {}
 | 
			
		||||
		end
 | 
			
		||||
		
 | 
			
		||||
		queueOutRequest[1][Identifier] = {}
 | 
			
		||||
		queueOutRequest[2][Identifier] = {}
 | 
			
		||||
		queueInRequest[1][Identifier] = {}
 | 
			
		||||
		queueInRequest[2][Identifier] = {}
 | 
			
		||||
		queueIn[Identifier] = {}
 | 
			
		||||
		if not queueOutRequest[1][Identifier] then
 | 
			
		||||
			queueOutRequest[1][Identifier] = {}
 | 
			
		||||
		end
 | 
			
		||||
		if not queueOutRequest[2][Identifier] then
 | 
			
		||||
			queueOutRequest[2][Identifier] = {}
 | 
			
		||||
		end
 | 
			
		||||
		if not queueInRequest[1][Identifier] then
 | 
			
		||||
			queueInRequest[1][Identifier] = {}
 | 
			
		||||
		end
 | 
			
		||||
		if not queueInRequest[2][Identifier] then
 | 
			
		||||
			queueInRequest[2][Identifier] = {}
 | 
			
		||||
		end
 | 
			
		||||
		if not queueIn[Identifier] then
 | 
			
		||||
			queueIn[Identifier] = {}
 | 
			
		||||
		end
 | 
			
		||||
	end
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -119,16 +119,34 @@ end
 | 
			
		|||
function ServerProcess.add(Identifier: string, originId: string, ratelimit: Type.rateLimitArg)
 | 
			
		||||
	if not serverQueue[Identifier] then
 | 
			
		||||
		RateLimit.create(originId, ratelimit.maxEntrance or 200, ratelimit.interval or 2)
 | 
			
		||||
		serverQueue[Identifier] = {}
 | 
			
		||||
		unreliableServerQueue[Identifier] = {}
 | 
			
		||||
		serverCallback[Identifier] = {}
 | 
			
		||||
		serverRequestQueue[Identifier] = {}
 | 
			
		||||
		if not serverQueue[Identifier] then
 | 
			
		||||
			serverQueue[Identifier] = {}
 | 
			
		||||
		end
 | 
			
		||||
		if not unreliableServerQueue[Identifier] then
 | 
			
		||||
			unreliableServerQueue[Identifier] = {}
 | 
			
		||||
		end
 | 
			
		||||
		if not serverCallback[Identifier] then
 | 
			
		||||
			serverCallback[Identifier] = {}
 | 
			
		||||
		end
 | 
			
		||||
		if not serverRequestQueue[Identifier] then
 | 
			
		||||
			serverRequestQueue[Identifier] = {}
 | 
			
		||||
		end
 | 
			
		||||
		
 | 
			
		||||
		queueIn[Identifier] = {}
 | 
			
		||||
		queueInRequest[1][Identifier] = {}
 | 
			
		||||
		queueInRequest[2][Identifier] = {}
 | 
			
		||||
		queueOutRequest[1][Identifier] = {}
 | 
			
		||||
		queueOutRequest[2][Identifier] = {}
 | 
			
		||||
		if not queueIn[Identifier] then
 | 
			
		||||
			queueIn[Identifier] = {}
 | 
			
		||||
		end
 | 
			
		||||
		if not queueInRequest[1][Identifier] then
 | 
			
		||||
			queueInRequest[1][Identifier] = {}
 | 
			
		||||
		end
 | 
			
		||||
		if not queueInRequest[2][Identifier] then
 | 
			
		||||
			queueInRequest[2][Identifier] = {}
 | 
			
		||||
		end
 | 
			
		||||
		if not queueOutRequest[1][Identifier] then
 | 
			
		||||
			queueOutRequest[1][Identifier] = {}
 | 
			
		||||
		end
 | 
			
		||||
		if not queueOutRequest[2][Identifier] then
 | 
			
		||||
			queueOutRequest[2][Identifier] = {}
 | 
			
		||||
		end
 | 
			
		||||
		
 | 
			
		||||
		for _, player: Player in ipairs(Players:GetPlayers()) do
 | 
			
		||||
			task.spawn(initializeEachPlayer, player)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -59,55 +59,55 @@ end
 | 
			
		|||
 | 
			
		||||
function DedicatedBuffer.wi8(self: any, val: number)
 | 
			
		||||
	if not val then return end
 | 
			
		||||
	DedicatedBuffer:alloc(1)
 | 
			
		||||
	self:alloc(1)
 | 
			
		||||
	writei8(self.buffer, self.point, val)
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
function DedicatedBuffer.wi16(self: any, val: number)
 | 
			
		||||
	if not val then return end
 | 
			
		||||
	DedicatedBuffer:alloc(2)
 | 
			
		||||
	self:alloc(2)
 | 
			
		||||
	writei16(self.buffer, self.point, val)
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
function DedicatedBuffer.wi32(self: any, val: number)
 | 
			
		||||
	if not val then return end
 | 
			
		||||
	DedicatedBuffer:alloc(4)
 | 
			
		||||
	self:alloc(4)
 | 
			
		||||
	writei32(self.buffer, self.point, val)
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
function DedicatedBuffer.wu8(self: any, val: number)
 | 
			
		||||
	if not val then return end
 | 
			
		||||
	DedicatedBuffer:alloc(1)
 | 
			
		||||
	self:alloc(1)
 | 
			
		||||
	writeu8(self.buffer, self.point, val)
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
function  DedicatedBuffer.wu16(self: any, val: number)
 | 
			
		||||
	if not val then return end
 | 
			
		||||
	DedicatedBuffer:alloc(2)
 | 
			
		||||
	self:alloc(2)
 | 
			
		||||
	writeu16(self.buffer, self.point, val)
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
function DedicatedBuffer.wu32(self: any, val: number)
 | 
			
		||||
	if not val then return end
 | 
			
		||||
	DedicatedBuffer:alloc(4)
 | 
			
		||||
	self:alloc(4)
 | 
			
		||||
	writeu32(self.buffer, self.point, val)
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
function DedicatedBuffer.wf32(self: any, val: number)
 | 
			
		||||
	if not val then return end
 | 
			
		||||
	DedicatedBuffer:alloc(4)
 | 
			
		||||
	self:alloc(4)
 | 
			
		||||
	writef32(self.buffer, self.point, val)
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
function DedicatedBuffer.wf64(self: any, val: number)
 | 
			
		||||
	if not val then return end
 | 
			
		||||
	DedicatedBuffer:alloc(8)
 | 
			
		||||
	self:alloc(8)
 | 
			
		||||
	writef64(self.buffer, self.point, val)
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
function DedicatedBuffer.wstring(self: any, val: string)
 | 
			
		||||
	if not val then return end
 | 
			
		||||
	DedicatedBuffer:alloc(#val)
 | 
			
		||||
	self:alloc(#val)
 | 
			
		||||
	writestring(self.buffer, self.point, val)
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in a new issue