设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 4608|回复: 9
打印 上一主题 下一主题

[原创发布] RMMV基于托管网站的游戏版本更新检测

[复制链接]

Lv1.梦旅人

梦石
0
星屑
70
在线时间
51 小时
注册时间
2014-11-29
帖子
15
跳转到指定楼层
1
发表于 2016-12-30 13:57:59 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有帐号?注册会员

x
  RMMV基于托管网站的游戏版本更新检测
楼主没发过什么帖子,也不知道该说些啥,就是基于github或者coding的游戏版本检查,首先是在这些网站上拥有自己的仓库,然后发布page页,新建一个关于版本的文件,然后在rmmv中用插件进行判断,详细说明在demo中有写,依赖jquery,有不懂的回复说明。

地址如下 RMMV插件游戏版本检测(原).rar (1.24 MB, 下载次数: 131)



插件地址:https://ycxyi.github.io/plugs/Ycx_VersionCheck.js

插件预览,记得有位大大说 document会覆盖,有建议可以及时提,谢谢。

JAVASCRIPT 代码复制
  1. //=============================================================================
  2. // Ycx_VersionCheck.js
  3. //=============================================================================
  4. var Imported = Imported || {};
  5. Imported.Ycx_VersionCheck = true;
  6.  
  7. var Ycx = Ycx || {};
  8. Ycx.CHECK = Ycx.CHECK || {};
  9. /*:
  10.  * @plugindesc 基于代码托管网站的检测游戏版本插件 v1.0.0
  11.  * @author ycx
  12.  *
  13.  * @param nowVersion
  14.  * @desc 目前游戏版本
  15.  * @default 1.0.0
  16.  *
  17.  *
  18.  * @param urlText
  19.  * @desc 检测版本的url地址
  20.  * @default [url]http://ycxm.coding.me/jquery/version.txt[/url]
  21.  *
  22.  * @param showInTitle
  23.  * @desc 菜单是否显示版本检查  false 不显示  true 显示
  24.  * @default true
  25.  *
  26.  *  @param showInTitleText
  27.  * @desc showInTitle为true,即要显示的标题命令文字
  28.  * @default 版本检测
  29.  *
  30.  *  
  31.  * @param urlOpen
  32.  * @desc 有新版本则要打开的url地址
  33.  * @default [url]http://ycxm.coding.me/jquery/version.rar[/url]
  34.  *
  35.  * @param startCheck
  36.  * @desc 是否开始游戏就检查版本  false 不检查  true 检查
  37.  * @default true
  38.  *
  39.  *
  40.  * @help
  41.  * ================================================================
  42.  * 检测游戏版本
  43.  * ================================================================
  44.  *   依赖项:需要导入Jquery.js
  45.  *
  46.  *   nowVersion:当前游戏版本。
  47.  *
  48.  *   urlText:检测版本的url地址,代码托管网站的文件地址,得到的是版本号,不要写其他的。
  49.  *   
  50.  *   showInTitle:是否在标题显示版本检查这一项。  false 不显示  true 显示
  51.  *
  52.  *   showInTitleText:showInTitle为true时,即要显示的标题命令文字。
  53.  *
  54.  *   urlOpen:检测到有新版本则要打开的url地址,可打开官网之类。
  55.  *
  56.  *   startCheck:是否开始游戏就检查版本。   false 不检查  true 检查
  57.  *
  58.  *   插件命令:“命令 内容” 形式,示例如下:
  59.  *       1. checkversion [url]http://ycxm.coding.me/jquery/version.txt[/url]      检测游戏版本
  60.  *
  61.  *       2. openurl  [url]https://www.baidu.com[/url]                             打开网址,可打开游戏官网等。
  62.  *
  63.  *  最后qq:1359762297
  64.  *  ycx插件库:[url]https://github.com/ycxYI/plugs[/url](待更新)
  65.  *
  66.  */
  67.  
  68.  
  69. Ycx.parameters = PluginManager.parameters('Ycx_VersionCheck');
  70.  
  71. Ycx.nowVersion = String(Ycx.parameters['nowVersion'] || '1.0.0');
  72. Ycx.urlText = String(Ycx.parameters['urlText'] || 'http://ycxm.coding.me/jquery/version.txt');
  73. Ycx.showInTitle = String(Ycx.parameters['showInTitle'] || 'true');
  74. Ycx.showInTitleText = String(Ycx.parameters['showInTitleText'] || '版本检测');
  75. Ycx.urlOpen = String(Ycx.parameters['urlOpen'] || 'http://ycxm.coding.me/jquery/version.rar');
  76. Ycx.startCheck = String(Ycx.parameters['startCheck'] || 'true');
  77.  
  78. //=============================================================================
  79. // SceneManager
  80. //=============================================================================
  81.  
  82. SceneManager.openPopupBlockerMessage = function() {
  83.         this._scene.openPopupBlockerMessage();
  84. };
  85.  
  86. //=============================================================================
  87. // Game_Interpreter
  88. //=============================================================================
  89.  
  90. Ycx.CHECK.Game_Interpreter_pluginCommand =
  91.     Game_Interpreter.prototype.pluginCommand;
  92. Game_Interpreter.prototype.pluginCommand = function(command, args) {
  93.     Ycx.CHECK.Game_Interpreter_pluginCommand.call(this, command, args)
  94.     if (command === 'checkversion') this.checkVersion(args);
  95.     if (command === 'openurl') this.openurl(args);
  96. };
  97.  
  98. Game_Interpreter.prototype.checkVersion = function(args) {
  99.     TouchInput.clear();
  100.     Input.clear();
  101.     var url = String(args[0]);
  102.     $(document).load(url, function(responseText, textStatus) {
  103.         if (Ycx.nowVersion == responseText) {
  104.             alert("已经是最新版本!");
  105.         } else {
  106.             if (confirm("存在最新版本是否更新?")) {
  107.                 var win = window.open(url);
  108.                 if (win) {
  109.                     win.focus();
  110.                 } else {
  111.                     SceneManager.openPopupBlockerMessage();
  112.                 }
  113.             }
  114.         }
  115.  
  116.     });
  117. };
  118.  
  119. Game_Interpreter.prototype.openurl = function(args) {
  120.     TouchInput.clear();
  121.     Input.clear();
  122.     var url = String(args[0]);
  123.     var win = window.open(url);
  124.     if (win) {
  125.         win.focus();
  126.     } else {
  127.         SceneManager.openPopupBlockerMessage();
  128.     }
  129.  
  130. };
  131.  
  132. //-----------------------------------------------------------------------------
  133. //开始检测
  134. //-----------------------------------------------------------------------------
  135. if (Ycx.startCheck == "true") {
  136.     $(document).load(Ycx.urlText, function(responseText, textStatus) {
  137.  
  138.         if (Ycx.nowVersion == responseText) {
  139.             alert("已经是最新版本!");
  140.         } else {
  141.             if (confirm("存在最新版本是否更新?")) {
  142.                 var win = window.open(Ycx.urlOpen);
  143.                 if (win) {
  144.                     win.focus();
  145.                 } else {
  146.                     SceneManager.openPopupBlockerMessage();
  147.                 }
  148.             }
  149.         }
  150.  
  151.     });
  152. }
  153.  
  154. //-----------------------------------------------------------------------------
  155. // Scene_Title
  156. //-----------------------------------------------------------------------------
  157.  
  158. Scene_Title.prototype.createCommandWindow = function() {
  159.     this._commandWindow = new Window_TitleCommand();
  160.     this._commandWindow.setHandler('newGame', this.commandNewGame.bind(this));
  161.     this._commandWindow.setHandler('continue', this.commandContinue.bind(this));
  162.     this._commandWindow.setHandler('options', this.commandOptions.bind(this));
  163.     if (Ycx.showInTitle == "true") {
  164.         this._commandWindow.setHandler('Check', this.versionCheck.bind(this));
  165.     }
  166.     this.addWindow(this._commandWindow);
  167. };
  168.  
  169. Scene_Title.prototype.versionCheck = function() {
  170.     this._commandWindow.close();
  171.     $(document).load(Ycx.urlText, function(responseText, textStatus) {
  172.         if (Ycx.nowVersion == responseText) {
  173.             alert("已经是最新版本!");
  174.         } else {
  175.             if (confirm("存在最新版本是否更新?")) {
  176.                 var win = window.open(Ycx.urlOpen);
  177.                 if (win) {
  178.                     win.focus();
  179.                 } else {
  180.                     SceneManager.openPopupBlockerMessage();
  181.                 }
  182.             }
  183.         }
  184.     });
  185.     SceneManager.goto(Scene_Title);
  186. };
  187.  
  188. //-----------------------------------------------------------------------------
  189. // Window_TitleCommand
  190. //-----------------------------------------------------------------------------
  191.  
  192. Window_TitleCommand.prototype.makeCommandList = function() {
  193.     this.addCommand(TextManager.newGame, 'newGame');
  194.     this.addCommand(TextManager.continue_, 'continue', this.isContinueEnabled());
  195.     this.addCommand(TextManager.options, 'options');
  196.     if (Ycx.showInTitle == "true") {
  197.         this.addCommand(Ycx.showInTitleText, 'Check');
  198.     }
  199. };

