Yet more cleanup/refactoring

zircon^2
MW 2007-05-16 16:01:01 +00:00
parent 3f39648605
commit bd6e69b97c
4 changed files with 61 additions and 33 deletions

View File

@ -20,6 +20,13 @@ namespace OpenSim
{ {
public partial class SimClient public partial class SimClient
{ {
protected virtual void RegisterLocalPacketHandlers()
{
this.AddLocalPacketHandler(PacketType.LogoutRequest, this.Logout);
this.AddLocalPacketHandler(PacketType.AgentCachedTexture, this.AgentTextureCached);
this.AddLocalPacketHandler(PacketType.MultipleObjectUpdate, this.MultipleObjUpdate);
}
protected virtual bool Logout(SimClient simClient, Packet packet) protected virtual bool Logout(SimClient simClient, Packet packet)
{ {
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "OpenSimClient.cs:ProcessInPacket() - Got a logout request"); OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "OpenSimClient.cs:ProcessInPacket() - Got a logout request");

View File

@ -135,13 +135,7 @@ namespace OpenSim
ClientThread.Start(); ClientThread.Start();
} }
protected virtual void RegisterLocalPacketHandlers() # region Client Methods
{
this.AddLocalPacketHandler(PacketType.LogoutRequest, this.Logout);
this.AddLocalPacketHandler(PacketType.AgentCachedTexture, this.AgentTextureCached);
this.AddLocalPacketHandler(PacketType.MultipleObjectUpdate, this.MultipleObjUpdate);
}
public void UpgradeClient() public void UpgradeClient()
{ {
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "SimClient.cs:UpgradeClient() - upgrading child to full agent"); OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "SimClient.cs:UpgradeClient() - upgrading child to full agent");
@ -188,7 +182,9 @@ namespace OpenSim
m_networkServer.RemoveClientCircuit(this.CircuitCode); m_networkServer.RemoveClientCircuit(this.CircuitCode);
this.ClientThread.Abort(); this.ClientThread.Abort();
} }
#endregion
# region Packet Handling
public static bool AddPacketHandler(PacketType packetType, PacketMethod handler) public static bool AddPacketHandler(PacketType packetType, PacketMethod handler)
{ {
bool result = false; bool result = false;
@ -242,6 +238,10 @@ namespace OpenSim
return result; return result;
} }
# endregion
# region Low Level Packet Methods
private void ack_pack(Packet Pack) private void ack_pack(Packet Pack)
{ {
if (Pack.Header.Reliable) if (Pack.Header.Reliable)
@ -327,6 +327,10 @@ namespace OpenSim
ResendUnacked(); ResendUnacked();
} }
# endregion
#region Packet Queue Processing
protected virtual void ProcessOutPacket(Packet Pack) protected virtual void ProcessOutPacket(Packet Pack)
{ {
// Keep track of when this packet was sent out // Keep track of when this packet was sent out
@ -495,6 +499,10 @@ namespace OpenSim
} }
} }
#endregion
# region Setup
protected virtual void InitNewClient() protected virtual void InitNewClient()
{ {
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "OpenSimClient.cs:InitNewClient() - Adding viewer agent to world"); OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "OpenSimClient.cs:InitNewClient() - Adding viewer agent to world");
@ -539,6 +547,7 @@ namespace OpenSim
ClientLoop(); ClientLoop();
} }
} }
# endregion
#region Inventory Creation #region Inventory Creation
private void SetupInventory(AuthenticateResponse sessionInfo) private void SetupInventory(AuthenticateResponse sessionInfo)
@ -630,6 +639,8 @@ namespace OpenSim
} }
#endregion #endregion
#region Nested Classes
public class QueItem public class QueItem
{ {
public QueItem() public QueItem()
@ -639,5 +650,6 @@ namespace OpenSim
public Packet Packet; public Packet Packet;
public bool Incoming; public bool Incoming;
} }
#endregion
} }
} }

View File

