查看: 5668|回复: 9

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

[复制链接]
梦石
0
星屑
70
在线时间
51 小时
注册时间
2014-11-29
回帖
14
发表于 2016-12-30 13:57:59 | 显示全部楼层 |阅读模式

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

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

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

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



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

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

[pre lang="javascript" line="0"]//=============================================================================
// Ycx_VersionCheck.js
//=============================================================================
var Imported = Imported || {};
Imported.Ycx_VersionCheck = true;

var Ycx = Ycx || {};
Ycx.CHECK = Ycx.CHECK || {};
/*:
* @plugindesc 基于代码托管网站的检测游戏版本插件 v1.0.0
* @author ycx
*
* @param nowVersion
* @desc 目前游戏版本
* @default 1.0.0
*
*
* @param urlText
* @desc 检测版本的url地址
* @default http://ycxm.coding.me/jquery/version.txt
*
* @param showInTitle
* @desc 菜单是否显示版本检查  false 不显示  true 显示
* @default true
*
*  @param showInTitleText
* @desc showInTitle为true,即要显示的标题命令文字
* @default 版本检测
*
*  
* @param urlOpen
* @desc 有新版本则要打开的url地址
* @default http://ycxm.coding.me/jquery/version.rar
*
* @param startCheck
* @desc 是否开始游戏就检查版本  false 不检查  true 检查
* @default true
*
*
* @help
* ================================================================
* 检测游戏版本
* ================================================================
*   依赖项:需要导入Jquery.js
*
*   nowVersion:当前游戏版本。
*
*   urlText:检测版本的url地址,代码托管网站的文件地址,得到的是版本号,不要写其他的。
*   
*   showInTitle:是否在标题显示版本检查这一项。  false 不显示  true 显示
*
*   showInTitleText:showInTitle为true时,即要显示的标题命令文字。
*
*   urlOpen:检测到有新版本则要打开的url地址,可打开官网之类。
*
*   startCheck:是否开始游戏就检查版本。   false 不检查  true 检查
*
*   插件命令:“命令 内容” 形式,示例如下:
*       1. checkversion http://ycxm.coding.me/jquery/version.txt      检测游戏版本
*
*       2. openurl  https://www.baidu.com                             打开网址,可打开游戏官网等。
*
*  最后qq:1359762297
*  ycx插件库:https://github.com/ycxYI/plugs(待更新)
*
*/
 

Ycx.parameters = PluginManager.parameters('Ycx_VersionCheck');

Ycx.nowVersion = String(Ycx.parameters['nowVersion'] || '1.0.0');
Ycx.urlText = String(Ycx.parameters['urlText'] || 'http://ycxm.coding.me/jquery/version.txt');
Ycx.showInTitle = String(Ycx.parameters['showInTitle'] || 'true');
Ycx.showInTitleText = String(Ycx.parameters['showInTitleText'] || '版本检测');
Ycx.urlOpen = String(Ycx.parameters['urlOpen'] || 'http://ycxm.coding.me/jquery/version.rar');
Ycx.startCheck = String(Ycx.parameters['startCheck'] || 'true');

//=============================================================================
// SceneManager
//=============================================================================

SceneManager.openPopupBlockerMessage = function() {
        this._scene.openPopupBlockerMessage();
};

//=============================================================================
// Game_Interpreter
//=============================================================================

Ycx.CHECK.Game_Interpreter_pluginCommand =
    Game_Interpreter.prototype.pluginCommand;
Game_Interpreter.prototype.pluginCommand = function(command, args) {
    Ycx.CHECK.Game_Interpreter_pluginCommand.call(this, command, args)
    if (command === 'checkversion') this.checkVersion(args);
    if (command === 'openurl') this.openurl(args);
};

Game_Interpreter.prototype.checkVersion = function(args) {
    TouchInput.clear();
    Input.clear();
    var url = String(args[0]);
    $(document).load(url, function(responseText, textStatus) {
        if (Ycx.nowVersion == responseText) {
            alert("已经是最新版本!");
        } else {
            if (confirm("存在最新版本是否更新?")) {
                var win = window.open(url);
                if (win) {
                    win.focus();
                } else {
                    SceneManager.openPopupBlockerMessage();
                }
            }
        }

    });
};

