| 22 |
public delegate void RexObjectPropertiesDelegate(RexClientView sender, UUID id, RexObjectProperties props); |
public delegate void RexObjectPropertiesDelegate(RexClientView sender, UUID id, RexObjectProperties props); |
| 23 |
public delegate void RexStartUpDelegate(RexClientView remoteClient, UUID agentID, string status); |
public delegate void RexStartUpDelegate(RexClientView remoteClient, UUID agentID, string status); |
| 24 |
public delegate void RexClientScriptCmdDelegate(RexClientView remoteClient, UUID agentID, List<string> parameters); |
public delegate void RexClientScriptCmdDelegate(RexClientView remoteClient, UUID agentID, List<string> parameters); |
| 25 |
|
public delegate void ReceiveRexMediaURL(IClientAPI remoteClient, UUID agentID, UUID itemID, string mediaURL, byte refreshRate); |
| 26 |
|
|
| 27 |
/// <summary> |
/// <summary> |
| 28 |
/// Inherits from LLClientView the majority of functionality |
/// Inherits from LLClientView the majority of functionality |
| 56 |
public event RexObjectPropertiesDelegate OnRexObjectProperties; |
public event RexObjectPropertiesDelegate OnRexObjectProperties; |
| 57 |
public event RexStartUpDelegate OnRexStartUp; |
public event RexStartUpDelegate OnRexStartUp; |
| 58 |
public event RexClientScriptCmdDelegate OnRexClientScriptCmd; |
public event RexClientScriptCmdDelegate OnRexClientScriptCmd; |
| 59 |
|
public event ReceiveRexMediaURL OnReceiveRexMediaURL; |
| 60 |
|
|
| 61 |
public RexClientView(EndPoint remoteEP, IScene scene, AssetCache assetCache, |
public RexClientView(EndPoint remoteEP, IScene scene, AssetCache assetCache, |
| 62 |
LLPacketServer packServer, AuthenticateResponse authenSessions, UUID agentId, |
LLPacketServer packServer, AuthenticateResponse authenSessions, UUID agentId, |
| 66 |
{ |
{ |
| 67 |
// Rex communication now occurs via GenericMessage |
// Rex communication now occurs via GenericMessage |
| 68 |
// We have a special handler here below. |
// We have a special handler here below. |
| 69 |
AddGenericPacketHandler("RexAppearance", RealXtendClientView_OnGenericMessage); |
AddGenericPacketHandlers(); |
|
AddGenericPacketHandler("RexFaceExpression", RealXtendClientView_OnGenericMessage); |
|
|
AddGenericPacketHandler("RexAvatarProp", RealXtendClientView_OnGenericMessage); |
|
|
AddGenericPacketHandler("RexPrimData", RealXtendClientView_OnGenericMessage); |
|
|
AddGenericPacketHandler("RexData", RealXtendClientView_OnGenericMessage); |
|
| 70 |
|
|
| 71 |
OnBinaryGenericMessage += RexClientView_BinaryGenericMessage; |
OnBinaryGenericMessage += RexClientView_BinaryGenericMessage; |
| 72 |
OnGenericMessage += RealXtendClientView_OnGenericMessage; |
OnGenericMessage += RealXtendClientView_OnGenericMessage; |
| 81 |
// Rex communication now occurs via GenericMessage |
// Rex communication now occurs via GenericMessage |
| 82 |
// We need to register GenericMessage handlers |
// We need to register GenericMessage handlers |
| 83 |
|
|
| 84 |
AddGenericPacketHandler("RexAppearance", RealXtendClientView_OnGenericMessage); |
AddGenericPacketHandlers(); |
|
AddGenericPacketHandler("RexFaceExpression", RealXtendClientView_OnGenericMessage); |
|
|
AddGenericPacketHandler("RexAvatarProp", RealXtendClientView_OnGenericMessage); |
|
|
AddGenericPacketHandler("RexPrimData", RealXtendClientView_OnGenericMessage); |
|
|
AddGenericPacketHandler("RexData", RealXtendClientView_OnGenericMessage); |
|
| 85 |
|
|
| 86 |
OnBinaryGenericMessage += RexClientView_BinaryGenericMessage; |
OnBinaryGenericMessage += RexClientView_BinaryGenericMessage; |
| 87 |
|
|
| 89 |
RexAuthURL = rexAuthURL; |
RexAuthURL = rexAuthURL; |
| 90 |
} |
} |
| 91 |
|
|
| 92 |
|
private void AddGenericPacketHandlers() |
| 93 |
|
{ |
| 94 |
|
AddGenericPacketHandler("RexAppearance", RealXtendClientView_OnGenericMessage); |
| 95 |
|
AddGenericPacketHandler("RexFaceExpression", RealXtendClientView_OnGenericMessage); |
| 96 |
|
AddGenericPacketHandler("RexAvatarProp", RealXtendClientView_OnGenericMessage); |
| 97 |
|
AddGenericPacketHandler("RexPrimData", RealXtendClientView_OnGenericMessage); |
| 98 |
|
AddGenericPacketHandler("RexData", RealXtendClientView_OnGenericMessage); |
| 99 |
|
AddGenericPacketHandler("RexMediaUrl", RealXtendClientView_OnGenericMessage); |
| 100 |
|
} |
| 101 |
|
|
| 102 |
/// <summary> |
/// <summary> |
| 103 |
/// Registers interfaces for IClientCore, |
/// Registers interfaces for IClientCore, |
| 104 |
/// every time you make a new Rex-specific |
/// every time you make a new Rex-specific |
| 232 |
OnRexObjectProperties(this, id, new RexObjectProperties(rpdArray)); |
OnRexObjectProperties(this, id, new RexObjectProperties(rpdArray)); |
| 233 |
} |
} |
| 234 |
|
|
| 235 |
|
private Dictionary<string, RexAvatarPropertiesDelegate> m_genericMessageHandlers; |
| 236 |
|
|
| 237 |
/// <summary> |
/// <summary> |
| 238 |
/// Special - used to convert GenericMessage packets |
/// Special - used to convert GenericMessage packets |
| 239 |
/// to their appropriate Rex equivilents. |
/// to their appropriate Rex equivilents. |
| 244 |
void RealXtendClientView_OnGenericMessage(object sender, string method, List<string> args) |
void RealXtendClientView_OnGenericMessage(object sender, string method, List<string> args) |
| 245 |
{ |
{ |
| 246 |
//TODO: Convert to Dictionary<Method, GenericMessageHandler> |
//TODO: Convert to Dictionary<Method, GenericMessageHandler> |
| 247 |
|
//RexAvatarPropertiesDelegate method; |
| 248 |
|
//if (m_genericMessageHandlers.TryGetValue(method, out method)) |
| 249 |
|
//{ |
| 250 |
|
// method(this, args); |
| 251 |
|
// return; |
| 252 |
|
//} |
| 253 |
|
|
| 254 |
if (method == "RexAppearance") |
if (method == "RexAppearance") |
| 255 |
if (OnRexAppearance != null) |
if (OnRexAppearance != null) |
| 256 |
{ |
{ |
| 299 |
} |
} |
| 300 |
} |
} |
| 301 |
|
|
| 302 |
|
if (method == "rexmediaurl") |
| 303 |
|
{ |
| 304 |
|
TriggerOnReceivedRexMediaURL(this, args); |
| 305 |
|
return; |
| 306 |
|
} |
| 307 |
|
|
| 308 |
m_log.Warn("[REXCLIENTVIEW] Unhandled GenericMessage (" + method + ") {"); |
m_log.Warn("[REXCLIENTVIEW] Unhandled GenericMessage (" + method + ") {"); |
| 309 |
foreach (string s in args) |
foreach (string s in args) |
| 310 |
{ |
{ |
| 313 |
m_log.Warn("}"); |
m_log.Warn("}"); |
| 314 |
} |
} |
| 315 |
|
|
| 316 |
|
private void TriggerOnReceivedRexMediaURL(IClientAPI sender, List<string> args) |
| 317 |
|
{ |
| 318 |
|
foreach (string s in args) |
| 319 |
|
{ |
| 320 |
|
m_log.Debug("[rexclient] MediaURL: "+ s); |
| 321 |
|
} |
| 322 |
|
|
| 323 |
|
UUID assetID = new UUID(args[0]); |
| 324 |
|
string mediaUrl = args[1]; |
| 325 |
|
byte refreshRate = Convert.ToByte(args[2]); |
| 326 |
|
|
| 327 |
|
if (OnReceiveRexMediaURL != null) |
| 328 |
|
{ |
| 329 |
|
OnReceiveRexMediaURL(this, AgentId, assetID, mediaUrl, refreshRate); |
| 330 |
|
} |
| 331 |
|
} |
| 332 |
|
|
| 333 |
public void SendRexObjectProperties(UUID id, RexObjectProperties x) |
public void SendRexObjectProperties(UUID id, RexObjectProperties x) |
| 334 |
{ |
{ |
| 335 |
GenericMessagePacket gmp = new GenericMessagePacket(); |
GenericMessagePacket gmp = new GenericMessagePacket(); |
| 725 |
/// <param name="refreshRate">How many times per second to refresh the texture</param> |
/// <param name="refreshRate">How many times per second to refresh the texture</param> |
| 726 |
public void SendMediaURL(UUID assetId, string mediaURL, byte refreshRate) |
public void SendMediaURL(UUID assetId, string mediaURL, byte refreshRate) |
| 727 |
{ |
{ |
| 728 |
|
if (mediaURL == null | mediaURL == string.Empty) |
| 729 |
|
return; |
| 730 |
List<string> pack = new List<string>(); |
List<string> pack = new List<string>(); |
| 731 |
|
|
| 732 |
pack.Add(assetId.ToString()); |
pack.Add(assetId.ToString()); |