public void ClientInPacket(uint circuitCode, Packet packet) { if (this.ClientThreads.ContainsKey(circuitCode)) { ClientThreads[circuitCode].InPacket(packet); } }
public override void ClientInPacket(uint circuitCode, Packet packet) { if (this.SweeperClientThreads.ContainsKey(circuitCode)) { SweeperClientThreads[circuitCode].InPacket(packet); } }
public bool RequestUUIDName(SimClient simClient, Packet packet) { System.Text.Encoding enc = System.Text.Encoding.ASCII; Console.WriteLine(packet.ToString()); UUIDNameRequestPacket nameRequest = (UUIDNameRequestPacket)packet; UUIDNameReplyPacket nameReply = new UUIDNameReplyPacket(); nameReply.UUIDNameBlock = new UUIDNameReplyPacket.UUIDNameBlockBlock[nameRequest.UUIDNameBlock.Length]; for (int i = 0; i < nameRequest.UUIDNameBlock.Length; i++) { nameReply.UUIDNameBlock[i] = new UUIDNameReplyPacket.UUIDNameBlockBlock(); nameReply.UUIDNameBlock[i].ID = nameRequest.UUIDNameBlock[i].ID; nameReply.UUIDNameBlock[i].FirstName = enc.GetBytes("Who\0"); //for now send any name nameReply.UUIDNameBlock[i].LastName = enc.GetBytes("Knows\0"); //in future need to look it up } simClient.OutPacket(nameReply); return true; }
public static object SerializeToLLSD(Packet packet) { Dictionary<string, object> body = new Dictionary<string, object>(); Type type = packet.GetType(); foreach (FieldInfo field in type.GetFields()) { if (field.IsPublic) { Type blockType = field.FieldType; if (blockType.IsArray) { object blockArray = field.GetValue(packet); Array array = (Array)blockArray; List<object> blockList = new List<object>(array.Length); IEnumerator ie = array.GetEnumerator(); while (ie.MoveNext()) { object block = ie.Current; blockList.Add(BuildLLSDBlock(block)); } body[field.Name] = blockList; } else { object block = field.GetValue(packet); body[field.Name] = BuildLLSDBlock(block); } } } return body; }
public static string SerializeToBinary(Packet packet) { throw new NotImplementedException("Need to finish BinaryLLSD first"); }
public static string SerializeToXml(Packet packet) { return LLSDParser.SerializeXmlString(SerializeToLLSD(packet)); }
public void SendPacketToAllExcept(Packet packet, SimClient simClient) { }
public void SendPacketToAllClients(Packet packet) { }
public static byte[] ToBinary(Packet packet) { return LLSDParser.SerializeBinary(ToLLSD(packet)); }
public void SendPacketToViewer(Packet packet) { this.ControllingClient.OutPacket(packet); }
public static byte[] ToBinary(Packet packet) { throw new NotImplementedException("Need to finish BinaryLLSD first"); }