Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make getting the KEY from the server a RemoteFunction #1458

Merged
merged 2 commits into from
Mar 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion MainModule/Client/Core/Core.lua
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,12 @@ return function(Vargs, GetEnv)

if not Core.Key then
log("~! Getting key from server")
Remote.Fire(`{client.DepsName}GET_KEY`)
Core.Key = Remote.Get(`{client.DepsName}GET_KEY`)
if Core.Key then
client.Finish_Loading()
else
Remote.Fire(`{client.DepsName}GET_KEY`)
end
end
end
end
Expand Down
48 changes: 34 additions & 14 deletions MainModule/Server/Core/Process.lua
Original file line number Diff line number Diff line change
Expand Up @@ -317,21 +317,41 @@ return function(Vargs, GetEnv)

if type(com) == "string" then
if com == `{keys.Special}GET_KEY` then
if keys.LoadingStatus == "WAITING_FOR_KEY" then
Remote.Fire(p, `{keys.Special}GIVE_KEY`, keys.Key)
keys.LoadingStatus = "LOADING"
keys.RemoteReady = true

AddLog("Script", string.format("%s requested client keys", p.Name))
--else
--Anti.Detected(p, "kick","Communication Key Error (r10003)")
end
if cliData.Mode == "Get" then
AddLog("RemoteFires", {
Text = `{p.Name} requested key from server`,
Desc = "Player requested key from server",
Player = p;
})

AddLog("RemoteFires", {
Text = `{p.Name} requested key from server`,
Desc = "Player requested key from server",
Player = p;
})
if keys.LoadingStatus == "WAITING_FOR_KEY" then
keys.LoadingStatus = "LOADING"
keys.RemoteReady = true
AddLog("Script", string.format("%s requested client keys", p.Name))

return keys.Key
--else
--Anti.Detected(p, "kick","Communication Key Error (r10003)")
end
elseif cliData.Mode == "Fire" then
if keys.LoadingStatus == "WAITING_FOR_KEY" then
Remote.Fire(p, `{keys.Special}GIVE_KEY`, keys.Key)
keys.LoadingStatus = "LOADING"
keys.RemoteReady = true

AddLog("Script", string.format("%s requested client keys", p.Name))
--else
--Anti.Detected(p, "kick","Communication Key Error (r10003)")
end

AddLog("RemoteFires", {
Text = `{p.Name} requested key from server`,
Desc = "Player requested key from server",
Player = p;
})
else
Anti.Detected(p, "kick","Communication Key Error (r10003)")
end
elseif rateLimitCheck and string.len(com) <= Remote.MaxLen then
local comString = Decrypt(com, keys.Key, keys.Cache)
local command = (cliData.Mode == "Get" and Remote.Returnables[comString]) or Remote.Commands[comString]
Expand Down
Loading