Пример #1
0
        /// <summary>
        /// This sends the needed packet out to change lvz.
        /// This should be sent after you ave finished modifying the display.
        /// Example: Update Points, Update Currency, etc ... Then Refresh Display.
        /// </summary>
        /// <param name="ssp"></param>
        /// <param name="q"></param>
        public void RefreshDisplay_Priv(SSPlayer ssp)
        {
            // List of lvz to update
            Dictionary <ushort, bool> updateList = new Dictionary <ushort, bool>();

            // Itirate through entire list
            foreach (ushort id in ssp.Display.Keys)
            {
                // Check if lvz needs updating
                if (ssp.Display[id] != ssp.Display_Old[id])
                {
                    // add update to list
                    updateList.Add(id, ssp.Display[id]);
                    // update the users old display
                    ssp.Display_Old[id] = !ssp.Display_Old[id];
                }
            }

            // Pack the event into q
            if (updateList.Count > 0)
            {
                LVZToggleEvent update = new LVZToggleEvent();
                update.TargetPlayerId = ssp.PlayerId;
                update.LVZObjects     = updateList;
                psyGame.Send(update);
            }
        }
Пример #2
0
        //----------------------------------------------------------------------//
        //                         Misc                                         //
        //----------------------------------------------------------------------//
        private void sendUpdate(ushort PlayerId, Dictionary <ushort, bool> updateList)
        {
            if (!(updateList.Count > 0))
            {
                return;
            }
            // Pack it up and send it out
            LVZToggleEvent update = new LVZToggleEvent();

            update.TargetPlayerId = PlayerId;
            update.LVZObjects     = updateList;
            psyGame.Send(update);
            //consoleShowUpdate(PlayerId, updateList);
        }