diff options
author | gareth | 2007-03-04 03:36:08 +0000 |
---|---|---|
committer | gareth | 2007-03-04 03:36:08 +0000 |
commit | c3d40feeb604bb19abd419eea381bd7f2df9bac1 (patch) | |
tree | 07681b8b4557af2c8b5502885575b9a363e94387 | |
parent | Fixed up bugs from patch in PREV: (diff) | |
download | opensim-SC-c3d40feeb604bb19abd419eea381bd7f2df9bac1.zip opensim-SC-c3d40feeb604bb19abd419eea381bd7f2df9bac1.tar.gz opensim-SC-c3d40feeb604bb19abd419eea381bd7f2df9bac1.tar.bz2 opensim-SC-c3d40feeb604bb19abd419eea381bd7f2df9bac1.tar.xz |
Implemented chat
Fixed "sticky borders" bug (avatar can hit side of sim and move away)
-rw-r--r-- | src/OpenSimClient.cs | 23 | ||||
-rw-r--r-- | src/world/PhysicsEngine.cs | 8 |
2 files changed, 26 insertions, 5 deletions
diff --git a/src/OpenSimClient.cs b/src/OpenSimClient.cs index 696031d..2e8dbb5 100644 --- a/src/OpenSimClient.cs +++ b/src/OpenSimClient.cs | |||
@@ -169,7 +169,28 @@ namespace OpenSim | |||
169 | case PacketType.AgentUpdate: | 169 | case PacketType.AgentUpdate: |
170 | ClientAvatar.HandleAgentUpdate((AgentUpdatePacket)Pack); | 170 | ClientAvatar.HandleAgentUpdate((AgentUpdatePacket)Pack); |
171 | break; | 171 | break; |
172 | } | 172 | case PacketType.ChatFromViewer: |
173 | ChatFromViewerPacket inchatpack = (ChatFromViewerPacket)Pack; | ||
174 | if(Helpers.FieldToString(inchatpack.ChatData.Message)=="") break; | ||
175 | |||
176 | System.Text.Encoding _enc = System.Text.Encoding.ASCII; | ||
177 | libsecondlife.Packets.ChatFromSimulatorPacket reply = new ChatFromSimulatorPacket(); | ||
178 | reply.ChatData.Audible = 1; | ||
179 | reply.ChatData.Message = inchatpack.ChatData.Message; | ||
180 | reply.ChatData.ChatType = 1; | ||
181 | reply.ChatData.SourceType = 1; | ||
182 | reply.ChatData.Position = this.ClientAvatar.position; | ||
183 | reply.ChatData.FromName = _enc.GetBytes(this.ClientAvatar.firstname + " " + this.ClientAvatar.lastname + "\0"); | ||
184 | reply.ChatData.OwnerID = this.AgentID; | ||
185 | reply.ChatData.SourceID = this.AgentID; | ||
186 | |||
187 | |||
188 | |||
189 | foreach(OpenSimClient client in OpenSim_Main.sim.ClientThreads.Values) { | ||
190 | client.OutPacket(reply); | ||
191 | } | ||
192 | break; | ||
193 | } | ||
173 | } | 194 | } |
174 | 195 | ||
175 | private void ResendUnacked() | 196 | private void ResendUnacked() |
diff --git a/src/world/PhysicsEngine.cs b/src/world/PhysicsEngine.cs index d9351af..4abf1f2 100644 --- a/src/world/PhysicsEngine.cs +++ b/src/world/PhysicsEngine.cs | |||
@@ -20,12 +20,12 @@ namespace OpenSim.world | |||
20 | public void DoStuff(World simworld) { | 20 | public void DoStuff(World simworld) { |
21 | foreach (libsecondlife.LLUUID UUID in simworld.Entities.Keys) | 21 | foreach (libsecondlife.LLUUID UUID in simworld.Entities.Keys) |
22 | { | 22 | { |
23 | if((simworld.Entities[UUID].position.X>0) & (simworld.Entities[UUID].position.X<256) & (simworld.Entities[UUID].position.Y>1) & (simworld.Entities[UUID].position.Y<256)) { | ||
24 | simworld.Entities[UUID].position += simworld.Entities[UUID].velocity; | 23 | simworld.Entities[UUID].position += simworld.Entities[UUID].velocity; |
25 | simworld.Entities[UUID].position.Z = simworld.LandMap[(int)simworld.Entities[UUID].position.Y * 256 + (int)simworld.Entities[UUID].position.X]+1; | 24 | simworld.Entities[UUID].position.Z = simworld.LandMap[(int)simworld.Entities[UUID].position.Y * 256 + (int)simworld.Entities[UUID].position.X]+1; |
26 | } else { | 25 | if(simworld.Entities[UUID].position.X<0) simworld.Entities[UUID].position.X=0; |
27 | simworld.Entities[UUID].velocity = new LLVector3(0f,0f,0f); | 26 | if(simworld.Entities[UUID].position.Y<0) simworld.Entities[UUID].position.Y=0; |
28 | } | 27 | if(simworld.Entities[UUID].position.X>255) simworld.Entities[UUID].position.X=255; |
28 | if(simworld.Entities[UUID].position.Y>255) simworld.Entities[UUID].position.Y=255; | ||
29 | } | 29 | } |
30 | } | 30 | } |
31 | } | 31 | } |