diff options
author | lbsa71 | 2007-08-06 13:21:30 +0000 |
---|---|---|
committer | lbsa71 | 2007-08-06 13:21:30 +0000 |
commit | 9924f35613e7cbb1a30316c032f16e69234d9983 (patch) | |
tree | 0d1759cb609449e75f986be3b2c650777092cec9 /OpenSim/Region/Environment/Scenes/ScenePresence.cs | |
parent | * minor refactorings (diff) | |
download | opensim-SC_OLD-9924f35613e7cbb1a30316c032f16e69234d9983.zip opensim-SC_OLD-9924f35613e7cbb1a30316c032f16e69234d9983.tar.gz opensim-SC_OLD-9924f35613e7cbb1a30316c032f16e69234d9983.tar.bz2 opensim-SC_OLD-9924f35613e7cbb1a30316c032f16e69234d9983.tar.xz |
* encapsulated firstname/lastname on ScenePresence
* fixed 'users' console command
* minor refactorings
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/ScenePresence.cs')
-rw-r--r-- | OpenSim/Region/Environment/Scenes/ScenePresence.cs | 86 |
1 files changed, 48 insertions, 38 deletions
diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs index 882bb20..cc66b2e 100644 --- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs | |||
@@ -43,8 +43,6 @@ namespace OpenSim.Region.Environment.Scenes | |||
43 | public static bool PhysicsEngineFlying = false; | 43 | public static bool PhysicsEngineFlying = false; |
44 | public static AvatarAnimations Animations; | 44 | public static AvatarAnimations Animations; |
45 | public static byte[] DefaultTexture; | 45 | public static byte[] DefaultTexture; |
46 | public string firstname; | ||
47 | public string lastname; | ||
48 | public IClientAPI ControllingClient; | 46 | public IClientAPI ControllingClient; |
49 | public LLUUID current_anim; | 47 | public LLUUID current_anim; |
50 | public int anim_seq; | 48 | public int anim_seq; |
@@ -69,7 +67,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
69 | protected RegionInfo m_regionInfo; | 67 | protected RegionInfo m_regionInfo; |
70 | protected ulong crossingFromRegion = 0; | 68 | protected ulong crossingFromRegion = 0; |
71 | 69 | ||
72 | private IScenePresenceBody m_body; | 70 | private IScenePresenceBody m_body; |
73 | 71 | ||
74 | private Vector3[] Dir_Vectors = new Vector3[6]; | 72 | private Vector3[] Dir_Vectors = new Vector3[6]; |
75 | private enum Dir_ControlFlags | 73 | private enum Dir_ControlFlags |
@@ -117,10 +115,22 @@ namespace OpenSim.Region.Environment.Scenes | |||
117 | } | 115 | } |
118 | } | 116 | } |
119 | 117 | ||
120 | public ulong RegionHandle | 118 | public ulong RegionHandle |
121 | { | 119 | { |
122 | get { return m_regionHandle; } | 120 | get { return m_regionHandle; } |
123 | } | 121 | } |
122 | |||
123 | private string m_firstname; | ||
124 | public string Firstname | ||
125 | { | ||
126 | get { return m_firstname; } | ||
127 | } | ||
128 | |||
129 | private string m_lastname; | ||
130 | public string Lastname | ||
131 | { | ||
132 | get { return m_lastname; } | ||
133 | } | ||
124 | 134 | ||
125 | #endregion | 135 | #endregion |
126 | 136 | ||
@@ -142,8 +152,8 @@ namespace OpenSim.Region.Environment.Scenes | |||
142 | m_regionHandle = reginfo.RegionHandle; | 152 | m_regionHandle = reginfo.RegionHandle; |
143 | MainLog.Instance.Verbose("Avatar.cs "); | 153 | MainLog.Instance.Verbose("Avatar.cs "); |
144 | ControllingClient = theClient; | 154 | ControllingClient = theClient; |
145 | this.firstname = ControllingClient.FirstName; | 155 | this.m_firstname = ControllingClient.FirstName; |
146 | this.lastname = ControllingClient.LastName; | 156 | this.m_lastname = ControllingClient.LastName; |
147 | m_localId = m_scene.NextLocalId; | 157 | m_localId = m_scene.NextLocalId; |
148 | Pos = ControllingClient.StartPos; | 158 | Pos = ControllingClient.StartPos; |
149 | 159 | ||
@@ -166,7 +176,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
166 | // ControllingClient.OnStartAnim += new StartAnim(this.SendAnimPack); | 176 | // ControllingClient.OnStartAnim += new StartAnim(this.SendAnimPack); |
167 | // ControllingClient.OnChildAgentStatus += new StatusChange(this.ChildStatusChange); | 177 | // ControllingClient.OnChildAgentStatus += new StatusChange(this.ChildStatusChange); |
168 | //ControllingClient.OnStopMovement += new GenericCall2(this.StopMovement); | 178 | //ControllingClient.OnStopMovement += new GenericCall2(this.StopMovement); |
169 | 179 | ||
170 | Dir_Vectors[0] = new Vector3(1, 0, 0); //FOWARD | 180 | Dir_Vectors[0] = new Vector3(1, 0, 0); //FOWARD |
171 | Dir_Vectors[1] = new Vector3(-1, 0, 0); //BACK | 181 | Dir_Vectors[1] = new Vector3(-1, 0, 0); //BACK |
172 | Dir_Vectors[2] = new Vector3(0, 1, 0); //LEFT | 182 | Dir_Vectors[2] = new Vector3(0, 1, 0); //LEFT |
@@ -312,7 +322,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
312 | { | 322 | { |
313 | movementflag -= (byte)(uint)DCF; | 323 | movementflag -= (byte)(uint)DCF; |
314 | update_movementflag = true; | 324 | update_movementflag = true; |
315 | 325 | ||
316 | } | 326 | } |
317 | } | 327 | } |
318 | i++; | 328 | i++; |
@@ -399,7 +409,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
399 | 409 | ||
400 | this.CheckForSignificantMovement(); | 410 | this.CheckForSignificantMovement(); |
401 | this.CheckForBorderCrossing(); | 411 | this.CheckForBorderCrossing(); |
402 | 412 | ||
403 | } | 413 | } |
404 | } | 414 | } |
405 | #endregion | 415 | #endregion |
@@ -434,7 +444,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
434 | /// <param name="remoteAvatar"></param> | 444 | /// <param name="remoteAvatar"></param> |
435 | public void SendFullUpdateToOtherClient(ScenePresence remoteAvatar) | 445 | public void SendFullUpdateToOtherClient(ScenePresence remoteAvatar) |
436 | { | 446 | { |
437 | remoteAvatar.ControllingClient.SendAvatarData(m_regionInfo.RegionHandle, this.firstname, this.lastname, this.m_uuid, this.LocalId, this.Pos, this.m_textureEntry.ToBytes()); | 447 | remoteAvatar.ControllingClient.SendAvatarData(m_regionInfo.RegionHandle, this.m_firstname, this.m_lastname, this.m_uuid, this.LocalId, this.Pos, this.m_textureEntry.ToBytes()); |
438 | } | 448 | } |
439 | 449 | ||
440 | public void SendFullUpdateToALLClients() | 450 | public void SendFullUpdateToALLClients() |
@@ -456,15 +466,15 @@ namespace OpenSim.Region.Environment.Scenes | |||
456 | /// </summary> | 466 | /// </summary> |
457 | public void SendInitialData() | 467 | public void SendInitialData() |
458 | { | 468 | { |
459 | this.ControllingClient.SendAvatarData(m_regionInfo.RegionHandle, this.firstname, this.lastname, this.m_uuid, this.LocalId, this.Pos, this.m_textureEntry.ToBytes()); | 469 | this.ControllingClient.SendAvatarData(m_regionInfo.RegionHandle, this.m_firstname, this.m_lastname, this.m_uuid, this.LocalId, this.Pos, this.m_textureEntry.ToBytes()); |
460 | if (this.newAvatar) | 470 | if (this.newAvatar) |
461 | { | 471 | { |
462 | this.m_scene.InformClientOfNeighbours(this.ControllingClient); | 472 | this.m_scene.InformClientOfNeighbours(this.ControllingClient); |
463 | this.newAvatar = false; | 473 | this.newAvatar = false; |
464 | } | 474 | } |
465 | 475 | ||
466 | // this.SendFullUpdateToALLClients(); | 476 | // this.SendFullUpdateToALLClients(); |
467 | // this.SendArrearanceToAllOtherAgents(); | 477 | // this.SendArrearanceToAllOtherAgents(); |
468 | } | 478 | } |
469 | 479 | ||
470 | /// <summary> | 480 | /// <summary> |
@@ -486,11 +496,11 @@ namespace OpenSim.Region.Environment.Scenes | |||
486 | /// </summary> | 496 | /// </summary> |
487 | public void SendArrearanceToAllOtherAgents() | 497 | public void SendArrearanceToAllOtherAgents() |
488 | { | 498 | { |
489 | List<ScenePresence> avatars = this.m_scene.RequestAvatarList(); | 499 | List<ScenePresence> avatars = this.m_scene.RequestAvatarList(); |
490 | foreach (ScenePresence avatar in this.m_scene.RequestAvatarList()) | 500 | foreach (ScenePresence avatar in this.m_scene.RequestAvatarList()) |
491 | { | 501 | { |
492 | this.SendAppearanceToOtherAgent(avatar); | 502 | this.SendAppearanceToOtherAgent(avatar); |
493 | } | 503 | } |
494 | } | 504 | } |
495 | 505 | ||
496 | /// <summary> | 506 | /// <summary> |
@@ -509,13 +519,13 @@ namespace OpenSim.Region.Environment.Scenes | |||
509 | /// <param name="seq"></param> | 519 | /// <param name="seq"></param> |
510 | public void SendAnimPack(LLUUID animID, int seq) | 520 | public void SendAnimPack(LLUUID animID, int seq) |
511 | { | 521 | { |
512 | this.current_anim = animID; | 522 | this.current_anim = animID; |
513 | this.anim_seq = seq; | 523 | this.anim_seq = seq; |
514 | List<ScenePresence> avatars = this.m_scene.RequestAvatarList(); | 524 | List<ScenePresence> avatars = this.m_scene.RequestAvatarList(); |
515 | for (int i = 0; i < avatars.Count; i++) | 525 | for (int i = 0; i < avatars.Count; i++) |
516 | { | 526 | { |
517 | avatars[i].ControllingClient.SendAnimation(animID, seq, this.ControllingClient.AgentId); | 527 | avatars[i].ControllingClient.SendAnimation(animID, seq, this.ControllingClient.AgentId); |
518 | } | 528 | } |
519 | } | 529 | } |
520 | 530 | ||
521 | /// <summary> | 531 | /// <summary> |
@@ -648,16 +658,16 @@ namespace OpenSim.Region.Environment.Scenes | |||
648 | 658 | ||
649 | public static void CreateDefaultTextureEntry(string name) | 659 | public static void CreateDefaultTextureEntry(string name) |
650 | { | 660 | { |
651 | /* FileInfo fInfo = new FileInfo(name); | 661 | /* FileInfo fInfo = new FileInfo(name); |
652 | long numBytes = fInfo.Length; | 662 | long numBytes = fInfo.Length; |
653 | FileStream fStream = new FileStream(name, FileMode.Open, FileAccess.Read); | 663 | FileStream fStream = new FileStream(name, FileMode.Open, FileAccess.Read); |
654 | BinaryReader br = new BinaryReader(fStream); | 664 | BinaryReader br = new BinaryReader(fStream); |
655 | byte[] data1 = br.ReadBytes((int)numBytes); | 665 | byte[] data1 = br.ReadBytes((int)numBytes); |
656 | br.Close(); | 666 | br.Close(); |
657 | fStream.Close(); | 667 | fStream.Close(); |
658 | DefaultTexture = data1; | 668 | DefaultTexture = data1; |
659 | LLObject.TextureEntry textu = new LLObject.TextureEntry(data1, 0, data1.Length); | 669 | LLObject.TextureEntry textu = new LLObject.TextureEntry(data1, 0, data1.Length); |
660 | Console.WriteLine("default texture entry: " + textu.ToString());*/ | 670 | Console.WriteLine("default texture entry: " + textu.ToString());*/ |
661 | 671 | ||
662 | LLObject.TextureEntry textu = new LLObject.TextureEntry(new LLUUID("C228D1CF-4B5D-4BA8-84F4-899A0796AA97")); | 672 | LLObject.TextureEntry textu = new LLObject.TextureEntry(new LLUUID("C228D1CF-4B5D-4BA8-84F4-899A0796AA97")); |
663 | textu.CreateFace(0).TextureID = new LLUUID("00000000-0000-1111-9999-000000000012"); | 673 | textu.CreateFace(0).TextureID = new LLUUID("00000000-0000-1111-9999-000000000012"); |