public int CurrentEventCount()
    {
        NrMyCharInfo kMyCharInfo = NrTSingleton <NkCharManager> .Instance.m_kMyCharInfo;

        if (kMyCharInfo == null)
        {
            return(0);
        }
        int level = kMyCharInfo.GetLevel();
        int num   = 0;

        for (int i = 0; i < 7; i++)
        {
            EVENT_INFO eventInfo = NrTSingleton <NrTable_BurnningEvent_Manager> .Instance.GetEventInfo(i);

            if (eventInfo != null)
            {
                if (eventInfo.m_nEventType != 0)
                {
                    if (NrTSingleton <ContentsLimitManager> .Instance.IsChallenge() || eventInfo.m_nEventType != 36)
                    {
                        BUNNING_EVENT_INFO value = NrTSingleton <NrTable_BurnningEvent_Manager> .Instance.GetValue((eBUNNING_EVENT)eventInfo.m_nEventType);

                        if (value != null)
                        {
                            if (level <= value.m_nLimitLevel)
                            {
                                num++;
                            }
                        }
                    }
                }
            }
        }
        if (this.SetBasicData())
        {
            num++;
        }
        int num2 = (int)kMyCharInfo.GetCharDetail(5);

        if (0 < num2 && NrTSingleton <NkQuestManager> .Instance.IsCompletedQuestGroup(num2))
        {
            num++;
        }
        int num3 = 0;

        for (int j = 0; j < 7; j++)
        {
            if (this.m_EventInfo[j].m_nEventType > 0)
            {
                num3++;
                if (this.m_EventInfo[j].m_nEventType == 1 || this.m_EventInfo[j].m_nEventType == 14 || this.m_EventInfo[j].m_nEventType == 18)
                {
                    num3--;
                }
            }
        }
        return(num3 - num);
    }
    public int GetLimitCount(eBUNNING_EVENT eBurnningEvent)
    {
        int result = -1;

        if (eBurnningEvent <= eBUNNING_EVENT.eBUNNING_EVENT_NONE || eBurnningEvent >= eBUNNING_EVENT.eBUNNING_EVENT_MAX)
        {
            return(result);
        }
        SUBDATA_UNION sUBDATA_UNION = default(SUBDATA_UNION);
        NrMyCharInfo  kMyCharInfo   = NrTSingleton <NkCharManager> .Instance.m_kMyCharInfo;

        sUBDATA_UNION.nSubData = kMyCharInfo.GetCharDetail(15);
        EVENT_INFO eventInfoFromType = this.GetEventInfoFromType((int)eBurnningEvent);

        if (eventInfoFromType == null)
        {
            return(result);
        }
        int nMaxLimitCount = eventInfoFromType.m_nMaxLimitCount;
        int num            = nMaxLimitCount * 2;

        if (eBurnningEvent != eBUNNING_EVENT.eBUNNING_EVENT_BABELPARTY)
        {
            if (eBurnningEvent == eBUNNING_EVENT.eBUNNING_EVENT_COLOSSEUM)
            {
                int num2 = (int)sUBDATA_UNION.n8SubData_1;
                result = (num - num2 + 1) / 2;
            }
        }
        else
        {
            int num2 = (int)sUBDATA_UNION.n8SubData_0;
            result = (num - num2 + 1) / 2;
        }
        return(result);
    }
