那么我该如何解决这个......这让我大概一周了! [英] Well how do I fix this... This getting me about a week!

查看:64
本文介绍了那么我该如何解决这个......这让我大概一周了!的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

此代码来自Modenacam FMS ....



一切正常,聊天除外。



当来自凸轮网站的表演者登录时,会在服务器上显示此消息:

 onConnect 
用户 ACEPTED
onConnect,performerId: 16 ,pasword:645062a5e513f1cd2e1a8d4e64789b4ccd05e795f51a9e3d4f72c4cc61337a87,userId: 16 ,userType:performer,userName:helma,uniqId:a8882bb2c3d7cd4a3f98f071afdc10528020d5038,sessionType: 1 ,md5Check: 1 ,truePrivate:undefined
ip = 84 104 42 0.94&安培;用户id = 16&安培; USERTYPE =表演&安培; pasword = 645062a5e513f1cd2e1a8d4e64789b4ccd05e795f51a9e3d4f72c4cc61337a87&安培; uniqId = a8882bb2c3d7cd4a3f98f071afdc10528020d5038&安培;用户名= helma&安培; PERF ormerId = 16& hash = WpRp4JJ2xjibLezgESz& numberOfCameras = 1
用户 ACCEPTED
Auth允许允许
getTopic,[ object 客户端]
发送错误消息:C:\Program Files \Adobe\Flash Media Server < span class =code-digit> 4
.5 \applications \ hotprive_main\main.asc:line 647 :ReferenceError:FMS_VERSION 未定义
代码:Application.Script.Error级别:错误
Application.Script.Error详细信息:C:\Program Files \ Adob​​e \\ \\ Flash Media Server 4 .5 \applications \ hotprive_main\main.asc:line 647 : ReferenceError:FMS_VERSION 未定义
Application.Script.Error详细信息:undefined
代码:Application.Script.Error级别:错误
发送错误消息:执行方法失败(getFmsVersion)。
onPublish [ object 客户端],[ object Stream]





如果本案例中的表演者Helma在聊天中说:这是作为表演者的测试信息



服务器将放弃:

 broadcastChatLineIcon helma,这是一个测试消息,表现为16,0xff0010 





并且聊天表格不会显示文字:这是一个测试消息,作为表演者



如果用户要聊天并说:这是来自用户的测试消息



服务器对此作出回应:



< pre lang =text> broadcastChatLineIcon rebecca,这是来自用户的测试消息,v1,0x123ff0





再次它不会在聊天表格中显示文字....







此脚本名为:main。 asc

如果你能看到有一节给我ssage out to the form ..

但我认为有一些代码失败,它不会回应聊天..



of你搜索下:broadcastChatLineIcon然后你可以看到它与markt +消息+但我认为这是错误的编码.....



它是一个Flash网站所以main.asc与Flash Media Server 4.5一起运行作为FMS文件

有人可以跟我说明它再次运行吗?



 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);

//设置执行者激活的摄像机数量
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:检查用户是否已登录
//变量
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)
{
//函数
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(用户被ACEPTED);
}

application.initClientInterval = function(clientObj)
{
if(clientObj.userType ==viewer)
{
clientObj.taxIntervalId = setInterval(application.checkTax,5000,clientObj);
}

trace(用户被接受);
}

application.checkTax = function(client)
{
trace(checkTax+ client.sessionType);

//检查用户是否还有会话
var isLoggedIn = false;
var clients = application.clients;
var n = clients.length;
for(var i = 0; i< n; i ++)
{
if(clients [i] == client)
{
isLoggedIn = true;
休息;
}
}

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。>





我的尝试:



一切!我做了一切让它工作,但我不会让我这样做....



对于Line代码,最好在postbin中观看:主要 - Pastebin.com [ ^ ]

解决方案

如果您仔细阅读错误消息,它会告诉您

引用:

ReferenceError:FMS_VERSION未定义

应该是非常明显的含义。

在此代码中,

 application.getFmsVersion = function()
{
返回FMS_VERSION;
}



您使用 FMS_VERSION ,但您没有说什么是 FMS_VERSION ,无处。

您必须定义什么是 FMS_VERSION 或者您使用了错误的名称。 />


[更新]

说你整个星期搜索都不告诉我们你做了什么。



问问自己你是如何想出 FMS_VERSION

你发明了它吗?

你找到了它某个地方?在这种情况下,你知道在哪里检查什么是错的。



肯定有一些文档,一些教程,一些示例代码,某处。

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[^]

解决方案

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.


这篇关于那么我该如何解决这个......这让我大概一周了!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