WorldSave modif.

Datum: 21/06/2012 15:01:10

Staženo: 465x

Popis:

do češtiny předěláno + oddělanéé cosi ..


Hodnocení: 4.2/10 (70 hlasy)

Download file:cs

Příkazy:

Kód:

using System;
using System.Timers;
using Phoenix.Communication.Packets;

namespace Phoenix.Plugins
{
    public class WorldSave
    {
        private DateTime lastSave = DateTime.MinValue;
        private Timer timer;
        private static DefaultPublicEvent worldSaving = new DefaultPublicEvent();

        public WorldSave()
        {
            WorldSaving += (s, e) => OnSave();
            timer = new Timer(TimeSpan.FromHours(2.5).TotalMilliseconds);
            timer.Elapsed += timer_Elapsed;
        }

        public static event EventHandler WorldSaving
        {
            add { worldSaving.AddHandler(value); }
            remove { worldSaving.RemoveHandler(value); }
        }

        [ServerMessageHandler(0x1C)]
        public CallbackResult OnAsciiSpeech(byte[] data, CallbackResult state)
        {
            AsciiSpeech speech = new AsciiSpeech(data);
            if (speech.Name != "System" || speech.Text != "World save has been initiated.")
                return CallbackResult.Normal;
            worldSaving.BeginInvoke(null, EventArgs.Empty);
            return CallbackResult.Eat;
        }

        private void timer_Elapsed(object sender, ElapsedEventArgs e)
        {
            UO.Print(0x0434, "Warning: World Save bude za 2 hodiny.n");
            timer.Stop();
            timer.Start();
        }

        private void OnSave()
        {
            bool firstSave = lastSave == DateTime.MinValue ? true : false;
            string str = firstSave ? "(Prvni od prihlaseni)" : "(Posledni pred {0})";
            UO.Print(0x0564, "!!!WORLD SAVE!!!n" + str, LongTime(DateTime.Now.Subtract(lastSave)));
            if (!firstSave)
                timer.Interval = DateTime.Now.Subtract(lastSave).Subtract(TimeSpan.FromMinutes(10)).TotalMilliseconds;
            lastSave = DateTime.Now;
            WaitForPing();
            UO.Print(0x0573,"World Save trval {0}.", ShortTime(DateTime.Now.Subtract(lastSave)));
        }

        private string LongTime(TimeSpan time)
        { return string.Format("{0}h {1}m {2}.{3:D3}s", time.Hours, time.Minutes, time.Seconds, time.Milliseconds); }

        private string ShortTime(TimeSpan time)
        { return string.Format(time.TotalMinutes > 1 ? "{0}m {1}.{2:D3}s" : "{1}.{2:D3}s", time.Minutes, time.Seconds, time.Milliseconds); }

        private void WaitForPing()
        {
            using (PingMessageWaiter waiter = new PingMessageWaiter())
            {
                Core.SendToServer(new byte[] { 0x73, 0x7F });
                waiter.Wait(1000 * 60 * 5);
            }
        }

        private class PingMessageWaiter : ServerMessageWaiter
        {
            public PingMessageWaiter() : base(0x73) { }
            protected override CallbackResult EventHandler(byte[] data, CallbackResult state)
            {
                if (data[1] != 0x7F)
                    return CallbackResult.Normal;
                waiter.Set();
                return CallbackResult.Eat;
            }
        }
    }
}
chenlixiang
10 Feb 2018

2018.2.11chenlixiang

rayban

nike air max 2017

ugg boots on sale

ugg outlet

adidas outlet store

nike huarache

fendi handbags

polo ralph

rolex watches

kobe bryant shoes

swarovski gioielli

converse all stars

flip flops

omega watches

burberry

bcbg max azria

oakley sunglasses

miu miu shoes

air max 95

free running

nike free

polo lacoste pas cher

ed hardy

brazil world cup jersey

montre homme

pandora uk

ugg outlet

coach outlet online

bijoux swarovski

germany world cup jersey

eyeglasses

michael kors

chloe handbags

longchamp handbags

adidas zx flux

nike blazer

polo ralph lauren

moncler

salomon boots

marc jacobs

michael kors uk

furla handbags

polo ralph lauren

replica watches

nike outlet

jordan 12

burberry outlet

oakley sunglasses

michael kors

ray ban sunglasses

nike air max

skechers sneakers

ugg boots

tods shoes

nike outlet store

burberry

cheap jerseys

mont blanc pens

lebron shoes

supra shoes

ferragamo

hilfiger outlet

nike free

giuseppe zanotti outlet

michael jordan

kate spade

boy london clothing

swarovski jewelry

christian louboutin

mercurial superfly

lebron james shoes

occhiali oakley

balenciaga sneakers

nike roshe

air max 90

karen millen

ray ban sunglasses

