1. I'm just wondering if there is any way to get all player sessions and send a pop up to all of them.
     
  2. Wulf

    Wulf Community Admin

    Look at the GetSessions method in Hurtworld's Assembly-CSharp.dll.
     
  3. Code:
    foreach (var i in GameManager.Instance.GetSessions()) {
        //session - i.Value
        //send message
    }
     
  4. Why not just use GameManager.Instance.GetSessions().Values?
     
  5. Just i take this code from my plugin, where i use values and keys.
    TS can use GameManager.Instance.GetSessions().Values, yeah.
     
  6. Like this? (stolen from Adverts)
    Code:
    hurt.BroadcastChat( "Message everyone online gets!" );
     
  7. nah, I mean using a popup, like a notification:
    AlertManager.Instance.GenericTextNotificationServer("message",sessions);
     
  8. Just not providing a second argument to GenericTextNotificationServer will send it to all currently connected sessions.
     
  9. What about:
    (JS)
    Code:
    getInstance: function(variable) {
        return global.Singleton(variable).Instance;
    },var gm = this.getInstance(global.GameManager);
    var playerso = gm.getSessions().GetEnumerator();while(playerso.MoveNext()) {
        var player = playerso.Current.Value;
      
        this.getInstance(global.AlertManager).GenericTextNotificationServer('Message', player.Player);
    }
    EDIT:
    Code:
    this.getInstance(global.AlertManager).GenericTextNotificationServer('Message');
    Will send notification to all players like I guess.
     
    Last edited by a moderator: Mar 2, 2016
  10. Thats what cowtrix said.