评分

参与人数 1星屑 +120 收起 理由
garfeng + 120 我很赞同

查看全部评分


Lv1.梦旅人

梦石
0
星屑
102
在线时间
402 小时
注册时间
2013-11-2
帖子
104
2
发表于 2016-12-30 15:25:38 | 只看该作者
感谢大大分享,记得va里也有类似的·功能
回复 支持 反对

使用道具 举报

Lv4.逐梦者

梦石
0
星屑
14222
在线时间
718 小时
注册时间
2011-7-16
帖子
1428

开拓者

3
发表于 2016-12-30 15:34:59 | 只看该作者
正需要啊,不用自己写了,多谢大师
RMMV网络插件,开源免费,内含服务器端,无需强制登录,云数据,弹幕,云存档,排名,兑换码,版本检测,可自由上架下架删除。q群399090587
免打包运行MV游戏,云游戏,安卓App雷神游戏厅,在线玩游戏,上传下载游戏
开源游戏:重装机兵之重装归来【RMMV制作】全球首款按照美剧分季分集的方式发布的游戏
体素画 -- MV画3D像素图的画板
RMMV显示3D模型和场景的插件
RMMV显示spine骨骼动画的插件
RMMV秘密通道插件
突破敌群数量上限8个的插件
在rmmv中显示gif动态图片的插件
一款可以在mv游戏界面的任意位置显示任意文字的插件
RMMV Toast 插件 带物品得失提示,可以设置开启关闭 兼容yep itemcore
制作一个改名卡道具插件、调整标题页面菜单的插件、在标题页面之前显示大段文字的插件、标题页面显示版本号的插件
物品得失自动提示自动上色自动换行插件
我的Q群 663889472
另外,我的插件、范例、游戏都在这里
回复 支持 1 反对 0

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
3453
在线时间
1159 小时
注册时间
2016-8-9
帖子
2390

