diff options
author | Teravus Ovares | 2008-06-06 12:51:20 +0000 |
---|---|---|
committer | Teravus Ovares | 2008-06-06 12:51:20 +0000 |
commit | c892ddcd2031466499ade7b101ba007d920af2fb (patch) | |
tree | fbf29835d4ec29011be02704e85d641bd333cd57 /OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | |
parent | * Fixes incorrect message server startup prompt (diff) | |
download | opensim-SC_OLD-c892ddcd2031466499ade7b101ba007d920af2fb.zip opensim-SC_OLD-c892ddcd2031466499ade7b101ba007d920af2fb.tar.gz opensim-SC_OLD-c892ddcd2031466499ade7b101ba007d920af2fb.tar.bz2 opensim-SC_OLD-c892ddcd2031466499ade7b101ba007d920af2fb.tar.xz |
* This wraps the autopilot request to the client's sit response. An interesting, but successful way to do it.
* This also takes care of a few error situations that were previously never seen.
Diffstat (limited to 'OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs')
-rw-r--r-- | OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | 59 |
1 files changed, 55 insertions, 4 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index b28a4a6..b2291bc 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | |||
@@ -269,6 +269,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
269 | 269 | ||
270 | private RequestObjectPropertiesFamily handlerObjectGroupRequest = null; | 270 | private RequestObjectPropertiesFamily handlerObjectGroupRequest = null; |
271 | private ScriptReset handlerScriptReset = null; | 271 | private ScriptReset handlerScriptReset = null; |
272 | private UpdateVector handlerAutoPilotGo = null; | ||
272 | 273 | ||
273 | /* Properties */ | 274 | /* Properties */ |
274 | 275 | ||
@@ -900,6 +901,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
900 | public event EstateDebugRegionRequest OnEstateDebugRegionRequest; | 901 | public event EstateDebugRegionRequest OnEstateDebugRegionRequest; |
901 | public event EstateTeleportOneUserHomeRequest OnEstateTeleportOneUserHomeRequest; | 902 | public event EstateTeleportOneUserHomeRequest OnEstateTeleportOneUserHomeRequest; |
902 | public event ScriptReset OnScriptReset; | 903 | public event ScriptReset OnScriptReset; |
904 | public event UpdateVector OnAutoPilotGo; | ||
903 | 905 | ||
904 | #region Scene/Avatar to Client | 906 | #region Scene/Avatar to Client |
905 | 907 | ||
@@ -1125,7 +1127,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
1125 | 1127 | ||
1126 | patches[0] = patchx + 0 + patchy * 16; | 1128 | patches[0] = patchx + 0 + patchy * 16; |
1127 | 1129 | ||
1128 | Packet layerpack = LLClientView.TerrainManager.CreateLandPacket(map, patches); | 1130 | LayerDataPacket layerpack = LLClientView.TerrainManager.CreateLandPacket(map, patches); |
1129 | layerpack.Header.Zerocoded = true; | 1131 | layerpack.Header.Zerocoded = true; |
1130 | OutPacket(layerpack, ThrottleOutPacketType.Land); | 1132 | OutPacket(layerpack, ThrottleOutPacketType.Land); |
1131 | } | 1133 | } |
@@ -3966,7 +3968,50 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
3966 | get { return m_packetProcessingEnabled; } | 3968 | get { return m_packetProcessingEnabled; } |
3967 | set { m_packetProcessingEnabled = value; } | 3969 | set { m_packetProcessingEnabled = value; } |
3968 | } | 3970 | } |
3971 | public void DecipherGenericMessage(string gmMethod, LLUUID gmInvoice, GenericMessagePacket.ParamListBlock[] gmParams) | ||
3972 | { | ||
3973 | switch (gmMethod) | ||
3974 | { | ||
3975 | case "autopilot": | ||
3976 | float locx = 0f; | ||
3977 | float locy = 0f; | ||
3978 | float locz = 0f; | ||
3979 | uint regionX = 0; | ||
3980 | uint regionY = 0; | ||
3981 | try | ||
3982 | |||
3983 | { | ||
3984 | Helpers.LongToUInts(Scene.RegionInfo.RegionHandle,out regionX, out regionY); | ||
3985 | locx = Convert.ToSingle(Helpers.FieldToUTF8String(gmParams[0].Parameter)) - (float)regionX; | ||
3986 | locy = Convert.ToSingle(Helpers.FieldToUTF8String(gmParams[1].Parameter)) - (float)regionY; | ||
3987 | locz = Convert.ToSingle(Helpers.FieldToUTF8String(gmParams[2].Parameter)); | ||
3988 | } | ||
3989 | catch (InvalidCastException) | ||
3990 | { | ||
3991 | m_log.Error("[CLIENT]: Invalid autopilot request"); | ||
3992 | return; | ||
3993 | } | ||
3994 | |||
3995 | handlerAutoPilotGo = OnAutoPilotGo; | ||
3996 | if (handlerAutoPilotGo != null) | ||
3997 | { | ||
3998 | handlerAutoPilotGo(0, new LLVector3(locx, locy, locz), this); | ||
3999 | } | ||
4000 | m_log.InfoFormat("[CLIENT]: Client Requests autopilot to position <{0},{1},{2}>", locx, locy, locz); | ||
3969 | 4001 | ||
4002 | |||
4003 | break; | ||
4004 | default: | ||
4005 | m_log.Debug("[CLIENT]: Unknown Generic Message, Method: " + gmMethod + ". Invoice: " + gmInvoice.ToString() + ". Dumping Params:"); | ||
4006 | for (int hi = 0; hi < gmParams.Length; hi++) | ||
4007 | { | ||
4008 | System.Console.WriteLine(gmParams[hi].ToString()); | ||
4009 | } | ||
4010 | //gmpack.MethodData. | ||
4011 | break; | ||
4012 | |||
4013 | } | ||
4014 | } | ||
3970 | protected void ProcessInPacket(Packet Pack) | 4015 | protected void ProcessInPacket(Packet Pack) |
3971 | { | 4016 | { |
3972 | ack_pack(Pack); | 4017 | ack_pack(Pack); |
@@ -3998,6 +4043,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
3998 | { | 4043 | { |
3999 | #region Scene/Avatar | 4044 | #region Scene/Avatar |
4000 | 4045 | ||
4046 | case PacketType.GenericMessage: | ||
4047 | GenericMessagePacket gmpack = (GenericMessagePacket)Pack; | ||
4048 | |||
4049 | DecipherGenericMessage(Helpers.FieldToUTF8String(gmpack.MethodData.Method),gmpack.MethodData.Invoice,gmpack.ParamList); | ||
4050 | |||
4051 | break; | ||
4001 | case PacketType.AvatarPropertiesRequest: | 4052 | case PacketType.AvatarPropertiesRequest: |
4002 | AvatarPropertiesRequestPacket avatarProperties = (AvatarPropertiesRequestPacket)Pack; | 4053 | AvatarPropertiesRequestPacket avatarProperties = (AvatarPropertiesRequestPacket)Pack; |
4003 | 4054 | ||
@@ -5933,10 +5984,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
5933 | // TODO: handle this packet | 5984 | // TODO: handle this packet |
5934 | m_log.Warn("[CLIENT]: unhandled CreateGroupRequest packet"); | 5985 | m_log.Warn("[CLIENT]: unhandled CreateGroupRequest packet"); |
5935 | break; | 5986 | break; |
5936 | case PacketType.GenericMessage: | 5987 | //case PacketType.GenericMessage: |
5937 | // TODO: handle this packet | 5988 | // TODO: handle this packet |
5938 | m_log.Warn("[CLIENT]: unhandled GenericMessage packet"); | 5989 | //m_log.Warn("[CLIENT]: unhandled GenericMessage packet"); |
5939 | break; | 5990 | //break; |
5940 | case PacketType.MapItemRequest: | 5991 | case PacketType.MapItemRequest: |
5941 | // TODO: handle this packet | 5992 | // TODO: handle this packet |
5942 | m_log.Warn("[CLIENT]: unhandled MapItemRequest packet"); | 5993 | m_log.Warn("[CLIENT]: unhandled MapItemRequest packet"); |