Added a CheckSumServer (handles template checksum , so there is no longer the need to connect to LL userserver). Currently onlt active in sandbox mode (someone simple needs to add

"CheckSumServer checkserver = new CheckSumServer(12036, m_console);" to the grid userserver).
Then when starting up the SL client add " -user localhost" (or whatever the IP address that the sim or grid userserver is at) to the command line
zircon^2
MW 2007-05-19 13:28:31 +00:00
parent 401004ea64
commit 42c45a8716
4 changed files with 161 additions and 25 deletions

View File

@ -0,0 +1,120 @@
using System;
using System.Text;
using System.IO;
using System.Threading;
using System.Net;
using System.Net.Sockets;
using System.Timers;
using System.Reflection;
using System.Collections;
using System.Collections.Generic;
using libsecondlife;
using libsecondlife.Packets;
using OpenSim.world;
using OpenSim.Terrain;
using OpenSim.Framework.Interfaces;
using OpenSim.Framework.Types;
using OpenSim.UserServer;
using OpenSim.Assets;
using OpenSim.CAPS;
using OpenSim.Framework.Console;
using Nwc.XmlRpc;
using OpenSim.Servers;
using OpenSim.GenericConfig;
namespace OpenSim
{
public class CheckSumServer : UDPServer
{
public CheckSumServer(int port, ConsoleBase console)
{
listenPort = port;
this.m_console = console;
}
protected override void CreatePacketServer()
{
}
public override void RegisterPacketServer(PacketServer server)
{
}
protected override void OnReceivedData(IAsyncResult result)
{
ipeSender = new IPEndPoint(IPAddress.Any, 0);
epSender = (EndPoint)ipeSender;
Packet packet = null;
int numBytes = Server.EndReceiveFrom(result, ref epSender);
int packetEnd = numBytes - 1;
packet = Packet.BuildPacket(RecvBuffer, ref packetEnd, ZeroBuffer);
// do we already have a circuit for this endpoint
if (packet.Type == PacketType.SecuredTemplateChecksumRequest)
{
SecuredTemplateChecksumRequestPacket checksum = (SecuredTemplateChecksumRequestPacket)packet;
TemplateChecksumReplyPacket checkreply = new TemplateChecksumReplyPacket();
checkreply.DataBlock.Checksum = 180572585;
checkreply.DataBlock.Flags = 0;
checkreply.DataBlock.MajorVersion = 1;
checkreply.DataBlock.MinorVersion = 15;
checkreply.DataBlock.PatchVersion = 0;
checkreply.DataBlock.ServerVersion = 2;
checkreply.TokenBlock.Token = checksum.TokenBlock.Token;
this.SendPacket(checkreply, epSender);
}
else
{ // invalid client
// Console.Error.WriteLine("CheckSumServer.cs:OnReceivedData() - WARNING: Got a invalid packet from an invalid client - " + epSender.ToString());
}
Server.BeginReceiveFrom(RecvBuffer, 0, RecvBuffer.Length, SocketFlags.None, ref epSender, ReceivedData, null);
}
protected override void AddNewClient(Packet packet)
{
}
private void SendPacket(Packet Pack, EndPoint endp)
{
if (!Pack.Header.Resent)
{
// Set the sequence number
Pack.Header.Sequence = 1;
}
byte[] ZeroOutBuffer = new byte[4096];
byte[] sendbuffer;
sendbuffer = Pack.ToBytes();
try
{
if (Pack.Header.Zerocoded)
{
int packetsize = Helpers.ZeroEncode(sendbuffer, sendbuffer.Length, ZeroOutBuffer);
this.SendPackTo(ZeroOutBuffer, packetsize, SocketFlags.None, endp);
}
else
{
this.SendPackTo(sendbuffer, sendbuffer.Length, SocketFlags.None, endp);
}
}
catch (Exception)
{
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.MEDIUM, "OpenSimClient.cs:ProcessOutPacket() - WARNING: Socket exception occurred on connection " );
}
}
private void SendPackTo(byte[] buffer, int size, SocketFlags flags, EndPoint endp)
{
this.Server.SendTo(buffer, size, flags, endp);
}
}
}

