Ejemplo n.º 1
0
    public void OutputAll(Dictionary <string, IgniteEvent> eventDict)
    {
        foreach (String cKey in eventDict.Keys)
        {
            Debug.Log("eventDict : cKey = " + cKey);

            IgniteEvent _e = eventDict [cKey];

            IgniteLeaderBoard ILB = (IgniteLeaderBoard)_e.activity;

            string CurrentUserId = ILB.CurrentUserId;

            string debugLogEntry =
                "Ignite Event" + "\n" +
                "cKey = " + cKey + "\n" +
                "Id = " + _e.Id + "\n" +
                "EventId = " + _e.EventId + "\n" +
                "StartTime = " + _e.StartTime.ToLongDateString() + "\n" +
                "CurrentUserId = " + CurrentUserId + "\n";

            debugLogEntry += "\tLeader Board Entries" + "\n";
            debugLogEntry += "\tId" + "              " + "Rank" + "  " + "Score" + "   " + "Name" + "    " + "User" + "\n";

            List <LeaderData> LeaderList = ILB.Leaders;

            foreach (LeaderData eventObject in LeaderList)
            {
                string cUser = eventObject.IsCurrentUser.ToString();

                debugLogEntry += "\t" + eventObject.Id + " " + eventObject.Rank + " " + eventObject.Score + " " + eventObject.Name + " " + cUser + "\n";
            }

            Debug.Log(debugLogEntry);
        }
    }
Ejemplo n.º 2
0
    void EventDebugPrint(string title, IgniteEvent igniteEvent)
    {
        string label = title;

        ReduxGuiController.Instance.addLabelAndStringToWindow(label, "data");
        label = "Id";
        ReduxGuiController.Instance.addLabelAndStringToWindow(label, igniteEvent.Id);
        label = "Name";
        ReduxGuiController.Instance.addLabelAndStringToWindow(label, igniteEvent.Metadata.Name);
        label = "State";
        ReduxGuiController.Instance.addLabelAndStringToWindow(label, igniteEvent.State);
        label = "Score";
        ReduxGuiController.Instance.addLabelAndStringToWindow(label, igniteEvent.Score.ToString());

        //label = "StartTime";
        //ReduxGuiController.Instance.addLabelAndDateTimeToWindow (label, igniteEvent.StartTime);
        //label = "EndTime";
        //ReduxGuiController.Instance.addLabelAndDateTimeToWindow (label, igniteEvent.EndTime);

        //label = "Special Character";
        //ReduxGuiController.Instance.addLabelAndStringToWindow (label, igniteEvent.Metadata.SpecialCharacterId.ToString());

        //if (igniteEvent.ComingSoon == true) {
        //	label = "Starting In";
        //	ReduxGuiController.Instance.addLabelAndStringToWindow (label, igniteEvent.RemainingStartTimeShortString);

        //} else {
        //	label = "Ending In";
        //	ReduxGuiController.Instance.addLabelAndStringToWindow (label, igniteEvent.RemainingEndTimeLongString);
        //
        //}
    }
Ejemplo n.º 3
0
    void SampleEventDebugPrint(string title, IgniteEvent igniteEvent)
    {
        string label = title;

        ReduxGuiController.Instance.addLabelAndStringToWindow(label, "data");
        label = "Id";
        ReduxGuiController.Instance.addLabelAndStringToWindow(label, igniteEvent.Id);
        label = "Name";
        ReduxGuiController.Instance.addLabelAndStringToWindow(label, igniteEvent.Metadata.Name);
    }
Ejemplo n.º 4
0
    void onFuelSDKIgniteEvents(Dictionary <string, object> data)
    {
        FuelSDKCommon.Log(FuelSDKCommon.LogLevel.DEBUG, "FuelIgnite : onFuelSDKIgniteEvents");

        mIgniteEventsDictionary = new Dictionary <string, IgniteEvent> ();

        object eventsObject;
        bool   keyExists = data.TryGetValue("events", out eventsObject);

        if (eventsObject == null || keyExists == false)
        {
            FuelSDKCommon.Log(FuelSDKCommon.LogLevel.ERROR, "missing expected event list");
            return;
        }

        List <object> eventList = null;

        try{
            eventList = eventsObject as List <object>;

            if (eventList == null)
            {
                FuelSDKCommon.Log(FuelSDKCommon.LogLevel.ERROR, "invalid event list data type: " + eventsObject.GetType().Name);
                return;
            }
        }catch (Exception e) {
            FuelSDKCommon.Log(FuelSDKCommon.LogLevel.ERROR, "invalid event list data type: " + eventsObject.GetType().Name + " error message : " + e.Message);
            return;
        }



        foreach (object eventObj in eventList)
        {
            IgniteEvent igniteEvent = new IgniteEvent();
            igniteEvent.Create(eventObj as Dictionary <string, object>);

            mIgniteEventsDictionary [igniteEvent.Id] = igniteEvent;
        }

        mIgniteEventsRecieved = true;
    }
Ejemplo n.º 5
0
    private void FactorInSampleEvents()
    {
        Debug.Log("REDUX LOG - FactorInSampleEvents");

        for (int e = 0; e < mIgniteSampleEventList.Count; e++)
        {
            IgniteEvent igniteEvent = mIgniteEventsDictionary[mIgniteSampleEventList[e].Id];

            if (igniteEvent == null)
            {
                //sample event is not in list so add it
                IgniteEvent igniteSampleEvent = mIgniteSampleEventList[e];

                Debug.Log("REDUX LOG - igniteSampleEvent.EventLocked = true");
                igniteSampleEvent.EventLocked = true;
                mIgniteEventsDictionary.Add(igniteSampleEvent.Id, igniteSampleEvent);
                break;                //just add 1 sample event? yes for now
            }
        }
    }
Ejemplo n.º 6
0
    void onFuelSDKIgniteMission(Dictionary <string, object> data)
    {
        FuelSDKCommon.Log(FuelSDKCommon.LogLevel.DEBUG, "FuelIgnite : onFuelSDKIgniteMission");

        object missionObject;
        bool   keyExists = data.TryGetValue("mission", out missionObject);

        if (missionObject == null || keyExists == false)
        {
            FuelSDKCommon.Log(FuelSDKCommon.LogLevel.ERROR, "missing expected mission data");
            return;
        }

        Dictionary <string, object> missionDictionary = null;

        try{
            missionDictionary = missionObject as Dictionary <string, object>;

            if (missionDictionary == null)
            {
                FuelSDKCommon.Log(FuelSDKCommon.LogLevel.ERROR, "invalid mission data type: " + missionObject.GetType().Name);
                return;
            }
        }catch (Exception e) {
            FuelSDKCommon.Log(FuelSDKCommon.LogLevel.ERROR, "invalid mission data type: " + missionObject.GetType().Name + " error message : " + e.Message);
            return;
        }

        IgniteEvent igniteEvent = mIgniteEventsDictionary[missionDictionary["id"].ToString()];

        if (igniteEvent != null)
        {
            igniteEvent.LoadActivityData(missionDictionary);
        }
        else
        {
        }
    }