| 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 = |
| 25 |
LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
| 26 |
|
|
| 27 |
|
private string m_rexAccountID; |
| 28 |
private string m_rexAvatarURL; |
private string m_rexAvatarURL; |
| 29 |
private string m_rexAuthURL; |
private string m_rexAuthURL; |
| 30 |
private string m_rexSkypeURL; |
private string m_rexSkypeURL; |
| 31 |
|
|
| 32 |
public event RexAppearanceDelegate OnRexAppearance; |
public event RexAppearanceDelegate OnRexAppearance; |
| 33 |
public event RexFaceExpressionDelegate OnRexFaceExpression; |
public event RexFaceExpressionDelegate OnRexFaceExpression; |
| 34 |
|
public event RexAvatarProperties OnRexAvatarProperties; |
| 35 |
|
|
| 36 |
public RexClientView(EndPoint remoteEP, IScene scene, AssetCache assetCache, |
public RexClientView(EndPoint remoteEP, IScene scene, AssetCache assetCache, |
| 37 |
LLPacketServer packServer, AgentCircuitManager authenSessions, UUID agentId, |
LLPacketServer packServer, AuthenticateResponse authenSessions, UUID agentId, |
| 38 |
UUID sessionId, uint circuitCode, EndPoint proxyEP) |
UUID sessionId, uint circuitCode, EndPoint proxyEP, ClientStackUserSettings userSettings) |
| 39 |
: base(remoteEP, scene, assetCache, packServer, authenSessions, agentId, |
: base(remoteEP, scene, assetCache, packServer, authenSessions, agentId, |
| 40 |
sessionId, circuitCode, proxyEP) |
sessionId, circuitCode, proxyEP, userSettings) |
| 41 |
{ |
{ |
| 42 |
OnGenericMessage += RealXtendClientView_OnGenericMessage; |
OnGenericMessage += RealXtendClientView_OnGenericMessage; |
| 43 |
} |
} |
| 44 |
|
|
| 45 |
public RexClientView(EndPoint remoteEP, IScene scene, AssetCache assetCache, |
public RexClientView(EndPoint remoteEP, IScene scene, AssetCache assetCache, |
| 46 |
LLPacketServer packServer, AgentCircuitManager authenSessions, UUID agentId, |
LLPacketServer packServer, AuthenticateResponse authenSessions, UUID agentId, |
| 47 |
UUID sessionId, uint circuitCode, EndPoint proxyEP, string rexAvatarURL, string rexAuthURL) |
UUID sessionId, uint circuitCode, EndPoint proxyEP, string rexAvatarURL, string rexAuthURL, ClientStackUserSettings userSettings) |
| 48 |
: base(remoteEP, scene, assetCache, packServer, authenSessions, agentId, |
: base(remoteEP, scene, assetCache, packServer, authenSessions, agentId, |
| 49 |
sessionId, circuitCode, proxyEP) |
sessionId, circuitCode, proxyEP, userSettings) |
| 50 |
{ |
{ |
| 51 |
OnGenericMessage += RealXtendClientView_OnGenericMessage; |
OnGenericMessage += RealXtendClientView_OnGenericMessage; |
| 52 |
|
|
| 54 |
RexAuthURL = rexAuthURL; |
RexAuthURL = rexAuthURL; |
| 55 |
} |
} |
| 56 |
|
|
| 57 |
|
protected override void RegisterInterfaces() |
| 58 |
|
{ |
| 59 |
|
RegisterInterface<IClientRexAppearance>(this); |
| 60 |
|
RegisterInterface<IClientRexFaceExpression>(this); |
| 61 |
|
RegisterInterface<RexClientView>(this); |
| 62 |
|
|
| 63 |
|
base.RegisterInterfaces(); |
| 64 |
|
} |
| 65 |
|
|
| 66 |
public string RexAvatarURL |
public string RexAvatarURL |
| 67 |
{ |
{ |
| 68 |
get { return m_rexAvatarURL; } |
get { return m_rexAvatarURL; } |
| 83 |
set { m_rexSkypeURL = value; } |
set { m_rexSkypeURL = value; } |
| 84 |
} |
} |
| 85 |
|
|
| 86 |
|
public string RexAccount |
| 87 |
|
{ |
| 88 |
|
get { return m_rexAccountID; } |
| 89 |
|
set |
| 90 |
|
{ |
| 91 |
|
// Todo: More solid data checking here. |
| 92 |
|
m_rexAccountID = value; |
| 93 |
|
RexAuthURL = m_rexAccountID.Split('@')[1]; |
| 94 |
|
} |
| 95 |
|
} |
| 96 |
|
|
| 97 |
public string RexAuthURL |
public string RexAuthURL |
| 98 |
{ |
{ |
| 99 |
get { return m_rexAuthURL; } |
get { return m_rexAuthURL; } |
| 122 |
if (OnRexFaceExpression != null) |
if (OnRexFaceExpression != null) |
| 123 |
{ |
{ |
| 124 |
OnRexFaceExpression(this, args); |
OnRexFaceExpression(this, args); |
| 125 |
|
return; |
| 126 |
|
} |
| 127 |
|
} |
| 128 |
|
|
| 129 |
|
if (method == "RexAvatarProp") |
| 130 |
|
{ |
| 131 |
|
if(OnRexAvatarProperties != null) |
| 132 |
|
{ |
| 133 |
|
OnRexAvatarProperties(this, args); |
| 134 |
|
return; |
| 135 |
|
} |
| 136 |
|
} |
| 137 |
|
|
| 138 |
|
m_log.Warn("[REXCLIENTVIEW] Unhandled GenericMessage (" + method + ") {"); |
| 139 |
|
foreach (string s in args) |
| 140 |
|
{ |
| 141 |
|
m_log.Warn("\t" + s); |
| 142 |
} |
} |
| 143 |
|
m_log.Warn("}"); |
| 144 |
|
|
| 145 |
} |
} |
| 146 |
|
|
| 147 |
|
public void SendRexScriptCommand(string unit, string command, string parameters) |
| 148 |
|
{ |
| 149 |
|
List<string> pack = new List<string>(); |
| 150 |
|
|
| 151 |
|
pack.Add(unit); |
| 152 |
|
pack.Add(command); |
| 153 |
|
|
| 154 |
|
if (!string.IsNullOrEmpty(parameters)) |
| 155 |
|
pack.Add(parameters); |
| 156 |
|
|
| 157 |
|
SendGenericMessage("RexScr", pack); |
| 158 |
|
} |
| 159 |
|
|
| 160 |
|
public void SendRexInventoryMessage(string message) |
| 161 |
|
{ |
| 162 |
|
SendRexScriptCommand("hud", "ShowInventoryMessage(\"" + message + "\")", ""); |
| 163 |
} |
} |
| 164 |
|
|
| 165 |
|
public void SendRexScrollMessage(string message, double time) |
| 166 |
|
{ |
| 167 |
|
SendRexScriptCommand("hud", "ShowScrollMessage(\"" + message + "\", \"" + time + "\")", ""); |
| 168 |
|
} |
| 169 |
|
|
| 170 |
|
public void SendRexTutorialMessage(string message, double time) |
| 171 |
|
{ |
| 172 |
|
SendRexScriptCommand("hud", "ShowScrollMessage(\"" + message + "\", \"" + time + "\")", ""); |
| 173 |
|
} |
| 174 |
|
|
| 175 |
|
public void SendRexFadeInAndOut(string message, double between, double time) |
| 176 |
|
{ |
| 177 |
|
SendRexScriptCommand("hud", |
| 178 |
|
"ShowInventoryMessage(\"" + message + "\"," |
| 179 |
|
+ " \"" + between + "\", \"" + time + "\")", ""); |
| 180 |
|
} |
| 181 |
|
|
| 182 |
|
|
| 183 |
public void SendRexFaceExpression(List<string> expressionData) |
public void SendRexFaceExpression(List<string> expressionData) |
| 184 |
{ |
{ |
| 185 |
expressionData.Insert(0, AgentId.ToString()); |
expressionData.Insert(0, AgentId.ToString()); |