Fork me on GitHub
frostbelt's home

想学更多有意思的东西,想做自己的网站,想学画画


  • 首页

  • 归档

  • 标签

laya 自动编译

发表于 2019-11-18 | 热度 ℃
| 字数统计 139 | 阅读时长 1

前面使用了 Laya 命令行编译 工具 layaair2-cmd-plus,但每次修改完手动执行 layaair2-plus-cmd compile 还是有点麻烦

使用 fswatch 实现了监听文件变化自动编译

阅读全文 »

fiddler 内置命令

发表于 2019-10-31 | 热度 ℃
| 字数统计 334 | 阅读时长 1

引自Fiddler内置命令

?

1
2
?google.com
高亮显示所有 url 中包含 google.com 的请求

> 和 <

1
2
>5000
高亮显示所有包 >5000 bytes 的请求
阅读全文 »

laya js bridge

发表于 2019-10-21 | 热度 ℃
| 字数统计 301 | 阅读时长 1

laya 文档

用反射机制实现二次开发

注

1
2
3
laya 的异步调用,内部并没有实现队列。如连续多次调用同一异步方法,回调函数会被覆盖,导致逻辑混乱。
即异步调用需要串行调用
方案: 所有接口使用同步方式调用,指定回调方法,客户端直接回调,类似 jsonp

示例

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
const os = conchConfig.getOS();

let GameClient = {
is_android : os == "Conch-android",
is_ios_jj : os == "Conch-ios",
bridge : os == "Conch-android" ? PlatformClass.createClass("com.xxx.xxx.xxx.JSBridge") : PlatformClass.createClass("JSBridge"),

data : {},

/**
* toast (同步方法示例)
* @param {String} msg
*/
alert (msg) {
this.bridge.call("showMessage", msg);
},

/**
* 获取用户信息 (异步方法示例)
* @param {Function} cb 回调
* @param {Boolean} force_update 强制取最新信息
* @example
* GameClient.getUserInfo(res => {
* // 已登录
* if(res.errno == 1){
* res.data = {
* name : "xxx",
* avatar : "xxx",
* };
* }
* });
*/
getUserInfo (cb, force_update) {
cb = cb || function(){};

// 已记录登录状态
if(this.data.userInfo && !force_update){
cb(this.data.userInfo);
return;
}

this.bridge.callWithBack(res => {
res = typeof res == "string" ? JSON.parse(res) : res;
if(res.errno == 1){
this.data.userInfo = res.data;
}
else {
this.data.userInfo = null;
}
cb(this.data.userInfo);
}, "getCurrentUserInfo");
},
};

export default GameClient;

fiddler显示IP

发表于 2019-10-19 | 热度 ℃
| 字数统计 41 | 阅读时长 1

Rules->Customize Rules…

在 static function Main() 中加一行

1
FiddlerObject.UI.lvSessions.AddBoundColumn("ServerIP",120,"X-HostIP");

后加在左侧的最后一栏,把它拖动到前面

fiddler抓包--websocket

发表于 2019-10-19 | 热度 ℃
| 字数统计 45 | 阅读时长 1

Rules->Customize Rules…

在 class Handlers 中加入以下代码

1
2
3
static function OnWebSocketMessage(oMsg:WebSocketMessage){
FiddlerApplication.Log.LogString(oMsg.ToString());
}

然后就可以在右侧的 log tab 下看到 websocket 的消息了

Laya 命令行编译(Mac)

发表于 2019-10-17 | 热度 ℃
| 字数统计 110 | 阅读时长 1

总感觉 Laya 是一款对 Mac 很不友好的游戏引擎,一开 Layaair IDE 风扇就不停。IDE 的关闭、最大最小化还是在右上角,是在 Windows exe 上套了个壳吗?想在命令行编译,尝试了官方的 layaair2-cmd 还报错…

后来,终于找到一个能在 Mac 上运行的命令行编译工具layaair2-cmd-plus

阅读全文 »

npm uninstall -g

发表于 2019-10-17 | 热度 ℃
| 字数统计 150 | 阅读时长 1
1
2
3
4
5
6
7
全局安装是:
$ npm install xxx -g
全局卸载是:
$ npm uninstall xxx -g
全局卸载后,查看全局安装的包:
$ npm list --depth=0 -global
发现还有残留,还有大量报错信息

解决方式

阅读全文 »

阿里云ECS开启websocket

发表于 2019-09-12 | 热度 ℃
| 字数统计 282 | 阅读时长 1

本地测试没问题,但放到阿云 ECS 上后 websocket 无法链接

1
2
1. 安全组放行 websocket 服务端口
2. 开启防火墙并设置端口开放
阅读全文 »

断开ssh后继续执行--nohup

发表于 2019-09-12 | 热度 ℃
| 字数统计 285 | 阅读时长 1
1
2
3
场景: ssh 连接开发机后启动服务,ssh 断开后服务不停
$ nohup npm start > /var/log/nginx/xxx.log 2>&1 &
运行 npm start 命令,并且 ssh 断开后继续执行。日志输出到 /var/log/nginx/xxx.log

ssh 登录阿里云 ECS,nohup 随 ssh 断开的问题

1
2
3
4
5
6
7
ssh 登录 ECS,同样是
$ nohup npm start > /var/log/nginx/xxx.log 2>&1 &
但关闭终端后进程也被杀掉了
解决方式:
$ nohup npm start > /var/log/nginx/xxx.log 2>&1 &!
$ exit
exit 退出 ssh,进程会保留,但如果 nohup 最后没有 !,exit 时会提示 zsh: you have running jobs
阅读全文 »

php 执行命令

发表于 2019-08-12 | 热度 ℃
| 字数统计 54 | 阅读时长 1
1
2
3
4
5
6
exec ( string $command [, array &$output [, int &$return_var ]] ) : string
例:
exec('curl --user api:TinyPNG密钥 --data-binary @xxx.png照片绝对路径 -i https://api.tinify.com/shrink', $res);
$res = $res[count($res) - 1];
$res = json_decode($res, true);
$this->outFormat(0, $res['output']);
1…678…16
frostbelt

frostbelt

想学更多有意思的东西,想做自己的网站,想学画画

159 日志
161 标签
© 2021 frostbelt Flag Counter
博客全站共31.7k字