Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Shockwave causes crash on htm page using SMUS

Status
Not open for further replies.

Johnathon

Programmer
Jul 29, 2006
23
US
I am currently working on a multiuser chat program that is to be embedded into a webpage. I am running into a problem though after the program connects to the server. For the most part it works fine during run mode, but when you try to quit the program by closing the window, going to another website, or in any other way that I've found causes the browser to crash (the standard Internet Explorer has encountered a problem and needs to close error) When I click for more information on the error it lists dirapi.dll as the source of the problem. Dirapi.dll is part of shockwave, so I can't be sure if it's just saying that shockwave in general crashed or shockwave overall crashed, but in any case, it lists it as the problem.
I've tried everything I can think of to solve this problem and I just can't figure it out. I've tried rerouting all xtras to local files, tried a whole lot of things to clear globals and connections before quitting, letting the movie just run out into nothingness... I'm out of ideas. Your help would be greatly appreciated

Thanks,
Johnathon
 
Update: I've found that the actual problem lies somewhere in the "errCode = sConnect.SetNetMessageHandler( #DefaultMessageHandler, script 1 )" line - I'm not sure how to get around this problem as I need the NetMessageHandler in order to communicate with the server (unless there's some other way that I'm not aware of to do the server/client communication)

Again, your help would be greatly appreciated!
 
(I apologize for the triple post, but I can't seem to find an edit button anywhere..)


Upon even further research I have determined that the actual error occurs once a sendNetMessage command is sent to the server from the client. (for example, if I were to run the following code on the client in the browser it would cause the crash when you quit the game):

errCode = sConnect.sendNetMessage([#recipients:"system.script", #subject:"LoadChar",#content:AcctDat])

Is there a way to clear it somehow in the on stopmovie method?
 
Here's the script I'm using. Perhaps one of you can find a problem with it that will solve the problem.


global sConnect, MuteCountdown
on stopmovie
sConnect = 0
clearglobals
end stopMovie

on DefaultMessageHandler
global sConnect, uname, passphrase, IAmAdmin, IAmMod, IAmGuide, MuteCountdown
newMessage = sConnect.getNetMessage()
errCode = newMessage.errorCode
if errCode <> 0 then
alert "Error: "& errCode & " : " & sConnect.getNetErrorString(errCode)
else
if newMessage.Subject = "OkayToLog" then
play frame 30
end if
if newMessage.SenderID = "System" AND newMessage.Subject = "ConnectToNetServer" then
play frame 5
end if
end if
end

-----------------------------------------------------------------------------------
-- LoadMeUp
-- Command lines that run when the login button is pressed
-- Creates the multiuser xtra instance and the connection to the server.
-----------------------------------------------------------------------------------
on LoadMeUp
set uname = field (member "username" of castlib "Internal")
set passphrase = field (member "password" of castlib "Internal")
sConnect = new(xtra "Multiuser")
errCode = sConnect.setNetMessageHandler(#DefaultMessageHandler, script 1)
errCode = sConnect.ConnectToNetServer( uname, passphrase, "server.theserv", 1626, "MainMovie" )
play frame 4
end

-----------------------------------------------------------------------------------
-- LoadCharacterCommand
-- The script below is the problem causer. I'm not sure how to clear it
-- in the on StopMovie command.
-----------------------------------------------------------------------------------
on LoadCharacterCommand
set uname = field(member "Username" of castlib "Internal")
set passphrase = field(member "Password" of castlib "Internal")
set CharDt = uname & ":" & passphrase
-- The Commented line below is how I would normally send a command like this, the one below is how I have it set now, it makes no difference which I use. They both cause the crash in the end.
-- errCode = sConnect.sendNetMessage([#recipients:"system.script", #subject:"LoadChar", #content:CharDt])
errCode = sConnect.sendNetMessage("system.script", "LoadChar", CharDt)
end
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top