Skip to content
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
2 changes: 1 addition & 1 deletion MainModule/Client/UI/Default/ServerDetails.luau
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ return function(data, env)
if data.ServerInternetInfo then
local serii = data.ServerInternetInfo
for _, v in ipairs({
{"Timezone", serii.timezone or "[Error]"},
-- {"Timezone", serii.timezone or "[Error]"},
{"Country", serii.country or "[Error]"},
{"Region", serii.region or "[Error]"},
{"City", serii.city or "[Error]"},
Expand Down
16 changes: 16 additions & 0 deletions MainModule/Server/Commands/Moderators.luau
Original file line number Diff line number Diff line change
Expand Up @@ -7515,5 +7515,21 @@ return function(Vargs, env)
end
end
};

RefreshServerLocation = {
Prefix = Settings.Prefix;
Commands = {"refreshserverlocation"};
Args = {};
Description = `Refreshes the server location shown in {Settings.PlayerPrefix}serverinfo`;
AdminLevel = "Moderators";
Function = function(plr: Player, args: {string})
local res = Functions.FetchServerInfo()
if type(res) == "table" then
Variables.IPInfo = res
Functions.Hint(`You have refreshed the server location info`, {plr})
return
end
end
};
}
end
6 changes: 2 additions & 4 deletions MainModule/Server/Commands/Players.luau
Original file line number Diff line number Diff line change
Expand Up @@ -703,10 +703,8 @@ return function(Vargs, env)
Args = {};
Description = "Shows the current time and date.";
AdminLevel = "Players";

Function = function(plr: Player)
local now = os.time()

Remote.MakeGui(plr, "List", {
Title = "Time & Date";
Table = {
Expand Down Expand Up @@ -862,7 +860,7 @@ return function(Vargs, env)
local elevated = Admin.CheckAdmin(plr)

local serverInfo = select(2, xpcall(function()
local res = Variables.IPInfo or service.HttpService:JSONDecode(service.HttpService:GetAsync(Variables.IPInfoUrl))
local res = Variables.IPInfo or Functions.FetchServerInfo()
if not Variables.IPInfo then
Variables.IPInfo = res
end
Expand All @@ -871,7 +869,7 @@ return function(Vargs, env)
city = res.city,
region = res.region,
zipcode = res.postal or "N/A",
timezone = res.timezone,
timezone = "N/A",
ip = elevated and res.ip or "[Redacted]",
coords = elevated and string.format("LAT: %s, LON: %s", string.match(res.loc, "(.*),(.*)")) or "[Redacted]",
}
Expand Down
28 changes: 27 additions & 1 deletion MainModule/Server/Core/Functions.luau
Original file line number Diff line number Diff line change
Expand Up @@ -1665,7 +1665,33 @@ return function(Vargs, GetEnv)
GetMainPrefix = function()
if type(Settings.Prefix) == "table" then return Settings.Prefix[1] else return Settings.Prefix end
end;

FetchServerInfo = function()
local _, ServerInfo = xpcall(function()
local res = service.HttpService:JSONDecode(
service.HttpService:GetAsync(Variables.IPInfoUrl, false, {["referer"] = "https://roblox.com"})
)

if res.latitude and res.longitude then
res.loc = `{res.latitude},{res.longitude}`
end

return {
country = res.country or "N/A",
city = res.city or "N/A",
region = res.region or "N/A",
postal = res.postalCode or "N/A",
timezone = "N/A", -- not supported. Keeping it just incase.
ip = res.ip or "N/A",
loc = res.loc or "N/A",
}
end, function()
return
end)

return ServerInfo
end
}


end
end
2 changes: 1 addition & 1 deletion MainModule/Server/Core/Variables.luau
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ return function(Vargs, GetEnv)
WebPanel_Initiated = false,
DeveloperWhitelist = {1237666, 76328606, 698712377},
HTTPCheckUrl = "https://www.google.com/humans.txt",
IPInfoUrl = "https://ipinfo.io/json",
IPInfoUrl = "https://speed.cloudflare.com/meta",
SizeLimit = 20,
ChatCreateRobloxCommands = true,
OriginalGravity = workspace.Gravity,
Expand Down
2 changes: 1 addition & 1 deletion MainModule/Shared/Credits.luau
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ return {
{Text = "@ccuser44", Desc = "Open Source Contributor"};
{Text = "@Awesomewebm", Desc = "Open Source Contributor"};
{Text = "@TheLegendarySpark",Desc = "Open Source Contributor"};
{Text = "@EasternBloxxer", Desc = "Open Source Contributor"};
{Text = "@krampuszc", Desc = "Open Source Contributor"};
{Text = "@Dimenpsyonal", Desc = "Open Source Contributor"};
{Text = "@policetonyR", Desc = "Open Source Contributor"};
{Text = "@enescglyn", Desc = "Open Source Contributor"};
Expand Down
Loading