Click here to Skip to main content
15,886,788 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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:
C#
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[^]
Posted
Updated 25-Aug-16 15:27pm
v3
Comments
Donny Rebecca 25-Aug-16 20:31pm    
i am sorry the code was to long so you can see it here: http://pastebin.com/5auHcVWv
Patrice T 25-Aug-16 20:35pm    
Use Improve question to update your question.
Patrice T 25-Aug-16 20:34pm    
Where is "main.asc: line 647" ?
Donny Rebecca 25-Aug-16 20:48pm    
application.getFmsVersion = function()
{
return FMS_VERSION;
}
Patrice T 25-Aug-16 21:07pm    
Use Improve question to update your question.
And tell which line is 647

1 solution

If you read carefully the error message, it tells you that
Quote:
ReferenceError: FMS_VERSION is not defined
Should be pretty obvious what it means.
In this code,
application.getFmsVersion = function()
{
return FMS_VERSION;
}

you use FMS_VERSION, but you didn't say what is FMS_VERSION, nowhere.
Either you have to define what is FMS_VERSION or you used a wrong name.

[Update]
Saying that you search all week do not tell us what you did.

Ask yourself how you came up with FMS_VERSION ?
You invented it ?
You found it somewhere ? in this case you know where to check what is wrong.

There is certainly some documentation, some tutorials, some sample code, somewhere.
 
Share this answer
 
v4
Comments
Donny Rebecca 25-Aug-16 21:29pm    
But is there anything how i can define this version? because the version of the FMS is 4.5
Patrice T 25-Aug-16 21:33pm    
I am not using Flash. Ask Google
Donny Rebecca 25-Aug-16 21:35pm    
Well i searched whole week... but i cant understand why you reply to this topic if your not using flash.... but thanks anyway....
Donny Rebecca 26-Aug-16 9:22am    
Well first of all i know what i did wrong with the FMS Version but if you read carefully the chat wont work..... maybe i have something done wrong and thats why i asking THIS Forum to resolve this issue....
Patrice T 26-Aug-16 11:01am    
Nice to see you resolved the issue with FMS_Version.
For the chat issue, you better open a new question with new problem.
And give details about what go wrong. "chat wont work" is not informative.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900