|
50精币
本帖最后由 大司命 于 2020-6-29 11:22 编辑
public function sendMessage(param1:Message) : void
{
var _loc4_:int = 0;
var _loc2_:int = 0;
var _loc8_:Number = NaN;
var _loc7_:* = NaN;
var _loc3_:int = 0;
var _loc9_:int = 0;
var _loc6_:int = 0;
var _loc5_:* = null;
if(isOffLine)
{
_loc4_ = Cmd.getCommandByName(Object(param1).constructor);
if(_loc4_ != 150)
{
DownScrollNotify.getInstance().DDMessage("您已掉线!");
}
return;
}
if(isKFConnected)
{
KFConnection.getInstance().sendMessage(param1);
}
else if(connected)
{
_loc2_ = Cmd.getCommandByName(Object(param1).constructor);
sendMsgBytes.length = 0;
sendBodyBytes.length = 0;
param1.writeTo(sendBodyBytes);
sendMsgBuf.cmd = _loc2_;
sendMsgBuf.data = sendBodyBytes;
_loc8_ = sendBodyBytes.length;
_loc7_ = 0;
_loc9_ = 0;
while(_loc9_ < _loc8_)
{
_loc3_ = sendBodyBytes[_loc9_];
_loc7_ = Number(_loc7_ + ((_loc3_ & 255) << 8 * _loc9_));
_loc9_++;
}
_loc6_ = Math.random() * 9999;
if(!_bool)
{
CModule.startAsync(this);
_bool = true;
o0 = getValue();
}
sendMsgBuf.v = MD5.hash(token + _loc6_ + _loc7_ + o0);
sendMsgBuf.userId = _loc6_;
sendMsgBuf.writeDelimitedTo(sendMsgBytes);
this.writeBytes(sendMsgBytes);
this.flush();
if(DebugManager.isOpenPanel)
{
_loc5_ = "发送****" + _loc2_ + " " + Object(param1).constructor + " " + TimeUtil.getHMMM();
if(_loc2_ != 150)
{
DebugManager.getInstance().addPrint(PROTBUFF,_loc5_);
}
else
{
DebugManager.getInstance().addPrint(HEART,_loc5_);
}
}
}
else
{
DebugManager.getInstance().addPrint("协yi","socket连接已经断开。。");
}
}
|
|