@ -81,6 +81,8 @@ namespace OpenSim
this.user_accounts = accounts; this.user_accounts = accounts;
this.m_console = console; this.m_console = console;
PacketServer packetServer = new PacketServer(this); PacketServer packetServer = new PacketServer(this);
//set up delegate for authenticate sessions
this.AuthenticateHandler = new AuthenticateSessionHandler(this.m_gridServers.GridServer.AuthenticateSession); this.AuthenticateHandler = new AuthenticateSessionHandler(this.m_gridServers.GridServer.AuthenticateSession);
} }

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> <PropertyGroup>
<ProjectType>Local</ProjectType> <ProjectType>Local</ProjectType>
<ProductVersion>8.0.50727</ProductVersion> <ProductVersion>8.0.50727</ProductVersion>
@ -6,7 +6,8 @@
<ProjectGuid>{E141F4EE-0000-0000-0000-000000000000}</ProjectGuid> <ProjectGuid>{E141F4EE-0000-0000-0000-000000000000}</ProjectGuid>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ApplicationIcon></ApplicationIcon> <ApplicationIcon>
</ApplicationIcon>
<AssemblyKeyContainerName> <AssemblyKeyContainerName>
</AssemblyKeyContainerName> </AssemblyKeyContainerName>
<AssemblyName>ServiceManager</AssemblyName> <AssemblyName>ServiceManager</AssemblyName>
@ -15,9 +16,11 @@
<DefaultTargetSchema>IE50</DefaultTargetSchema> <DefaultTargetSchema>IE50</DefaultTargetSchema>
<DelaySign>false</DelaySign> <DelaySign>false</DelaySign>
<OutputType>Exe</OutputType> <OutputType>Exe</OutputType>
<AppDesignerFolder></AppDesignerFolder> <AppDesignerFolder>
</AppDesignerFolder>
<RootNamespace>ServiceManager</RootNamespace> <RootNamespace>ServiceManager</RootNamespace>
<StartupObject></StartupObject> <StartupObject>
</StartupObject>
<FileUpgradeFlags> <FileUpgradeFlags>
</FileUpgradeFlags> </FileUpgradeFlags>
</PropertyGroup> </PropertyGroup>
@ -28,7 +31,8 @@
<ConfigurationOverrideFile> <ConfigurationOverrideFile>
</ConfigurationOverrideFile> </ConfigurationOverrideFile>
<DefineConstants>TRACE;DEBUG</DefineConstants> <DefineConstants>TRACE;DEBUG</DefineConstants>
<DocumentationFile></DocumentationFile> <DocumentationFile>
</DocumentationFile>
<DebugSymbols>True</DebugSymbols> <DebugSymbols>True</DebugSymbols>
<FileAlignment>4096</FileAlignment> <FileAlignment>4096</FileAlignment>
<Optimize>False</Optimize> <Optimize>False</Optimize>
@ -37,7 +41,8 @@
<RemoveIntegerChecks>False</RemoveIntegerChecks> <RemoveIntegerChecks>False</RemoveIntegerChecks>
<TreatWarningsAsErrors>False</TreatWarningsAsErrors> <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<NoWarn></NoWarn> <NoWarn>
</NoWarn>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<AllowUnsafeBlocks>False</AllowUnsafeBlocks> <AllowUnsafeBlocks>False</AllowUnsafeBlocks>
@ -46,7 +51,8 @@
<ConfigurationOverrideFile> <ConfigurationOverrideFile>
</ConfigurationOverrideFile> </ConfigurationOverrideFile>
<DefineConstants>TRACE</DefineConstants> <DefineConstants>TRACE</DefineConstants>
<DocumentationFile></DocumentationFile> <DocumentationFile>
</DocumentationFile>
<DebugSymbols>False</DebugSymbols> <DebugSymbols>False</DebugSymbols>
<FileAlignment>4096</FileAlignment> <FileAlignment>4096</FileAlignment>
<Optimize>True</Optimize> <Optimize>True</Optimize>
@ -55,7 +61,8 @@
<RemoveIntegerChecks>False</RemoveIntegerChecks> <RemoveIntegerChecks>False</RemoveIntegerChecks>
<TreatWarningsAsErrors>False</TreatWarningsAsErrors> <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<NoWarn></NoWarn> <NoWarn>
</NoWarn>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="System"> <Reference Include="System">
@ -75,7 +82,7 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="ServiceManager.cs"> <Compile Include="ServiceManager.cs">
<SubType>Code</SubType> <SubType>Component</SubType>
</Compile> </Compile>
</ItemGroup> </ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" /> <Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" />