View File

@ -1,4 +1,4 @@
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectType>Local</ProjectType>
<ProductVersion>8.0.50727</ProductVersion>
@ -6,7 +6,8 @@
<ProjectGuid>{632E1BFD-0000-0000-0000-000000000000}</ProjectGuid>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ApplicationIcon></ApplicationIcon>
<ApplicationIcon>
</ApplicationIcon>
<AssemblyKeyContainerName>
</AssemblyKeyContainerName>
<AssemblyName>OpenSim.RegionServer</AssemblyName>
@ -15,9 +16,11 @@
<DefaultTargetSchema>IE50</DefaultTargetSchema>
<DelaySign>false</DelaySign>
<OutputType>Library</OutputType>
<AppDesignerFolder></AppDesignerFolder>
<AppDesignerFolder>
</AppDesignerFolder>
<RootNamespace>OpenSim.RegionServer</RootNamespace>
<StartupObject></StartupObject>
<StartupObject>
</StartupObject>
<FileUpgradeFlags>
</FileUpgradeFlags>
</PropertyGroup>
@ -28,7 +31,8 @@
<ConfigurationOverrideFile>
</ConfigurationOverrideFile>
<DefineConstants>TRACE;DEBUG</DefineConstants>
<DocumentationFile></DocumentationFile>
<DocumentationFile>
</DocumentationFile>
<DebugSymbols>True</DebugSymbols>
<FileAlignment>4096</FileAlignment>
<Optimize>False</Optimize>
@ -37,7 +41,8 @@
<RemoveIntegerChecks>False</RemoveIntegerChecks>
<TreatWarningsAsErrors>False</TreatWarningsAsErrors>
<WarningLevel>4</WarningLevel>
<NoWarn></NoWarn>
<NoWarn>
</NoWarn>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<AllowUnsafeBlocks>False</AllowUnsafeBlocks>
@ -46,7 +51,8 @@
<ConfigurationOverrideFile>
</ConfigurationOverrideFile>
<DefineConstants>TRACE</DefineConstants>
<DocumentationFile></DocumentationFile>
<DocumentationFile>
</DocumentationFile>
<DebugSymbols>False</DebugSymbols>
<FileAlignment>4096</FileAlignment>
<Optimize>True</Optimize>
@ -55,26 +61,28 @@
<RemoveIntegerChecks>False</RemoveIntegerChecks>
<TreatWarningsAsErrors>False</TreatWarningsAsErrors>
<WarningLevel>4</WarningLevel>
<NoWarn></NoWarn>
<NoWarn>
</NoWarn>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" >
<Reference Include="System">
<HintPath>System.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System.Xml" >
<Reference Include="System.Data" />
<Reference Include="System.Xml">
<HintPath>System.Xml.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="libsecondlife.dll" >
<Reference Include="libsecondlife.dll">
<HintPath>..\bin\libsecondlife.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Axiom.MathLib.dll" >
<Reference Include="Axiom.MathLib.dll">
<HintPath>..\bin\Axiom.MathLib.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Db4objects.Db4o.dll" >
<Reference Include="Db4objects.Db4o.dll">
<HintPath>..\bin\Db4objects.Db4o.dll</HintPath>
<Private>False</Private>
</Reference>
@ -84,43 +92,43 @@
<Name>OpenSim.Terrain.BasicTerrain</Name>
<Project>{2270B8FE-0000-0000-0000-000000000000}</Project>
<Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
<Private>False</Private>
<Private>False</Private>
</ProjectReference>
<ProjectReference Include="..\OpenSim.Framework\OpenSim.Framework.csproj">
<Name>OpenSim.Framework</Name>
<Project>{8ACA2445-0000-0000-0000-000000000000}</Project>
<Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
<Private>False</Private>
<Private>False</Private>
</ProjectReference>
<ProjectReference Include="..\OpenSim.Framework.Console\OpenSim.Framework.Console.csproj">
<Name>OpenSim.Framework.Console</Name>
<Project>{A7CD0630-0000-0000-0000-000000000000}</Project>
<Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
<Private>False</Private>
<Private>False</Private>
</ProjectReference>
<ProjectReference Include="..\OpenSim.GenericConfig\Xml\OpenSim.GenericConfig.Xml.csproj">
<Name>OpenSim.GenericConfig.Xml</Name>
<Project>{E88EF749-0000-0000-0000-000000000000}</Project>
<Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
<Private>False</Private>
<Private>False</Private>
</ProjectReference>
<ProjectReference Include="..\OpenSim.Physics\Manager\OpenSim.Physics.Manager.csproj">
<Name>OpenSim.Physics.Manager</Name>
<Project>{8BE16150-0000-0000-0000-000000000000}</Project>
<Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
<Private>False</Private>
<Private>False</Private>
</ProjectReference>
<ProjectReference Include="..\OpenSim.Servers\OpenSim.Servers.csproj">
<Name>OpenSim.Servers</Name>
<Project>{8BB20F0A-0000-0000-0000-000000000000}</Project>
<Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
<Private>False</Private>
<Private>False</Private>
</ProjectReference>
<ProjectReference Include="..\XmlRpcCS\XMLRPC.csproj">
<Name>XMLRPC</Name>
<Project>{8E81D43C-0000-0000-0000-000000000000}</Project>
<Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
<Private>False</Private>
<Private>False</Private>
</ProjectReference>
</ItemGroup>
<ItemGroup>
@ -136,6 +144,7 @@
<Compile Include="AuthenticateSessionsRemote.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="CheckSumServer.cs" />
<Compile Include="Grid.cs">
<SubType>Code</SubType>
</Compile>
@ -255,4 +264,4 @@
<PostBuildEvent>
</PostBuildEvent>
</PropertyGroup>
</Project>
</Project>