开拓者

4
发表于 2016-12-31 13:09:53 | 只看该作者
不知道为何不能给分,但是至少要回复一下楼主表示感谢
酸酸甜甜就④哇噢
回复 支持 反对

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
2133
在线时间
388 小时
注册时间
2013-8-28
帖子
93
5
发表于 2017-1-20 06:18:22 | 只看该作者
哈哈
回复 支持 反对

使用道具 举报

Lv4.逐梦者

梦石
2
星屑
5520
在线时间
2564 小时
注册时间
2012-2-9
帖子
990

开拓者

6
发表于 2017-1-20 09:00:01 | 只看该作者
可以更进一步,在version文件里提供各版本升级包下载地址,直链地址,用js下载升级包覆盖本地游戏目录,这样就可以自动升级了。
回复 支持 反对

使用道具 举报

Lv5.捕梦者

梦石
0
星屑
21932
在线时间
8564 小时
注册时间
2011-12-31
帖子
3362
7
发表于 2017-1-20 10:42:55 | 只看该作者
SRD_AutoUpdater.js
可在version文件里提供各版本升级文件下载地址,可以自动升级。
Download the Plugin Here:
http://sumrndm.site/auto-updater/
示範視頻
https://www.youtube.com/watch?v= ... p;index=92&t=3s

评分

参与人数 1星屑 +120 收起 理由
garfeng + 120 我很赞同

查看全部评分

回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
70
在线时间
51 小时
注册时间
2014-11-29
帖子
15
8
 楼主| 发表于 2017-1-22 01:41:24 | 只看该作者
garfeng 发表于 2017-1-20 09:00
可以更进一步,在version文件里提供各版本升级包下载地址,直链地址,用js下载升级包覆盖本地游戏目录,这 ...

我知道了,感谢

回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
70
在线时间
51 小时
注册时间
2014-11-29
帖子
15
9
 楼主| 发表于 2017-1-22 01:42:34 | 只看该作者
tseyik 发表于 2017-1-20 10:42
SRD_AutoUpdater.js
可在version文件里提供各版本升级文件下载地址,可以自动升级。
Download the Plugin H ...

好的,我会看看的

回复 支持 反对

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
1370
在线时间
121 小时
注册时间
2018-7-31
帖子
55
10
发表于 2023-8-3 16:21:42 | 只看该作者
https://rpg.blue/thread-398017-1-1.html谁指导下仓库那边如何设置
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-4-29 01:10

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表