public static AdminInfoUpdateMessage SendFullUpdate(GameObject recipient, Dictionary <uint, AdminInfo> infoEntries)
    {
        var update = new AdminInfoUpdate();

        foreach (var e in infoEntries)
        {
            if (e.Value != null)
            {
                update.entries.Add(new AdminInfosEntry
                {
                    netId  = e.Key,
                    infos  = e.Value.StringInfo,
                    offset = e.Value.OffsetPosition
                });
            }
        }

        AdminInfoUpdateMessage msg =
            new AdminInfoUpdateMessage
        {
            JsonData   = JsonUtility.ToJson(update),
            FullUpdate = true
        };

        msg.SendTo(recipient);
        return(msg);
    }
Esempio n. 2
0
        public static void ClientFullUpdate(AdminInfoUpdate update)
        {
            Instance.ReturnAllPanelsToPool();

            foreach (var e in update.entries)
            {
                ClientAddEntry(e);
            }
        }