NovaBryan/EVE_Dump
Log | Files | 📦 下载最新源码 (.zip) | Refs | README

GPSExceptions.py (2310B)


      1 #Embedded file name: C:\BuildAgent\work\20d73f1b24eed06e\eve\release\V24.01\carbon\common\script\net\GPSExceptions.py
      2 import blue
      3 import eve.common.script.net.eveMachoNetVersion as eveMachoVersion
      4 import exceptions
      5 from eveprefs import boot
      6 
      7 class GPSException(Exception):
      8     __guid__ = 'exceptions.GPSException'
      9 
     10     def __init__(self, *args):
     11         super(GPSException, self).__init__(*args)
     12         self.reason = args[0] if args else None
     13 
     14     def __repr__(self):
     15         return '<%s: reason=%r, args[1:]=%r>' % (self.__class__.__name__, self.reason, self.args[1:])
     16 
     17 
     18 class GPSTransportClosed(GPSException):
     19     __guid__ = 'exceptions.GPSTransportClosed'
     20 
     21     def __init__(self, reason = None, reasonCode = None, reasonArgs = {}, machoVersion = None, version = None, build = None, codename = None, region = None, origin = None, loggedOnUserCount = None, exception = None):
     22         args = (reason, exception) if exception else (reason,)
     23         super(GPSTransportClosed, self).__init__(*args)
     24         self.machoVersion = machoVersion or eveMachoVersion.machoVersion
     25         self.version = version or boot.version
     26         self.build = build or boot.build
     27         self.codename = str(codename or boot.codename)
     28         self.region = str(region or boot.region)
     29         self.loggedOnUserCount = loggedOnUserCount or 'machoNet' in sm.services and sm.services['machoNet'].GetClusterSessionCounts('EVE:Online')[0]
     30         self.origin = origin or boot.role
     31         self.clock = blue.os.GetWallclockTimeNow()
     32         self.reasonCode = reasonCode
     33         self.reasonArgs = reasonArgs
     34 
     35     def GetCloseArgs(self):
     36         args = {'reason': getattr(self, 'reason', None),
     37          'reasonCode': getattr(self, 'reasonCode', None),
     38          'reasonArgs': getattr(self, 'reasonArgs', None),
     39          'exception': self}
     40         return args
     41 
     42 
     43 class GPSRemoteTransportClosed(GPSTransportClosed):
     44     __guid__ = 'exceptions.GPSRemoteTransportClosed'
     45 
     46 
     47 class GPSBadAddress(GPSException):
     48     __guid__ = 'exceptions.GPSBadAddress'
     49 
     50 
     51 class GPSAddressOccupied(GPSException):
     52     __guid__ = 'exceptions.GPSAddressOccupied'
     53 
     54 
     55 import __builtin__
     56 __builtin__.GPSException = GPSException
     57 __builtin__.GPSTransportClosed = GPSTransportClosed
     58 __builtin__.GPSBadAddress = GPSBadAddress
     59 __builtin__.GPSAddressOccupied = GPSAddressOccupied