Score
0
Watch 78 Star 237 Fork 99

呵大官人 / fookingC++

运行不了?

Open
penck  Opened this issue

config.lua和router.lua中的监听ip是本机的ip吗?还需要修改哪里?运行不起来

11506 scgywx 1578914778 total 2 participants

Comments (18)

11506 scgywx 1578914778
呵大官人 2015-04-08 13:21 owner

ip就是你在配置中填的ip,,运行不起来报什么错?

penck 2015-04-08 15:13

我在router.lua中写的:
HOST = "127.0.0.1";
PORT = 9010;
config.lua中是:
HOST = "127.0.0.1";
PORT = 9001;
在../popo/index.html中:<param name="flashvars" value="server=192.168.1.100&port=9001&handler=flashevent"

ip改成我的电脑ip;然后nginx路径指向../popo,nginx,redis,php5-fpm都运行起来了,浏览器输入localhost可以进入游戏界面,就是不能运行游戏,界面是死的

不知道哪里没有配置好?

11506 scgywx 1578914778
呵大官人 2015-04-08 15:15 owner

你有运行flash安全沙箱吗?在popo目录下,运行python flash.py

penck 2015-04-08 15:31

运行了,就是游戏界面点击没反应,

penck 2015-04-08 15:34

运行flash.py后,界面上打印了正在监听843这个端口,这个是不是有问题?

11506 scgywx 1578914778
呵大官人 2015-04-08 15:40 owner

1、游戏界面里面有没有人物出现?
如果没有人物出现,那说明连接有问题,你可以观察一下gateway的日志,浏览器是不是已经连接到gateway了,具体日志如下:
2015-04-08 15:31:49.558631 [DEBUG][10167] new client, fd=9, ip=61.151.186.141, port=916, sid=5524d965f5f027b70009

2、检测PHP是不是已经正确处理数据了,日志如下:
2015-04-08 09:58:46.569132 [DEBUG][10167] new client, fd=10, ip=61.151.186.141, port=54772, sid=55248b56f5f027b7000a
2015-04-08 09:58:46.569160 [DEBUG][10167] unlock accept mutex
2015-04-08 09:58:46.569168 [DEBUG][10167] lock accept mutex
2015-04-08 09:58:46.569190 [DEBUG][10167] write to fd=8, len=28
2015-04-08 09:58:46.569198 [DEBUG][10167] write completed
2015-04-08 09:58:46.569278 [DEBUG][10167] client message, fd=10, len=65
2015-04-08 09:58:47.568847 [DEBUG][10167] backend data
2015-04-08 09:58:47.568871 [DEBUG][10167] version=1, type=6, requestid=1, contentLength=53, paddingLength=3, reserved=0, data=X-Powered-By: PHP/5.4.36
Content-type: text/html

2015-04-08 09:58:47.568879 [DEBUG][10167] version=1, type=3, requestid=1, contentLength=8, paddingLength=0, reserved=0, data=
2015-04-08 09:58:47.568884 [DEBUG][10167] FastCGI End Request, protocolStatus=0, exitStatus=0

3、查看安全沙箱的日志,是不是浏览器已经连接到安全沙箱并且获取到了相关的权限。

penck 2015-04-08 15:43

你的意思是浏览器没有权限的问题?我的是Ubuntu,怎么设置?

penck 2015-04-08 15:45

晚上再试试,多谢了。

11506 scgywx 1578914778
呵大官人 2015-04-08 15:45 owner

不是浏览器,而是flash的安全沙箱,因为flash要通过socket跟服务器通信的话,必须要经过一个843端口获取到通信权限才能正常通信的,所以,每一次你刷新而成,,,python flash.py这个窗口,应该会有日志输出的!你看有没有。。并且在gateway的日志里面,也应该是有new client字样的日志,你看看有没有?

penck 2015-04-08 21:51

gateway日志:
2015-04-08 21:28:31.950953 [INFO][2981] server started, listenfd=4
2015-04-08 21:28:31.951877 [INFO][2983] connect router server 127.0.0.1:9010
2015-04-08 21:28:31.951848 [INFO][2982] connect router server 127.0.0.1:9010
2015-04-08 21:28:31.951991 [DEBUG][2983] worker started, pipefd=7
2015-04-08 21:28:31.952001 [DEBUG][2982] worker started, pipefd=6
2015-04-08 21:28:31.952016 [DEBUG][2983] eventloop started, event driven is epoll
2015-04-08 21:28:31.952023 [DEBUG][2982] eventloop started, event driven is epoll
2015-04-08 21:28:31.952075 [DEBUG][2983] lock accept mutex
2015-04-08 21:28:31.952106 [INFO][2982] router connected
2015-04-08 21:28:31.952128 [INFO][2983] router connected

