我正在编写一个动作脚本,我似乎无法在这个代码块上找到问题。
请帮忙。
部分代码:
private function constructCommunicatorAndConnect() : void
{
var cHost:* = ExternalData.splashServerHosts[this.m_nSplashServerIndex];
var nPort:* = int(ExternalData.splashServerPorts[this.m_nSplashServerIndex]);
var cSocket:* = new ReconnectingStringSocket(cHost, nPort, new RandomXORScrambler(68, 47));
cSocket.addEventListener(ReconnectingStringSocket.RECONNECTING, function (event:Event) : void
{
MultiplayerContainer.addTextToConsole("Lost splash connection, trying to reconnect...");
return;
}// end function
);
cSocket.addEventListener(ReconnectingStringSocket.RECONNECTING_SUCCESSFUL, function (event:Event) : void
{
MultiplayerContainer.addTextToConsole("Splash connection succesfully reestablished");
return;
}// end function
);
this.m_cSplashCommunicator = new SplashCommunicator(cSocket, MultiplayerContainer.player.com.miniclip.multiplayer.container.player:ILocalPlayer::sessionID, MultiplayerContainer.player.userID, ExternalData.gameID, this);
this.m_cSplashCommunicator.connect();
MultiplayerContainer.addTextToConsole("Connecting to splash server #" + this.m_nSplashServerIndex + " (" + cHost + ":" + nPort + ") with session \"" + MultiplayerContainer.player.sessionID + "\"");
dispatchEvent(new Event(COMMUNICATOR_CONSTRUCTED));
return;
}// end function
错误在
this.m_cSplashCommunicator = new SplashCommunicator(cSocket, MultiplayerContainer.player.com.miniclip.multiplayer.container.player:ILocalPlayer::sessionID, MultiplayerContainer.player.userID, ExternalData.gameID, this);
一些相关功能:
public function SplashCommunicator(param1:StringSocket_i, param2:String, param3:String, param4:String, param5:ISplashListener)
{
super(param1, param5);
param1.setSocketEventHandler(this.handleSocketEvent);
param1.addEventListener(Event.CONNECT, this.socketConnected);
this.m_cSessionID = param2 != null ? (param2) : ("");
this.m_cUserID = param3 != null ? (param3) : ("");
this.m_cGameID = param4;
this.m_cListener = param5;
return;
}// end function