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
27 changes: 0 additions & 27 deletions G2DManager_s.lua
Original file line number Diff line number Diff line change
@@ -1,27 +1,3 @@
xmlLoadStr = _G["xmlLoad".."String"]
if not xmlLoadStr then
tempXmlLogger = {count=0}
xmlLoadStr = function(str)
local tick = tempXmlLogger.count
tempXmlLogger.count = tempXmlLogger.count+1
local xmlFile = fileCreate("g2dCrawlTmp_"..tick..".xml")
fileWrite(xmlFile,str)
fileClose(xmlFile)
local xml = xmlLoadFile("g2dCrawlTmp_"..tick..".xml")
tempXmlLogger[xml] = {path="g2dCrawlTmp_"..tick..".xml"}
return xml
end
xmlReleaseTempFiles = function(xml)
if tempXmlLogger[xml] then
xmlUnloadFile(xml)
fileDelete(tempXmlLogger[xml].path)
tempXmlLogger[xml] = nil
end
end
else
xmlReleaseTempFiles = function() end
end

local function tableCount(tabl)
local cnt = 0
for k,v in pairs(tabl) do
Expand Down Expand Up @@ -118,7 +94,6 @@ addCommandHandler("g2d",function(player,command,...)
outputDGSMessage("G2D is not running!","G2D")
end
elseif args[1] == "crawl" then
if not checkServerVersion() then return end
if args[2] and args[2] ~= "" then
if args[2] == "npp" or args[2] == "n++" then
CrawlWikiFromMTA("npp")
Expand Down Expand Up @@ -637,7 +612,6 @@ function CrawlWikiFromMTA(t)
}
table.insert(fncList,nTable)
startPos = liEnd_2
xmlReleaseTempFiles(xmlNode)
end
local fncListLen = #fncList
outputDGSMessage(fncList.." function"..fncListLen > 1 and "s" or "".." has been found. Crawling..","G2D")
Expand Down Expand Up @@ -670,7 +644,6 @@ function CrawlWikiFromMTA(t)
local line = data:sub(startPos,endPos)
local xmlNode = xmlLoadStr(line)
local pageSource = xmlNodeGetValue(xmlNode)
xmlReleaseTempFiles(xmlNode)
local _,rangeStart = pageSource:find("==Syntax==")
local _,syntaxStart = pageSource:find("%<syntaxhighlight lang%=\"lua\"%>",rangeStart+1)
local syntaxEnd = pageSource:find("%<%/syntaxhighlight%>",syntaxStart+1)
Expand Down
2 changes: 1 addition & 1 deletion client.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1068,7 +1068,7 @@ function onClientKeyTriggered(button)
end

function dgsCheckHit(hits,cursorShowing)
if not cursorShowing then -- Also checks if main menu is visible https://github.com/multitheftauto/mtasa-blue/issues/2944
if not cursorShowing then
if CursorData.enabled and CursorData[MouseData.cursorType] then
setCursorAlpha(255)
end
Expand Down
4 changes: 2 additions & 2 deletions meta.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<meta>
<meta>
<info type="script" name="dgs" description="thisdp's directx graphic user interface system" author="DGS Community" version="3.522" />
<file src="html/media.html" />
<file src="styleManager/styleMapper.lua"/>
Expand Down Expand Up @@ -959,7 +959,7 @@
<export function="dgsImportOOPClass" type="client" />
<export function="dgsG2DLoadHooker" type="client" />

<min_mta_version client="1.6.0-9.21938" server="1.5.4-9.11342" />
<min_mta_version client="1.6.0-9.21938" server="1.6.0-9.21938" />
<aclrequest>
<right name="function.fetchRemote" access="true" />
<right name="function.loadstring" access="true" />
Expand Down
1 change: 0 additions & 1 deletion plugin/cmd.lua
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,6 @@ function executeCmdCommand(cmd,str,...)
end
--------------DGS CMD
dgs_MyIP = "Unknown"
triggerServerEvent("DGSI_RequestIP",localPlayer)
addEventHandler("DGSI_ReceiveIP",localPlayer,function(ip)
dgs_MyIP = ip
end)
Expand Down
5 changes: 2 additions & 3 deletions server.lua
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ loadConfig()

-----------Remote Stuff
addEvent("DGSI_RequestQRCode",true)
addEvent("DGSI_RequestIP",true)
addEvent("DGSI_RequestRemoteImage",true)
addEventHandler("DGSI_RequestQRCode",root,function(str,w,h,id)
fetchRemote("https://api.qrserver.com/v1/create-qr-code/?size="..w.."x"..h.."&data="..str,{},function(data,info,player,id2)
Expand All @@ -112,9 +111,9 @@ addEventHandler("DGSI_RequestRemoteImage",root,function(website,id)
end)

function getMyIP()
triggerClientEvent(client,"DGSI_ReceiveIP",client,getPlayerIP(client))
triggerClientEvent(source,"DGSI_ReceiveIP",source,getPlayerIP(source))
end
addEventHandler("DGSI_RequestIP",root,getMyIP)
addEventHandler("onPlayerResourceStart",root,getMyIP)

setElementData(root,"DGS-ResName",getResourceName(getThisResource()))

Expand Down
10 changes: 0 additions & 10 deletions update.lua
Original file line number Diff line number Diff line change
Expand Up @@ -51,22 +51,12 @@ function checkUpdate()
end)
end

function checkServerVersion(player)
if getVersion().sortable < "1.5.4-9.11342" then
outputDGSMessage("Your server version is too old to support dgs update system.",nil,2,player)
return false
end
return true
end

if DGSConfig.updateCheckAuto then
if not checkServerVersion() then return end
checkUpdate()
updatePeriodTimer = setTimer(checkUpdate,DGSConfig.updateCheckInterval*3600000,0)
end

addCommandHandler(DGSConfig.updateCommand,function(player)
if not checkServerVersion(player) then return end
local account = getPlayerAccount(player)
local isPermit = hasObjectPermissionTo(player,"command."..DGSConfig.updateCommand,false)
if not isPermit then
Expand Down