-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRovolutionLogisticsCDN.lua
More file actions
73 lines (53 loc) · 2.89 KB
/
RovolutionLogisticsCDN.lua
File metadata and controls
73 lines (53 loc) · 2.89 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
-- ______ _ _ _ _ _ _ _
-- | ___ \ | | | | (_) | | (_) | | (_)
-- | |_/ /_____ _____ | |_ _| |_ _ ___ _ __ | | ___ __ _ _ ___| |_ _ ___ ___
-- | // _ \ \ / / _ \| | | | | __| |/ _ \| '_ \ | | / _ \ / _` | / __| __| |/ __/ __|
-- | |\ \ (_) \ V / (_) | | |_| | |_| | (_) | | | | | |___| (_) | (_| | \__ \ |_| | (__\__ \
-- \_| \_\___/ \_/ \___/|_|\__,_|\__|_|\___/|_| |_| \_____/\___/ \__, |_|___/\__|_|\___|___/
-- __/ |
-- |___/
-- Rovolution Logistics CDN provides a importer to load RovolutionLogistics in game tools and software
-- Please place me in ServerScriptService!
-- Please report issues here, feel free to browse the code and even contribute if you want to help out! (https://github.com/RovolutionTeam/RovolutionAnalytica)
-- Also the loader is here https://github.com/RovolutionTeam/RovolutionCDN/ but won't be updated much due to it being basically done.
-- GeraldIn2016 - CEO and Founder of Rovolution
local warn = function(...)
warn(": Rovolution Logistics CDN :", ...)
end
warn("Loading...")
-- Get Globals
local API_KEY = script:FindFirstChild("API_KEY")
local ProjectID = script:FindFirstChild("ProjectID")
local HttpService = game:GetService("HttpService")
-- Make block function
do
if API_KEY == nil or not API_KEY:IsA("StringValue") then
warn("No API_KEY or not a string value, RovolutionLogistics CDN can not function without it, aborting...")
return
end
if ProjectID == nil or not ProjectID:IsA("StringValue") then
warn("No ProjectID or not a string value, RovolutionLogistics CDN can not function without it, aborting...")
return
end
-- All servies are running now lets fetch module ID and test for HTTP
local s, data = pcall(function()
return HttpService:JSONDecode(game:GetService('HttpService'):GetAsync('https://analytics.rovolution.me/api/v1/projectInfo/'..ProjectID.value.."?bearer_key="..API_KEY.Value))
end)
if s == false then
warn("Unable to connect to Rovolution, please check HTTP is turned on in game settings, aborting...")
return
end
if data.error ~= nil then
warn(data.error..", aborting...")
return
end
-- Now fetch module from roblox, making moduleID a number as well
local module = require(tonumber(data.moduleID))
-- Lets now start the module, with projectID and api key
local errors = module.default(ProjectID.value, API_KEY.Value)
if errors == true then
warn("Failed to load RovolutionCDN module '"..data.moduleName.."' please check project ID and api key!")
end
warn("Successfully loaded RovolutionCDN module '"..data.moduleName.."'!")
-- Loader Finished
end