Annotation of /trunk/ModularRex/RexNetwork/RexClientView.cs
Parent Directory
|
Revision Log
Revision 25 - (view) (download)
| 1 : | afrisby | 25 | using System; |
| 2 : | using System.Collections; | ||
| 3 : | afrisby | 4 | using System.Collections.Generic; |
| 4 : | afrisby | 2 | using System.Net; |
| 5 : | afrisby | 4 | using System.Reflection; |
| 6 : | using System.Threading; | ||
| 7 : | using log4net; | ||
| 8 : | afrisby | 25 | using ModularRex.RexFramework; |
| 9 : | afrisby | 4 | using Nwc.XmlRpc; |
| 10 : | afrisby | 2 | using OpenMetaverse; |
| 11 : | afrisby | 25 | using OpenMetaverse.Packets; |
| 12 : | afrisby | 2 | using OpenSim.Framework; |
| 13 : | using OpenSim.Framework.Communications.Cache; | ||
| 14 : | afrisby | 5 | using OpenSim.Region.ClientStack; |
| 15 : | afrisby | 2 | using OpenSim.Region.ClientStack.LindenUDP; |
| 16 : | |||
| 17 : | namespace ModularRex.RexNetwork | ||
| 18 : | { | ||
| 19 : | public delegate void RexAppearanceDelegate(RexClientView sender); | ||
| 20 : | |||
| 21 : | mikkopa | 14 | public delegate void RexFaceExpressionDelegate(RexClientView sender, List<string> parameters); |
| 22 : | afrisby | 2 | |
| 23 : | afrisby | 5 | public delegate void RexAvatarProperties(RexClientView sender, List<string> parameters); |
| 24 : | |||
| 25 : | afrisby | 25 | public delegate void RexRecieveObjectPropertiesDelegate(RexClientView sender, UUID id, RexObjectProperties props); |
| 26 : | |||
| 27 : | mikkopa | 14 | 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 : | afrisby | 11 | /// <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 : | afrisby | 3 | public class RexClientView : LLClientView, IClientRexFaceExpression, IClientRexAppearance |
| 40 : | afrisby | 2 | { |
| 41 : | afrisby | 4 | private static readonly ILog m_log = |
| 42 : | LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | ||
| 43 : | |||
| 44 : | afrisby | 10 | private string m_rexAccountID; |
| 45 : | afrisby | 4 | private string m_rexAvatarURL; |
| 46 : | private string m_rexAuthURL; | ||
| 47 : | private string m_rexSkypeURL; | ||
| 48 : | mikkopa | 12 | public string AvatarStorageOverride; |
| 49 : | afrisby | 4 | |
| 50 : | mikkopa | 20 | 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 : | afrisby | 2 | public event RexAppearanceDelegate OnRexAppearance; |
| 58 : | public event RexFaceExpressionDelegate OnRexFaceExpression; | ||
| 59 : | afrisby | 5 | public event RexAvatarProperties OnRexAvatarProperties; |
| 60 : | afrisby | 25 | public event RexRecieveObjectPropertiesDelegate OnRexObjectProperties; |
| 61 : | mikkopa | 14 | public event ReceiveRexStartUp OnReceiveRexStartUp; |
| 62 : | public event ReceiveRexClientScriptCmd OnReceiveRexClientScriptCmd; | ||
| 63 : | afrisby | 2 | |
| 64 : | public RexClientView(EndPoint remoteEP, IScene scene, AssetCache assetCache, | ||
| 65 : | afrisby | 6 | LLPacketServer packServer, AuthenticateResponse authenSessions, UUID agentId, |
| 66 : | afrisby | 5 | UUID sessionId, uint circuitCode, EndPoint proxyEP, ClientStackUserSettings userSettings) |
| 67 : | afrisby | 2 | : base(remoteEP, scene, assetCache, packServer, authenSessions, agentId, |
| 68 : | afrisby | 5 | sessionId, circuitCode, proxyEP, userSettings) |
| 69 : | afrisby | 2 | { |
| 70 : | afrisby | 11 | // Rex communication now occurs via GenericMessage |
| 71 : | // We have a special handler here below. | ||
| 72 : | afrisby | 25 | |
| 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 : | afrisby | 2 | OnGenericMessage += RealXtendClientView_OnGenericMessage; |
| 82 : | } | ||
| 83 : | |||
| 84 : | afrisby | 4 | public RexClientView(EndPoint remoteEP, IScene scene, AssetCache assetCache, |
| 85 : | afrisby | 6 | LLPacketServer packServer, AuthenticateResponse authenSessions, UUID agentId, |
| 86 : | afrisby | 5 | UUID sessionId, uint circuitCode, EndPoint proxyEP, string rexAvatarURL, string rexAuthURL, ClientStackUserSettings userSettings) |
| 87 : | afrisby | 4 | : base(remoteEP, scene, assetCache, packServer, authenSessions, agentId, |
| 88 : | afrisby | 5 | sessionId, circuitCode, proxyEP, userSettings) |
| 89 : | afrisby | 4 | { |
| 90 : | afrisby | 11 | // Rex communication now occurs via GenericMessage |
| 91 : | afrisby | 25 | // We need to register GenericMessage handlers |
| 92 : | afrisby | 4 | |
| 93 : | afrisby | 25 | 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 : | afrisby | 4 | RexAvatarURL = rexAvatarURL; |
| 102 : | RexAuthURL = rexAuthURL; | ||
| 103 : | } | ||
| 104 : | |||
| 105 : | afrisby | 11 | /// <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 : | afrisby | 9 | protected override void RegisterInterfaces() |
| 111 : | { | ||
| 112 : | RegisterInterface<IClientRexAppearance>(this); | ||
| 113 : | RegisterInterface<IClientRexFaceExpression>(this); | ||
| 114 : | |||
| 115 : | afrisby | 25 | // Register our own class 'as-is' so it can be |
| 116 : | // used via IClientCore.Get<RexClientView>()... | ||
| 117 : | RegisterInterface(this); | ||
| 118 : | |||
| 119 : | afrisby | 9 | base.RegisterInterfaces(); |
| 120 : | } | ||
| 121 : | |||
| 122 : | afrisby | 11 | /// <summary> |
| 123 : | /// The avatar URL for this avatar | ||
| 124 : | /// Eg: http://avatar.com:10000/uuid/ | ||
| 125 : | /// </summary> | ||
| 126 : | afrisby | 4 | public string RexAvatarURL |
| 127 : | { | ||
| 128 : | get { return m_rexAvatarURL; } | ||
| 129 : | set | ||
| 130 : | { | ||
| 131 : | m_rexAvatarURL = value; | ||
| 132 : | if (OnRexAppearance != null) | ||
| 133 : | { | ||
| 134 : | OnRexAppearance(this); | ||
| 135 : | return; | ||
| 136 : | } | ||
| 137 : | } | ||
| 138 : | } | ||
| 139 : | |||
| 140 : | afrisby | 11 | /// <summary> |
| 141 : | /// Skype username of the avatar | ||
| 142 : | /// eg: Skypeuser | ||
| 143 : | /// </summary> | ||
| 144 : | afrisby | 4 | public string RexSkypeURL |
| 145 : | { | ||
| 146 : | get { return m_rexSkypeURL; } | ||
| 147 : | set { m_rexSkypeURL = value; } | ||
| 148 : | } | ||
| 149 : | |||
| 150 : | afrisby | 11 | /// <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 : | afrisby | 10 | 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 : | afrisby | 11 | /// <summary> |
| 176 : | /// The URL of the Avatar's Authentication Server | ||
| 177 : | /// Eg: http://authentication.com:10001/ | ||
| 178 : | /// </summary> | ||
| 179 : | afrisby | 4 | public string RexAuthURL |
| 180 : | { | ||
| 181 : | get { return m_rexAuthURL; } | ||
| 182 : | set | ||
| 183 : | { | ||
| 184 : | mikkopa | 14 | if (value.Contains("@")) |
| 185 : | { | ||
| 186 : | m_rexAuthURL = "http://" + value.Split('@')[1]; | ||
| 187 : | } | ||
| 188 : | else | ||
| 189 : | { | ||
| 190 : | m_rexAuthURL = value; | ||
| 191 : | } | ||
| 192 : | afrisby | 4 | // Request Agent Properties Asynchronously |
| 193 : | ThreadPool.QueueUserWorkItem(RequestProperties); | ||
| 194 : | } | ||
| 195 : | } | ||
| 196 : | |||
| 197 : | afrisby | 25 | 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 : | afrisby | 11 | /// <summary> |
| 245 : | /// Special - used to convert GenericMessage packets | ||
| 246 : | /// to their appropriate Rex equivilents. | ||
| 247 : | /// | ||
| 248 : | /// Eg: GenericMessage(RexAppearance) -> | ||
| 249 : | /// OnRexAppearance(...) | ||
| 250 : | /// </summary> | ||
| 251 : | afrisby | 2 | void RealXtendClientView_OnGenericMessage(object sender, string method, List<string> args) |
| 252 : | { | ||
| 253 : | //TODO: Convert to Dictionary<Method, GenericMessageHandler> | ||
| 254 : | |||
| 255 : | if (method == "RexAppearance") | ||
| 256 : | if (OnRexAppearance != null) | ||
| 257 : | { | ||
| 258 : | OnRexAppearance(this); | ||
| 259 : | return; | ||
| 260 : | } | ||
| 261 : | |||
| 262 : | afrisby | 4 | if (method == "RexFaceExpression") |
| 263 : | afrisby | 2 | { |
| 264 : | afrisby | 4 | if (OnRexFaceExpression != null) |
| 265 : | afrisby | 2 | { |
| 266 : | OnRexFaceExpression(this, args); | ||
| 267 : | afrisby | 5 | return; |
| 268 : | afrisby | 2 | } |
| 269 : | } | ||
| 270 : | afrisby | 5 | |
| 271 : | if (method == "RexAvatarProp") | ||
| 272 : | { | ||
| 273 : | if(OnRexAvatarProperties != null) | ||
| 274 : | { | ||
| 275 : | OnRexAvatarProperties(this, args); | ||
| 276 : | return; | ||
| 277 : | } | ||
| 278 : | } | ||
| 279 : | |||
| 280 : | afrisby | 25 | if(method == "RexData") |
| 281 : | { | ||
| 282 : | |||
| 283 : | } | ||
| 284 : | |||
| 285 : | mikkopa | 14 | 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 : | afrisby | 5 | 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 : | afrisby | 2 | } |
| 309 : | |||
| 310 : | afrisby | 25 | 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 : | afrisby | 11 | /// <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 : | afrisby | 5 | 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 : | afrisby | 6 | 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 : | afrisby | 2 | public void SendRexFaceExpression(List<string> expressionData) |
| 399 : | { | ||
| 400 : | expressionData.Insert(0, AgentId.ToString()); | ||
| 401 : | SendGenericMessage("RexFaceExpression", expressionData); | ||
| 402 : | } | ||
| 403 : | |||
| 404 : | public void SendRexAppearance(UUID agentID, string avatarURL) | ||
| 405 : | { | ||
| 406 : | List<string> pack = new List<string>(); | ||
| 407 : | pack.Add(avatarURL); | ||
| 408 : | pack.Add(agentID.ToString()); | ||
| 409 : | |||
| 410 : | SendGenericMessage("RexAppearance", pack); | ||
| 411 : | } | ||
| 412 : | afrisby | 4 | |
| 413 : | /// <summary> | ||
| 414 : | /// Requests properties about this agent from their | ||
| 415 : | /// authentication server. This should be run in | ||
| 416 : | /// an async thread. | ||
| 417 : | /// | ||
| 418 : | /// Note that this particular function may set the | ||
| 419 : | /// avatars appearance which may in turn call | ||
| 420 : | /// additional modules and functions elsewhere. | ||
| 421 : | /// </summary> | ||
| 422 : | /// <param name="o"></param> | ||
| 423 : | private void RequestProperties(object o) | ||
| 424 : | { | ||
| 425 : | m_log.Info("[REXCLIENT] Resolving avatar..."); | ||
| 426 : | Hashtable ReqVals = new Hashtable(); | ||
| 427 : | afrisby | 25 | ReqVals["avatar_account"] = RexAccount; |
| 428 : | afrisby | 4 | ReqVals["AuthenticationAddress"] = RexAuthURL; |
| 429 : | |||
| 430 : | ArrayList SendParams = new ArrayList(); | ||
| 431 : | SendParams.Add(ReqVals); | ||
| 432 : | |||
| 433 : | afrisby | 25 | XmlRpcRequest req = new XmlRpcRequest("get_user_by_account", SendParams); |
| 434 : | afrisby | 4 | |
| 435 : | afrisby | 25 | m_log.Info("[REXCLIENT] Sending XMLRPC Request to http://" + RexAuthURL); |
| 436 : | afrisby | 4 | |
| 437 : | afrisby | 25 | XmlRpcResponse authreply = req.Send("http://" + RexAuthURL, 9000); |
| 438 : | |||
| 439 : | m_log.Info(authreply.ToString()); | ||
| 440 : | |||
| 441 : | string rexAsAddress = ((Hashtable)authreply.Value)["as_address"].ToString(); | ||
| 442 : | /* string rexSkypeURL = ((Hashtable)authreply.Value)["skype_url"].ToString(); */ | ||
| 443 : | UUID userID = new UUID(((Hashtable) authreply.Value)["uuid"].ToString()); | ||
| 444 : | |||
| 445 : | mikkopa | 14 | // Sanity check |
| 446 : | if (userID == AgentId) | ||
| 447 : | { | ||
| 448 : | RexAvatarURL = rexAsAddress; | ||
| 449 : | RexSkypeURL = rexSkypeURL; | ||
| 450 : | } | ||
| 451 : | } | ||
| 452 : | else | ||
| 453 : | afrisby | 4 | { |
| 454 : | afrisby | 25 | RexAvatarURL = rexAsAddress; |
| 455 : | // RexSkypeURL = rexSkypeURL; | ||
| 456 : | afrisby | 4 | } |
| 457 : | } | ||
| 458 : | mikkopa | 12 | |
| 459 : | mikkopa | 20 | /// <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 : | mikkopa | 12 | { |
| 469 : | mikkopa | 20 | 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 : | mikkopa | 12 | } |
| 479 : | |||
| 480 : | mikkopa | 20 | /// <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 : | mikkopa | 12 | { |
| 486 : | mikkopa | 20 | List<string> pack = new List<string>(); |
| 487 : | |||
| 488 : | pack.Add(height.ToString()); | ||
| 489 : | |||
| 490 : | SendGenericMessage("RexWaterHeight", pack); | ||
| 491 : | mikkopa | 12 | } |
| 492 : | |||
| 493 : | mikkopa | 21 | /// <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 : | mikkopa | 12 | { |
| 501 : | mikkopa | 21 | List<string> pack = new List<string>(); |
| 502 : | |||
| 503 : | pack.Add(effectId.ToString()); | ||
| 504 : | pack.Add(toggle.ToString()); | ||
| 505 : | |||
| 506 : | SendGenericMessage("RexPostP", pack); | ||
| 507 : | mikkopa | 12 | } |
| 508 : | |||
| 509 : | mikkopa | 21 | /// <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 : | mikkopa | 12 | { |
| 521 : | mikkopa | 21 | 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 : | mikkopa | 12 | } |
| 533 : | |||
| 534 : | mikkopa | 21 | /// <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 : | mikkopa | 12 | { |
| 545 : | mikkopa | 21 | 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 : | mikkopa | 12 | } |
| 556 : | |||
| 557 : | mikkopa | 21 | /// <summary> |
| 558 : | /// Toggles the wind sound on client | ||
| 559 : | /// </summary> | ||
| 560 : | /// <param name="toggle"></param> | ||
| 561 : | public void SendRexToggleWindSound(bool toggle) | ||
| 562 : | mikkopa | 12 | { |
| 563 : | mikkopa | 21 | List<string> pack = new List<string>(); |
| 564 : | |||
| 565 : | pack.Add(toggle.ToString()); | ||
| 566 : | |||
| 567 : | SendGenericMessage("RexToggleWindSound", pack); | ||
| 568 : | mikkopa | 12 | } |
| 569 : | |||
| 570 : | mikkopa | 21 | /// <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 : | mikkopa | 12 | { |
| 579 : | mikkopa | 21 | 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 : | mikkopa | 12 | } |
| 588 : | |||
| 589 : | mikkopa | 21 | /// <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 : | mikkopa | 12 | { |
| 600 : | mikkopa | 21 | 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 : | mikkopa | 12 | } |
| 608 : | |||
| 609 : | mikkopa | 21 | /// <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 : | mikkopa | 12 | { |
| 620 : | mikkopa | 21 | 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 : | mikkopa | 12 | } |
| 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 : | afrisby | 2 | } |
| 687 : | afrisby | 25 | } |
| ViewVC Help | |
| Powered by ViewVC 1.0.0 |

