Ejemplo n.º 1
0
    //////////////////////////////////////////////////////////////////////
    public bool PushPacketWithID(TrackerPacket packet)
    {
        try
        {
            CTracker tracker = ConfigMgr.inst().GetTrackerByID((int)packet.m_ID);
            if (tracker != null)
            {
                if (packet.IsValid())
                {
                    lock (m_Queue)
                        m_Queue.Enqueue(packet);

                    if (packet.IsFixed(true))
                    {
                        CurPosMgr.inst().AddPoint(packet);
                    }
                    LastPointMgr.inst().AddPoint(packet);
                }
                return(true);
            }
        }
        catch (Exception ex)
        {
            m_Logger.Push(LogLevel.ERROR, 0, "PushPacket:" + ex.ToString());
        }
        return(false);
    }
Ejemplo n.º 2
0
    static void Main(string[] args)
    {
        //TestEvents.inst();

        Configuration.inst();

        ConfigMgr.inst();


        CurPosMgr.inst();
        LastPointMgr.inst();

        if (args.Length == 0)
        {
            bool  tryCreateNewApp;
            Mutex _inst = new Mutex(true, "geolocserver_dkfbsdmkbf", out tryCreateNewApp);
            if (tryCreateNewApp)
            {
                Start();
            }
        }
        else
        {
            if (args[0] == "config")
            {
                Configuration.inst().SaveConfig();
            }
            else
            {
                long IMEI = 0;
                if (args.Length > 1)
                {
                    long.TryParse(args[1], out IMEI);
                }
                Log2DB(args[0], IMEI);
            }
        }

        Global.m_Logger.FlushData();
    }