aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/OpenSim.RegionServer
diff options
context:
space:
mode:
authorMW2007-06-15 13:11:26 +0000
committerMW2007-06-15 13:11:26 +0000
commit95676b298819d6b2d1df74d1f52668e2549a2c2f (patch)
treee3152f0685f262253e72a482a4a3e4b64aae631a /OpenSim/OpenSim.RegionServer
parentand some more (diff)
downloadopensim-SC_OLD-95676b298819d6b2d1df74d1f52668e2549a2c2f.zip
opensim-SC_OLD-95676b298819d6b2d1df74d1f52668e2549a2c2f.tar.gz
opensim-SC_OLD-95676b298819d6b2d1df74d1f52668e2549a2c2f.tar.bz2
opensim-SC_OLD-95676b298819d6b2d1df74d1f52668e2549a2c2f.tar.xz
Preliminary movement added to sugilite, forwards walking only and no animations.
Diffstat (limited to 'OpenSim/OpenSim.RegionServer')
-rw-r--r--OpenSim/OpenSim.RegionServer/ClientStackNetworkHandler.cs (renamed from OpenSim/OpenSim.RegionServer/OpenSimNetworkHandler.cs)2
-rw-r--r--OpenSim/OpenSim.RegionServer/ClientView.API.cs99
-rw-r--r--OpenSim/OpenSim.RegionServer/ClientView.ProcessPackets.cs3
-rw-r--r--OpenSim/OpenSim.RegionServer/OpenSim.RegionServer.csproj11
-rw-r--r--OpenSim/OpenSim.RegionServer/OpenSim.RegionServer.dll.build5
-rw-r--r--OpenSim/OpenSim.RegionServer/PacketServer.cs4
-rw-r--r--OpenSim/OpenSim.RegionServer/RegionApplicationBase.cs (renamed from OpenSim/OpenSim.RegionServer/RegionServerBase.cs)6
-rw-r--r--OpenSim/OpenSim.RegionServer/UDPServer.cs2
-rw-r--r--OpenSim/OpenSim.RegionServer/UserConfigUtility.cs37
9 files changed, 113 insertions, 56 deletions
diff --git a/OpenSim/OpenSim.RegionServer/OpenSimNetworkHandler.cs b/OpenSim/OpenSim.RegionServer/ClientStackNetworkHandler.cs
index 382ba21..7552195 100644
--- a/OpenSim/OpenSim.RegionServer/OpenSimNetworkHandler.cs
+++ b/OpenSim/OpenSim.RegionServer/ClientStackNetworkHandler.cs
@@ -36,7 +36,7 @@ using libsecondlife;
36namespace OpenSim 36namespace OpenSim
37{ 37{
38 38
39 public interface OpenSimNetworkHandler 39 public interface ClientStackNetworkHandler
40 { 40 {
41 void SendPacketTo(byte[] buffer, int size, SocketFlags flags, uint circuitcode);// EndPoint packetSender); 41 void SendPacketTo(byte[] buffer, int size, SocketFlags flags, uint circuitcode);// EndPoint packetSender);
42 void RemoveClientCircuit(uint circuitcode); 42 void RemoveClientCircuit(uint circuitcode);
diff --git a/OpenSim/OpenSim.RegionServer/ClientView.API.cs b/OpenSim/OpenSim.RegionServer/ClientView.API.cs
index 484ecc1..33727c4 100644
--- a/OpenSim/OpenSim.RegionServer/ClientView.API.cs
+++ b/OpenSim/OpenSim.RegionServer/ClientView.API.cs
@@ -47,7 +47,7 @@ namespace OpenSim
47 public event GenericCall OnRequestWearables; 47 public event GenericCall OnRequestWearables;
48 public event SetAppearance OnSetAppearance; 48 public event SetAppearance OnSetAppearance;
49 public event GenericCall2 OnCompleteMovementToRegion; 49 public event GenericCall2 OnCompleteMovementToRegion;
50 public event GenericCall3 OnAgentUpdate; 50 public event UpdateAgent OnAgentUpdate;
51 public event StartAnim OnStartAnim; 51 public event StartAnim OnStartAnim;
52 public event GenericCall OnRequestAvatarsData; 52 public event GenericCall OnRequestAvatarsData;
53 public event LinkObjects OnLinkObjects; 53 public event LinkObjects OnLinkObjects;
@@ -393,6 +393,26 @@ namespace OpenSim
393 393
394 } 394 }
395 395
396 /// <summary>
397 ///
398 /// </summary>
399 /// <param name="regionHandle"></param>
400 /// <param name="timeDilation"></param>
401 /// <param name="localID"></param>
402 /// <param name="position"></param>
403 /// <param name="velocity"></param>
404 public void SendAvatarTerseUpdate(ulong regionHandle, ushort timeDilation, uint localID, LLVector3 position, LLVector3 velocity)
405 {
406 ImprovedTerseObjectUpdatePacket.ObjectDataBlock terseBlock = this.CreateAvatarImprovedBlock(localID, position, velocity);
407 ImprovedTerseObjectUpdatePacket terse = new ImprovedTerseObjectUpdatePacket();
408 terse.RegionData.RegionHandle = regionHandle;
409 terse.RegionData.TimeDilation = timeDilation;
410 terse.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[1];
411 terse.ObjectData[0] = terseBlock;
412
413 this.OutPacket(terse);
414 }
415
396 #endregion 416 #endregion
397 417
398 #region Primitive Packet/data Sending Methods 418 #region Primitive Packet/data Sending Methods
@@ -491,6 +511,83 @@ namespace OpenSim
491 511
492 #region Helper Methods 512 #region Helper Methods
493 513
514 protected ImprovedTerseObjectUpdatePacket.ObjectDataBlock CreateAvatarImprovedBlock(uint localID, LLVector3 pos, LLVector3 velocity)
515 {
516 byte[] bytes = new byte[60];
517 int i = 0;
518 ImprovedTerseObjectUpdatePacket.ObjectDataBlock dat = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock();
519
520 dat.TextureEntry = new byte[0];// AvatarTemplate.TextureEntry;
521
522 uint ID = localID;
523
524 bytes[i++] = (byte)(ID % 256);
525 bytes[i++] = (byte)((ID >> 8) % 256);
526 bytes[i++] = (byte)((ID >> 16) % 256);
527 bytes[i++] = (byte)((ID >> 24) % 256);
528 bytes[i++] = 0;
529 bytes[i++] = 1;
530 i += 14;
531 bytes[i++] = 128;
532 bytes[i++] = 63;
533
534 byte[] pb = pos.GetBytes();
535 Array.Copy(pb, 0, bytes, i, pb.Length);
536 i += 12;
537 ushort InternVelocityX;
538 ushort InternVelocityY;
539 ushort InternVelocityZ;
540 Axiom.MathLib.Vector3 internDirec = new Axiom.MathLib.Vector3(0, 0, 0);
541
542 internDirec = new Axiom.MathLib.Vector3(velocity.X, velocity.Y, velocity.Z);
543
544 internDirec = internDirec / 128.0f;
545 internDirec.x += 1;
546 internDirec.y += 1;
547 internDirec.z += 1;
548
549 InternVelocityX = (ushort)(32768 * internDirec.x);
550 InternVelocityY = (ushort)(32768 * internDirec.y);
551 InternVelocityZ = (ushort)(32768 * internDirec.z);
552
553 ushort ac = 32767;
554 bytes[i++] = (byte)(InternVelocityX % 256);
555 bytes[i++] = (byte)((InternVelocityX >> 8) % 256);
556 bytes[i++] = (byte)(InternVelocityY % 256);
557 bytes[i++] = (byte)((InternVelocityY >> 8) % 256);
558 bytes[i++] = (byte)(InternVelocityZ % 256);
559 bytes[i++] = (byte)((InternVelocityZ >> 8) % 256);
560
561 //accel
562 bytes[i++] = (byte)(ac % 256);
563 bytes[i++] = (byte)((ac >> 8) % 256);
564 bytes[i++] = (byte)(ac % 256);
565 bytes[i++] = (byte)((ac >> 8) % 256);
566 bytes[i++] = (byte)(ac % 256);
567 bytes[i++] = (byte)((ac >> 8) % 256);
568
569 //rot
570 bytes[i++] = (byte)(ac % 256);
571 bytes[i++] = (byte)((ac >> 8) % 256);
572 bytes[i++] = (byte)(ac % 256);
573 bytes[i++] = (byte)((ac >> 8) % 256);
574 bytes[i++] = (byte)(ac % 256);
575 bytes[i++] = (byte)((ac >> 8) % 256);
576 bytes[i++] = (byte)(ac % 256);
577 bytes[i++] = (byte)((ac >> 8) % 256);
578
579 //rotation vel
580 bytes[i++] = (byte)(ac % 256);
581 bytes[i++] = (byte)((ac >> 8) % 256);
582 bytes[i++] = (byte)(ac % 256);
583 bytes[i++] = (byte)((ac >> 8) % 256);
584 bytes[i++] = (byte)(ac % 256);
585 bytes[i++] = (byte)((ac >> 8) % 256);
586
587 dat.Data = bytes;
588 return (dat);
589 }
590
494 /// <summary> 591 /// <summary>
495 /// 592 ///
496 /// </summary> 593 /// </summary>
diff --git a/OpenSim/OpenSim.RegionServer/ClientView.ProcessPackets.cs b/OpenSim/OpenSim.RegionServer/ClientView.ProcessPackets.cs
index dbe0bd9..f8c7cdb 100644
--- a/OpenSim/OpenSim.RegionServer/ClientView.ProcessPackets.cs
+++ b/OpenSim/OpenSim.RegionServer/ClientView.ProcessPackets.cs
@@ -168,7 +168,8 @@ namespace OpenSim
168 case PacketType.AgentUpdate: 168 case PacketType.AgentUpdate:
169 if (OnAgentUpdate != null) 169 if (OnAgentUpdate != null)
170 { 170 {
171 OnAgentUpdate(Pack); 171 AgentUpdatePacket agenUpdate = (AgentUpdatePacket) Pack;
172 OnAgentUpdate(this, agenUpdate.AgentData.ControlFlags, agenUpdate.AgentData.BodyRotation );
172 } 173 }
173 break; 174 break;
174 case PacketType.AgentAnimation: 175 case PacketType.AgentAnimation:
diff --git a/OpenSim/OpenSim.RegionServer/OpenSim.RegionServer.csproj b/OpenSim/OpenSim.RegionServer/OpenSim.RegionServer.csproj
index 4231f40..63eeb9c 100644
--- a/OpenSim/OpenSim.RegionServer/OpenSim.RegionServer.csproj
+++ b/OpenSim/OpenSim.RegionServer/OpenSim.RegionServer.csproj
@@ -130,6 +130,9 @@
130 </ProjectReference> 130 </ProjectReference>
131 </ItemGroup> 131 </ItemGroup>
132 <ItemGroup> 132 <ItemGroup>
133 <Compile Include="ClientStackNetworkHandler.cs">
134 <SubType>Code</SubType>
135 </Compile>
133 <Compile Include="ClientView.AgentAssetUpload.cs"> 136 <Compile Include="ClientView.AgentAssetUpload.cs">
134 <SubType>Code</SubType> 137 <SubType>Code</SubType>
135 </Compile> 138 </Compile>
@@ -151,21 +154,15 @@
151 <Compile Include="NetworkServersInfo.cs"> 154 <Compile Include="NetworkServersInfo.cs">
152 <SubType>Code</SubType> 155 <SubType>Code</SubType>
153 </Compile> 156 </Compile>
154 <Compile Include="OpenSimNetworkHandler.cs">
155 <SubType>Code</SubType>
156 </Compile>
157 <Compile Include="PacketServer.cs"> 157 <Compile Include="PacketServer.cs">
158 <SubType>Code</SubType> 158 <SubType>Code</SubType>
159 </Compile> 159 </Compile>
160 <Compile Include="RegionServerBase.cs"> 160 <Compile Include="RegionApplicationBase.cs">
161 <SubType>Code</SubType> 161 <SubType>Code</SubType>
162 </Compile> 162 </Compile>
163 <Compile Include="UDPServer.cs"> 163 <Compile Include="UDPServer.cs">
164 <SubType>Code</SubType> 164 <SubType>Code</SubType>
165 </Compile> 165 </Compile>
166 <Compile Include="UserConfigUtility.cs">
167 <SubType>Code</SubType>
168 </Compile>
169 <Compile Include="VersionInfo.cs"> 166 <Compile Include="VersionInfo.cs">
170 <SubType>Code</SubType> 167 <SubType>Code</SubType>
171 </Compile> 168 </Compile>
diff --git a/OpenSim/OpenSim.RegionServer/OpenSim.RegionServer.dll.build b/OpenSim/OpenSim.RegionServer/OpenSim.RegionServer.dll.build
index f5f8440..23eca3a 100644
--- a/OpenSim/OpenSim.RegionServer/OpenSim.RegionServer.dll.build
+++ b/OpenSim/OpenSim.RegionServer/OpenSim.RegionServer.dll.build
@@ -11,6 +11,7 @@
11 <resources prefix="OpenSim.RegionServer" dynamicprefix="true" > 11 <resources prefix="OpenSim.RegionServer" dynamicprefix="true" >
12 </resources> 12 </resources>
13 <sources failonempty="true"> 13 <sources failonempty="true">
14 <include name="ClientStackNetworkHandler.cs" />
14 <include name="ClientView.AgentAssetUpload.cs" /> 15 <include name="ClientView.AgentAssetUpload.cs" />
15 <include name="ClientView.API.cs" /> 16 <include name="ClientView.API.cs" />
16 <include name="ClientView.cs" /> 17 <include name="ClientView.cs" />
@@ -18,11 +19,9 @@
18 <include name="ClientView.ProcessPackets.cs" /> 19 <include name="ClientView.ProcessPackets.cs" />
19 <include name="ClientViewBase.cs" /> 20 <include name="ClientViewBase.cs" />
20 <include name="NetworkServersInfo.cs" /> 21 <include name="NetworkServersInfo.cs" />
21 <include name="OpenSimNetworkHandler.cs" />
22 <include name="PacketServer.cs" /> 22 <include name="PacketServer.cs" />
23 <include name="RegionServerBase.cs" /> 23 <include name="RegionApplicationBase.cs" />
24 <include name="UDPServer.cs" /> 24 <include name="UDPServer.cs" />
25 <include name="UserConfigUtility.cs" />
26 <include name="VersionInfo.cs" /> 25 <include name="VersionInfo.cs" />
27 <include name="Assets/InventoryCache.cs" /> 26 <include name="Assets/InventoryCache.cs" />
28 </sources> 27 </sources>
diff --git a/OpenSim/OpenSim.RegionServer/PacketServer.cs b/OpenSim/OpenSim.RegionServer/PacketServer.cs
index f0bf44f..229570c 100644
--- a/OpenSim/OpenSim.RegionServer/PacketServer.cs
+++ b/OpenSim/OpenSim.RegionServer/PacketServer.cs
@@ -40,13 +40,13 @@ namespace OpenSim
40{ 40{
41 public class PacketServer 41 public class PacketServer
42 { 42 {
43 private OpenSimNetworkHandler _networkHandler; 43 private ClientStackNetworkHandler _networkHandler;
44 private IWorld _localWorld; 44 private IWorld _localWorld;
45 public Dictionary<uint, ClientView> ClientThreads = new Dictionary<uint, ClientView>(); 45 public Dictionary<uint, ClientView> ClientThreads = new Dictionary<uint, ClientView>();
46 public Dictionary<uint, IClientAPI> ClientAPIs = new Dictionary<uint, IClientAPI>(); 46 public Dictionary<uint, IClientAPI> ClientAPIs = new Dictionary<uint, IClientAPI>();
47 protected uint serverPort; 47 protected uint serverPort;
48 48
49 public PacketServer(OpenSimNetworkHandler networkHandler, uint port) 49 public PacketServer(ClientStackNetworkHandler networkHandler, uint port)
50 { 50 {
51 _networkHandler = networkHandler; 51 _networkHandler = networkHandler;
52 this.serverPort = port; 52 this.serverPort = port;
diff --git a/OpenSim/OpenSim.RegionServer/RegionServerBase.cs b/OpenSim/OpenSim.RegionServer/RegionApplicationBase.cs
index c059d7c..8509dcc 100644
--- a/OpenSim/OpenSim.RegionServer/RegionServerBase.cs
+++ b/OpenSim/OpenSim.RegionServer/RegionApplicationBase.cs
@@ -52,7 +52,7 @@ using OpenSim.GenericConfig;
52 52
53namespace OpenSim 53namespace OpenSim
54{ 54{
55 public class RegionServerBase 55 public class RegionApplicationBase
56 { 56 {
57 protected IGenericConfig localConfig; 57 protected IGenericConfig localConfig;
58 protected PhysicsManager physManager; 58 protected PhysicsManager physManager;
@@ -78,12 +78,12 @@ namespace OpenSim
78 78
79 protected ConsoleBase m_console; 79 protected ConsoleBase m_console;
80 80
81 public RegionServerBase() 81 public RegionApplicationBase()
82 { 82 {
83 83
84 } 84 }
85 85
86 public RegionServerBase(bool sandBoxMode, bool startLoginServer, string physicsEngine, bool useConfigFile, bool silent, string configFile) 86 public RegionApplicationBase(bool sandBoxMode, bool startLoginServer, string physicsEngine, bool useConfigFile, bool silent, string configFile)
87 { 87 {
88 this.configFileSetup = useConfigFile; 88 this.configFileSetup = useConfigFile;
89 m_sandbox = sandBoxMode; 89 m_sandbox = sandBoxMode;
diff --git a/OpenSim/OpenSim.RegionServer/UDPServer.cs b/OpenSim/OpenSim.RegionServer/UDPServer.cs
index 090ed7d..315cb2c 100644
--- a/OpenSim/OpenSim.RegionServer/UDPServer.cs
+++ b/OpenSim/OpenSim.RegionServer/UDPServer.cs
@@ -52,7 +52,7 @@ using OpenSim.GenericConfig;
52namespace OpenSim 52namespace OpenSim
53{ 53{
54 54
55 public class UDPServer : OpenSimNetworkHandler 55 public class UDPServer : ClientStackNetworkHandler
56 { 56 {
57 protected Dictionary<EndPoint, uint> clientCircuits = new Dictionary<EndPoint, uint>(); 57 protected Dictionary<EndPoint, uint> clientCircuits = new Dictionary<EndPoint, uint>();
58 public Socket Server; 58 public Socket Server;
diff --git a/OpenSim/OpenSim.RegionServer/UserConfigUtility.cs b/OpenSim/OpenSim.RegionServer/UserConfigUtility.cs
deleted file mode 100644
index 2f04c07..0000000
--- a/OpenSim/OpenSim.RegionServer/UserConfigUtility.cs
+++ /dev/null
@@ -1,37 +0,0 @@
1/*
2* Copyright (c) Contributors, http://www.openmetaverse.org/
3* See CONTRIBUTORS.TXT for a full list of copyright holders.
4*
5* Redistribution and use in source and binary forms, with or without
6* modification, are permitted provided that the following conditions are met:
7* * Redistributions of source code must retain the above copyright
8* notice, this list of conditions and the following disclaimer.
9* * Redistributions in binary form must reproduce the above copyright
10* notice, this list of conditions and the following disclaimer in the
11* documentation and/or other materials provided with the distribution.
12* * Neither the name of the OpenSim Project nor the
13* names of its contributors may be used to endorse or promote products
14* derived from this software without specific prior written permission.
15*
16* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY
17* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26*
27*/
28using System;
29using System.Collections.Generic;
30using System.Text;
31
32namespace OpenSim
33{
34 public class UserConfigUtility
35 {
36 }
37}