Game "Minecraft" or other application automatically updates the client version

This slag again write (water) the blog.

 

Let me talk about, enterprise-class security is not my solution, we are a group of poor opening service of Minecraft players.

If you want to put into enterprise applications (vulnerable to hacking scene), please write their own, thinking make do and see. Otherwise safety can not be guaranteed!

This program default framework version .NET Framework 4.5.2, To change the framework of the final version, please download the source article into the VS to make changes.

This solution is more inclined to the game "Minecraft" client update, rather than enterprise-level client application.

Scenario: Minecraft client server-side updates, integrated package Minecraft version of the update, or any other game (in the end require regular updating of client files).

Other games, applications need to automatically update with this project is possible, but it needs to look at the situation to reconstruct ~

This project is a reconstruction of an ancient items. Mainly to improve the .NET Framework, rewriting part of the code and so on. (Source that I'll be up for)

This project uses the free version ESFarmework communications framework, supports up to 10 online update, if you want to apply to large projects that 100 people high concurrency (for me big project)

You need to pay to use.

Ado, directly on the map

 

 

 The above is part of the server, the following is the client.

 

Will be updated automatically added to the solution in the Minecraft launcher:

 

 

 

 

 It is like this.

For the main service of Minecraft, this is regarded as a blessing, right?

After the QQ group no longer need to send a new client, a direct update any file in the client directory, delete files, replace files can be ~

 

Then we talk about ideas.

 

Lightweight solution:

Some lightweight update, most are not the traditional C / S structure (combination of server + client). Only update the client application on the client,

Then to get the method to get web version of the file, if fill in the web version of the file version and the client do not match, then use the file web-side version of the file package straight to update the client.

Professional Solutions:

采用C/S结构,部署更新程序服务端在自己主机上,更新程序客户端部署在应用程序客户端上。

通过ESFarmework通信系统,进行数据传输。

更新程序客户端更新程序服务端获取版本信息,然后进行文件更新,若网络出现波动可进行重新连接,并断点续传

 

我们当然要用更加花里胡哨的专业解决方案啊~

 

接下来我们来配置它~

自动更新程序的服务端:

 

 

 

 

把监听端口Value="xxxxx"改成一个可以被外网连接的端口。

可以去站长工具检查你服务器上的端口的开放状态。

然后双击exe后,是这个样子:

 

 

 

点击文件版本管理:

 

 

 

 

说明:

服务端程序在启动后会自动检测同级目录下FileFolder文件夹内的文件夹、文件。然后自动添加入更新名单内。

文件夹结构说明: 

 

 

 看上面那张图,假设你要更新游戏客户端的这个Config文件夹里的Config.xml,那就在自动更新服务端的FileFolder

新建文件夹Config,然后文件夹里扔一个叫Config.xml的同名文件,然后关闭文件版本管理窗口,重新打开。就可以看见这个目录被添加进去了。

然后客户端那边如果再想,就可以更新Config文件夹下的Config.xml了。

.minecraft文件夹下的文件雷同上面的方法,这样就可以更新模组、材质包了。如法炮制去吧。

 

如果在文件版本管理窗口里点击一个文件,然后并点击删除按钮。那么客户端更新时,也会删除这个文件~。

 

 

 

 

然后我们说说

 

 

 

这个版本的值,是文件的版本。

比如你有一个233.zip文件,现在版本是1。

然后客户端的233.zip版本是0(也就是没有这个文件)。

更新程序启动后,会更新这个文件,然后把客户端的233.zip版本设置成1。

这样,下一次启动更新程序,服务端版本和客户端版本就一模一样,不会启动更新,避免更新同样的文件。

如果你在更新程序服务端改了233.zip的内容,然后你需要更新这个文件到客户端,那么你需要在文件版本管理内,把版本1改成版本2.

这样下一次客户端就会去更新了。

 

接下来我们说自动更新程序的客户端:

 

 

 

我们把自动更新程序的客户端放在.minecraft文件夹里面

 

所有从服务端传输来的文件都在更新程序客户端同级目录的上一层目录。

也就是如下的结构:

 

更新程序客户端位置: D:\xxxx服务器客户端\.minecraft\

更新后的文件存放位置: D:\xxxx服务器客户端\

这样如果你要更新.minecraft的文件,就需要在更新程序服务端添加.minecraft文件夹,然后在文件夹内添加mods文件夹或是其他文件。

所有从服务端传输来的文件都在更新程序客户端同级目录的上一层目录。

所有从服务端传输来的文件都在更新程序客户端同级目录的上一层目录。

所有从服务端传输来的文件都在更新程序客户端同级目录的上一层目录。

重要的话说三遍!!!

 

然后我们打开更新程序客户端的配置文件:

 

 

 服务器IP需要填写IP地址,而不是域名。有的域名无法被解析。

 

 

服务器的IP是动态IP怎么办?

如果你的IP是动态的,经常会换。可以使用FRP代理端口映射。

www.natfrp.com

把你的代理服务器域名换成IP写入自动更新客户端配置文件里就可以。

 

 

 很好,教程差不多就结束了。

下载(源码+直接部署版):

https://github.com/carierx/MRUS-Core

 

 

 

 

 

 

 

 点击这个下载

 

MRUS.7z是源码,需要Visual Studio打开并进行编译。

MRUS-开包即用版.7z 是直接使用的版本。里面含客户端和服务端。按照上面配置完成后就可以使用。

 

 

 

感谢你耐心看完本帖子。

Guess you like

Origin www.cnblogs.com/Dinnerbone/p/12110922.html