Game_Interpreter.prototype.openurl = function(args) {
    TouchInput.clear();
    Input.clear();
    var url = String(args[0]);
    var win = window.open(url);
    if (win) {
        win.focus();
    } else {
        SceneManager.openPopupBlockerMessage();
    }
           
};

//-----------------------------------------------------------------------------
//开始检测
//-----------------------------------------------------------------------------
if (Ycx.startCheck == "true") {
    $(document).load(Ycx.urlText, function(responseText, textStatus) {

        if (Ycx.nowVersion == responseText) {
            alert("已经是最新版本!");
        } else {
            if (confirm("存在最新版本是否更新?")) {
                var win = window.open(Ycx.urlOpen);
                if (win) {
                    win.focus();
                } else {
                    SceneManager.openPopupBlockerMessage();
                }
            }
        }

    });
}

//-----------------------------------------------------------------------------
// Scene_Title
//-----------------------------------------------------------------------------

Scene_Title.prototype.createCommandWindow = function() {
    this._commandWindow = new Window_TitleCommand();
    this._commandWindow.setHandler('newGame', this.commandNewGame.bind(this));
    this._commandWindow.setHandler('continue', this.commandContinue.bind(this));
    this._commandWindow.setHandler('options', this.commandOptions.bind(this));
    if (Ycx.showInTitle == "true") {
        this._commandWindow.setHandler('Check', this.versionCheck.bind(this));
    }
    this.addWindow(this._commandWindow);
};

Scene_Title.prototype.versionCheck = function() {
    this._commandWindow.close();
    $(document).load(Ycx.urlText, function(responseText, textStatus) {
        if (Ycx.nowVersion == responseText) {
            alert("已经是最新版本!");
        } else {
            if (confirm("存在最新版本是否更新?")) {
                var win = window.open(Ycx.urlOpen);
                if (win) {
                    win.focus();
                } else {
                    SceneManager.openPopupBlockerMessage();
                }
            }
        }
    });
    SceneManager.goto(Scene_Title);
};

//-----------------------------------------------------------------------------
// Window_TitleCommand
//-----------------------------------------------------------------------------

Window_TitleCommand.prototype.makeCommandList = function() {
    this.addCommand(TextManager.newGame, 'newGame');
    this.addCommand(TextManager.continue_, 'continue', this.isContinueEnabled());
    this.addCommand(TextManager.options, 'options');
    if (Ycx.showInTitle == "true") {
        this.addCommand(Ycx.showInTitleText, 'Check');
    }
};[/pre]

评分

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

查看全部评分


梦石
0
星屑
102
在线时间
402 小时
注册时间
2013-11-2
回帖
80
发表于 2016-12-30 15:25:38 | 显示全部楼层
感谢大大分享,记得va里也有类似的·功能
回复

使用道具 举报

梦石
0
星屑
15291
在线时间
720 小时
注册时间
2011-7-16
回帖
1373

开拓者

发表于 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

使用道具 举报

梦石
0
星屑
3922
在线时间
1198 小时
注册时间
2016-8-9
回帖
2355

开拓者

发表于 2016-12-31 13:09:53 | 显示全部楼层
不知道为何不能给分,但是至少要回复一下楼主表示感谢
酸酸甜甜就④哇噢
回复

使用道具 举报

梦石
0
星屑
2147
在线时间
427 小时
注册时间
2013-8-28
回帖
87
发表于 2017-1-20 06:18:22 | 显示全部楼层
哈哈
回复

使用道具 举报

梦石
2
星屑
5550
在线时间
2566 小时
注册时间
2012-2-9
回帖
947

开拓者

发表于 2017-1-20 09:00:01 | 显示全部楼层
可以更进一步,在version文件里提供各版本升级包下载地址,直链地址,用js下载升级包覆盖本地游戏目录,这样就可以自动升级了。
回复

使用道具 举报

梦石
0
星屑
22879
在线时间
8598 小时
注册时间
2011-12-31
回帖
3270
发表于 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 我很赞同

查看全部评分

回复

使用道具 举报

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

我知道了,感谢

回复

使用道具 举报

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

好的,我会看看的

回复

使用道具 举报

梦石
0
星屑
1433
在线时间
128 小时
注册时间
2018-7-31
回帖
50
发表于 2023-8-3 16:21:42 | 显示全部楼层
https://rpg.blue/thread-398017-1-1.html谁指导下仓库那边如何设置
回复

使用道具 举报

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

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部