Skip to content

Commit

Permalink
调整版本号,发布
Browse files Browse the repository at this point in the history
  • Loading branch information
zsxsoft committed Oct 3, 2015
1 parent e3bdd34 commit 33be1f3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 20 deletions.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"version": "1.0.3",
"description": "Danmu client",
"main": "main.js",
"js-flags": "--harmony",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"go": "electron .",
Expand Down
24 changes: 5 additions & 19 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,15 @@ danmu-client

## 直接启动程序

目前仅有Windows x86版本可用。

1. 打开[Release](https://github.com/zsxsoft/danmu-client/releases)下载已经编译好的程序包并解压到某目录。
2. 双击目录下的``danmu-client``,启动成功。
2. 双击目录下的``danmu-client.exe``,启动成功。

## 源代码部署说明

1. 下载并安装[Nodejs](https://nodejs.org),同时需要安装[Visual Studio](https://www.visualstudio.com/en-us/products/visual-studio-express-vs.aspx)``Python``以便编译C++组件。
2. 命令行切换到工程目录下,执行``npm install``,等待自动下载和编译组件。(如果不想通过npm下载electron,可以在``package.json``里去掉``electron-prebuilt``)。
3. 执行``electron .``,启动成功。

## 调试工具打开说明

直接F12即可。

## 发布说明(Windows x86 + x64)

1. 根据``danmu.png``手动生成一个``danmu.ico``
Expand Down Expand Up @@ -71,8 +65,8 @@ danmu-client
为了保证安全与稳定,图片弹幕有防火墙机制。只有在弹幕程序目录及子目录下存在的图片才可被加载。引用网络图片,必须手动修改``config.js``添加白名单规则。如果被过滤,则程序不会有任何提示,该弹幕也不会被显示。

## 自定义弹幕
需要在服务器打开相应开关后,才允许使用自定义弹幕功能。自定义弹幕必须返回一个函数(或类),继承自``lib/danmu/sprite.js``中的``Sprite``,并需要实现``updateLifeTime``方法和``draw``方法。
示例代码如下(生成一个在屏幕上晃来晃去的玩意):
需要在服务器打开相应开关后,才允许使用自定义弹幕功能。自定义弹幕必须返回一个函数(或类),继承自``lib/danmu/sprite.js``中的``Sprite``,并需要实现``updateLifeTime``方法和``draw``方法,有``alive``属性
示例代码如下(生成一个颜色随机、在屏幕上晃来晃去的玩意):
```javascript
var Sprite = require('./lib/danmu/sprite.js');
var canvasWidth = 0;
Expand All @@ -81,14 +75,13 @@ function Comment(param) {
Sprite.call(this, param.x, param.y, param.width, param.height, param.speed);
this.text = param.text || ""; //文字内容
this.lifeTime = param.lifeTime || config.display.comment.lifeTime;
this.color = param.color || config.display.comment.color;
this.font = param.font || config.display.comment.fontStyle;
this.alive = true; //生命状态
}
Comment.prototype = Object.create(Sprite.prototype);
Comment.prototype.draw = function (canvasContext) {
if (canvasWidth == 0) canvasWidth = canvasContext.canvas.width;
if (canvasHeight == 0) canvasHeight = canvasContext.canvas.height;
if (canvasWidth === 0) canvasWidth = canvasContext.canvas.width;
if (canvasHeight === 0) canvasHeight = canvasContext.canvas.height;
canvasContext.fillStyle = "rgb(" + parseInt(Math.random() * 255) + ", " + parseInt(Math.random() * 255) + ", " + parseInt(Math.random() * 255) + ")";
canvasContext.font = this.font;
canvasContext.fillText(this.text, parseInt(Math.random() * canvasWidth), parseInt(Math.random() * canvasHeight));
Expand All @@ -100,13 +93,6 @@ Comment.prototype.updateLifeTime = function () {
return Comment;
```

## 通讯协议

此处基于socket.io作为底层协议。具体监听方法为
``io.on(PROTO_NAME, CALLBACK)``

### init
表示接收到

## 开源协议
The MIT License (MIT)
Expand Down

3 comments on commit 33be1f3

@phperwuhan
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

十一期间做了好多更新啊 👍
Electron(v0.33.3)版和nwjs(v0.12.3)版有啥区别呢?之前我用的老版client就是nwjs版,对吗?

@zsxsoft
Copy link
Owner Author

@zsxsoft zsxsoft commented on 33be1f3 Oct 5, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@zsxsoft
Copy link
Owner Author

@zsxsoft zsxsoft commented on 33be1f3 Oct 5, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

区别主要就是XP了,剩下的都是开发方面的区别

Please sign in to comment.