Flash MX 编程深层次应用-网络连线游戏(3),Flash MX 编程深层次应用-网络连线游戏(3)
【 tulaoshi.com - Flash 】
7.2 游戏区(2)下面是对应的SIT部分的Java代码:
if(cmd.equals(this.cmd_SIT)) {
if(param != null) {
param = param.trim();
if( param.indexOf(" ") != -1) {
String desk_name = param.substring(0, param.indexOf(" "));
param = param.substring(param.indexOf(" "));
param = param.trim();
String chessman_status = param.substring(0,param.indexOf(" "));
String player_name = param.substring(param.indexOf(" "));
player_name = player_name.trim();
chessman_status = chessman_status.trim();
user.deskname = desk_name;
user.place = chessman_status;
(本文来源于图老师网站,更多请访问http://www.tulaoshi.com/flash/)if (chessman_status.equals("stand_up")) {
user.deskname = null;
user.place = null;
user.play_status = null;
(本文来源于图老师网站,更多请访问http://www.tulaoshi.com/flash/)}
// 由于是广播,所以自己也会收到一个坐下的命令,所以自己就不发给自己了
user.manager.notifyAll(packMsg(this.m_SIT, desk_name+":" + chessman_status + ":" + player_name,"" ));
}
}
}
服务器发一条信息,是如何收到,然后如何动作的呢?请看下面的部分Flash代码:
function onXML_Receive(x) {
if (x == null) {
return;
}
var e = x.firstChild;
if (e == null) {<
来源:http://www.tulaoshi.com/n/20160129/1488396.html
看过《Flash MX 编程深层次应用-网络连线游戏(3)》的人还看了以下文章 更多>>