Skip to content

Commit

Permalink
Merge branch 'development'
Browse files Browse the repository at this point in the history
  • Loading branch information
GigsD4X committed Apr 7, 2017
2 parents 5bca143 + 12c0fb5 commit f47857c
Show file tree
Hide file tree
Showing 7 changed files with 2,137 additions and 2,011 deletions.
20 changes: 20 additions & 0 deletions SyncAPI.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1200,6 +1200,11 @@ Actions = {
['Export'] = function (Parts)
-- Serializes, exports, and returns ID for importing given parts

-- Offload action to server-side if API is running locally
if RunService:IsClient() and not RunService:IsStudio() then
return SyncAPI.ServerEndpoint:InvokeServer('Export', Parts);
end;

-- Ensure valid selection
assert(type(Parts) == 'table', 'Invalid item table');

Expand Down Expand Up @@ -1247,6 +1252,11 @@ Actions = {
['IsHttpServiceEnabled'] = function ()
-- Returns whether HttpService is enabled

-- Offload action to server-side if API is running locally
if RunService:IsClient() and not RunService:IsStudio() then
return SyncAPI.ServerEndpoint:InvokeServer('IsHttpServiceEnabled');
end;

-- For in-game tool, return cached status if available
if ToolMode == 'Tool' and (IsHttpServiceEnabled ~= nil) then
return IsHttpServiceEnabled;
Expand All @@ -1272,6 +1282,11 @@ Actions = {
['ExtractMeshFromAsset'] = function (AssetId)
-- Returns the first found mesh in the given asset

-- Offload action to server-side if API is running locally
if RunService:IsClient() and not RunService:IsStudio() then
return SyncAPI.ServerEndpoint:InvokeServer('ExtractMeshFromAsset', AssetId);
end;

-- Ensure valid asset ID is given
assert(type(AssetId) == 'number', 'Invalid asset ID');

Expand All @@ -1285,6 +1300,11 @@ Actions = {
['ExtractImageFromDecal'] = function (DecalAssetId)
-- Returns the first image found in the given decal asset

-- Offload action to server-side if API is running locally
if RunService:IsClient() and not RunService:IsStudio() then
return SyncAPI.ServerEndpoint:InvokeServer('ExtractImageFromDecal', DecalAssetId);
end;

-- Return direct response from the API
return HttpService:GetAsync('http://f3xteam.com/bt/getDecalImageID/' .. DecalAssetId);

Expand Down
Loading

0 comments on commit f47857c

Please sign in to comment.