Beispiel #3
0
    public void SetSelectInfoItem(int nEventType, bool bCurrentEvent)
    {
        string text = string.Empty;

        if (bCurrentEvent)
        {
            EVENT_INFO eventInfoFromType = NrTSingleton <NrTable_BurnningEvent_Manager> .Instance.GetEventInfoFromType(nEventType);

            if (eventInfoFromType == null)
            {
                return;
            }
            BUNNING_EVENT_INFO value = NrTSingleton <NrTable_BurnningEvent_Manager> .Instance.GetValue((eBUNNING_EVENT)nEventType);

            if (value == null)
            {
                return;
            }
            int num = eventInfoFromType.m_nStartTime + eventInfoFromType.m_nEndDurationTime / 60;
            if (num >= 0 && num > 24)
            {
                num -= 24;
            }
            string text2 = this.EventWeek((int)eventInfoFromType.m_nEventInfoWeek);
            if (nEventType == 15)
            {
                text = NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("2550");
            }
            else if (nEventType == 16)
            {
                text = NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("2560");
            }
            else if (nEventType == 17)
            {
                text = NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("2561");
            }
            else if (value.m_nYear > 0)
            {
                NrTSingleton <CTextParser> .Instance.ReplaceParam(ref text, new object[]
                {
                    NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("2307"),
                    "month",
                    value.m_nMonth.ToString(),
                    "day",
                    value.m_nDay.ToString(),
                    "starttime",
                    eventInfoFromType.m_nStartTime.ToString(),
                    "endmonth",
                    value.m_nEndMonth.ToString(),
                    "endday",
                    value.m_nEndDay.ToString(),
                    "endtime",
                    num.ToString()
                });
            }
            else if (eventInfoFromType.m_nEventType == 4)
            {
                text2 = this.EventWeek(-1);
                NrTSingleton <CTextParser> .Instance.ReplaceParam(ref text, new object[]
                {
                    NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("1794"),
                    "day",
                    text2,
                    "starttime",
                    eventInfoFromType.m_nStartTime.ToString(),
                    "endtime",
                    num.ToString()
                });
            }
            else if (eventInfoFromType.m_nEventType == 19 || eventInfoFromType.m_nEventType == 20 || eventInfoFromType.m_nEventType == 21 || eventInfoFromType.m_nEventType == 22 || eventInfoFromType.m_nEventType == 23 || eventInfoFromType.m_nEventType == 24)
            {
                string textFromInterface = NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("2543");

                NrTSingleton <CTextParser> .Instance.ReplaceParam(ref text, new object[]
                {
                    NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("1794"),
                    "day",
                    textFromInterface,
                    "starttime",
                    eventInfoFromType.m_nStartTime.ToString(),
                    "endtime",
                    num.ToString()
                });
            }
            else
            {
                NrTSingleton <CTextParser> .Instance.ReplaceParam(ref text, new object[]
                {
                    NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("1794"),
                    "day",
                    text2,
                    "starttime",
                    eventInfoFromType.m_nStartTime.ToString(),
                    "endtime",
                    num.ToString()
                });
            }
            this.m_lbTitle.SetText(NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface(eventInfoFromType.m_nTitleText.ToString()));
            this.m_lbEventDetail.SetText(NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface(eventInfoFromType.m_nExplain.ToString()));
        }
        else
        {
            BUNNING_EVENT_REFLASH_INFO bUNNING_EVENT_REFLASH_INFO = NrTSingleton <NrTable_BurnningEvent_Manager> .Instance.Get_Value((eBUNNING_EVENT)nEventType);

            if (bUNNING_EVENT_REFLASH_INFO == null)
            {
                return;
            }
            BUNNING_EVENT_INFO value = NrTSingleton <NrTable_BurnningEvent_Manager> .Instance.GetValue((eBUNNING_EVENT)nEventType);

            if (value == null)
            {
                return;
            }
            int num2 = bUNNING_EVENT_REFLASH_INFO.m_nStartTime + bUNNING_EVENT_REFLASH_INFO.m_nEndTime / 60;
            if (num2 >= 0 && num2 > 24)
            {
                num2 -= 24;
            }
            string text3 = this.EventWeek((int)value.m_nWeek);
            if (nEventType == 15)
            {
                text = NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("2550");
            }
            else if (nEventType == 16)
            {
                text = NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("2560");
            }
            else if (nEventType == 17)
            {
                text = NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("2561");
            }
            else if (value.m_nYear > 0)
            {
                NrTSingleton <CTextParser> .Instance.ReplaceParam(ref text3, new object[]
                {
                    NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("2307"),
                    "month",
                    value.m_nMonth.ToString(),
                    "day",
                    value.m_nDay.ToString(),
                    "starttime",
                    bUNNING_EVENT_REFLASH_INFO.m_nStartTime.ToString(),
                    "endmonth",
                    value.m_nEndMonth.ToString(),
                    "endday",
                    value.m_nEndDay.ToString(),
                    "endtime",
                    num2.ToString()
                });

                NrTSingleton <CTextParser> .Instance.ReplaceParam(ref text, new object[]
                {
                    NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("1794"),
                    "day",
                    text3,
                    "starttime",
                    bUNNING_EVENT_REFLASH_INFO.m_nStartTime.ToString(),
                    "endtime",
                    num2.ToString()
                });
            }
            else if (bUNNING_EVENT_REFLASH_INFO.m_eEventType == eBUNNING_EVENT.eBUNNING_EVENT_BUFFDAMAGE)
            {
                text3 = this.EventWeek(-1);
                NrTSingleton <CTextParser> .Instance.ReplaceParam(ref text, new object[]
                {
                    NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("1794"),
                    "day",
                    text3,
                    "starttime",
                    bUNNING_EVENT_REFLASH_INFO.m_nStartTime.ToString(),
                    "endtime",
                    num2.ToString()
                });
            }
            else if (bUNNING_EVENT_REFLASH_INFO.m_eEventType == eBUNNING_EVENT.eBUNNING_EVENT_GMBUFF1 || bUNNING_EVENT_REFLASH_INFO.m_eEventType == eBUNNING_EVENT.eBUNNING_EVENT_GMBUFF2 || bUNNING_EVENT_REFLASH_INFO.m_eEventType == eBUNNING_EVENT.eBUNNING_EVENT_GMBUFF3 || bUNNING_EVENT_REFLASH_INFO.m_eEventType == eBUNNING_EVENT.eBUNNING_EVENT_GMBUFF4 || bUNNING_EVENT_REFLASH_INFO.m_eEventType == eBUNNING_EVENT.eBUNNING_EVENT_GMBUFF5 || bUNNING_EVENT_REFLASH_INFO.m_eEventType == eBUNNING_EVENT.eBUNNING_EVENT_GMBUFF6)
            {
                string textFromInterface2 = NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("2543");

                NrTSingleton <CTextParser> .Instance.ReplaceParam(ref text, new object[]
                {
                    NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("1794"),
                    "day",
                    textFromInterface2,
                    "starttime",
                    bUNNING_EVENT_REFLASH_INFO.m_nStartTime.ToString(),
                    "endtime",
                    num2.ToString()
                });
            }
            else
            {
                NrTSingleton <CTextParser> .Instance.ReplaceParam(ref text, new object[]
                {
                    NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("1794"),
                    "day",
                    text3,
                    "starttime",
                    bUNNING_EVENT_REFLASH_INFO.m_nStartTime.ToString(),
                    "endtime",
                    num2.ToString()
                });
            }
            this.m_lbTitle.SetText(NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface(bUNNING_EVENT_REFLASH_INFO.m_nTitleText.ToString()));
            this.m_lbEventDetail.SetText(NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface(bUNNING_EVENT_REFLASH_INFO.m_nExplain.ToString()));
        }
        this.m_lbTime.SetText(text);
    }
