Example #1
0
        public bool Init()
        {
            Debug.Log("# Init Steam account info, polling for user stats and achievements");
            bool result;

            try
            {
                EventRegistry endgame   = EventRegistry.Endgame;
                object        completed = TfEvent.Endgame.Completed;
                if (SteamAccountInfo.< > f__mg$cache0 == null)
                {
                    SteamAccountInfo.< > f__mg$cache0 = new EventRegistry.SubscriberCallback(AccountInfo.SetStoryCompleted);
                }
                endgame.Subscribe(completed, SteamAccountInfo.< > f__mg$cache0);
                this._statReceivedCallback = Callback <UserStatsReceived_t> .Create(new Callback <UserStatsReceived_t> .DispatchDelegate(this.OnReceivedStats));

                result = SteamUserStats.RequestCurrentStats();
            }
            catch (Exception exception)
            {
                Debug.LogException(exception);
                result = false;
            }
            return(result);
        }
Example #2
0
 public void Subscribe(object eventType, EventRegistry.SubscriberCallback newSubscriber)
 {
     EventRegistry.EventSubscription eventSubscription;
     if (this._eventSubscriptions.ContainsKey(eventType))
     {
         eventSubscription = this._eventSubscriptions[eventType];
     }
     else
     {
         eventSubscription = new EventRegistry.EventSubscription();
         this._eventSubscriptions[eventType] = eventSubscription;
     }
     eventSubscription._callbacks.Add(newSubscriber);
 }
Example #3
0
 public void Unsubscribe(object eventType, EventRegistry.SubscriberCallback unsubscriber)
 {
     if (this._eventSubscriptions.ContainsKey(eventType))
     {
         EventRegistry.EventSubscription eventSubscription = this._eventSubscriptions[eventType];
         if (eventSubscription._publishingEventIndex > -1)
         {
             int num = eventSubscription._callbacks.IndexOf(unsubscriber);
             if (num < eventSubscription._publishingEventIndex)
             {
                 eventSubscription._publishingEventIndex--;
             }
         }
         eventSubscription._callbacks.Remove(unsubscriber);
     }
 }
Example #4
0
        public static void Init()
        {
            if (!GameSettings.InitDone)
            {
                GameSettings.InitDone = true;
                GameSettings.Survival = new SurvivalSettings();
                GameSettings.Animals  = new AnimalSettings();
                GameSettings.Ai       = new AiSettings();
            }
            EventRegistry game          = EventRegistry.Game;
            object        difficultySet = TfEvent.DifficultySet;

            if (GameSettings.< > f__mg$cache0 == null)
            {
                GameSettings.< > f__mg$cache0 = new EventRegistry.SubscriberCallback(GameSettings.OnDifficultySet);
            }
            game.Subscribe(difficultySet, GameSettings.< > f__mg$cache0);
        }