Annotation of /trunk/ModularRex/RexNetwork/RexClientView.cs
Parent Directory
|
Revision Log
Revision 21 - (view) (download)
| 1 : | afrisby | 4 | using System.Collections; |
| 2 : | using System.Collections.Generic; | ||
| 3 : | afrisby | 2 | using System.Net; |
| 4 : | afrisby | 4 | using System.Reflection; |
| 5 : | using System.Threading; | ||
| 6 : | using log4net; | ||
| 7 : | using Nwc.XmlRpc; | ||
| 8 : | afrisby | 2 | using OpenMetaverse; |
| 9 : | using OpenSim.Framework; | ||
| 10 : | using OpenSim.Framework.Communications.Cache; | ||
| 11 : | afrisby | 5 | using OpenSim.Region.ClientStack; |
| 12 : | afrisby | 2 | using OpenSim.Region.ClientStack.LindenUDP; |
| 13 : | |||
| 14 : | namespace ModularRex.RexNetwork | ||
| 15 : | { | ||
| 16 : | public delegate void RexAppearanceDelegate(RexClientView sender); | ||
| 17 : | |||
| 18 : | mikkopa | 14 | public delegate void RexFaceExpressionDelegate(RexClientView sender, List<string> parameters); |
| 19 : | afrisby | 2 | |
| 20 : | afrisby | 5 | public delegate void RexAvatarProperties(RexClientView sender, List<string> parameters); |
| 21 : | |||
| 22 : | mikkopa | 14 | public delegate void ReceiveRexStartUp(RexClientView remoteClient, UUID agentID, string status); |
| 23 : | |||
| 24 : | public delegate void ReceiveRexClientScriptCmd(RexClientView remoteClient, UUID agentID, List<string> parameters); | ||
| 25 : | |||
| 26 : | afrisby | 11 | /// <summary> |
| 27 : | /// Inherits from LLClientView the majority of functionality | ||
| 28 : | /// Overrides and extends for Rex-specific functionality. | ||
| 29 : | /// | ||
| 30 : | /// In the case whereby functionality uses the same packets but differs | ||
| 31 : | /// between Rex and LL, you can use a override on those specific functions | ||
| 32 : | /// to overload the request. | ||
| 33 : | /// </summary> | ||
| 34 : | afrisby | 3 | public class RexClientView : LLClientView, IClientRexFaceExpression, IClientRexAppearance |
| 35 : | afrisby | 2 | { |
| 36 : | afrisby | 4 | private static readonly ILog m_log = |
| 37 : | LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | ||
| 38 : | |||
| 39 : | afrisby | 10 | private string m_rexAccountID; |
| 40 : | afrisby | 4 | private string m_rexAvatarURL; |
| 41 : | private string m_rexAuthURL; | ||
| 42 : | private string m_rexSkypeURL; | ||
| 43 : | mikkopa | 12 | public string AvatarStorageOverride; |
| 44 : | afrisby | 4 | |
| 45 : | mikkopa | 20 | public float RexCharacterSpeedMod = 1.0f; |
| 46 : | public float RexMovementSpeedMod = 1.0f; | ||
| 47 : | public float RexVertMovementSpeedMod = 1.0f; | ||
| 48 : | public bool RexWalkDisabled = false; | ||
| 49 : | public bool RexFlyDisabled = false; | ||
| 50 : | public bool RexSitDisabled = false; | ||
| 51 : | |||
| 52 : | afrisby | 2 | public event RexAppearanceDelegate OnRexAppearance; |
| 53 : | public event RexFaceExpressionDelegate OnRexFaceExpression; | ||
| 54 : | afrisby | 5 | public event RexAvatarProperties OnRexAvatarProperties; |
| 55 : | mikkopa | 14 | public event ReceiveRexStartUp OnReceiveRexStartUp; |
| 56 : | public event ReceiveRexClientScriptCmd OnReceiveRexClientScriptCmd; | ||
| 57 : | afrisby | 2 | |
| 58 : | public RexClientView(EndPoint remoteEP, IScene scene, AssetCache assetCache, | ||
| 59 : | afrisby | 6 | LLPacketServer packServer, AuthenticateResponse authenSessions, UUID agentId, |
| 60 : | afrisby | 5 | UUID sessionId, uint circuitCode, EndPoint proxyEP, ClientStackUserSettings userSettings) |
| 61 : | afrisby | 2 | : base(remoteEP, scene, assetCache, packServer, authenSessions, agentId, |
| 62 : | afrisby | 5 | sessionId, circuitCode, proxyEP, userSettings) |
| 63 : | afrisby | 2 | { |
| 64 : | afrisby | 11 | // Rex communication now occurs via GenericMessage |
| 65 : | // We have a special handler here below. | ||
| 66 : | afrisby | 2 | OnGenericMessage += RealXtendClientView_OnGenericMessage; |
| 67 : | } | ||
| 68 : | |||
| 69 : | afrisby | 4 | public RexClientView(EndPoint remoteEP, IScene scene, AssetCache assetCache, |
| 70 : | afrisby | 6 | LLPacketServer packServer, AuthenticateResponse authenSessions, UUID agentId, |
| 71 : | afrisby | 5 | UUID sessionId, uint circuitCode, EndPoint proxyEP, string rexAvatarURL, string rexAuthURL, ClientStackUserSettings userSettings) |
| 72 : | afrisby | 4 | : base(remoteEP, scene, assetCache, packServer, authenSessions, agentId, |
| 73 : | afrisby | 5 | sessionId, circuitCode, proxyEP, userSettings) |
| 74 : | afrisby | 4 | { |
| 75 : | afrisby | 11 | // Rex communication now occurs via GenericMessage |
| 76 : | // We have a special handler here below. | ||
| 77 : | afrisby | 4 | OnGenericMessage += RealXtendClientView_OnGenericMessage; |
| 78 : | |||
| 79 : | RexAvatarURL = rexAvatarURL; | ||
| 80 : | RexAuthURL = rexAuthURL; | ||
| 81 : | } | ||
| 82 : | |||
| 83 : | afrisby | 11 | /// <summary> |
| 84 : | /// Registers interfaces for IClientCore, | ||
| 85 : | /// every time you make a new Rex-specific | ||
| 86 : | /// Interface. Make sure to register it here. | ||
| 87 : | /// </summary> | ||
| 88 : | afrisby | 9 | protected override void RegisterInterfaces() |
| 89 : | { | ||
| 90 : | RegisterInterface<IClientRexAppearance>(this); | ||
| 91 : | RegisterInterface<IClientRexFaceExpression>(this); | ||
| 92 : | RegisterInterface<RexClientView>(this); | ||
| 93 : | |||
| 94 : | base.RegisterInterfaces(); | ||
| 95 : | } | ||
| 96 : | |||
| 97 : | afrisby | 11 | /// <summary> |
| 98 : | /// The avatar URL for this avatar | ||
| 99 : | /// Eg: http://avatar.com:10000/uuid/ | ||
| 100 : | /// </summary> | ||
| 101 : | afrisby | 4 | public string RexAvatarURL |
| 102 : | { | ||
| 103 : | get { return m_rexAvatarURL; } | ||
| 104 : | set | ||
| 105 : | { | ||
| 106 : | m_rexAvatarURL = value; | ||
| 107 : | if (OnRexAppearance != null) | ||
| 108 : | { | ||
| 109 : | OnRexAppearance(this); | ||
| 110 : | return; | ||
| 111 : | } | ||
| 112 : | } | ||
| 113 : | } | ||
| 114 : | |||
| 115 : | afrisby | 11 | /// <summary> |
| 116 : | /// Skype username of the avatar | ||
| 117 : | /// eg: Skypeuser | ||
| 118 : | /// </summary> | ||
| 119 : | afrisby | 4 | public string RexSkypeURL |
| 120 : | { | ||
| 121 : | get { return m_rexSkypeURL; } | ||
| 122 : | set { m_rexSkypeURL = value; } | ||
| 123 : | } | ||
| 124 : | |||
| 125 : | afrisby | 11 | /// <summary> |
| 126 : | /// The full Rex Username of this account | ||
| 127 : | /// Eg: user@hostname.com:10001 | ||
| 128 : | /// | ||
| 129 : | /// Note: This is not filled immedietely on | ||
| 130 : | /// creation. This property is filled in | ||
| 131 : | /// via Login and may not be availible | ||
| 132 : | /// immedietely upon connect. | ||
| 133 : | /// | ||
| 134 : | /// The above glitch is scheduled to be | ||
| 135 : | /// fixed by a new RexCommsManager which | ||
| 136 : | /// will allow this to be set at spawn in | ||
| 137 : | /// login. | ||
| 138 : | /// </summary> | ||
| 139 : | afrisby | 10 | public string RexAccount |
| 140 : | { | ||
| 141 : | get { return m_rexAccountID; } | ||
| 142 : | set | ||
| 143 : | { | ||
| 144 : | // Todo: More solid data checking here. | ||
| 145 : | m_rexAccountID = value; | ||
| 146 : | RexAuthURL = m_rexAccountID.Split('@')[1]; | ||
| 147 : | } | ||
| 148 : | } | ||
| 149 : | |||
| 150 : | afrisby | 11 | /// <summary> |
| 151 : | /// The URL of the Avatar's Authentication Server | ||
| 152 : | /// Eg: http://authentication.com:10001/ | ||
| 153 : | /// </summary> | ||
| 154 : | afrisby | 4 | public string RexAuthURL |
| 155 : | { | ||
| 156 : | get { return m_rexAuthURL; } | ||
| 157 : | set | ||
| 158 : | { | ||
| 159 : | mikkopa | 14 | if (value.Contains("@")) |
| 160 : | { | ||
| 161 : | m_rexAuthURL = "http://" + value.Split('@')[1]; | ||
| 162 : | } | ||
| 163 : | else | ||
| 164 : | { | ||
| 165 : | m_rexAuthURL = value; | ||
| 166 : | } | ||
| 167 : | afrisby | 4 | // Request Agent Properties Asynchronously |
| 168 : | ThreadPool.QueueUserWorkItem(RequestProperties); | ||
| 169 : | } | ||
| 170 : | } | ||
| 171 : | |||
| 172 : | afrisby | 11 | /// <summary> |
| 173 : | /// Special - used to convert GenericMessage packets | ||
| 174 : | /// to their appropriate Rex equivilents. | ||
| 175 : | /// | ||
| 176 : | /// Eg: GenericMessage(RexAppearance) -> | ||
| 177 : | /// OnRexAppearance(...) | ||
| 178 : | /// </summary> | ||
| 179 : | afrisby | 2 | void RealXtendClientView_OnGenericMessage(object sender, string method, List<string> args) |
| 180 : | { | ||
| 181 : | //TODO: Convert to Dictionary<Method, GenericMessageHandler> | ||
| 182 : | |||
| 183 : | if (method == "RexAppearance") | ||
| 184 : | if (OnRexAppearance != null) | ||
| 185 : | { | ||
| 186 : | OnRexAppearance(this); | ||
| 187 : | return; | ||
| 188 : | } | ||
| 189 : | |||
| 190 : | afrisby | 4 | if (method == "RexFaceExpression") |
| 191 : | afrisby | 2 | { |
| 192 : | afrisby | 4 | if (OnRexFaceExpression != null) |
| 193 : | afrisby | 2 | { |
| 194 : | OnRexFaceExpression(this, args); | ||
| 195 : | afrisby | 5 | return; |
| 196 : | afrisby | 2 | } |
| 197 : | } | ||
| 198 : | afrisby | 5 | |
| 199 : | if (method == "RexAvatarProp") | ||
| 200 : | { | ||
| 201 : | if(OnRexAvatarProperties != null) | ||
| 202 : | { | ||
| 203 : | OnRexAvatarProperties(this, args); | ||
| 204 : | return; | ||
| 205 : | } | ||
| 206 : | } | ||
| 207 : | |||
| 208 : | mikkopa | 14 | if (method == "rexscr") |
| 209 : | { | ||
| 210 : | if (OnReceiveRexClientScriptCmd != null) | ||
| 211 : | { | ||
| 212 : | OnReceiveRexClientScriptCmd(this, AgentId, args); | ||
| 213 : | } | ||
| 214 : | } | ||
| 215 : | |||
| 216 : | if (method == "RexStartup") | ||
| 217 : | { | ||
| 218 : | if (OnReceiveRexStartUp != null) | ||
| 219 : | { | ||
| 220 : | OnReceiveRexStartUp(this, AgentId, args[0]); | ||
| 221 : | } | ||
| 222 : | } | ||
| 223 : | |||
| 224 : | afrisby | 5 | m_log.Warn("[REXCLIENTVIEW] Unhandled GenericMessage (" + method + ") {"); |
| 225 : | foreach (string s in args) | ||
| 226 : | { | ||
| 227 : | m_log.Warn("\t" + s); | ||
| 228 : | } | ||
| 229 : | m_log.Warn("}"); | ||
| 230 : | |||
| 231 : | afrisby | 2 | } |
| 232 : | |||
| 233 : | afrisby | 11 | /// <summary> |
| 234 : | /// Sends a Rex Script Command to the viewer | ||
| 235 : | /// attached to this ClientView. | ||
| 236 : | /// | ||
| 237 : | /// If you are coding something, try use | ||
| 238 : | /// SendRex*** instead, as many of them | ||
| 239 : | /// will trigger this instead with type | ||
| 240 : | /// and parameter checking. | ||
| 241 : | /// </summary> | ||
| 242 : | afrisby | 5 | public void SendRexScriptCommand(string unit, string command, string parameters) |
| 243 : | { | ||
| 244 : | List<string> pack = new List<string>(); | ||
| 245 : | |||
| 246 : | pack.Add(unit); | ||
| 247 : | pack.Add(command); | ||
| 248 : | |||
| 249 : | if (!string.IsNullOrEmpty(parameters)) | ||
| 250 : | pack.Add(parameters); | ||
| 251 : | |||
| 252 : | SendGenericMessage("RexScr", pack); | ||
| 253 : | } | ||
| 254 : | |||
| 255 : | public void SendRexInventoryMessage(string message) | ||
| 256 : | { | ||
| 257 : | SendRexScriptCommand("hud", "ShowInventoryMessage(\"" + message + "\")", ""); | ||
| 258 : | } | ||
| 259 : | |||
| 260 : | afrisby | 6 | public void SendRexScrollMessage(string message, double time) |
| 261 : | { | ||
| 262 : | SendRexScriptCommand("hud", "ShowScrollMessage(\"" + message + "\", \"" + time + "\")", ""); | ||
| 263 : | } | ||
| 264 : | |||
| 265 : | public void SendRexTutorialMessage(string message, double time) | ||
| 266 : | { | ||
| 267 : | SendRexScriptCommand("hud", "ShowScrollMessage(\"" + message + "\", \"" + time + "\")", ""); | ||
| 268 : | } | ||
| 269 : | |||
| 270 : | public void SendRexFadeInAndOut(string message, double between, double time) | ||
| 271 : | { | ||
| 272 : | SendRexScriptCommand("hud", | ||
| 273 : | "ShowInventoryMessage(\"" + message + "\"," | ||
| 274 : | + " \"" + between + "\", \"" + time + "\")", ""); | ||
| 275 : | } | ||
| 276 : | |||
| 277 : | |||
| 278 : | afrisby | 2 | public void SendRexFaceExpression(List<string> expressionData) |
| 279 : | { | ||
| 280 : | expressionData.Insert(0, AgentId.ToString()); | ||
| 281 : | SendGenericMessage("RexFaceExpression", expressionData); | ||
| 282 : | } | ||
| 283 : | |||
| 284 : | public void SendRexAppearance(UUID agentID, string avatarURL) | ||
| 285 : | { | ||
| 286 : | List<string> pack = new List<string>(); | ||
| 287 : | pack.Add(avatarURL); | ||
| 288 : | pack.Add(agentID.ToString()); | ||
| 289 : | |||
| 290 : | SendGenericMessage("RexAppearance", pack); | ||
| 291 : | } | ||
| 292 : | afrisby | 4 | |
| 293 : | /// <summary> | ||
| 294 : | /// Requests properties about this agent from their | ||
| 295 : | /// authentication server. This should be run in | ||
| 296 : | /// an async thread. | ||
| 297 : | /// | ||
| 298 : | /// Note that this particular function may set the | ||
| 299 : | /// avatars appearance which may in turn call | ||
| 300 : | /// additional modules and functions elsewhere. | ||
| 301 : | /// </summary> | ||
| 302 : | /// <param name="o"></param> | ||
| 303 : | private void RequestProperties(object o) | ||
| 304 : | { | ||
| 305 : | m_log.Info("[REXCLIENT] Resolving avatar..."); | ||
| 306 : | Hashtable ReqVals = new Hashtable(); | ||
| 307 : | ReqVals["avatar_uuid"] = AgentId.ToString(); | ||
| 308 : | ReqVals["AuthenticationAddress"] = RexAuthURL; | ||
| 309 : | |||
| 310 : | ArrayList SendParams = new ArrayList(); | ||
| 311 : | SendParams.Add(ReqVals); | ||
| 312 : | |||
| 313 : | XmlRpcRequest req = new XmlRpcRequest("get_user_by_uuid", SendParams); | ||
| 314 : | |||
| 315 : | m_log.Info("[REXCLIENT] Sending XMLRPC Request to " + RexAuthURL); | ||
| 316 : | XmlRpcResponse authreply = req.Send(RexAuthURL, 9000); | ||
| 317 : | mikkopa | 14 | if (!((Hashtable)authreply.Value).ContainsKey("error_type")) |
| 318 : | { | ||
| 319 : | string rexAsAddress = ((Hashtable)authreply.Value)["as_address"].ToString(); | ||
| 320 : | string rexSkypeURL = ((Hashtable)authreply.Value)["skype_url"].ToString(); | ||
| 321 : | UUID userID = new UUID(((Hashtable)authreply.Value)["uuid"].ToString()); | ||
| 322 : | afrisby | 4 | |
| 323 : | mikkopa | 14 | // Sanity check |
| 324 : | if (userID == AgentId) | ||
| 325 : | { | ||
| 326 : | RexAvatarURL = rexAsAddress; | ||
| 327 : | RexSkypeURL = rexSkypeURL; | ||
| 328 : | } | ||
| 329 : | } | ||
| 330 : | else | ||
| 331 : | afrisby | 4 | { |
| 332 : | mikkopa | 14 | //Error has occurred |
| 333 : | m_log.Warn("[REXCLIENT]: User not found"); | ||
| 334 : | afrisby | 4 | } |
| 335 : | } | ||
| 336 : | mikkopa | 12 | |
| 337 : | mikkopa | 20 | /// <summary> |
| 338 : | /// Sends Fog parameters to client. Only works underwater. | ||
| 339 : | /// </summary> | ||
| 340 : | /// <param name="start">meters from camera where the fog starts</param> | ||
| 341 : | /// <param name="end">meters from camera where the fog ends</param> | ||
| 342 : | /// <param name="red">redness in fog</param> | ||
| 343 : | /// <param name="green">greeness in fog</param> | ||
| 344 : | /// <param name="blue">blueness in fog</param> | ||
| 345 : | public void SendRexFog(float start, float end, float red, float green, float blue) | ||
| 346 : | mikkopa | 12 | { |
| 347 : | mikkopa | 20 | List<string> pack = new List<string>(); |
| 348 : | |||
| 349 : | pack.Add(start.ToString()); | ||
| 350 : | pack.Add(end.ToString()); | ||
| 351 : | pack.Add(red.ToString()); | ||
| 352 : | pack.Add(green.ToString()); | ||
| 353 : | pack.Add(blue.ToString()); | ||
| 354 : | |||
| 355 : | SendGenericMessage("RexFog", pack); | ||
| 356 : | mikkopa | 12 | } |
| 357 : | |||
| 358 : | mikkopa | 20 | /// <summary> |
| 359 : | /// Sends water height to client. Usually used when changing water height on the fly with scripting. | ||
| 360 : | /// </summary> | ||
| 361 : | /// <param name="height">Water height in meters</param> | ||
| 362 : | public void SendRexWaterHeight(float height) | ||
| 363 : | mikkopa | 12 | { |
| 364 : | mikkopa | 20 | List<string> pack = new List<string>(); |
| 365 : | |||
| 366 : | pack.Add(height.ToString()); | ||
| 367 : | |||
| 368 : | SendGenericMessage("RexWaterHeight", pack); | ||
| 369 : | mikkopa | 12 | } |
| 370 : | |||
| 371 : | mikkopa | 21 | /// <summary> |
| 372 : | /// Sends post postprosessing effect toggle to client. | ||
| 373 : | /// </summary> | ||
| 374 : | /// <see cref="http://rexdeveloper.org/wiki/index.php?title=Content_Scripting_Python_Post-Process"/> | ||
| 375 : | /// <param name="effectId">Id of the effect. See documentation for the effect ids</param> | ||
| 376 : | /// <param name="toggle">True to set effect on. False to set effect off.</param> | ||
| 377 : | public void SendRexPostProcess(int effectId, bool toggle) | ||
| 378 : | mikkopa | 12 | { |
| 379 : | mikkopa | 21 | List<string> pack = new List<string>(); |
| 380 : | |||
| 381 : | pack.Add(effectId.ToString()); | ||
| 382 : | pack.Add(toggle.ToString()); | ||
| 383 : | |||
| 384 : | SendGenericMessage("RexPostP", pack); | ||
| 385 : | mikkopa | 12 | } |
| 386 : | |||
| 387 : | mikkopa | 21 | /// <summary> |
| 388 : | /// Creates client side rtt camera | ||
| 389 : | /// </summary> | ||
| 390 : | /// <param name="command">0 to remove existing rtt camera (by name), 1 to add new rtt camera</param> | ||
| 391 : | /// <param name="name">Unique identifier for the camera</param> | ||
| 392 : | /// <param name="assetId">UUID of the texture that gets rendered to</param> | ||
| 393 : | /// <param name="pos">Position of the camera in the world</param> | ||
| 394 : | /// <param name="lookat">Point in the world the camera will look at</param> | ||
| 395 : | /// <param name="width">Width of the texture</param> | ||
| 396 : | /// <param name="height">Height of the texture</param> | ||
| 397 : | public void SendRexRttCamera(int command, string name, UUID assetId, Vector3 pos, Vector3 lookat, int width, int height) | ||
| 398 : | mikkopa | 12 | { |
| 399 : | mikkopa | 21 | List<string> pack = new List<string>(); |
| 400 : | |||
| 401 : | pack.Add(command.ToString()); | ||
| 402 : | pack.Add(name); | ||
| 403 : | pack.Add(assetId.ToString()); | ||
| 404 : | pack.Add(pos.ToString()); | ||
| 405 : | pack.Add(lookat.ToString()); | ||
| 406 : | pack.Add(width.ToString()); | ||
| 407 : | pack.Add(height.ToString()); | ||
| 408 : | |||
| 409 : | SendGenericMessage("RexRttCam", pack); | ||
| 410 : | mikkopa | 12 | } |
| 411 : | |||
| 412 : | mikkopa | 21 | /// <summary> |
| 413 : | /// Sends a viewport to client | ||
| 414 : | /// </summary> | ||
| 415 : | /// <param name="command">0 to remove existing viewport (by name), 1 to add new viewport.</param> | ||
| 416 : | /// <param name="name">Unique identifier for the viewport</param> | ||
| 417 : | /// <param name="posX">screen relative position of the left edge of the viewport</param> | ||
| 418 : | /// <param name="posY">screen relative position of the top edge of the viewport</param> | ||
| 419 : | /// <param name="width">screen relative width of the viewport</param> | ||
| 420 : | /// <param name="height">screen relative height of the viewport</param> | ||
| 421 : | public void SendRexViewport(int command, string name, float posX, float posY, float width, float height) | ||
| 422 : | mikkopa | 12 | { |
| 423 : | mikkopa | 21 | List<string> pack = new List<string>(); |
| 424 : | |||
| 425 : | pack.Add(command.ToString()); | ||
| 426 : | pack.Add(name); | ||
| 427 : | pack.Add(posX.ToString()); | ||
| 428 : | pack.Add(posY.ToString()); | ||
| 429 : | pack.Add(width.ToString()); | ||
| 430 : | pack.Add(height.ToString()); | ||
| 431 : | |||
| 432 : | SendGenericMessage("RexSetViewport", pack); | ||
| 433 : | mikkopa | 12 | } |
| 434 : | |||
| 435 : | mikkopa | 21 | /// <summary> |
| 436 : | /// Toggles the wind sound on client | ||
| 437 : | /// </summary> | ||
| 438 : | /// <param name="toggle"></param> | ||
| 439 : | public void SendRexToggleWindSound(bool toggle) | ||
| 440 : | mikkopa | 12 | { |
| 441 : | mikkopa | 21 | List<string> pack = new List<string>(); |
| 442 : | |||
| 443 : | pack.Add(toggle.ToString()); | ||
| 444 : | |||
| 445 : | SendGenericMessage("RexToggleWindSound", pack); | ||
| 446 : | mikkopa | 12 | } |
| 447 : | |||
| 448 : | mikkopa | 21 | /// <summary> |
| 449 : | /// Sends Rex clientside camera effects, particle script attached to camera etc. | ||
| 450 : | /// </summary> | ||
| 451 : | /// <param name="enable">True to enable the effect, False to disable</param> | ||
| 452 : | /// <param name="assetId">Id of the effect</param> | ||
| 453 : | /// <param name="pos">Offset position from the camera</param> | ||
| 454 : | /// <param name="rot">Offset rotation from the camera</param> | ||
| 455 : | public void SendRexCameraClientSideEffect(bool enable, UUID assetId, Vector3 pos, Quaternion rot) | ||
| 456 : | mikkopa | 12 | { |
| 457 : | mikkopa | 21 | List<string> pack = new List<string>(); |
| 458 : | |||
| 459 : | pack.Add(assetId.ToString()); | ||
| 460 : | pack.Add(pos.ToString()); | ||
| 461 : | pack.Add(rot.ToString()); | ||
| 462 : | pack.Add(enable.ToString()); | ||
| 463 : | |||
| 464 : | SendGenericMessage("RexSCSEffect", pack); | ||
| 465 : | mikkopa | 12 | } |
| 466 : | |||
| 467 : | mikkopa | 21 | /// <summary> |
| 468 : | /// Overrides default lighting conditions and ambient light in the world. | ||
| 469 : | /// | ||
| 470 : | /// Note that this override is a hard one. The user will be unable to change the lighting | ||
| 471 : | /// conditions in any way after they are overridden. | ||
| 472 : | /// </summary> | ||
| 473 : | /// <param name="direction">Direction of the global light (sun)</param> | ||
| 474 : | /// <param name="colour">Colour of the global light</param> | ||
| 475 : | /// <param name="ambientColour">Colour of the ambient light (the light that is always present)</param> | ||
| 476 : | public void SendRexSetAmbientLight(Vector3 direction, Vector3 colour, Vector3 ambientColour) | ||
| 477 : | mikkopa | 12 | { |
| 478 : | mikkopa | 21 | List<string> pack = new List<string>(); |
| 479 : | |||
| 480 : | pack.Add(direction.ToString()); | ||
| 481 : | pack.Add(colour.ToString()); | ||
| 482 : | pack.Add(ambientColour.ToString()); | ||
| 483 : | |||
| 484 : | SendGenericMessage("RexAmbientL", pack); | ||
| 485 : | mikkopa | 12 | } |
| 486 : | |||
| 487 : | mikkopa | 21 | /// <summary> |
| 488 : | /// Lauch flash animation to play on client | ||
| 489 : | /// </summary> | ||
| 490 : | /// <param name="assetId">Id of the flash animation (swf) to play</param> | ||
| 491 : | /// <param name="left">left border of the rectangle</param> | ||
| 492 : | /// <param name="top">top border of the rectangle</param> | ||
| 493 : | /// <param name="right">right border of the rectangle</param> | ||
| 494 : | /// <param name="bottom">bottom border of the rectangle</param> | ||
| 495 : | /// <param name="timeToDeath">time in seconds from start of animation playback until the flash control is destroyed</param> | ||
| 496 : | public void SendRexPlayFlashAnimation(UUID assetId, float left, float top, float right, float bottom, float timeToDeath) | ||
| 497 : | mikkopa | 12 | { |
| 498 : | mikkopa | 21 | List<string> pack = new List<string>(); |
| 499 : | |||
| 500 : | pack.Add(assetId.ToString()); | ||
| 501 : | pack.Add(left.ToString()); | ||
| 502 : | pack.Add(top.ToString()); | ||
| 503 : | pack.Add(right.ToString()); | ||
| 504 : | pack.Add(bottom.ToString()); | ||
| 505 : | pack.Add(timeToDeath.ToString()); | ||
| 506 : | |||
| 507 : | SendGenericMessage("RexFlashAnim", pack); | ||
| 508 : | mikkopa | 12 | } |
| 509 : | |||
| 510 : | internal void SendRexPreloadAvatarAssets(List<string> vAssetsList) | ||
| 511 : | { | ||
| 512 : | throw new System.NotImplementedException(); | ||
| 513 : | } | ||
| 514 : | |||
| 515 : | internal void SendRexForceFOV(float fov, bool enable) | ||
| 516 : | { | ||
| 517 : | throw new System.NotImplementedException(); | ||
| 518 : | } | ||
| 519 : | |||
| 520 : | internal void SendRexForceCamera(int forceMode, float minZoom, float maxZoom) | ||
| 521 : | { | ||
| 522 : | throw new System.NotImplementedException(); | ||
| 523 : | } | ||
| 524 : | |||
| 525 : | internal void SendRexSky(int type, string images, float curvature, float tiling) | ||
| 526 : | { | ||
| 527 : | throw new System.NotImplementedException(); | ||
| 528 : | } | ||
| 529 : | |||
| 530 : | internal void SendRexPreloadAssets(Dictionary<UUID, uint> tempassetlist) | ||
| 531 : | { | ||
| 532 : | throw new System.NotImplementedException(); | ||
| 533 : | } | ||
| 534 : | |||
| 535 : | internal void SendMediaURL(UUID assetId, string mediaURL, byte vRefreshRate) | ||
| 536 : | { | ||
| 537 : | throw new System.NotImplementedException(); | ||
| 538 : | } | ||
| 539 : | |||
| 540 : | internal void RexIKSendLimbTarget(UUID vAgentID, int vLimbId, Vector3 vDest, float vTimeToTarget, float vStayTime, float vConstraintAngle, string vStartAnim, string vTargetAnim, string vEndAnim) | ||
| 541 : | { | ||
| 542 : | throw new System.NotImplementedException(); | ||
| 543 : | } | ||
| 544 : | |||
| 545 : | public void SendRexAvatarAnimation(UUID agentID, string vAnimName, float vRate, float vFadeIn, float vFadeOut, int nRepeats, bool vbStopAnim) //rex | ||
| 546 : | { | ||
| 547 : | throw new System.NotImplementedException(); | ||
| 548 : | } | ||
| 549 : | |||
| 550 : | internal void SendRexAvatarMorph(UUID uUID, string vMorphName, float vWeight, float vTime) | ||
| 551 : | { | ||
| 552 : | throw new System.NotImplementedException(); | ||
| 553 : | } | ||
| 554 : | |||
| 555 : | internal void SendRexMeshAnimation(UUID uUID, string vAnimName, float vRate, bool vbLooped, bool vbStopAnim) | ||
| 556 : | { | ||
| 557 : | throw new System.NotImplementedException(); | ||
| 558 : | } | ||
| 559 : | |||
| 560 : | internal void SendRexClientSideEffect(string assetId, float vTimeUntilLaunch, float vTimeUntilDeath, Vector3 pos, Quaternion rot, float vSpeed) | ||
| 561 : | { | ||
| 562 : | throw new System.NotImplementedException(); | ||
| 563 : | } | ||
| 564 : | afrisby | 2 | } |
| 565 : | } |
| ViewVC Help | |
| Powered by ViewVC 1.0.0 |

