Esempio n. 1
0
        public static void Handle(Player account, byte[] buffer)
        {
            MsgRemoteMaintenance packet = buffer;

            packet.Success = true;
            switch (packet.Type)
            {
            case MsgRemoteMaintenanceType.StartBackup:
                //if (!YiCore.BackupInProgress)
                //    Db.Backup();
                //else
                //    packet.Success = false;
                break;

            case MsgRemoteMaintenanceType.OptimizeMemory:
                YiCore.CompactLoh();
                break;

            case MsgRemoteMaintenanceType.Shutdown:
                packet.Success = false;
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }
            account.SendRaw(packet);
        }
Esempio n. 2
0
        public static byte[] Create(MsgRemoteMaintenanceType type)
        {
            var packet = new MsgRemoteMaintenance {
                Size = 6, Id = 3, Type = type, Success = false
            };

            return(packet);
        }