public void SetClientInfo(ClientInfo info) { }
/// <summary> /// Modifies the UDP throttles /// </summary> /// <param name="info">New throttling values</param> public void SetClientInfo(ClientInfo info) { // TODO: Allowing throttles to be manually set from this function seems like a reasonable // idea. On the other hand, letting external code manipulate our ACK accounting is not // going to happen throw new NotImplementedException(); }
public void SetClientInfo(ClientInfo info) { throw new System.NotImplementedException(); }
/// <summary> /// Gets information about this client connection /// </summary> /// <returns>Information about the client connection</returns> public ClientInfo GetClientInfo() { // TODO: This data structure is wrong in so many ways. Locking and copying the entire lists // of pending and needed ACKs for every client every time some method wants information about // this connection is a recipe for poor performance ClientInfo info = new ClientInfo(); info.pendingAcks = new Dictionary<uint, uint>(); info.needAck = new Dictionary<uint, byte[]>(); info.resendThrottle = m_throttleCategories[(int)ThrottleOutPacketType.Resend].DripRate; info.landThrottle = m_throttleCategories[(int)ThrottleOutPacketType.Land].DripRate; info.windThrottle = m_throttleCategories[(int)ThrottleOutPacketType.Wind].DripRate; info.cloudThrottle = m_throttleCategories[(int)ThrottleOutPacketType.Cloud].DripRate; info.taskThrottle = m_throttleCategories[(int)ThrottleOutPacketType.State].DripRate + m_throttleCategories[(int)ThrottleOutPacketType.Task].DripRate; info.assetThrottle = m_throttleCategories[(int)ThrottleOutPacketType.Asset].DripRate; info.textureThrottle = m_throttleCategories[(int)ThrottleOutPacketType.Texture].DripRate; info.totalThrottle = info.resendThrottle + info.landThrottle + info.windThrottle + info.cloudThrottle + info.taskThrottle + info.assetThrottle + info.textureThrottle; return info; }
public void SetClientInfo(ClientInfo info) { m_PendingAcksMap = info.pendingAcks; m_PendingAcks = new List<uint>(m_PendingAcksMap.Keys); m_NeedAck = new Dictionary<uint, LLQueItem>(); Packet packet = null; int packetEnd = 0; byte[] zero = new byte[3000]; foreach (uint key in info.needAck.Keys) { byte[] buff = info.needAck[key]; packetEnd = buff.Length - 1; try { packet = PacketPool.Instance.GetPacket(buff, ref packetEnd, zero); } catch (Exception) { } LLQueItem item = new LLQueItem(); item.Packet = packet; item.Incoming = false; item.throttleType = 0; item.TickCount = Environment.TickCount; item.Identifier = 0; item.Resends = 0; item.Length = packet.Length; item.Sequence = packet.Header.Sequence; m_NeedAck.Add(key, item); } m_Sequence = info.sequence; m_PacketQueue.ResendThrottle.Throttle = info.resendThrottle; m_PacketQueue.LandThrottle.Throttle = info.landThrottle; m_PacketQueue.WindThrottle.Throttle = info.windThrottle; m_PacketQueue.CloudThrottle.Throttle = info.cloudThrottle; m_PacketQueue.TaskThrottle.Throttle = info.taskThrottle; m_PacketQueue.AssetThrottle.Throttle = info.assetThrottle; m_PacketQueue.TextureThrottle.Throttle = info.textureThrottle; m_PacketQueue.TotalThrottle.Throttle = info.totalThrottle; }
public ClientInfo GetClientInfo() { ClientInfo info = new ClientInfo(); info.pendingAcks = m_PendingAcksMap; info.needAck = new Dictionary<uint, byte[]>(); lock (m_NeedAck) { foreach (uint key in m_NeedAck.Keys) info.needAck.Add(key, m_NeedAck[key].Packet.ToBytes()); } LLQueItem[] queitems = m_PacketQueue.GetQueueArray(); for (int i = 0; i < queitems.Length; i++) { if (queitems[i].Incoming == false) info.out_packets.Add(queitems[i].Packet.ToBytes()); } info.sequence = m_Sequence; float multiplier = m_PacketQueue.ThrottleMultiplier; info.resendThrottle = (int) (m_PacketQueue.ResendThrottle.Throttle / multiplier); info.landThrottle = (int) (m_PacketQueue.LandThrottle.Throttle / multiplier); info.windThrottle = (int) (m_PacketQueue.WindThrottle.Throttle / multiplier); info.cloudThrottle = (int) (m_PacketQueue.CloudThrottle.Throttle / multiplier); info.taskThrottle = (int) (m_PacketQueue.TaskThrottle.Throttle / multiplier); info.assetThrottle = (int) (m_PacketQueue.AssetThrottle.Throttle / multiplier); info.textureThrottle = (int) (m_PacketQueue.TextureThrottle.Throttle / multiplier); info.totalThrottle = (int) (m_PacketQueue.TotalThrottle.Throttle / multiplier); return info; }
/// <summary> /// Gets information about this client connection /// </summary> /// <returns>Information about the client connection</returns> public ClientInfo GetClientInfo() { ///<mic> TokenBucket tb; tb = m_throttleClient.Parent; m_log.WarnFormat("[TOKENS] {3}: Actual={0},Request={1},TotalRequest={2}",tb.DripRate,tb.RequestedDripRate,tb.TotalDripRequest,"ROOT"); tb = m_throttleClient; m_log.WarnFormat("[TOKENS] {3}: Actual={0},Request={1},TotalRequest={2}",tb.DripRate,tb.RequestedDripRate,tb.TotalDripRequest," CLIENT"); tb = m_throttleCategory; m_log.WarnFormat("[TOKENS] {3}: Actual={0},Request={1},TotalRequest={2}",tb.DripRate,tb.RequestedDripRate,tb.TotalDripRequest," CATEGORY"); for (int i = 0; i < THROTTLE_CATEGORY_COUNT; i++) { tb = m_throttleCategories[i]; m_log.WarnFormat("[TOKENS] {4} <{0}:{1}>: Actual={2},Requested={3}",AgentID,i,tb.DripRate,tb.RequestedDripRate," BUCKET"); } ///</mic> // TODO: This data structure is wrong in so many ways. Locking and copying the entire lists // of pending and needed ACKs for every client every time some method wants information about // this connection is a recipe for poor performance ClientInfo info = new ClientInfo(); info.pendingAcks = new Dictionary<uint, uint>(); info.needAck = new Dictionary<uint, byte[]>(); info.resendThrottle = (int)m_throttleCategories[(int)ThrottleOutPacketType.Resend].DripRate; info.landThrottle = (int)m_throttleCategories[(int)ThrottleOutPacketType.Land].DripRate; info.windThrottle = (int)m_throttleCategories[(int)ThrottleOutPacketType.Wind].DripRate; info.cloudThrottle = (int)m_throttleCategories[(int)ThrottleOutPacketType.Cloud].DripRate; // info.taskThrottle = m_throttleCategories[(int)ThrottleOutPacketType.State].DripRate + m_throttleCategories[(int)ThrottleOutPacketType.Task].DripRate; info.taskThrottle = (int)m_throttleCategories[(int)ThrottleOutPacketType.Task].DripRate; info.assetThrottle = (int)m_throttleCategories[(int)ThrottleOutPacketType.Asset].DripRate; info.textureThrottle = (int)m_throttleCategories[(int)ThrottleOutPacketType.Texture].DripRate; info.totalThrottle = info.resendThrottle + info.landThrottle + info.windThrottle + info.cloudThrottle + info.taskThrottle + info.assetThrottle + info.textureThrottle; return info; }