Beispiel #4
0
        private bool setupReader()
        {
            if (reader.connect() == false)
            {
                tsslStatus.Text = "Cannot connect to reader";
                return(false);
            }

            //Disable all events
            System.Collections.ArrayList eventList;
            eventList = reader.listEvent();
            if (eventList != null)
            {
                foreach (EVENT_INFO e in eventList)
                {
                    reader.enableEvent(e.id, false);
                }
            }

            //Setup Operation Profile
            OPERATION_PROFILE profile = new OPERATION_PROFILE();

            profile.profile_id         = "Default Profile";
            profile.profile_enable     = true;
            profile.modulation_profile = settings.Text("CS461/Reader/ModulationProfile", "Profile0");
            profile.population         = settings.Int16("CS461/Reader/PopulationEstimation", 10);
            profile.session_no         = settings.Int16("CS461/Reader/Session", 1);
            profile.ant1_power         = settings.Text("CS461/Reader/Antennas/Ant1/Power", "30.00");
            profile.ant2_power         = settings.Text("CS461/Reader/Antennas/Ant2/Power", "30.00");
            profile.ant3_power         = settings.Text("CS461/Reader/Antennas/Ant3/Power", "30.00");
            profile.ant4_power         = settings.Text("CS461/Reader/Antennas/Ant4/Power", "30.00");
            profile.ant1_enable        = settings.Boolean("CS461/Reader/Antennas/Ant1/Enabled", false);
            profile.ant2_enable        = settings.Boolean("CS461/Reader/Antennas/Ant2/Enabled", false);
            profile.ant3_enable        = settings.Boolean("CS461/Reader/Antennas/Ant3/Enabled", false);
            profile.ant4_enable        = settings.Boolean("CS461/Reader/Antennas/Ant4/Enabled", false);
            profile.window_time        = settings.Int16("CS461/Reader/DuplicationElimination/Time", 1000);
            profile.trigger            = settings.Text("CS461/Reader/DuplicationElimination/Method", "Autonomous Time Trigger");
            profile.capture_mode       = "Time Window";
            profile.tagModel           = settings.Text("CS461/Reader/TagIC", "GenericTID32");
            profile.memoryBank         = settings.Text("CS461/Reader/AdditionalMemoryBank", "None");
            profile.antennaPortScheme  = settings.Text("CS461/Reader/DuplicationElimination/AntennaPortScheme", "true");

            if (reader.setOperProfile_TxPowers(profile) == false)
            {
                tsslStatus.Text = "Fail to set operation profile";
                return(false);
            }

            //Setup Trusted Server
            SERVER_INFO svr = new SERVER_INFO();

            svr.id          = "AccessControlDemoServer";
            svr.desc        = "Access Control Demo Server";
            svr.ip          = settings.Text("CS461/Application/LocalIP", "0.0.0.0");
            svr.server_port = settings.Text("CS461/Application/ServerPort", "9090");
            svr.mode        = "Listening Port on Server Side";
            svr.enable      = true;

            if (reader.setServerID(svr) == false)
            {
                if (reader.modServerID(svr) == false)
                {
                    tsslStatus.Text = "Fail to set trusted server";
                    return(false);
                }
            }

            //Setup Triggering Logic
            reader.delTriggeringLogic("AccessControlDemoLogic");

            TRIGGER_INFO trigger = new TRIGGER_INFO();

            trigger.id             = "AccessControlDemoLogic";
            trigger.desc           = "Access Control Demo";
            trigger.mode           = "Read Any Tags (any ID, 1 trigger per tag)"; //For firmware 2.1.0 or later
            trigger.capture_point  = "";
            trigger.capture_point += settings.Boolean("CS461/Reader/Antennas/Ant1/Enabled", false) ? "1" : "";
            trigger.capture_point += settings.Boolean("CS461/Reader/Antennas/Ant2/Enabled", false) ? "2" : "";
            trigger.capture_point += settings.Boolean("CS461/Reader/Antennas/Ant3/Enabled", false) ? "3" : "";
            trigger.capture_point += settings.Boolean("CS461/Reader/Antennas/Ant4/Enabled", false) ? "4" : "";

            if (reader.addTriggeringLogic(trigger) == false)
            {
                trigger.mode = "Read Any Tags";     //For firmware 2.0.9, 2.0.10
                if (reader.addTriggeringLogic(trigger) == false)
                {
                    tsslStatus.Text = "Fail to set triggering logic";
                    return(false);
                }
            }

            //Setup Resultant Action
            reader.delResultantAction("AccessControlDemoAction");

            RESULTANT_ACTION_INFO action1 = new RESULTANT_ACTION_INFO();

            action1.id   = "AccessControlDemoAction";
            action1.desc = "Access Control Demo";
            if (profile.trigger.Equals("Autonomous Time Trigger") == true)
            {
                action1.mode = "Instant Alert to Server";
            }
            else
            {
                action1.mode = "Batch Alert to Server";
            }
            action1.server_id = svr.id;
            action1.report_id = "Default Report";

            if (reader.addResultantAction(action1) == false)
            {
                tsslStatus.Text = "Fail to set resultant action";
                return(false);
            }

            //Setup Event
            reader.delEvent("AccessControlDemoEvent");

            EVENT_INFO eventInfo = new EVENT_INFO();

            eventInfo.id        = "AccessControlDemoEvent";
            eventInfo.desc      = "Access Control Demo";
            eventInfo.profile   = profile.profile_id;
            eventInfo.trigger   = trigger.id;
            eventInfo.action    = action1.id;
            eventInfo.log       = false;
            eventInfo.enable    = true;
            eventInfo.enabling  = "Always On";
            eventInfo.disabling = "Never Stop";

            if (reader.addEvent(eventInfo) == false)
            {
                tsslStatus.Text = "Fail to set event";
                return(false);
            }

            return(true);
        }