Implemented chat
Fixed "sticky borders" bug (avatar can hit side of sim and move away)adam
parent
412d7e098c
commit
c3d40feeb6
|
@ -169,6 +169,27 @@ namespace OpenSim
|
||||||
case PacketType.AgentUpdate:
|
case PacketType.AgentUpdate:
|
||||||
ClientAvatar.HandleAgentUpdate((AgentUpdatePacket)Pack);
|
ClientAvatar.HandleAgentUpdate((AgentUpdatePacket)Pack);
|
||||||
break;
|
break;
|
||||||
|
case PacketType.ChatFromViewer:
|
||||||
|
ChatFromViewerPacket inchatpack = (ChatFromViewerPacket)Pack;
|
||||||
|
if(Helpers.FieldToString(inchatpack.ChatData.Message)=="") break;
|
||||||
|
|
||||||
|
System.Text.Encoding _enc = System.Text.Encoding.ASCII;
|
||||||
|
libsecondlife.Packets.ChatFromSimulatorPacket reply = new ChatFromSimulatorPacket();
|
||||||
|
reply.ChatData.Audible = 1;
|
||||||
|
reply.ChatData.Message = inchatpack.ChatData.Message;
|
||||||
|
reply.ChatData.ChatType = 1;
|
||||||
|
reply.ChatData.SourceType = 1;
|
||||||
|
reply.ChatData.Position = this.ClientAvatar.position;
|
||||||
|
reply.ChatData.FromName = _enc.GetBytes(this.ClientAvatar.firstname + " " + this.ClientAvatar.lastname + "\0");
|
||||||
|
reply.ChatData.OwnerID = this.AgentID;
|
||||||
|
reply.ChatData.SourceID = this.AgentID;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
foreach(OpenSimClient client in OpenSim_Main.sim.ClientThreads.Values) {
|
||||||
|
client.OutPacket(reply);
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -20,12 +20,12 @@ namespace OpenSim.world
|
||||||
public void DoStuff(World simworld) {
|
public void DoStuff(World simworld) {
|
||||||
foreach (libsecondlife.LLUUID UUID in simworld.Entities.Keys)
|
foreach (libsecondlife.LLUUID UUID in simworld.Entities.Keys)
|
||||||
{
|
{
|
||||||
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)) {
|
|
||||||
simworld.Entities[UUID].position += simworld.Entities[UUID].velocity;
|
simworld.Entities[UUID].position += simworld.Entities[UUID].velocity;
|
||||||
simworld.Entities[UUID].position.Z = simworld.LandMap[(int)simworld.Entities[UUID].position.Y * 256 + (int)simworld.Entities[UUID].position.X]+1;
|
simworld.Entities[UUID].position.Z = simworld.LandMap[(int)simworld.Entities[UUID].position.Y * 256 + (int)simworld.Entities[UUID].position.X]+1;
|
||||||
} else {
|
if(simworld.Entities[UUID].position.X<0) simworld.Entities[UUID].position.X=0;
|
||||||
simworld.Entities[UUID].velocity = new LLVector3(0f,0f,0f);
|
if(simworld.Entities[UUID].position.Y<0) simworld.Entities[UUID].position.Y=0;
|
||||||
}
|
if(simworld.Entities[UUID].position.X>255) simworld.Entities[UUID].position.X=255;
|
||||||
|
if(simworld.Entities[UUID].position.Y>255) simworld.Entities[UUID].position.Y=255;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue