Beispiel #1
0
        public void OnQueryResults(IDataObjectInputStream data,
                                   SIF_Error error,
                                   IZone zone,
                                   IMessageInfo info)
        {
            SifMessageInfo smi = (SifMessageInfo)info;

            if (error != null)
            {
                Adk.Log.Warn("Received Error Response: " + error.SIF_Desc);
            }
            else
            {
                string debug =
                    string.Format
                        ("Received Response for {0} from zone: {1}. Packet {2} of {3}",
                        data.ObjectType, zone.ZoneId, smi.PacketNumber,
                        smi.MorePackets ? smi.PacketNumber + "+" : smi.PacketNumber + " (FINAL)");
                zone.Log.Info(debug);
                zone.ServerLog.Log
                    (LogLevel.INFO, debug, null, "1003", LogEntryCodes.CATEGORY_SUCCESS,
                    LogEntryCodes.CODE_SUCCESS, smi, null);
                bool logToconsole = fAgent.getChameleonProperty(zone, "logConsole", false);
                if (fAgent.getChameleonProperty(zone, "logResponses", true))
                {
                    Log
                        (fDir + Path.DirectorySeparatorChar + zone.ZoneId +
                        Path.DirectorySeparatorChar + "Responses\\" + data.ObjectType.Name + "\\" +
                        data.ObjectType.Name + DateTime.Now.ToFileTime().ToString() + ".xml", data,
                        smi, logToconsole);
                }
            }
        }