mirror of
https://github.com/opensim/opensim.git
synced 2026-08-08 10:15:33 +08:00
Preliminary movement added to sugilite, forwards walking only and no animations.
This commit is contained in:
@@ -36,7 +36,7 @@ using libsecondlife;
|
||||
namespace OpenSim
|
||||
{
|
||||
|
||||
public interface OpenSimNetworkHandler
|
||||
public interface ClientStackNetworkHandler
|
||||
{
|
||||
void SendPacketTo(byte[] buffer, int size, SocketFlags flags, uint circuitcode);// EndPoint packetSender);
|
||||
void RemoveClientCircuit(uint circuitcode);
|
||||
@@ -47,7 +47,7 @@ namespace OpenSim
|
||||
public event GenericCall OnRequestWearables;
|
||||
public event SetAppearance OnSetAppearance;
|
||||
public event GenericCall2 OnCompleteMovementToRegion;
|
||||
public event GenericCall3 OnAgentUpdate;
|
||||
public event UpdateAgent OnAgentUpdate;
|
||||
public event StartAnim OnStartAnim;
|
||||
public event GenericCall OnRequestAvatarsData;
|
||||
public event LinkObjects OnLinkObjects;
|
||||
@@ -393,6 +393,26 @@ namespace OpenSim
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="regionHandle"></param>
|
||||
/// <param name="timeDilation"></param>
|
||||
/// <param name="localID"></param>
|
||||
/// <param name="position"></param>
|
||||
/// <param name="velocity"></param>
|
||||
public void SendAvatarTerseUpdate(ulong regionHandle, ushort timeDilation, uint localID, LLVector3 position, LLVector3 velocity)
|
||||
{
|
||||
ImprovedTerseObjectUpdatePacket.ObjectDataBlock terseBlock = this.CreateAvatarImprovedBlock(localID, position, velocity);
|
||||
ImprovedTerseObjectUpdatePacket terse = new ImprovedTerseObjectUpdatePacket();
|
||||
terse.RegionData.RegionHandle = regionHandle;
|
||||
terse.RegionData.TimeDilation = timeDilation;
|
||||
terse.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[1];
|
||||
terse.ObjectData[0] = terseBlock;
|
||||
|
||||
this.OutPacket(terse);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Primitive Packet/data Sending Methods
|
||||
@@ -491,6 +511,83 @@ namespace OpenSim
|
||||
|
||||
#region Helper Methods
|
||||
|
||||
protected ImprovedTerseObjectUpdatePacket.ObjectDataBlock CreateAvatarImprovedBlock(uint localID, LLVector3 pos, LLVector3 velocity)
|
||||
{
|
||||
byte[] bytes = new byte[60];
|
||||
int i = 0;
|
||||
ImprovedTerseObjectUpdatePacket.ObjectDataBlock dat = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock();
|
||||
|
||||
dat.TextureEntry = new byte[0];// AvatarTemplate.TextureEntry;
|
||||
|
||||
uint ID = localID;
|
||||
|
||||
bytes[i++] = (byte)(ID % 256);
|
||||
bytes[i++] = (byte)((ID >> 8) % 256);
|
||||
bytes[i++] = (byte)((ID >> 16) % 256);
|
||||
bytes[i++] = (byte)((ID >> 24) % 256);
|
||||
bytes[i++] = 0;
|
||||
bytes[i++] = 1;
|
||||
i += 14;
|
||||
bytes[i++] = 128;
|
||||
bytes[i++] = 63;
|
||||
|
||||
byte[] pb = pos.GetBytes();
|
||||
Array.Copy(pb, 0, bytes, i, pb.Length);
|
||||
i += 12;
|
||||
ushort InternVelocityX;
|
||||
ushort InternVelocityY;
|
||||
ushort InternVelocityZ;
|
||||
Axiom.MathLib.Vector3 internDirec = new Axiom.MathLib.Vector3(0, 0, 0);
|
||||
|
||||
internDirec = new Axiom.MathLib.Vector3(velocity.X, velocity.Y, velocity.Z);
|
||||
|
||||
internDirec = internDirec / 128.0f;
|
||||
internDirec.x += 1;
|
||||
internDirec.y += 1;
|
||||
internDirec.z += 1;
|
||||
|
||||
InternVelocityX = (ushort)(32768 * internDirec.x);
|
||||
InternVelocityY = (ushort)(32768 * internDirec.y);
|
||||
InternVelocityZ = (ushort)(32768 * internDirec.z);
|
||||
|
||||
ushort ac = 32767;
|
||||
bytes[i++] = (byte)(InternVelocityX % 256);
|
||||
bytes[i++] = (byte)((InternVelocityX >> 8) % 256);
|
||||
bytes[i++] = (byte)(InternVelocityY % 256);
|
||||
bytes[i++] = (byte)((InternVelocityY >> 8) % 256);
|
||||
bytes[i++] = (byte)(InternVelocityZ % 256);
|
||||
bytes[i++] = (byte)((InternVelocityZ >> 8) % 256);
|
||||
|
||||
//accel
|
||||
bytes[i++] = (byte)(ac % 256);
|
||||
bytes[i++] = (byte)((ac >> 8) % 256);
|
||||
bytes[i++] = (byte)(ac % 256);
|
||||
bytes[i++] = (byte)((ac >> 8) % 256);
|
||||
bytes[i++] = (byte)(ac % 256);
|
||||
bytes[i++] = (byte)((ac >> 8) % 256);
|
||||
|
||||
//rot
|
||||
bytes[i++] = (byte)(ac % 256);
|
||||
bytes[i++] = (byte)((ac >> 8) % 256);
|
||||
bytes[i++] = (byte)(ac % 256);
|
||||
bytes[i++] = (byte)((ac >> 8) % 256);
|
||||
bytes[i++] = (byte)(ac % 256);
|
||||
bytes[i++] = (byte)((ac >> 8) % 256);
|
||||
bytes[i++] = (byte)(ac % 256);
|
||||
bytes[i++] = (byte)((ac >> 8) % 256);
|
||||
|
||||
//rotation vel
|
||||
bytes[i++] = (byte)(ac % 256);
|
||||
bytes[i++] = (byte)((ac >> 8) % 256);
|
||||
bytes[i++] = (byte)(ac % 256);
|
||||
bytes[i++] = (byte)((ac >> 8) % 256);
|
||||
bytes[i++] = (byte)(ac % 256);
|
||||
bytes[i++] = (byte)((ac >> 8) % 256);
|
||||
|
||||
dat.Data = bytes;
|
||||
return (dat);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
|
||||
@@ -168,7 +168,8 @@ namespace OpenSim
|
||||
case PacketType.AgentUpdate:
|
||||
if (OnAgentUpdate != null)
|
||||
{
|
||||
OnAgentUpdate(Pack);
|
||||
AgentUpdatePacket agenUpdate = (AgentUpdatePacket) Pack;
|
||||
OnAgentUpdate(this, agenUpdate.AgentData.ControlFlags, agenUpdate.AgentData.BodyRotation );
|
||||
}
|
||||
break;
|
||||
case PacketType.AgentAnimation:
|
||||
|
||||
@@ -130,6 +130,9 @@
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="ClientStackNetworkHandler.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="ClientView.AgentAssetUpload.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
@@ -151,21 +154,15 @@
|
||||
<Compile Include="NetworkServersInfo.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="OpenSimNetworkHandler.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="PacketServer.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="RegionServerBase.cs">
|
||||
<Compile Include="RegionApplicationBase.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="UDPServer.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="UserConfigUtility.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="VersionInfo.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
<resources prefix="OpenSim.RegionServer" dynamicprefix="true" >
|
||||
</resources>
|
||||
<sources failonempty="true">
|
||||
<include name="ClientStackNetworkHandler.cs" />
|
||||
<include name="ClientView.AgentAssetUpload.cs" />
|
||||
<include name="ClientView.API.cs" />
|
||||
<include name="ClientView.cs" />
|
||||
@@ -18,11 +19,9 @@
|
||||
<include name="ClientView.ProcessPackets.cs" />
|
||||
<include name="ClientViewBase.cs" />
|
||||
<include name="NetworkServersInfo.cs" />
|
||||
<include name="OpenSimNetworkHandler.cs" />
|
||||
<include name="PacketServer.cs" />
|
||||
<include name="RegionServerBase.cs" />
|
||||
<include name="RegionApplicationBase.cs" />
|
||||
<include name="UDPServer.cs" />
|
||||
<include name="UserConfigUtility.cs" />
|
||||
<include name="VersionInfo.cs" />
|
||||
<include name="Assets/InventoryCache.cs" />
|
||||
</sources>
|
||||
|
||||
@@ -40,13 +40,13 @@ namespace OpenSim
|
||||
{
|
||||
public class PacketServer
|
||||
{
|
||||
private OpenSimNetworkHandler _networkHandler;
|
||||
private ClientStackNetworkHandler _networkHandler;
|
||||
private IWorld _localWorld;
|
||||
public Dictionary<uint, ClientView> ClientThreads = new Dictionary<uint, ClientView>();
|
||||
public Dictionary<uint, IClientAPI> ClientAPIs = new Dictionary<uint, IClientAPI>();
|
||||
protected uint serverPort;
|
||||
|
||||
public PacketServer(OpenSimNetworkHandler networkHandler, uint port)
|
||||
public PacketServer(ClientStackNetworkHandler networkHandler, uint port)
|
||||
{
|
||||
_networkHandler = networkHandler;
|
||||
this.serverPort = port;
|
||||
|
||||
@@ -52,7 +52,7 @@ using OpenSim.GenericConfig;
|
||||
|
||||
namespace OpenSim
|
||||
{
|
||||
public class RegionServerBase
|
||||
public class RegionApplicationBase
|
||||
{
|
||||
protected IGenericConfig localConfig;
|
||||
protected PhysicsManager physManager;
|
||||
@@ -78,12 +78,12 @@ namespace OpenSim
|
||||
|
||||
protected ConsoleBase m_console;
|
||||
|
||||
public RegionServerBase()
|
||||
public RegionApplicationBase()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public RegionServerBase(bool sandBoxMode, bool startLoginServer, string physicsEngine, bool useConfigFile, bool silent, string configFile)
|
||||
public RegionApplicationBase(bool sandBoxMode, bool startLoginServer, string physicsEngine, bool useConfigFile, bool silent, string configFile)
|
||||
{
|
||||
this.configFileSetup = useConfigFile;
|
||||
m_sandbox = sandBoxMode;
|
||||
@@ -52,7 +52,7 @@ using OpenSim.GenericConfig;
|
||||
namespace OpenSim
|
||||
{
|
||||
|
||||
public class UDPServer : OpenSimNetworkHandler
|
||||
public class UDPServer : ClientStackNetworkHandler
|
||||
{
|
||||
protected Dictionary<EndPoint, uint> clientCircuits = new Dictionary<EndPoint, uint>();
|
||||
public Socket Server;
|
||||
|
||||
@@ -1,37 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) Contributors, http://www.openmetaverse.org/
|
||||
* See CONTRIBUTORS.TXT for a full list of copyright holders.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* * Neither the name of the OpenSim Project nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace OpenSim
|
||||
{
|
||||
public class UserConfigUtility
|
||||
{
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user