Use correct message count

This commit is contained in:
Foereaper
2021-07-18 03:45:44 +02:00
parent 9fb6b631b5
commit c0a80bf40d
3 changed files with 5 additions and 4 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
*.bak

View File

@ -88,7 +88,7 @@ local function ProcessVariables(reqId, ...)
end end
if not datacache[reqId] then if not datacache[reqId] then
datacache[reqId] = { count = 1, data = {}} datacache[reqId] = { count = 0, data = {}}
end end
for i=1, msg:len(), splitLength do for i=1, msg:len(), splitLength do
@ -331,7 +331,7 @@ function SendClientRequest(prefix, functionId, ...)
local reqId = GenerateReqId() local reqId = GenerateReqId()
local varTable = ProcessVariables(reqId, ...) local varTable = ProcessVariables(reqId, ...)
CMH.SendREQ(functionId, #varTable["data"], reqId, prefix) CMH.SendREQ(functionId, varTable.count, reqId, prefix)
end end
--A API END --A API END

View File

@ -92,7 +92,7 @@ local function ProcessVariables(sender, reqId, ...)
datacache[sender:GetGUIDLow()] = datacache[sender:GetGUIDLow()] or {} datacache[sender:GetGUIDLow()] = datacache[sender:GetGUIDLow()] or {}
if not datacache[sender:GetGUIDLow()][reqId] then if not datacache[sender:GetGUIDLow()][reqId] then
datacache[sender:GetGUIDLow()][reqId] = { count = 1, data = {}} datacache[sender:GetGUIDLow()][reqId] = { count = 0, data = {}}
end end
for i=1, msg:len(), splitLength do for i=1, msg:len(), splitLength do
@ -345,7 +345,7 @@ function Player:SendServerResponse(prefix, functionId, ...)
local reqId = GenerateReqId() local reqId = GenerateReqId()
local varTable = ProcessVariables(self, reqId, ...) local varTable = ProcessVariables(self, reqId, ...)
SMH.SendREQ(self, functionId, #varTable["data"], reqId, prefix) SMH.SendREQ(self, functionId, varTable.count, reqId, prefix)
end end
-- API END -- API END