/// <summary> /// Send full update to an admin client /// </summary> public static AdminChatNotifications Send(NetworkConnection adminConn, AdminChatNotificationFullUpdate update) { AdminChatNotifications msg = new AdminChatNotifications { IsFullUpdate = true, FullUpdateJson = JsonUtility.ToJson(update) }; msg.SendTo(adminConn); return(msg); }
/// <summary> /// Use for initialization of admin chat notifications when the admin logs in /// </summary> /// <param name="adminConn"></param> public void ServerUpdateAdminNotifications(NetworkConnection adminConn) { var update = new AdminChatNotificationFullUpdate(); foreach (var n in adminNotification.notifications) { update.notificationEntries.Add(new AdminChatNotificationEntry { Amount = n.Value, Key = n.Key, TargetWindow = AdminChatWindow.AdminToAdminChat }); } foreach (var n in playerNotification.notifications) { if (PlayerList.Instance.GetByUserID(n.Key) == null || PlayerList.Instance.GetByUserID(n.Key).Connection == null) { continue; } update.notificationEntries.Add(new AdminChatNotificationEntry { Amount = n.Value, Key = n.Key, TargetWindow = AdminChatWindow.AdminPlayerChat }); } foreach (var n in prayerNotification.notifications) { if (PlayerList.Instance.GetByUserID(n.Key) == null || PlayerList.Instance.GetByUserID(n.Key).Connection == null) { continue; } update.notificationEntries.Add(new AdminChatNotificationEntry { Amount = n.Value, Key = n.Key, TargetWindow = AdminChatWindow.PrayerWindow }); } AdminChatNotifications.Send(adminConn, update); }