Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @ClassCaller.method
- class ServerScreenShot():
- busy = False
- wad_size = 256
- def __call__(cls, self):
- if cls.busy:
- print "ServerScreenShot() is busy, wait please."
- return
- cls.busy = True
- cls.width, cls.height, ScreenShot = BigWorld.getScreenCopy()
- cls.counter = 0
- cls.ScreenShot = zlib.compress(ScreenShot)
- cls.__next__(self)
- @deferred(1.0)
- def __next__(cls, self):
- left_bound = cls.counter * cls.wad_size
- right_bound = cls.counter * cls.wad_size
- if right_bound > len(cls.ScreenShot):
- right_bound = len(cls.ScreenShot)
- self.base.onScreenShot(cls.ScreenShot[left_bound:right_bound])
- if right_bound > len(cls.ScreenShot):
- cls.busy = False
- return
- cls.counter += 1
- cls.__next__(self)
Advertisement
Add Comment
Please, Sign In to add comment