| 1 |
using System.Collections; |
using System; |
| 2 |
|
using System.Collections; |
| 3 |
using System.Collections.Generic; |
using System.Collections.Generic; |
| 4 |
using System.Net; |
using System.Net; |
| 5 |
using System.Reflection; |
using System.Reflection; |
| 6 |
using System.Threading; |
using System.Threading; |
| 7 |
using log4net; |
using log4net; |
| 8 |
|
using ModularRex.RexFramework; |
| 9 |
using Nwc.XmlRpc; |
using Nwc.XmlRpc; |
| 10 |
using OpenMetaverse; |
using OpenMetaverse; |
| 11 |
|
using OpenMetaverse.Packets; |
| 12 |
using OpenSim.Framework; |
using OpenSim.Framework; |
| 13 |
using OpenSim.Framework.Communications.Cache; |
using OpenSim.Framework.Communications.Cache; |
| 14 |
|
using OpenSim.Region.ClientStack; |
| 15 |
using OpenSim.Region.ClientStack.LindenUDP; |
using OpenSim.Region.ClientStack.LindenUDP; |
| 16 |
|
|
| 17 |
namespace ModularRex.RexNetwork |
namespace ModularRex.RexNetwork |
| 18 |
{ |
{ |
| 19 |
public delegate void RexAppearanceDelegate(RexClientView sender); |
public delegate void RexAppearanceDelegate(RexClientView sender); |
| 20 |
|
|
| 21 |
public delegate void RexFaceExpressionDelegate(RexClientView sender, List<string> vParams); |
public delegate void RexFaceExpressionDelegate(RexClientView sender, List<string> parameters); |
| 22 |
|
|
| 23 |
|
public delegate void RexAvatarProperties(RexClientView sender, List<string> parameters); |
| 24 |
|
|
| 25 |
|
public delegate void RexRecieveObjectPropertiesDelegate(RexClientView sender, UUID id, RexObjectProperties props); |
| 26 |
|
|
| 27 |
|
public delegate void ReceiveRexStartUp(RexClientView remoteClient, UUID agentID, string status); |
| 28 |
|
|
| 29 |
|
public delegate void ReceiveRexClientScriptCmd(RexClientView remoteClient, UUID agentID, List<string> parameters); |
| 30 |
|
|
| 31 |
|
/// <summary> |
| 32 |
|
/// Inherits from LLClientView the majority of functionality |
| 33 |
|
/// Overrides and extends for Rex-specific functionality. |
| 34 |
|
/// |
| 35 |
|
/// In the case whereby functionality uses the same packets but differs |
| 36 |
|
/// between Rex and LL, you can use a override on those specific functions |
| 37 |
|
/// to overload the request. |
| 38 |
|
/// </summary> |
| 39 |
public class RexClientView : LLClientView, IClientRexFaceExpression, IClientRexAppearance |
public class RexClientView : LLClientView, IClientRexFaceExpression, IClientRexAppearance |
| 40 |
{ |
{ |
| 41 |
private static readonly ILog m_log = |
private static readonly ILog m_log = |
| 42 |
LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
| 43 |
|
|
| 44 |
|
private string m_rexAccountID; |
| 45 |
private string m_rexAvatarURL; |
private string m_rexAvatarURL; |
| 46 |
private string m_rexAuthURL; |
private string m_rexAuthURL; |
| 47 |
private string m_rexSkypeURL; |
private string m_rexSkypeURL; |
| 48 |
|
public string AvatarStorageOverride; |
| 49 |
|
|
| 50 |
|
public float RexCharacterSpeedMod = 1.0f; |
| 51 |
|
public float RexMovementSpeedMod = 1.0f; |
| 52 |
|
public float RexVertMovementSpeedMod = 1.0f; |
| 53 |
|
public bool RexWalkDisabled = false; |
| 54 |
|
public bool RexFlyDisabled = false; |
| 55 |
|
public bool RexSitDisabled = false; |
| 56 |
|
|
| 57 |
public event RexAppearanceDelegate OnRexAppearance; |
public event RexAppearanceDelegate OnRexAppearance; |
| 58 |
public event RexFaceExpressionDelegate OnRexFaceExpression; |
public event RexFaceExpressionDelegate OnRexFaceExpression; |
| 59 |
|
public event RexAvatarProperties OnRexAvatarProperties; |
| 60 |
|
public event RexRecieveObjectPropertiesDelegate OnRexObjectProperties; |
| 61 |
|
public event ReceiveRexStartUp OnReceiveRexStartUp; |
| 62 |
|
public event ReceiveRexClientScriptCmd OnReceiveRexClientScriptCmd; |
| 63 |
|
|
| 64 |
public RexClientView(EndPoint remoteEP, IScene scene, AssetCache assetCache, |
public RexClientView(EndPoint remoteEP, IScene scene, AssetCache assetCache, |
| 65 |
LLPacketServer packServer, AgentCircuitManager authenSessions, UUID agentId, |
LLPacketServer packServer, AuthenticateResponse authenSessions, UUID agentId, |
| 66 |
UUID sessionId, uint circuitCode, EndPoint proxyEP) |
UUID sessionId, uint circuitCode, EndPoint proxyEP, ClientStackUserSettings userSettings) |
| 67 |
: base(remoteEP, scene, assetCache, packServer, authenSessions, agentId, |
: base(remoteEP, scene, assetCache, packServer, authenSessions, agentId, |
| 68 |
sessionId, circuitCode, proxyEP) |
sessionId, circuitCode, proxyEP, userSettings) |
| 69 |
{ |
{ |
| 70 |
|
// Rex communication now occurs via GenericMessage |
| 71 |
|
// We have a special handler here below. |
| 72 |
|
|
| 73 |
|
|
| 74 |
|
AddGenericPacketHandler("RexAppearance", RealXtendClientView_OnGenericMessage); |
| 75 |
|
AddGenericPacketHandler("RexFaceExpression", RealXtendClientView_OnGenericMessage); |
| 76 |
|
AddGenericPacketHandler("RexAvatarProp", RealXtendClientView_OnGenericMessage); |
| 77 |
|
AddGenericPacketHandler("RexPrimData", RealXtendClientView_OnGenericMessage); |
| 78 |
|
AddGenericPacketHandler("RexData", RealXtendClientView_OnGenericMessage); |
| 79 |
|
|
| 80 |
|
OnBinaryGenericMessage += RexClientView_BinaryGenericMessage; |
| 81 |
OnGenericMessage += RealXtendClientView_OnGenericMessage; |
OnGenericMessage += RealXtendClientView_OnGenericMessage; |
| 82 |
} |
} |
| 83 |
|
|
| 84 |
public RexClientView(EndPoint remoteEP, IScene scene, AssetCache assetCache, |
public RexClientView(EndPoint remoteEP, IScene scene, AssetCache assetCache, |
| 85 |
LLPacketServer packServer, AgentCircuitManager authenSessions, UUID agentId, |
LLPacketServer packServer, AuthenticateResponse authenSessions, UUID agentId, |
| 86 |
UUID sessionId, uint circuitCode, EndPoint proxyEP, string rexAvatarURL, string rexAuthURL) |
UUID sessionId, uint circuitCode, EndPoint proxyEP, string rexAvatarURL, string rexAuthURL, ClientStackUserSettings userSettings) |
| 87 |
: base(remoteEP, scene, assetCache, packServer, authenSessions, agentId, |
: base(remoteEP, scene, assetCache, packServer, authenSessions, agentId, |
| 88 |
sessionId, circuitCode, proxyEP) |
sessionId, circuitCode, proxyEP, userSettings) |
| 89 |
{ |
{ |
| 90 |
OnGenericMessage += RealXtendClientView_OnGenericMessage; |
// Rex communication now occurs via GenericMessage |
| 91 |
|
// We need to register GenericMessage handlers |
| 92 |
|
|
| 93 |
|
AddGenericPacketHandler("RexAppearance", RealXtendClientView_OnGenericMessage); |
| 94 |
|
AddGenericPacketHandler("RexFaceExpression", RealXtendClientView_OnGenericMessage); |
| 95 |
|
AddGenericPacketHandler("RexAvatarProp", RealXtendClientView_OnGenericMessage); |
| 96 |
|
AddGenericPacketHandler("RexPrimData", RealXtendClientView_OnGenericMessage); |
| 97 |
|
AddGenericPacketHandler("RexData", RealXtendClientView_OnGenericMessage); |
| 98 |
|
|
| 99 |
|
OnBinaryGenericMessage += RexClientView_BinaryGenericMessage; |
| 100 |
|
|
| 101 |
RexAvatarURL = rexAvatarURL; |
RexAvatarURL = rexAvatarURL; |
| 102 |
RexAuthURL = rexAuthURL; |
RexAuthURL = rexAuthURL; |
| 103 |
} |
} |
| 104 |
|
|
| 105 |
|
/// <summary> |
| 106 |
|
/// Registers interfaces for IClientCore, |
| 107 |
|
/// every time you make a new Rex-specific |
| 108 |
|
/// Interface. Make sure to register it here. |
| 109 |
|
/// </summary> |
| 110 |
|
protected override void RegisterInterfaces() |
| 111 |
|
{ |
| 112 |
|
RegisterInterface<IClientRexAppearance>(this); |
| 113 |
|
RegisterInterface<IClientRexFaceExpression>(this); |
| 114 |
|
|
| 115 |
|
// Register our own class 'as-is' so it can be |
| 116 |
|
// used via IClientCore.Get<RexClientView>()... |
| 117 |
|
RegisterInterface(this); |
| 118 |
|
|
| 119 |
|
base.RegisterInterfaces(); |
| 120 |
|
} |
| 121 |
|
|
| 122 |
|
/// <summary> |
| 123 |
|
/// The avatar URL for this avatar |
| 124 |
|
/// Eg: http://avatar.com:10000/uuid/ |
| 125 |
|
/// </summary> |
| 126 |
public string RexAvatarURL |
public string RexAvatarURL |
| 127 |
{ |
{ |
| 128 |
get { return m_rexAvatarURL; } |
get { return m_rexAvatarURL; } |
| 137 |
} |
} |
| 138 |
} |
} |
| 139 |
|
|
| 140 |
|
/// <summary> |
| 141 |
|
/// Skype username of the avatar |
| 142 |
|
/// eg: Skypeuser |
| 143 |
|
/// </summary> |
| 144 |
public string RexSkypeURL |
public string RexSkypeURL |
| 145 |
{ |
{ |
| 146 |
get { return m_rexSkypeURL; } |
get { return m_rexSkypeURL; } |
| 147 |
set { m_rexSkypeURL = value; } |
set { m_rexSkypeURL = value; } |
| 148 |
} |
} |
| 149 |
|
|
| 150 |
|
/// <summary> |
| 151 |
|
/// The full Rex Username of this account |
| 152 |
|
/// Eg: user@hostname.com:10001 |
| 153 |
|
/// |
| 154 |
|
/// Note: This is not filled immedietely on |
| 155 |
|
/// creation. This property is filled in |
| 156 |
|
/// via Login and may not be availible |
| 157 |
|
/// immedietely upon connect. |
| 158 |
|
/// |
| 159 |
|
/// The above glitch is scheduled to be |
| 160 |
|
/// fixed by a new RexCommsManager which |
| 161 |
|
/// will allow this to be set at spawn in |
| 162 |
|
/// login. |
| 163 |
|
/// </summary> |
| 164 |
|
public string RexAccount |
| 165 |
|
{ |
| 166 |
|
get { return m_rexAccountID; } |
| 167 |
|
set |
| 168 |
|
{ |
| 169 |
|
// Todo: More solid data checking here. |
| 170 |
|
m_rexAccountID = value; |
| 171 |
|
RexAuthURL = m_rexAccountID.Split('@')[1]; |
| 172 |
|
} |
| 173 |
|
} |
| 174 |
|
|
| 175 |
|
/// <summary> |
| 176 |
|
/// The URL of the Avatar's Authentication Server |
| 177 |
|
/// Eg: http://authentication.com:10001/ |
| 178 |
|
/// </summary> |
| 179 |
public string RexAuthURL |
public string RexAuthURL |
| 180 |
{ |
{ |
| 181 |
get { return m_rexAuthURL; } |
get { return m_rexAuthURL; } |
| 182 |
set |
set |
| 183 |
{ |
{ |
| 184 |
|
if (value.Contains("@")) |
| 185 |
|
{ |
| 186 |
|
m_rexAuthURL = "http://" + value.Split('@')[1]; |
| 187 |
|
} |
| 188 |
|
else |
| 189 |
|
{ |
| 190 |
m_rexAuthURL = value; |
m_rexAuthURL = value; |
| 191 |
|
} |
| 192 |
// Request Agent Properties Asynchronously |
// Request Agent Properties Asynchronously |
| 193 |
ThreadPool.QueueUserWorkItem(RequestProperties); |
ThreadPool.QueueUserWorkItem(RequestProperties); |
| 194 |
} |
} |
| 195 |
} |
} |
| 196 |
|
|
| 197 |
|
void RexClientView_BinaryGenericMessage(Object sender, string method, byte[][] args) |
| 198 |
|
{ |
| 199 |
|
if(method == "RexPrimData".ToLower()) |
| 200 |
|
{ |
| 201 |
|
HandleRexPrimData(args); |
| 202 |
|
return; |
| 203 |
|
} |
| 204 |
|
} |
| 205 |
|
|
| 206 |
|
private void HandleRexPrimData(byte[][] args) |
| 207 |
|
{ |
| 208 |
|
int rpdLen = 0; |
| 209 |
|
int idx = 0; |
| 210 |
|
bool first = false; |
| 211 |
|
UUID id = UUID.Zero; |
| 212 |
|
|
| 213 |
|
foreach (byte[] arg in args) |
| 214 |
|
{ |
| 215 |
|
if(!first) |
| 216 |
|
{ |
| 217 |
|
id = new UUID(Util.FieldToString(arg)); |
| 218 |
|
first = true; |
| 219 |
|
continue; |
| 220 |
|
} |
| 221 |
|
|
| 222 |
|
rpdLen += arg.Length; |
| 223 |
|
} |
| 224 |
|
|
| 225 |
|
first = false; |
| 226 |
|
byte[] rpdArray = new byte[rpdLen]; |
| 227 |
|
|
| 228 |
|
foreach (byte[] arg in args) |
| 229 |
|
{ |
| 230 |
|
if(!first) |
| 231 |
|
{ |
| 232 |
|
first = true; |
| 233 |
|
continue; |
| 234 |
|
} |
| 235 |
|
|
| 236 |
|
arg.CopyTo(rpdArray,idx); |
| 237 |
|
idx += arg.Length; |
| 238 |
|
} |
| 239 |
|
|
| 240 |
|
if (OnRexObjectProperties != null) |
| 241 |
|
OnRexObjectProperties(this, id, new RexObjectProperties(rpdArray)); |
| 242 |
|
} |
| 243 |
|
|
| 244 |
|
/// <summary> |
| 245 |
|
/// Special - used to convert GenericMessage packets |
| 246 |
|
/// to their appropriate Rex equivilents. |
| 247 |
|
/// |
| 248 |
|
/// Eg: GenericMessage(RexAppearance) -> |
| 249 |
|
/// OnRexAppearance(...) |
| 250 |
|
/// </summary> |
| 251 |
void RealXtendClientView_OnGenericMessage(object sender, string method, List<string> args) |
void RealXtendClientView_OnGenericMessage(object sender, string method, List<string> args) |
| 252 |
{ |
{ |
| 253 |
//TODO: Convert to Dictionary<Method, GenericMessageHandler> |
//TODO: Convert to Dictionary<Method, GenericMessageHandler> |
| 264 |
if (OnRexFaceExpression != null) |
if (OnRexFaceExpression != null) |
| 265 |
{ |
{ |
| 266 |
OnRexFaceExpression(this, args); |
OnRexFaceExpression(this, args); |
| 267 |
|
return; |
| 268 |
|
} |
| 269 |
|
} |
| 270 |
|
|
| 271 |
|
if (method == "RexAvatarProp") |
| 272 |
|
{ |
| 273 |
|
if(OnRexAvatarProperties != null) |
| 274 |
|
{ |
| 275 |
|
OnRexAvatarProperties(this, args); |
| 276 |
|
return; |
| 277 |
|
} |
| 278 |
|
} |
| 279 |
|
|
| 280 |
|
if(method == "RexData") |
| 281 |
|
{ |
| 282 |
|
|
| 283 |
|
} |
| 284 |
|
|
| 285 |
|
if (method == "rexscr") |
| 286 |
|
{ |
| 287 |
|
if (OnReceiveRexClientScriptCmd != null) |
| 288 |
|
{ |
| 289 |
|
OnReceiveRexClientScriptCmd(this, AgentId, args); |
| 290 |
|
} |
| 291 |
|
} |
| 292 |
|
|
| 293 |
|
if (method == "RexStartup") |
| 294 |
|
{ |
| 295 |
|
if (OnReceiveRexStartUp != null) |
| 296 |
|
{ |
| 297 |
|
OnReceiveRexStartUp(this, AgentId, args[0]); |
| 298 |
|
} |
| 299 |
|
} |
| 300 |
|
|
| 301 |
|
m_log.Warn("[REXCLIENTVIEW] Unhandled GenericMessage (" + method + ") {"); |
| 302 |
|
foreach (string s in args) |
| 303 |
|
{ |
| 304 |
|
m_log.Warn("\t" + s); |
| 305 |
|
} |
| 306 |
|
m_log.Warn("}"); |
| 307 |
|
|
| 308 |
|
} |
| 309 |
|
|
| 310 |
|
public void SendRexObjectProperties(UUID id, RexObjectProperties x) |
| 311 |
|
{ |
| 312 |
|
GenericMessagePacket gmp = new GenericMessagePacket(); |
| 313 |
|
gmp.MethodData.Method = Utils.StringToBytes("RexPrimData"); |
| 314 |
|
|
| 315 |
|
byte[] temprexprimdata = x.GetRexPrimDataToBytes(); |
| 316 |
|
int numlines = 0; |
| 317 |
|
int i = 0; |
| 318 |
|
|
| 319 |
|
if (temprexprimdata != null) |
| 320 |
|
{ |
| 321 |
|
while (i <= temprexprimdata.Length) |
| 322 |
|
{ |
| 323 |
|
numlines++; |
| 324 |
|
i += 200; |
| 325 |
|
} |
| 326 |
|
} |
| 327 |
|
|
| 328 |
|
gmp.ParamList = new GenericMessagePacket.ParamListBlock[1 + numlines]; |
| 329 |
|
gmp.ParamList[0] = new GenericMessagePacket.ParamListBlock(); |
| 330 |
|
gmp.ParamList[0].Parameter = Utils.StringToBytes(id.ToString()); |
| 331 |
|
|
| 332 |
|
for (i = 0; i < numlines; i++) |
| 333 |
|
{ |
| 334 |
|
gmp.ParamList[i + 1] = new GenericMessagePacket.ParamListBlock(); |
| 335 |
|
|
| 336 |
|
if ((temprexprimdata.Length - i * 200) < 200) |
| 337 |
|
{ |
| 338 |
|
gmp.ParamList[i + 1].Parameter = new byte[temprexprimdata.Length - i * 200]; |
| 339 |
|
Buffer.BlockCopy(temprexprimdata, i * 200, gmp.ParamList[i + 1].Parameter, 0, temprexprimdata.Length - i * 200); |
| 340 |
|
} |
| 341 |
|
else |
| 342 |
|
{ |
| 343 |
|
gmp.ParamList[i + 1].Parameter = new byte[200]; |
| 344 |
|
Buffer.BlockCopy(temprexprimdata, i * 200, gmp.ParamList[i + 1].Parameter, 0, 200); |
| 345 |
|
} |
| 346 |
|
} |
| 347 |
|
|
| 348 |
|
// m_log.Warn("[REXDEBUG]: SendRexPrimData " + vPrimId.ToString()); |
| 349 |
|
OutPacket(gmp, ThrottleOutPacketType.Task); |
| 350 |
|
|
| 351 |
|
} |
| 352 |
|
|
| 353 |
|
/// <summary> |
| 354 |
|
/// Sends a Rex Script Command to the viewer |
| 355 |
|
/// attached to this ClientView. |
| 356 |
|
/// |
| 357 |
|
/// If you are coding something, try use |
| 358 |
|
/// SendRex*** instead, as many of them |
| 359 |
|
/// will trigger this instead with type |
| 360 |
|
/// and parameter checking. |
| 361 |
|
/// </summary> |
| 362 |
|
public void SendRexScriptCommand(string unit, string command, string parameters) |
| 363 |
|
{ |
| 364 |
|
List<string> pack = new List<string>(); |
| 365 |
|
|
| 366 |
|
pack.Add(unit); |
| 367 |
|
pack.Add(command); |
| 368 |
|
|
| 369 |
|
if (!string.IsNullOrEmpty(parameters)) |
| 370 |
|
pack.Add(parameters); |
| 371 |
|
|
| 372 |
|
SendGenericMessage("RexScr", pack); |
| 373 |
|
} |
| 374 |
|
|
| 375 |
|
public void SendRexInventoryMessage(string message) |
| 376 |
|
{ |
| 377 |
|
SendRexScriptCommand("hud", "ShowInventoryMessage(\"" + message + "\")", ""); |
| 378 |
} |
} |
| 379 |
|
|
| 380 |
|
public void SendRexScrollMessage(string message, double time) |
| 381 |
|
{ |
| 382 |
|
SendRexScriptCommand("hud", "ShowScrollMessage(\"" + message + "\", \"" + time + "\")", ""); |
| 383 |
|
} |
| 384 |
|
|
| 385 |
|
public void SendRexTutorialMessage(string message, double time) |
| 386 |
|
{ |
| 387 |
|
SendRexScriptCommand("hud", "ShowScrollMessage(\"" + message + "\", \"" + time + "\")", ""); |
| 388 |
} |
} |
| 389 |
|
|
| 390 |
|
public void SendRexFadeInAndOut(string message, double between, double time) |
| 391 |
|
{ |
| 392 |
|
SendRexScriptCommand("hud", |
| 393 |
|
"ShowInventoryMessage(\"" + message + "\"," |
| 394 |
|
+ " \"" + between + "\", \"" + time + "\")", ""); |
| 395 |
} |
} |
| 396 |
|
|
| 397 |
|
|
| 398 |
public void SendRexFaceExpression(List<string> expressionData) |
public void SendRexFaceExpression(List<string> expressionData) |
| 399 |
{ |
{ |
| 400 |
expressionData.Insert(0, AgentId.ToString()); |
expressionData.Insert(0, AgentId.ToString()); |
| 424 |
{ |
{ |
| 425 |
m_log.Info("[REXCLIENT] Resolving avatar..."); |
m_log.Info("[REXCLIENT] Resolving avatar..."); |
| 426 |
Hashtable ReqVals = new Hashtable(); |
Hashtable ReqVals = new Hashtable(); |
| 427 |
ReqVals["avatar_uuid"] = AgentId.ToString(); |
ReqVals["avatar_account"] = RexAccount; |
| 428 |
ReqVals["AuthenticationAddress"] = RexAuthURL; |
ReqVals["AuthenticationAddress"] = RexAuthURL; |
| 429 |
|
|
| 430 |
ArrayList SendParams = new ArrayList(); |
ArrayList SendParams = new ArrayList(); |
| 431 |
SendParams.Add(ReqVals); |
SendParams.Add(ReqVals); |
| 432 |
|
|
| 433 |
XmlRpcRequest req = new XmlRpcRequest("get_user_by_uuid", SendParams); |
XmlRpcRequest req = new XmlRpcRequest("get_user_by_account", SendParams); |
| 434 |
|
|
| 435 |
m_log.Info("[REXCLIENT] Sending XMLRPC Request to " + RexAuthURL); |
m_log.Info("[REXCLIENT] Sending XMLRPC Request to http://" + RexAuthURL); |
| 436 |
XmlRpcResponse authreply = req.Send(RexAuthURL, 9000); |
|
| 437 |
|
XmlRpcResponse authreply = req.Send("http://" + RexAuthURL, 9000); |
| 438 |
|
|
| 439 |
|
m_log.Info(authreply.ToString()); |
| 440 |
|
if (!((Hashtable)authreply.Value).ContainsKey("error_type")) |
| 441 |
|
{ |
| 442 |
string rexAsAddress = ((Hashtable)authreply.Value)["as_address"].ToString(); |
string rexAsAddress = ((Hashtable)authreply.Value)["as_address"].ToString(); |
| 443 |
string rexSkypeURL = ((Hashtable)authreply.Value)["skype_url"].ToString(); |
string rexSkypeURL = ((Hashtable)authreply.Value)["skype_url"].ToString(); |
| 444 |
UUID userID = new UUID(((Hashtable) authreply.Value)["uuid"].ToString()); |
UUID userID = new UUID(((Hashtable) authreply.Value)["uuid"].ToString()); |
| 450 |
RexSkypeURL = rexSkypeURL; |
RexSkypeURL = rexSkypeURL; |
| 451 |
} |
} |
| 452 |
} |
} |
| 453 |
|
else |
| 454 |
|
{ |
| 455 |
|
m_log.Warn("[REXCLIENT]: User not found"); |
| 456 |
|
} |
| 457 |
|
} |
| 458 |
|
|
| 459 |
|
/// <summary> |
| 460 |
|
/// Sends Fog parameters to client. Only works underwater. |
| 461 |
|
/// </summary> |
| 462 |
|
/// <param name="start">meters from camera where the fog starts</param> |
| 463 |
|
/// <param name="end">meters from camera where the fog ends</param> |
| 464 |
|
/// <param name="red">redness in fog</param> |
| 465 |
|
/// <param name="green">greeness in fog</param> |
| 466 |
|
/// <param name="blue">blueness in fog</param> |
| 467 |
|
public void SendRexFog(float start, float end, float red, float green, float blue) |
| 468 |
|
{ |
| 469 |
|
List<string> pack = new List<string>(); |
| 470 |
|
|
| 471 |
|
pack.Add(start.ToString()); |
| 472 |
|
pack.Add(end.ToString()); |
| 473 |
|
pack.Add(red.ToString()); |
| 474 |
|
pack.Add(green.ToString()); |
| 475 |
|
pack.Add(blue.ToString()); |
| 476 |
|
|
| 477 |
|
SendGenericMessage("RexFog", pack); |
| 478 |
|
} |
| 479 |
|
|
| 480 |
|
/// <summary> |
| 481 |
|
/// Sends water height to client. Usually used when changing water height on the fly with scripting. |
| 482 |
|
/// </summary> |
| 483 |
|
/// <param name="height">Water height in meters</param> |
| 484 |
|
public void SendRexWaterHeight(float height) |
| 485 |
|
{ |
| 486 |
|
List<string> pack = new List<string>(); |
| 487 |
|
|
| 488 |
|
pack.Add(height.ToString()); |
| 489 |
|
|
| 490 |
|
SendGenericMessage("RexWaterHeight", pack); |
| 491 |
|
} |
| 492 |
|
|
| 493 |
|
/// <summary> |
| 494 |
|
/// Sends post postprosessing effect toggle to client. |
| 495 |
|
/// </summary> |
| 496 |
|
/// <see cref="http://rexdeveloper.org/wiki/index.php?title=Content_Scripting_Python_Post-Process"/> |
| 497 |
|
/// <param name="effectId">Id of the effect. See documentation for the effect ids</param> |
| 498 |
|
/// <param name="toggle">True to set effect on. False to set effect off.</param> |
| 499 |
|
public void SendRexPostProcess(int effectId, bool toggle) |
| 500 |
|
{ |
| 501 |
|
List<string> pack = new List<string>(); |
| 502 |
|
|
| 503 |
|
pack.Add(effectId.ToString()); |
| 504 |
|
pack.Add(toggle.ToString()); |
| 505 |
|
|
| 506 |
|
SendGenericMessage("RexPostP", pack); |
| 507 |
|
} |
| 508 |
|
|
| 509 |
|
/// <summary> |
| 510 |
|
/// Creates client side rtt camera |
| 511 |
|
/// </summary> |
| 512 |
|
/// <param name="command">0 to remove existing rtt camera (by name), 1 to add new rtt camera</param> |
| 513 |
|
/// <param name="name">Unique identifier for the camera</param> |
| 514 |
|
/// <param name="assetId">UUID of the texture that gets rendered to</param> |
| 515 |
|
/// <param name="pos">Position of the camera in the world</param> |
| 516 |
|
/// <param name="lookat">Point in the world the camera will look at</param> |
| 517 |
|
/// <param name="width">Width of the texture</param> |
| 518 |
|
/// <param name="height">Height of the texture</param> |
| 519 |
|
public void SendRexRttCamera(int command, string name, UUID assetId, Vector3 pos, Vector3 lookat, int width, int height) |
| 520 |
|
{ |
| 521 |
|
List<string> pack = new List<string>(); |
| 522 |
|
|
| 523 |
|
pack.Add(command.ToString()); |
| 524 |
|
pack.Add(name); |
| 525 |
|
pack.Add(assetId.ToString()); |
| 526 |
|
pack.Add(pos.ToString()); |
| 527 |
|
pack.Add(lookat.ToString()); |
| 528 |
|
pack.Add(width.ToString()); |
| 529 |
|
pack.Add(height.ToString()); |
| 530 |
|
|
| 531 |
|
SendGenericMessage("RexRttCam", pack); |
| 532 |
|
} |
| 533 |
|
|
| 534 |
|
/// <summary> |
| 535 |
|
/// Sends a viewport to client |
| 536 |
|
/// </summary> |
| 537 |
|
/// <param name="command">0 to remove existing viewport (by name), 1 to add new viewport.</param> |
| 538 |
|
/// <param name="name">Unique identifier for the viewport</param> |
| 539 |
|
/// <param name="posX">screen relative position of the left edge of the viewport</param> |
| 540 |
|
/// <param name="posY">screen relative position of the top edge of the viewport</param> |
| 541 |
|
/// <param name="width">screen relative width of the viewport</param> |
| 542 |
|
/// <param name="height">screen relative height of the viewport</param> |
| 543 |
|
public void SendRexViewport(int command, string name, float posX, float posY, float width, float height) |
| 544 |
|
{ |
| 545 |
|
List<string> pack = new List<string>(); |
| 546 |
|
|
| 547 |
|
pack.Add(command.ToString()); |
| 548 |
|
pack.Add(name); |
| 549 |
|
pack.Add(posX.ToString()); |
| 550 |
|
pack.Add(posY.ToString()); |
| 551 |
|
pack.Add(width.ToString()); |
| 552 |
|
pack.Add(height.ToString()); |
| 553 |
|
|
| 554 |
|
SendGenericMessage("RexSetViewport", pack); |
| 555 |
|
} |
| 556 |
|
|
| 557 |
|
/// <summary> |
| 558 |
|
/// Toggles the wind sound on client |
| 559 |
|
/// </summary> |
| 560 |
|
/// <param name="toggle"></param> |
| 561 |
|
public void SendRexToggleWindSound(bool toggle) |
| 562 |
|
{ |
| 563 |
|
List<string> pack = new List<string>(); |
| 564 |
|
|
| 565 |
|
pack.Add(toggle.ToString()); |
| 566 |
|
|
| 567 |
|
SendGenericMessage("RexToggleWindSound", pack); |
| 568 |
|
} |
| 569 |
|
|
| 570 |
|
/// <summary> |
| 571 |
|
/// Sends Rex clientside camera effects, particle script attached to camera etc. |
| 572 |
|
/// </summary> |
| 573 |
|
/// <param name="enable">True to enable the effect, False to disable</param> |
| 574 |
|
/// <param name="assetId">Id of the effect</param> |
| 575 |
|
/// <param name="pos">Offset position from the camera</param> |
| 576 |
|
/// <param name="rot">Offset rotation from the camera</param> |
| 577 |
|
public void SendRexCameraClientSideEffect(bool enable, UUID assetId, Vector3 pos, Quaternion rot) |
| 578 |
|
{ |
| 579 |
|
List<string> pack = new List<string>(); |
| 580 |
|
|
| 581 |
|
pack.Add(assetId.ToString()); |
| 582 |
|
pack.Add(pos.ToString()); |
| 583 |
|
pack.Add(rot.ToString()); |
| 584 |
|
pack.Add(enable.ToString()); |
| 585 |
|
|
| 586 |
|
SendGenericMessage("RexSCSEffect", pack); |
| 587 |
|
} |
| 588 |
|
|
| 589 |
|
/// <summary> |
| 590 |
|
/// Overrides default lighting conditions and ambient light in the world. |
| 591 |
|
/// |
| 592 |
|
/// Note that this override is a hard one. The user will be unable to change the lighting |
| 593 |
|
/// conditions in any way after they are overridden. |
| 594 |
|
/// </summary> |
| 595 |
|
/// <param name="direction">Direction of the global light (sun)</param> |
| 596 |
|
/// <param name="colour">Colour of the global light</param> |
| 597 |
|
/// <param name="ambientColour">Colour of the ambient light (the light that is always present)</param> |
| 598 |
|
public void SendRexSetAmbientLight(Vector3 direction, Vector3 colour, Vector3 ambientColour) |
| 599 |
|
{ |
| 600 |
|
List<string> pack = new List<string>(); |
| 601 |
|
|
| 602 |
|
pack.Add(direction.ToString()); |
| 603 |
|
pack.Add(colour.ToString()); |
| 604 |
|
pack.Add(ambientColour.ToString()); |
| 605 |
|
|
| 606 |
|
SendGenericMessage("RexAmbientL", pack); |
| 607 |
|
} |
| 608 |
|
|
| 609 |
|
/// <summary> |
| 610 |
|
/// Lauch flash animation to play on client |
| 611 |
|
/// </summary> |
| 612 |
|
/// <param name="assetId">Id of the flash animation (swf) to play</param> |
| 613 |
|
/// <param name="left">left border of the rectangle</param> |
| 614 |
|
/// <param name="top">top border of the rectangle</param> |
| 615 |
|
/// <param name="right">right border of the rectangle</param> |
| 616 |
|
/// <param name="bottom">bottom border of the rectangle</param> |
| 617 |
|
/// <param name="timeToDeath">time in seconds from start of animation playback until the flash control is destroyed</param> |
| 618 |
|
public void SendRexPlayFlashAnimation(UUID assetId, float left, float top, float right, float bottom, float timeToDeath) |
| 619 |
|
{ |
| 620 |
|
List<string> pack = new List<string>(); |
| 621 |
|
|
| 622 |
|
pack.Add(assetId.ToString()); |
| 623 |
|
pack.Add(left.ToString()); |
| 624 |
|
pack.Add(top.ToString()); |
| 625 |
|
pack.Add(right.ToString()); |
| 626 |
|
pack.Add(bottom.ToString()); |
| 627 |
|
pack.Add(timeToDeath.ToString()); |
| 628 |
|
|
| 629 |
|
SendGenericMessage("RexFlashAnim", pack); |
| 630 |
|
} |
| 631 |
|
|
| 632 |
|
internal void SendRexPreloadAvatarAssets(List<string> vAssetsList) |
| 633 |
|
{ |
| 634 |
|
throw new System.NotImplementedException(); |
| 635 |
|
} |
| 636 |
|
|
| 637 |
|
internal void SendRexForceFOV(float fov, bool enable) |
| 638 |
|
{ |
| 639 |
|
throw new System.NotImplementedException(); |
| 640 |
|
} |
| 641 |
|
|
| 642 |
|
internal void SendRexForceCamera(int forceMode, float minZoom, float maxZoom) |
| 643 |
|
{ |
| 644 |
|
throw new System.NotImplementedException(); |
| 645 |
|
} |
| 646 |
|
|
| 647 |
|
internal void SendRexSky(int type, string images, float curvature, float tiling) |
| 648 |
|
{ |
| 649 |
|
throw new System.NotImplementedException(); |
| 650 |
|
} |
| 651 |
|
|
| 652 |
|
internal void SendRexPreloadAssets(Dictionary<UUID, uint> tempassetlist) |
| 653 |
|
{ |
| 654 |
|
throw new System.NotImplementedException(); |
| 655 |
|
} |
| 656 |
|
|
| 657 |
|
internal void SendMediaURL(UUID assetId, string mediaURL, byte vRefreshRate) |
| 658 |
|
{ |
| 659 |
|
throw new System.NotImplementedException(); |
| 660 |
|
} |
| 661 |
|
|
| 662 |
|
internal void RexIKSendLimbTarget(UUID vAgentID, int vLimbId, Vector3 vDest, float vTimeToTarget, float vStayTime, float vConstraintAngle, string vStartAnim, string vTargetAnim, string vEndAnim) |
| 663 |
|
{ |
| 664 |
|
throw new System.NotImplementedException(); |
| 665 |
|
} |
| 666 |
|
|
| 667 |
|
public void SendRexAvatarAnimation(UUID agentID, string vAnimName, float vRate, float vFadeIn, float vFadeOut, int nRepeats, bool vbStopAnim) //rex |
| 668 |
|
{ |
| 669 |
|
throw new System.NotImplementedException(); |
| 670 |
|
} |
| 671 |
|
|
| 672 |
|
internal void SendRexAvatarMorph(UUID uUID, string vMorphName, float vWeight, float vTime) |
| 673 |
|
{ |
| 674 |
|
throw new System.NotImplementedException(); |
| 675 |
|
} |
| 676 |
|
|
| 677 |
|
internal void SendRexMeshAnimation(UUID uUID, string vAnimName, float vRate, bool vbLooped, bool vbStopAnim) |
| 678 |
|
{ |
| 679 |
|
throw new System.NotImplementedException(); |
| 680 |
|
} |
| 681 |
|
|
| 682 |
|
internal void SendRexClientSideEffect(string assetId, float vTimeUntilLaunch, float vTimeUntilDeath, Vector3 pos, Quaternion rot, float vSpeed) |
| 683 |
|
{ |
| 684 |
|
throw new System.NotImplementedException(); |
| 685 |
|
} |
| 686 |
} |
} |
| 687 |
} |
} |