I'm just wondering if there is any way to get all player sessions and send a pop up to all of them.
Getting all player sessions?
Discussion in 'Hurtworld Development' started by cogu 2, Feb 26, 2016.
-
Wulf Community Admin
Look at the GetSessions method in Hurtworld's Assembly-CSharp.dll.
-
Code:
foreach (var i in GameManager.Instance.GetSessions()) { //session - i.Value //send message }
-
-
TS can use GameManager.Instance.GetSessions().Values, yeah. -
Like this? (stolen from Adverts)
Code:hurt.BroadcastChat( "Message everyone online gets!" );
-
AlertManager.Instance.GenericTextNotificationServer("message",sessions); -
Just not providing a second argument to GenericTextNotificationServer will send it to all currently connected sessions.
-
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); }
Code:this.getInstance(global.AlertManager).GenericTextNotificationServer('Message');
Last edited by a moderator: Mar 2, 2016 -