router日志:
2015-04-08 21:28:11.216335 [DEBUG][2927] router server started, listening port=9010
2015-04-08 21:28:11.216456 [DEBUG][2927] eventloop started, event driven is epoll
2015-04-08 21:28:31.951862 [DEBUG][2927] new client
2015-04-08 21:28:31.951957 [DEBUG][2927] new client
2015-04-08 21:28:31.952202 [DEBUG][2927] on data, type=1, slen=0, len=4
2015-04-08 21:28:31.952253 [DEBUG][2927] auth 1
2015-04-08 21:28:31.952275 [DEBUG][2927] on data, type=1, slen=0, len=4
2015-04-08 21:28:31.952287 [DEBUG][2927] auth 1
php5-fpm.log日志:
[08-Apr-2015 21:13:35] NOTICE: configuration file /etc/php5/fpm/php-fpm.conf test is successful
不知道安全沙箱的日志在哪里?我感觉是php没起作用?

11506 scgywx 1578914778
呵大官人 2015-04-08 22:17 owner

从你的日志看。浏览器根本还没有去链接fooking,flash安全沙箱日志有吗?还有。确定你的浏览器支持flash吗

11506 scgywx 1578914778
呵大官人 2015-04-08 22:28 owner

安全沙箱日志就是你运行的那个python flash.py后,你刷新页面,看这个程序的输出

penck 2015-04-08 22:31

刷新界面shell没有输出,我的是火狐浏览器,怎么设置?换一个?

11506 scgywx 1578914778
呵大官人 2015-04-08 22:34 owner

装个firefox 的flash插件

penck 2015-04-08 23:08

安装flash刷新界面:
沙箱日志:
Connection from ::ffff:127.0.0.1:33093
Valid request received from ::ffff:127.0.0.1:33093
Sent policy file to ::ffff:127.0.0.1:33093

config.lua日志:
new client, sid=552542fe00dd0b650008

close client, sid=552542fe00dd0b6500

gatway日志:
2015-04-08 23:02:22.168861 [DEBUG][2917] unlock accept mutex
2015-04-08 23:02:22.168877 [DEBUG][2917] lock accept mutex
2015-04-08 23:02:22.181159 [DEBUG][2917] client message, fd=8, len=34
2015-04-08 23:02:22.181205 [DEBUG][2917] call lua func onInput start
2015-04-08 23:02:22.181259 [DEBUG][2917] call lua func onInput, ret=1
2015-04-08 23:02:22.181273 [DEBUG][2917] process message, fd=8, reqid=1, proc=1, buffer size=0, msg len=0
2015-04-08 23:02:48.416669 [DEBUG][2917] close client, fd=8, sid=552542fe00dd0b650008
2015-04-08 23:02:48.416761 [DEBUG][2917] backend connect to 127.0.0.1:9000
2015-04-08 23:02:48.416896 [DEBUG][2917] backend close, conn=0x880b00
router日志:
2015-04-08 23:02:22.168865 [DEBUG][2848] new connection, sid=552542fe00dd0b650008
2015-04-08 23:02:48.416750 [DEBUG][2848] on data, type=3, slen=20, len=0
2015-04-08 23:02:48.416780 [DEBUG][2848] close connection, sid=552542fe00dd0b650008

not found Sec-WebSocket-Key是什么意思?

11506 scgywx 1578914778
呵大官人 2015-04-08 23:22 owner

哦。这个是websocket协议。你把config.lua里面的script.lua那一行注释掉就好了,另外config.lua里面的fastcgi目录记得配置

11506 scgywx 1578914778
呵大官人 2015-04-08 23:24 owner

新版的fooking支持websocket协议了。以后很多时候可以不用flash 的socket了

penck 2015-04-09 23:47

试了一下还是不行,可能是nginx的配置文件还有php-fpm的配置文件有问题,沙箱使用日志的,关闭后页面也弹出connection close 字样。多谢了

Sign in to comment

Assignees
Labels
Not set
Projects
Milestones
Branches
Planed to start
Not set
Planed to end
Not set
Top level
Priority