Skip to content

Commit

Permalink
Selene Error fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
crazyRBLX11 committed Nov 24, 2024
1 parent d3dab27 commit 9935442
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 194 deletions.
9 changes: 6 additions & 3 deletions src/Atom/AtomModuleContents/AtomClient_OOP.lua
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,12 @@ end ]]

function Clean(WorkingJanitor)
WorkingJanitor:Cleanup()
print("Memory Usage: "..collectgarbage('count').."kb")
print("Memory Usage: "..collectgarbage('count') * 1024, "B")
return "Cleaned"
return "Cleaned."
end

function AtomMain.Clean(WorkingJanitor)
WorkingJanitor:Cleanup()
return "Cleaned."
end

--[[
Expand Down
21 changes: 15 additions & 6 deletions src/Atom/AtomModuleContents/Core/MemoryStoreOperations.lua
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@ end

function MemoryStoreOperations:GetMemoryIdentifier(Queue:MemoryStoreQueue, count:number, allOrNothing:boolean, waitTimeout:number)
local results, identifier = Queue:ReadAsync(count, allOrNothing, waitTimeout)
return identifier
if not results then
return nil
else
return identifier
end
end

function MemoryStoreOperations:RemoveFromMemoryStoreQueue(Queue:MemoryStoreQueue, Identifier:string)
Expand All @@ -41,27 +45,32 @@ end
function MemoryStoreOperations:ReadFromMemoryStoreQueue(Queue:MemoryStoreQueue, count:number, allOrNothing:boolean, waitTimeout:number)
local results = nil
local success, errormessage = pcall(function()
local results, identifier = Queue:ReadAsync(count, allOrNothing, waitTimeout)
results = Queue:ReadAsync(count, allOrNothing, waitTimeout)
end)
if success then
return results
elseif not success then
return "Error reading MemoryStoreQueue. "..errormessage
warn("Error reading MemoryStoreQueue. "..errormessage)
return nil
else
return "Error with function. "..errormessage
warn("Error with function "..errormessage)
return nil
end
end

function MemoryStoreOperations:ReadFromSortedMap(SortedMap:MemoryStoreSortedMap, Key:string)
local SortedMapData = nil
local success, errormessage = pcall(function()
SortedMap:GetAsync(Key)
SortedMapData = SortedMap:GetAsync(Key)
end)
if success then
return SortedMap:GetAsync(Key)
return SortedMapData
elseif not success then
warn("Error getting Value! "..errormessage)
return nil
else
warn("Error with function! "..errormessage)
return nil
end
end

Expand Down
2 changes: 1 addition & 1 deletion src/Atom/AtomModuleContents/Core/Serializer.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ local Serializer = {}

function Serializer.serialize(Buffer: buffer, offset: number, DataType: string, Data)
local dataType = string.lower(DataType)

print(dataType)
Switch(Data)({
case("number")(function()
buffer.writef64(Buffer, offset * math.random(1, 34), Data)
Expand Down
180 changes: 0 additions & 180 deletions src/Atom/AtomModuleContents/Utils/Signal.lua

This file was deleted.

8 changes: 4 additions & 4 deletions src/Atom/Packages/GoodSignal.lua
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,10 @@ end

-- Make Connection strict
setmetatable(Connection, {
__index = function(tb, key)
__index = function(key)
error(("Attempt to get Connection::%s (not a valid member)"):format(tostring(key)), 2)
end,
__newindex = function(tb, key, value)
__newindex = function(key)
error(("Attempt to set Connection::%s (not a valid member)"):format(tostring(key)), 2)
end
})
Expand Down Expand Up @@ -169,10 +169,10 @@ end

-- Make signal strict
setmetatable(Signal, {
__index = function(tb, key)
__index = function(key)
error(("Attempt to get Signal::%s (not a valid member)"):format(tostring(key)), 2)
end,
__newindex = function(tb, key, value)
__newindex = function(key)
error(("Attempt to set Signal::%s (not a valid member)"):format(tostring(key)), 2)
end
})
Expand Down

0 comments on commit 9935442

Please sign in to comment.