我用的是win版本的
[attach]898[/attach]
[attach]899[/attach]
[attach]897[/attach]
不應(yīng)該是先joinGroup 然后再getClientSessionsByGroup么?
剛才我試了下,先joinGroup在getClientSessionsByGroup也獲取不到值,我用的是GatewayClient3.0里面的方法。我看workerman-chat PHP聊天室里面寫的也是先獲取getClientSessionsByGroup在joinGroup的,他的就能獲取到,結(jié)合到TP里面用GatewayClient的getClientSessionsByGroup方法就不行,求大神指導(dǎo)
@1490:GatewayClient是在github下最新3.0的,GatewayWorker也是最新的版本。很奇怪,在Event.php里的onMessage里面是可以獲取到的,到了TP方法里用GatewayClient去獲取分組里全部用戶就不行,都不知道怎么弄了
問題解決了,在MVC框架里設(shè)置SESSION應(yīng)該用Gateway::setSession方法。謝謝大家?guī)椭。。?/p>
看看這個(gè)workerman與thinkphp5的實(shí)戰(zhàn)教學(xué)視頻,就都會(huì)了。
http://study.163.com/course/introduction/1005015012.htm?share=2&shareId=400000000388007