I see only 2 problems with this;
1- Getting a plugins version you'd have to search the plugins website page (1900ish lines)
2- Downloading a newer version would require a logged in account or it can not download it.
Has anyone tried this?
I guess the fixes would be;
1- Another website page that is callable (E.G http://fougerite.com/resourcesINFO/PluginName/) and displays plugin name & version
2- Maybe on the same page there is a link?
To download a file I think you'd use:
1- Getting a plugins version you'd have to search the plugins website page (1900ish lines)
2- Downloading a newer version would require a logged in account or it can not download it.
Has anyone tried this?
I guess the fixes would be;
1- Another website page that is callable (E.G http://fougerite.com/resourcesINFO/PluginName/) and displays plugin name & version
2- Maybe on the same page there is a link?
To download a file I think you'd use:
Python:
System.Net.WebRequestMethods.File.DownloadFile(http://fougerite.com/lol/lol.py
Python:
__title__ = 'Check'
__author__ = 'Jakkee'
__version__ = '1.0'
import clr
clr.AddReferenceByPartialName("Fougerite")
import Fougerite
class Check:
def On_PluginInit(self):
self.versioncheck("http://fougerite.com/resources/98/")
def versioncheck(self, website):
Util.Log("Checking: " + website + " ...")
if not Plugin.IniExists("Log"):
Plugin.CreateIni("Log")
log = Plugin.GetIni("Log")
log.Save()
s = Web.GET(website)
"""version = FindVersion in s (Line 1300ish)
if self.__version__ < version:
for Player in Server.Players:
if not Player.Admin
Continue
else:
Player.Message(self.__title__ + " has new update, Downloading version: " + version)
file = System.Net.WebRequestMethods.File.DownloadFile(http://fougerite.com/lol/lol.py
for Player in Server.Players:
if not Player.Admin
Continue
else:
Player.Message(self.__title__ + " Downloaded! Reload to take effect!")"""
log = Plugin.GetIni("Log")
log.AddSetting("Log", Plugin.GetDate() + "|" + Plugin.GetTime(), "Website Response: " + s)
log.Save()
Util.Log("Saved log file")