nike air max

asics running

replica watches

hilfiger uk

watches for men

rayban

true religion jeans

prada handbags

prada

jordan 1

nike vapor max

jordan

scarpe hogan

ghd hair straighteners

guess pas cher

michael jordan

jordans

converse

nike free

dansko outlet

timberland pas cher

roty burch handbags

adidas shoes

chrome hearts jewelry

fitflop sandals

adidas outlet store

ugg australia

michael kors handbags

montres

marc by marc jacobs

ralph lauren

rayban

puma shoes

jordans

ugg pas cher

michael kors outlet

nike mercurial

air max 2018

birkin bag

nike huarache

nike air max

ugg

nike factory outlet

louboutin pas cher

ralph lauren outlet

mizuno

parajumpers Outlet

air jordan

sac longchamp

nike air max 90

ray ban

true religion outlet

jordan 3

vans outlet

longchamp outlet

jordan 11

vans outlet

mac make up

nike uk

reebok outlet

religion jeans

bcbg

chi hair

polo ralph lauren

pandora bijoux

guess canada

michael kors canada

air force

adidas trainers uk

adidas running shoes

nike kyrie 2

cheap oakley sunglasses

timberland

canada goose

nike air max

ray ban pas cher

softball bats

cheap wedding dresses

bottega

nike roshe run

vans pas cher

michael kors

james shoes

adidas clothing

mac cosmetics

ralph lauren

yves saint laurent

kates pade outlet online

uggs outlet

moncler

nike free run

timberland boots

converse chuck taylor

cheap oakley sunglasses

canada goose outlet

iphone x case

burberry outlet

canada goose pas cher

thomas sabo uk

oakley uk

dolce gabbana

adidas outlet store

kate spade uk

england world cup jersey

dolce and gabbana

burberry sale

timberland shoes

christian louboutin

herve leger dresses

salvatore ferragamo

ray ban sunglasses

cheap jerseys

coach factory outlet

ray ban sunglasses

the north face

longchamp handbags

roshe run

spain world cup jersey

longchamp bags

moncler

free running

ralph lauren uk

michael kors

iphone 7 cases

canada goose

iphone cases

hogan shoes

michael jordan

moncler outlet

nike air max

nike air max

kobe 9 elite

ai max

ugg boots

nike store

instyler

air force

argentina world cup jersey

jordans

tommy hilfiger pas cher

michael kors handbags

new balance

sac michael kors

nike pas cher

air max

cheap jordan shoes

goyard handbags

asics gel

supra shoes

true religion outlet

uggs

softball bats

moncler jackets

nike air max

adidas soccer cleats

nike shoes

links of london uk

mulberry handbags

cheap basketball shoes

balance shoes

salvatore ferragamo

uggs

nike air max

versace handbags

guess factory

christian louboutin

north face

wedding dress

jimmy choo shoes

true religion outlet

converse

new balance femme

nike air

sac michael kors

true religion

clarks shoes

lacoste shoes

north face outlet

celine handbags

nfl jerseys

hermes

asics trainers

louboutin

roty burch outlet

nike factory

soccer shoes

the north face

barbour jackets

nike air

nike air max

nike roshe run

doudoune moncler

pandora bracciali

prom dresses

jordan

adidas superstar

louboutin

michael kors outlet online

cheap wedding dresses

uggs

air jordan

ugg boots clearance

fitflops

lunette oakley

mac cosmetics outlet

montre pas cher

nike air max

chaussure nike

oakley vault

ray ban

christian louboutin

moncler

nike blazer

converse uk

nike air force 1

new balance soldes

ugg

hermes birkin

reebok outlet

nike roshe run

moncler

air max plus

adidas superstar

ugg soldes

free running

air max 90

north face soldes

manolo blahnik shoes

ugg

jordan 6

michael kors outlet

beats headphones

belgium world cup jerseys

fitflops

ugg

sac vanessa bruno

mont blanc pens

ai max

asics gel

new balance

kenzo clothing

pandora charms

adidas originals

coach outlet

prada outlet

yeezy shoe

france world cup jersey

vans scarpe

adidas shoes

oakley pas cher

jordan 5

canada goose

timberland boots

beats headphones

the north face

mizuno

converse shoes

adidas flip-flops

nike air max 97

canada goose uk

dansko shoes

north face

ugg australia

polo ralph lauren

ray ban

reebok shoes

cheap jordans

tory burch

adidas slides

pandora charms

cartier bracelet

kevin durant shoes 2017

ugg outlet

soccer jerseys

swarovski

pandora jewelry

oakley sunglasses

coach outlet

longchamp

air max

louboutin outlet

uggs

air max

air max

nike clothing

oakley sunglasses

stuart weitzman

rolex prezzi

nike outlet

portugal world cup jersey

