| 8 |
using OpenMetaverse; |
using OpenMetaverse; |
| 9 |
using OpenSim.Framework; |
using OpenSim.Framework; |
| 10 |
using OpenSim.Framework.Communications.Cache; |
using OpenSim.Framework.Communications.Cache; |
| 11 |
|
using OpenSim.Region.ClientStack; |
| 12 |
using OpenSim.Region.ClientStack.LindenUDP; |
using OpenSim.Region.ClientStack.LindenUDP; |
| 13 |
|
|
| 14 |
namespace ModularRex.RexNetwork |
namespace ModularRex.RexNetwork |
| 17 |
|
|
| 18 |
public delegate void RexFaceExpressionDelegate(RexClientView sender, List<string> vParams); |
public delegate void RexFaceExpressionDelegate(RexClientView sender, List<string> vParams); |
| 19 |
|
|
| 20 |
|
public delegate void RexAvatarProperties(RexClientView sender, List<string> parameters); |
| 21 |
|
|
| 22 |
public class RexClientView : LLClientView, IClientRexFaceExpression, IClientRexAppearance |
public class RexClientView : LLClientView, IClientRexFaceExpression, IClientRexAppearance |
| 23 |
{ |
{ |
| 24 |
private static readonly ILog m_log = |
private static readonly ILog m_log = |
| 30 |
|
|
| 31 |
public event RexAppearanceDelegate OnRexAppearance; |
public event RexAppearanceDelegate OnRexAppearance; |
| 32 |
public event RexFaceExpressionDelegate OnRexFaceExpression; |
public event RexFaceExpressionDelegate OnRexFaceExpression; |
| 33 |
|
public event RexAvatarProperties OnRexAvatarProperties; |
| 34 |
|
|
| 35 |
public RexClientView(EndPoint remoteEP, IScene scene, AssetCache assetCache, |
public RexClientView(EndPoint remoteEP, IScene scene, AssetCache assetCache, |
| 36 |
LLPacketServer packServer, AgentCircuitManager authenSessions, UUID agentId, |
LLPacketServer packServer, AuthenticateResponse authenSessions, UUID agentId, |
| 37 |
UUID sessionId, uint circuitCode, EndPoint proxyEP) |
UUID sessionId, uint circuitCode, EndPoint proxyEP, ClientStackUserSettings userSettings) |
| 38 |
: base(remoteEP, scene, assetCache, packServer, authenSessions, agentId, |
: base(remoteEP, scene, assetCache, packServer, authenSessions, agentId, |
| 39 |
sessionId, circuitCode, proxyEP) |
sessionId, circuitCode, proxyEP, userSettings) |
| 40 |
{ |
{ |
| 41 |
OnGenericMessage += RealXtendClientView_OnGenericMessage; |
OnGenericMessage += RealXtendClientView_OnGenericMessage; |
| 42 |
} |
} |
| 43 |
|
|
| 44 |
public RexClientView(EndPoint remoteEP, IScene scene, AssetCache assetCache, |
public RexClientView(EndPoint remoteEP, IScene scene, AssetCache assetCache, |
| 45 |
LLPacketServer packServer, AgentCircuitManager authenSessions, UUID agentId, |
LLPacketServer packServer, AuthenticateResponse authenSessions, UUID agentId, |
| 46 |
UUID sessionId, uint circuitCode, EndPoint proxyEP, string rexAvatarURL, string rexAuthURL) |
UUID sessionId, uint circuitCode, EndPoint proxyEP, string rexAvatarURL, string rexAuthURL, ClientStackUserSettings userSettings) |
| 47 |
: base(remoteEP, scene, assetCache, packServer, authenSessions, agentId, |
: base(remoteEP, scene, assetCache, packServer, authenSessions, agentId, |
| 48 |
sessionId, circuitCode, proxyEP) |
sessionId, circuitCode, proxyEP, userSettings) |
| 49 |
{ |
{ |
| 50 |
OnGenericMessage += RealXtendClientView_OnGenericMessage; |
OnGenericMessage += RealXtendClientView_OnGenericMessage; |
| 51 |
|
|
| 53 |
RexAuthURL = rexAuthURL; |
RexAuthURL = rexAuthURL; |
| 54 |
} |
} |
| 55 |
|
|
| 56 |
|
protected override void RegisterInterfaces() |
| 57 |
|
{ |
| 58 |
|
RegisterInterface<IClientRexAppearance>(this); |
| 59 |
|
RegisterInterface<IClientRexFaceExpression>(this); |
| 60 |
|
RegisterInterface<RexClientView>(this); |
| 61 |
|
|
| 62 |
|
base.RegisterInterfaces(); |
| 63 |
|
} |
| 64 |
|
|
| 65 |
public string RexAvatarURL |
public string RexAvatarURL |
| 66 |
{ |
{ |
| 67 |
get { return m_rexAvatarURL; } |
get { return m_rexAvatarURL; } |
| 110 |
if (OnRexFaceExpression != null) |
if (OnRexFaceExpression != null) |
| 111 |
{ |
{ |
| 112 |
OnRexFaceExpression(this, args); |
OnRexFaceExpression(this, args); |
| 113 |
|
return; |
| 114 |
|
} |
| 115 |
|
} |
| 116 |
|
|
| 117 |
|
if (method == "RexAvatarProp") |
| 118 |
|
{ |
| 119 |
|
if(OnRexAvatarProperties != null) |
| 120 |
|
{ |
| 121 |
|
OnRexAvatarProperties(this, args); |
| 122 |
|
return; |
| 123 |
|
} |
| 124 |
|
} |
| 125 |
|
|
| 126 |
|
m_log.Warn("[REXCLIENTVIEW] Unhandled GenericMessage (" + method + ") {"); |
| 127 |
|
foreach (string s in args) |
| 128 |
|
{ |
| 129 |
|
m_log.Warn("\t" + s); |
| 130 |
|
} |
| 131 |
|
m_log.Warn("}"); |
| 132 |
|
|
| 133 |
} |
} |
| 134 |
|
|
| 135 |
|
public void SendRexScriptCommand(string unit, string command, string parameters) |
| 136 |
|
{ |
| 137 |
|
List<string> pack = new List<string>(); |
| 138 |
|
|
| 139 |
|
pack.Add(unit); |
| 140 |
|
pack.Add(command); |
| 141 |
|
|
| 142 |
|
if (!string.IsNullOrEmpty(parameters)) |
| 143 |
|
pack.Add(parameters); |
| 144 |
|
|
| 145 |
|
SendGenericMessage("RexScr", pack); |
| 146 |
|
} |
| 147 |
|
|
| 148 |
|
public void SendRexInventoryMessage(string message) |
| 149 |
|
{ |
| 150 |
|
SendRexScriptCommand("hud", "ShowInventoryMessage(\"" + message + "\")", ""); |
| 151 |
} |
} |
| 152 |
|
|
| 153 |
|
public void SendRexScrollMessage(string message, double time) |
| 154 |
|
{ |
| 155 |
|
SendRexScriptCommand("hud", "ShowScrollMessage(\"" + message + "\", \"" + time + "\")", ""); |
| 156 |
|
} |
| 157 |
|
|
| 158 |
|
public void SendRexTutorialMessage(string message, double time) |
| 159 |
|
{ |
| 160 |
|
SendRexScriptCommand("hud", "ShowScrollMessage(\"" + message + "\", \"" + time + "\")", ""); |
| 161 |
} |
} |
| 162 |
|
|
| 163 |
|
public void SendRexFadeInAndOut(string message, double between, double time) |
| 164 |
|
{ |
| 165 |
|
SendRexScriptCommand("hud", |
| 166 |
|
"ShowInventoryMessage(\"" + message + "\"," |
| 167 |
|
+ " \"" + between + "\", \"" + time + "\")", ""); |
| 168 |
|
} |
| 169 |
|
|
| 170 |
|
|
| 171 |
public void SendRexFaceExpression(List<string> expressionData) |
public void SendRexFaceExpression(List<string> expressionData) |
| 172 |
{ |
{ |
| 173 |
expressionData.Insert(0, AgentId.ToString()); |
expressionData.Insert(0, AgentId.ToString()); |