This code is from Modenacam FMS....
Everything is working except the chat.
When the performer from the cam site logged in it gives this message at the server:
onConnect
User is ACEPTED
onConnect, performerId: 16, pasword: 645062a5e513f1cd2e1a8d4e64789b4ccd05e795f51a9e3d4f72c4cc61337a87, userId: 16, userType: performer, userName: helma, uniqId: a8882bb2c3d7cd4a3f98f071afdc10528020d5038, sessionType: 1, md5Check: 1, truePrivate: undefined
ip=84.104.42.94&userId=16&userType=performer&pasword=645062a5e513f1cd2e1a8d4e64789b4ccd05e795f51a9e3d4f72c4cc61337a87&uniqId=a8882bb2c3d7cd4a3f98f071afdc10528020d5038&userName=helma&performerId=16&hash=WpRp4JJ2xjibLezgESz&numberOfCameras=1
User is ACCEPTED
Auth allowed allow
getTopic , [object Client]
Sending error message: C:\Program Files\Adobe\Flash Media Server 4.5\applications\hotprive_main\main.asc: line 647: ReferenceError: FMS_VERSION is not defined
code: Application.Script.Error level: error
Application.Script.Error details: C:\Program Files\Adobe\Flash Media Server 4.5\applications\hotprive_main\main.asc: line 647: ReferenceError: FMS_VERSION is not defined
Application.Script.Error details: undefined
code: Application.Script.Error level: error
Sending error message: Failed to execute method (getFmsVersion).
onPublish [object Client], [object Stream]
If the performer in this case "Helma" says in the chat: This is a test message as performer
The server will give this up:
broadcastChatLineIcon helma, This is a test message as performer, 16, 0xff0010
And the chat form will not show the text: This is a test message as performer
If a user gonna chat and say: This is a test message from a user
The server respond to this:
broadcastChatLineIcon rebecca, This is a test message from a user, v1, 0x123ff0
And again it will not show the text in the chat form....
This script below called: main.asc
If you can see there is a section for giving the message out to the form..
But i think there is some code failure that it will not respond to the chat..
of you search under: broadcastChatLineIcon then you can see it with the markt + message + but i think it is wrong coded.....
it is a flash site so main.asc is running with Flash Media Server 4.5 As FMS Files
Can someone figure it out with me to make it run again?
load("components.asc");
application.topic = "";
application.cameraNo = 0;
application.performer = null;
application.hash = null;
application.fmsId = null;
application.flvName = null;
application.videoStream;
application.baseUrl = "http://www.pcheld.nl/arco/chat/";
application.banUrl = "fms/banmanager";
application.authUrl = "fms/auth";
application.authPerformerUrl = "performer/fms/auth";
application.taxUrl = "fms/tax";
application.truePrivateUrl = "fms/trueprivate";
application.endSessionUrl = "fms/endsession";
application.chatLogUrl = "fms/log";
application.tipUrl = "fms/tip";
application.validateChipsUrl = "fms/validatechips";
application.onAppStart = function()
{
trace("onAppStart");
application.allowDebug = true;
}
application.onConnect = function(clientObj, performerId, pasword,
userId, userType, userName, uniqId, sessionType, md5Check, truePrivate)
{
load("hash.as");
trace("onConnect");
application.hash = hash;
application.fmsId = md5Check;
trace("onConnect, performerId: " + performerId + ", pasword: " +
pasword + ", userId: " + userId + ", userType: " + userType +
", userName: ", userName + ", uniqId: " +
uniqId + ", sessionType: " + sessionType + ", md5Check: " + md5Check + ", truePrivate: " + truePrivate);
// Set the number of cameras activated if performer
if(userType == "performer")
{
application.cameraNo = sessionType;
application.performer = clientObj;
}
application.initClient(clientObj);
clientObj.userId = userId;
clientObj.releaseStream = function() { trace("releaseStream"); };
clientObj.FCPublish = function() { trace("FCPublish"); };
clientObj.FCUnpublish = function() { trace("FCUnpublish"); };
// TODO: Check if user isnt logged in already
// Variables
application.acceptConnection(clientObj);
clientObj.userType = userType;
clientObj.userName = userName;
clientObj.performerId = performerId;
clientObj.pasword = pasword;
clientObj.sessionType = sessionType;
clientObj.uniqId = uniqId;
clientObj.truePrivate = truePrivate;
clientObj.md5Check = md5Check;
if(userType == "viewer" || userType == "performer")
application.userCheck(clientObj);
else
application.initClientInterval(clientObj);
};
application.initClient = function(clientObj)
{
// Functions
clientObj.broadcastChatLine = application.broadcastChatLine;
clientObj.broadcastChatLineIcon = application.broadcastChatLineIcon;
clientObj.updateTopic = application.updateTopic;
clientObj.getTopic = application.getTopic;
clientObj.askForNumberOfCameras = application.askForNumberOfCameras;
clientObj.ask_song = application.ask_song;
clientObj.change_song = application.change_song;
clientObj.send_song = application.send_song;
clientObj.initializeSpy = application.initializeSpy;
clientObj.rec = application.rec;
clientObj.recStop = application.recStop;
clientObj.kick = application.kick;
clientObj.ban = application.ban;
clientObj.kickSelf = application.kickSelf;
clientObj.banSelf = application.banSelf;
clientObj.privateInvitation = application.privateInvitation;
clientObj.acceptInvitation = application.acceptInvitation;
clientObj.enterPrivate = application.enterPrivate;
clientObj.changeSessionTypeToPrivate = application.changeSessionTypeToPrivate;
clientObj.rejectInvitation = application.rejectInvitation;
clientObj.tipPerfromer = application.tipPerfromer;
clientObj.setViewerBroadcast = application.setViewerBroadcast;
clientObj.getFmsVersion = application.getFmsVersion;
if(clientObj.userType == "viewer")
{
clientObj.taxIntervalId = setInterval(application.checkTax, 5000, clientObj);
}
trace("User is ACEPTED");
}
application.initClientInterval = function(clientObj)
{
if(clientObj.userType == "viewer")
{
clientObj.taxIntervalId = setInterval(application.checkTax, 5000, clientObj);
}
trace("User is ACCEPTED");
}
application.checkTax = function(client)
{
trace("checkTax " + client.sessionType);
// Check if the user has session still
var isLoggedIn = false;
var clients = application.clients;
var n = clients.length;
for(var i = 0; i < n; i++)
{
if(clients[i] == client)
{
isLoggedIn = true;
break;
}
}
if(!isLoggedIn)
clearInterval(client.taxIntervalId);
var taxSendLV = new LoadVars();
var taxRecvLV = new LoadVars();
taxSendLV.userId = client.userId;
taxSendLV.userType = client.userType;
taxSendLV.pasword = client.pasword;
taxSendLV.uniqId = client.uniqId;
taxSendLV.performerId = client.performerId;
taxSendLV.truePrivate = client.truePrivate;
taxSendLV.sessionType = (client.sessionType == "true_private") ? "private" : client.sessionType;
taxSendLV.hash = application.hash;
taxSendLV.sendAndLoad(application.baseUrl + application.taxUrl, taxRecvLV, "POST");
taxRecvLV.>
What I have tried:
Everything! i did everything to make it work but i wont letting me do that....
For the Line code its better to watch this in postbin:
main - Pastebin.com[
^]