mac makeup

jordan xx9

roshe run

michael kors outlet

canada goose outlet

michael kors outlet online

beats by dre

hogan

jordan 4

five finger shoes

canada goose

tn pas cher

blazer nike

jordan

balance shoes

mulberry

nike roshe

michael kors uk

uggs outlet

bottega veneta

fendi

valentinos

weitzman shoes

longchamp pas cher

louboutin

mizuno running shoes

ralph lauren outlet

jordan pas cher

2018.2.11chenlixiang

07 Feb 2018

canada goose outlet

ultra boosts

coach factory outlet online

canada goose outlet

oakley sunglasses

valentino shoes

pandora outlet

ralph lauren outlet

pandora outlet

nfl jerseys

michael kors outlet online

kate spade outlet store

ugg boots clearance

christian louboutin shoes

mbt shoes

mbt shoes outlet

michael kors outlet online

michael kors outlet

pandora outlet store

polo ralph lauren

mcm bag

canada goose jackets canada

nike air max

nike shoes

coach outlet store

ray ban sunglasse

oakley sunglasses wholesale

true religion outlet online

cheap ugg boots

canada goose jackets

nike outlet

ralph lauren polo shirts

nike outlet

puma outlet

coach factory outlet

coach outlet store online

michael kors outlet

michael kors outlet online

oakley sunglasses

nike outlet store

ralph lauren outlet

cheap oakley sunglasses

ugg outlet

coach outlet store online

mont blanc outlet

ralph lauren outlet

oakley sunglasses wholesale

kate spade outlet store

coach outlet

kate spade handbags

ugg boots clearance

nike factory store

nike air jordan 4

canada goose outlet online

adidas shoes for men

ugg boots

pandora charms outlet

prada outlet

cheap jordan shoes

pandora jewelry

pandora charms sale clearance

coach factory outlet online

canada goose outlet

ugg boots canada

ugg outlet

michael kors handbags clearance

coach outlet store online

kate spade outlet

asics outlet

polo ralph lauren outlet

kate spade outlet

michael kors

michael kors outlet online

coach outlet online

moncler outlet

cheap jordans

nfl jerseys wholesale

coach outlet

hermes outlet

coach outlet

coach outlet

coach outlet store online

michael kors outlet

christian louboutin

ugg outlet

pandora jewelry

uggs outlet

coach outlet

ugg outlet

ray ban sunglasses

canada goose outlet

nfl jerseys

yeezy boost 350

coach outlet

prada outlet store

christian louboutin sale

oakley sunglasses

coach outlet

polo ralph lauren

canada goose jackets

polo ralph lauren outlet

pandora jewelry

coach outlet online

ugg boots clearance

canada goose outlet store

air jordan shoes

oakley sunglasses wholesale

pandora jewelry

pandora charms sale clearance

vintage nhl jerseys

coach outlet

canada goose outlet store

ray ban wayfarer

giuseppe zanotti outlet

pandora charms

ferragamo shoes

canada goose outlet

coach outlet

cheap ray ban sunglasses

adidas nmd shoes

ralph lauren uk

ralph lauren

nike shoes on sale

ray ban sunglasses outlet

prada outlet store

fred perry clothing

pandora charms

ugg boots clearance

ralph lauren pas cher

ugg boots

christian louboutin outlet

canada goose

cheap nfl jerseys

polo ralph lauren outlet

supreme shirts

adidas yeezy

nike outlet

nike shoes

polo ralph lauren

michael kors outlet

michael kors outlet

pandora outlet online

mulberry outlet

coach outlet

ray ban sunglasses outlet

michael kors handbags

moncler jackets

canada goose

fitflops sale

christian louboutin outlet

polo ralph lauren

oakley sunglasses outlet

valentino outlet store

coach outlet

polo ralph lauren

nfl jerseys wholesale

pandora rings

ray ban sunglasse

kate spade outlet online

michael kors outlet clearance

pandora jewelry outlet

fitflop sale

ferragamo outlet store

supreme outlet

ray ban outlet

nfl jerseys wholesale

canada goose outlet stores

coach outlet online

pandora jewelry

canada goose jackets

canada goose sale

ugg outlet online clearance

cheap nba jersey

ugg boots outlet

lebron james shoes

michael kors outlet

fred perry polo shirts

pandora charms

moncler jackets

coach outlet

nike shoes

coach outlet clearance

coach outlet

michael kors outlet clearance

ralph lauren

canada goose outlet

ray ban sunglasses

ralph lauren outlet

cheap ugg boots

fitflops clearance

ugg outlet

michael kors outlet clearance

canada goose parka

nike outlet store

canada goose outlet online

michael kors outlet online

uggs outlet

ralph lauren uk

ugg outlet

michael kors outlet

yaoxuemei20180207

Nový komentář