View File

@ -72,7 +72,11 @@ namespace OpenSim
}
}
public UDPServer(int port, Grid gridServers, AssetCache assetCache, InventoryCache inventoryCache, RegionInfo _regionData, bool sandbox, bool accounts, ConsoleBase console , AuthenticateSessionsBase authenticateClass)
public UDPServer()
{
}
public UDPServer(int port, Grid gridServers, AssetCache assetCache, InventoryCache inventoryCache, RegionInfo _regionData, bool sandbox, bool accounts, ConsoleBase console, AuthenticateSessionsBase authenticateClass)
{
listenPort = port;
this.m_gridServers = gridServers;
@ -84,7 +88,7 @@ namespace OpenSim
this.m_console = console;
this.m_authenticateSessionsClass = authenticateClass;
this.CreatePacketServer();
//set up delegate for authenticate sessions
this.AuthenticateHandler = new AuthenticateSessionHandler(this.m_authenticateSessionsClass.AuthenticateSession);
}
@ -145,7 +149,7 @@ namespace OpenSim
ServerIncoming = new IPEndPoint(IPAddress.Any, listenPort);
Server = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
Server.Bind(ServerIncoming);
m_console.WriteLine("UDPServer.cs:ServerListener() - UDP socket bound, getting ready to listen");
ipeSender = new IPEndPoint(IPAddress.Any, 0);
@ -195,7 +199,7 @@ namespace OpenSim
public virtual AuthenticateResponse AuthenticateSession(LLUUID sessionID, LLUUID agentID, uint circuitCode)
{
return this.AuthenticateHandler(sessionID, agentID, circuitCode);
return this.AuthenticateHandler(sessionID, agentID, circuitCode);
}
}
}

View File

@ -56,6 +56,7 @@ namespace OpenSim
public class OpenSimMain : RegionServerBase, conscmd_callback
{
private CheckSumServer checkServer;
public OpenSimMain(bool sandBoxMode, bool startLoginServer, string physicsEngine, bool useConfigFile, bool silent, string configFile)
{
@ -99,6 +100,8 @@ namespace OpenSim
//Authenticate Session Handler
AuthenticateSessionsLocal authen = new AuthenticateSessionsLocal();
this.AuthenticateSessionsHandler = authen;
this.checkServer = new CheckSumServer(12036, m_console);
this.checkServer.ServerListener();
}
else
{