Ñò
.Pc        I   @   s0  d  d k  l Z d  d k Z d  d k l Z d  d k l Z l Z d  d k Z d  d k l Z l	 Z	 d  d k
 l Z l Z d d g Z e d	 d
 d d d g ƒ Z d „  Z d „  Z d „  Z d „  Z e i oe d d h e d 6e i d 6e i d 6f d h e d 6e i d 6e i d 6f d h e d 6e i d 6e i d 6f d h e d 6e i d 6e i d 6f d h e d 6e i d 6e i d 6f d h e d 6e i d 6e i d 6f d h e d 6e i d 6e i d 6f d h e d 6e i d 6e i d 6f d h e d 6e i d 6e i d 6f d h e d 6e i d 6e i d 6f d  h e d 6e i d 6e i d 6f d! h e d 6e i d 6e i d 6f d" h e d 6e i d 6e i d 6f d# h e d 6e i d 6e i d 6f d$ h e d 6e i d 6e i d 6f d% h e d 6e i d 6e i d 6f d& h e d 6e i d 6e i d 6f d' h e d 6e i d 6e i d 6f d( h e d 6e i d 6e i d 6f d) h e d 6e i d 6e i d 6f d* h e d 6e i d 6e i d 6f d+ h e d 6e i d 6e i d 6f d, h e d 6e i d 6e i d 6f d- h e d 6e i d 6e i d 6f d. h e d 6e i d 6e i d 6f d/ h e d 6e i d 6e i d 6f d0 h e d 6e i d 6e i d 6f d1 h e d 6e i d 6e i d 6f d2 h e d 6e i d 6e i d 6f d3 h e d 6e i d 6e i d 6f d4 h e d 6e i d 6e i d 6f d5 h e d 6e i d 6e i d 6f d6 h e d 6e i d 6e i d 6f d7 h e d 6e i d 6e i d 6f d8 h e d 6e i d 6e i d 6f g# d9 e ƒZ nQe d: d h  f d h  f d h  f d h  f d h  f d h  f d h  f d h  f d h  f d h  f d  h  f d! h  f d" h  f d# h  f d$ h  f d% h  f d& h  f d' h  f d( h  f d) h  f d* h  f d+ h  f d, h  f d- h  f d. h  f d/ h  f d0 h  f d1 h  f d2 h  f d3 h  f d4 h  f d5 h  f d6 h  f d7 h  f d8 h  f g# d9 e ƒZ e d; dzƒ Z da Z e Z db Z dc Z  dd Z! e  e! BZ" e de df h dg dh 6f di h dg dh 6f dj h dg dh 6h dk dl 6e" dm 6dn 6f d% h dg dh 6h dk dl 6e" dm 6dn 6f d$ h dg dh 6h dk dl 6e" dm 6dn 6f d' h dg dh 6h dk dl 6e" dm 6dn 6f d& h dg dh 6h dk dl 6e" dm 6dn 6f d( h dg dh 6h dk dl 6e" dm 6dn 6f do h dg dh 6f d# h dg dh 6f dp h dg dh 6f dq h dg dh 6f dr h dg dh 6f ds h dg dh 6f dt h dg dh 6f du h dg dh 6f dv h dc dh 6dc dw 6h dx dl 6e" dm 6dn 6f dy h dc dh 6dc dw 6h dx dl 6e" dm 6dn 6f dz h dc dh 6d{ dw 6h d| dl 6e" dm 6dn 6f d} h dc dh 6dc dw 6h d| dl 6e" dm 6dn 6f d~ h dc dh 6dc dw 6h d| dl 6e" dm 6dn 6f d h dc dh 6dc dw 6h d| dl 6e" dm 6dn 6f d€ h dc d� 6dg dw 6h dk dl 6e" dm 6dn 6d‚ dƒ 6d„ d… 6d„ d† 6f d‡ h dc d� 6dc dw 6h dk dl 6e" dm 6dn 6dˆ dƒ 6d‰ d… 6d‰ d† 6f dŠ h dc d� 6dg dw 6h dk dl 6e" dm 6dn 6d‹ dƒ 6dŒ d† 6f d� h dc d� 6dg dw 6h dk dl 6e" dm 6dn 6dŽ dƒ 6d� d† 6f d� h dc d� 6dg dw 6h dk dl 6e" dm 6dn 6d‘ dƒ 6d’ d… 6d’ d† 6f d“ h dc d� 6dg dw 6h dk dl 6e" dm 6dn 6d” dƒ 6d• d… 6d• d† 6f d– h dc d� 6dc dw 6h e dl 6e" dm 6dn 6d— dƒ 6f d˜ h dc d� 6dc dw 6h dk dl 6e" dm 6dn 6d™ dƒ 6dŒ d… 6dš d† 6f d› h dg dh 6f dœ h dg dh 6f d/ h dc d� 6h dg dl 6e" dm 6dn 6f dž h dc d� 6f dŸ h dc d� 6h dk dl 6e" dm 6dn 6f d  h dc d� 6h dk dl 6e" dm 6dn 6f d¡ h dc d� 6h dk dl 6e" dm 6dn 6f d¢ h dc d� 6h dk dl 6e" dm 6dn 6f d£ h dc dh 6h e dl 6e" dm 6dn 6f d¤ h dg dh 6h e dl 6e" dm 6dn 6f d¥ h dg dh 6h dk dl 6e" dm 6dn 6f d¦ h dg dh 6f d§ h dg dh 6h d| dl 6e" dm 6dn 6f d¨ h dg dh 6f d© h dc dh 6dc dª 6h d« dl 6dg dm 6dn 6f d¬ h dg dh 6h e dl 6dg dm 6dn 6f d­ h dg dh 6h e dl 6dg dm 6dn 6f d h dg dh 6h e i# p e n e dl 6e" dm 6dn 6f d® h dc d¯ 6d° dw 6h dk dl 6e" dm 6dn 6f d± h dc d¯ 6dd dw 6h dk dl 6e" dm 6dn 6f d² h dc dh 6dc dª 6h e dl 6e" dm 6dn 6f d³ h dg dh 6dc dª 6f d6 h dg dh 6h dk dl 6e" dm 6dn 6f d7 h dg dh 6h dk dl 6e" dm 6dn 6f d8 h dg dh 6h e dl 6e" dm 6dn 6f d´ h dc d� 6dc dw 6h dk dl 6e" dm 6dn 6dµ dƒ 6d¶ d… 6d¶ d† 6f d· h dc d� 6dc dw 6h dk dl 6e" dm 6dn 6d¸ dƒ 6d¹ d… 6d¹ d† 6f dº h dc d� 6dc dw 6h dk dl 6e" dm 6dn 6d» dƒ 6dŒ d… 6d¼ d† 6f d½ h dc d� 6dg dw 6h dk dl 6e" dm 6dn 6d¾ dƒ 6d¿ d… 6d¿ d† 6f dÀ h dc d� 6dc dw 6h dk dl 6e" dm 6dn 6dÁ dƒ 6dÂ d… 6dÂ d† 6f g< d9 e ƒZ$ e dÃ dÄ dÅ g ƒ Z% e dÆ dÇ dÈ dÉ g ƒ Z& e dÊ dË dÌ dÍ g ƒ Z' e dÊ dË dÎ dÏ dÐ g ƒ Z( dc Z) dd Z* d° Z+ dÑ Z, dÒ Z- dÓ Z. dÔ Z/ dÕ Z0 dÖ Z1 d× Z2 dØ Z3 dÙ Z4 d{ Z5 dg Z6 dc Z7 dd Z8 d{ Z9 dÚ „  Z: d dÛ „ Z; dÜ Z< dÝ „  Z= e dÞ „  ƒ Z> dß „  Z? e@ dà „ ZA dá „  ZB dâ „  ZC dã „  ZD dä „  ZE då „  ZF dæ „  ZG dç „  ZH dè „  ZI dé „  ZJ dê „  ZK dë „  ZL dì „  ZM dí „  ZN dî „  ZO dï „  ZP dð „  ZQ dñ „  ZR dò „  ZS dó „  ZT dô eU f dõ „  ƒ  YZV dö eV f d÷ „  ƒ  YZW dø eV f dù „  ƒ  YZX dú eV f dû „  ƒ  YZY dü eV f dý „  ƒ  YZZ dþ eZ f dÿ „  ƒ  YZ[ d eZ f d„  ƒ  YZ\ h eY ƒ  e$ i] 6eW e$ i^ ƒ e$ i^ 6eW e$ i_ ƒ e$ i_ 6eW e$ i` ƒ e$ i` 6eW e$ ia ƒ e$ ia 6eW e$ ib ƒ e$ ib 6eX e$ ic ƒ e$ ic 6eX e$ id ƒ e$ id 6eX e$ ie ƒ e$ ie 6eX e$ if ƒ e$ if 6eX e$ ig ƒ e$ ig 6eX e$ ih ƒ e$ ih 6eX e$ ii ƒ e$ ii 6eW e$ ij ƒ e$ ij 6e[ ƒ  e$ ik 6e\ ƒ  e$ il 6Zm d„  Zn e io o en ƒ  Zp n e@ d„ Zq e@ d„ Zr d„  Zs dddg Zt d	„  Zu d d d
„ Zv d„  Zw d„  Zx d„  Zy d„  Zz d„  Z{ d„  Z| d„  Z} d„  Z~ d„  Z d„  Z€ d„  Z� e@ d„ Z‚ dg dg ddd„ Zƒ d„  Z„ deU f d„  ƒ  YZ… dd{d„  ƒ  YZ† de† f d„  ƒ  YZ‡ d e† f d!„  ƒ  YZˆ d"e† f d#„  ƒ  YZ‰ d$e† f d%„  ƒ  YZŠ d&e† f d'„  ƒ  YZ‹ d(e† f d)„  ƒ  YZŒ d*e† f d+„  ƒ  YZ� d,e† f d-„  ƒ  YZŽ d.e† f d/„  ƒ  YZ� d0e† f d1„  ƒ  YZ� d2e† f d3„  ƒ  YZ‘ d4e† f d5„  ƒ  YZ’ d6e† f d7„  ƒ  YZ“ d8e† f d9„  ƒ  YZ” d:e” f d;„  ƒ  YZ• d<e• f d=„  ƒ  YZ– d>e“ f d?„  ƒ  YZ— d@e“ f dA„  ƒ  YZ˜ dBe“ f dC„  ƒ  YZ™ dDe“ f dE„  ƒ  YZš dFe“ f dG„  ƒ  YZ› dHe“ f dI„  ƒ  YZœ dJe† e� f dK„  ƒ  YZž dLež f dM„  ƒ  YZŸ dNež f dO„  ƒ  YZ  e dPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcdddedfdgdhdidjdkdlg ƒ Z¡ e dmdndog ƒ Z¢ dc Z£ dd Z¤ dp„  Z¥ dq„  Z¦ dr„  Z§ ds„  Z¨ dc Z© dd Zª d° Z« dt„  Z¬ du„  Z­ dv„  Z® dw„  Z¯ dxeU f dy„  ƒ  YZ° d S(|  iÿÿÿÿ(   t   noexceptN(   t   Event(   t   LOG_RFt	   LOG_ERROR(   t   CHAT_LOGt   RESTRICTION_TYPE(   t   Enumerationt   AttributeEnumItemt   CHAT_ACTIONSt   CHAT_ACTION_RESPONSESs!   Group of members for notificationt   Allt   Nonet
   Originatort   ExceptOriginatorc         C   s   t  S(   N(   t   True(   t   originatorIdt   entityId(    (    s   scripts/common/chat_shared.pyt   __notifyFilterAll   s    c         C   s   t  S(   N(   t   False(   R   R   (    (    s   scripts/common/chat_shared.pyt   __notifyFilterNone   s    c         C   s
   |  | j S(   N(    (   R   R   (    (    s   scripts/common/chat_shared.pyt   __notifyFilterOnlyOriginator   s    c         C   s
   |  | j S(   N(    (   R   R   (    (    s   scripts/common/chat_shared.pyt   __notifyFilterExceptOriginator   s    t   chatChannelActionst   entert   notifyFiltert   notificationGroupt   logLevelt	   broadcastt   leavet   requestMemberst   channelDestroyedt   createChannelt   requestChannelst	   selfEntert	   selfLeavet   requestMessageHistoryt   channelInfoUpdatedt   memberStatusUpdatet	   findUserst   requestUsersRostert
   addIgnoredt	   addFriendt   removeIgnoredt   removeFriendt   createPrivatet   friendStatusUpdatet   userChatCommandt
   sysMessaget   personalSysMessaget   chatInitializationt   userInviteCommandt   createInvitet   receiveInvitet   receiveArchiveInvitet   receiveMembersCountt   receiveMembersDeltat   VOIPSettingst   VOIPCredentialst   setMutedt
   unsetMutedt   logVivoxLogint   instancet   chatActionst   chatActionResponsest   successt   internalErrort   channelAlreadyExistst   passwordRequiredt   incorrectPasswordt   channelNotExistst   memberBannedt   memberDisconnectingt
   notAllowedt   connectTimeoutt   initializationFailuret   userNotExistst   usersRosterLimitReachedt   activeChannelsLimitReachedt   sqlErrort   incorrectCharactert   addFriendErrort   addIgnoredErrort   userIgnoredErrort   chatCommandErrort   memberAlreadyBannedt   memberAlreadyModeratort   memberNotModeratort   commandInCooldownt   createPrivateErrort   actionInCooldownt
   chatBannedt   inviteCommandErrort   unknownCommandt   inviteCreateErrort   membersLimitReachedt   notSupportedt   inviteCreationNotAllowedt   incorrectCommandArgumentt   invalidChannelNamet   setMutedErrort   unsetMutedErrorg      à?g      @i   i   t   chatCommandst   initAcki    t   chnlCmdt   updateMemeberStatust   findUserg      @t   periodt   sidet   cooldownt   joinPrivatet   requestFriendStatust   friendStatusChanget
   addAdmirert   addAdmirerAckt   removeAdmirert   onAddToIgnoredt   CHGCHNLNAMEt   argsCntg      >@t   GREETINGt   BANi   g      $@t   UNBANt   ADDMODERATORt   DELMODERATORt   HELPMEt	   battleCmds"   #ingame_gui:chat_shortcuts/help_met   msgTextt   help_met	   vehMarkert   sound_notificationt   FOLLOWMEs$   #ingame_gui:chat_shortcuts/follow_met	   follow_met   ATTACKs!   #ingame_gui:chat_shortcuts/attackt   attackt
   BACKTOBASEs'   #ingame_gui:chat_shortcuts/back_to_baset   back_to_baset   POSITIVEs#   #ingame_gui:chat_shortcuts/positivet   positivet   NEGATIVEs#   #ingame_gui:chat_shortcuts/negativet   negativet   ATTENTIONTOCELLs,   #ingame_gui:chat_shortcuts/attention_to_cellt   ATTACKENEMYs'   #ingame_gui:chat_shortcuts/attack_enemyt   attack_the_enemyt   requestLastSysMessagest   chatAckInitializationt	   inviteCmdt   inviteReceivedt   acceptInvitet   rejectInvitet   getActiveInvitest   getArchiveInvitest   getMembersCountt   requestSystemChatChannelst   findChatChannelst   getChannelInfoByIdt   createChatChannelt   destroyChatChannelt   requestChatChannelMemberst   skipBanCheckg       @t   enterChatChannelt   leaveChatChannelt   USERBANt   userCmdi   t	   USERUNBANt   requestVOIPSettingst   requestVOIPCredentialst   TURNBACKs$   #ingame_gui:chat_shortcuts/turn_backt	   turn_backt   HELPMEEXs%   #ingame_gui:chat_shortcuts/help_me_ext
   help_me_ext   SUPPORTMEWITHFIREs/   #ingame_gui:chat_shortcuts/support_me_with_firet   support_me_with_firet   RELOADINGGUNs(   #ingame_gui:chat_shortcuts/reloading_gunt   reloading_gunt   STOPs   #ingame_gui:chat_shortcuts/stopt   stopt   chatMemberStatusest	   availablet   inBattlet   chatMemberBanTypet   nonet   readonlyt   fullt   chatMemberRolet   membert   visitort	   moderatort   channelOwnert   channelModeratort	   chatAdmini   i   i    i@   i€   i   i   i   i   c            s   ‡  f d †  } | S(   Nc            s"   t  ˆ  ƒ ‡  ‡ f d †  ƒ } | S(   Nc            s0   t  | d ˆ j o ˆ  |  | | | Ž n d  S(   Nt   actionResponse(   t   CHAT_RESPONSES(   t   objt
   actionDatat   argst   kwArgs(   t   funct   response(    s   scripts/common/chat_shared.pyt   wrapperî  s    (   t   wraps(   RÃ   RÅ   (   RÄ   (   RÃ   s   scripts/common/chat_shared.pyt   wrapí  s    (    (   RÄ   RÇ   (    (   RÄ   s   scripts/common/chat_shared.pyt   boundActionResponseFilterì  s    c         K   sÿ   h  } | i  d d ƒ | d <|  i ƒ  | d <| d  j	 o | n d | d <| i  d t i ƒ i ƒ  | d <| i  d d ƒ | d <| i  d d	 ƒ | d <| i  d
 t i ƒ i ƒ  | d
 <| i  d ƒ | d <t i ƒ  | d <| d | d <| i  d d ƒ | d <| S(   Nt	   requestIDiÿÿÿÿt   actioni    t   channelR½   t
   originatort   originatorNickNamet    t   groupt   datat   timet   sentTimet   flags(   t   gett   indexR   R¾   R@   t   CHAT_MEMBER_GROUPR·   RÑ   (   RÊ   t	   channelIdRÂ   RÐ   (    (    s   scripts/common/chat_shared.pyt   buildChatActionDataö  s    t   chatChannel_c         C   s   d t  |  f S(   Ns   %s%d(   t   ChatChannelKeyPrefix(   t   id(    (    s   scripts/common/chat_shared.pyt   buildChannelsKey  s    c         C   s1   |  i  t ƒ o |  i t d ƒ } t | ƒ Sd S(   NRÎ   i    (   t
   startswithRÚ   t   replacet   int(   t   keyt   strID(    (    s   scripts/common/chat_shared.pyt   getChannelsIDFromKey  s    c         C   s   |  d  j	 o |  i d t ƒ S(   Nt
   isReadOnly(   R   RÔ   R   (   t   channelInfo(    (    s   scripts/common/chat_shared.pyt   isChannelSecured  s    c         C   s1   |  d  j o | S|  i d d ƒ } t | | ƒ S(   NRÓ   i    (   R   RÔ   t
   _testFlags(   Rä   t
   testedFlagt   resultForNoneRÓ   (    (    s   scripts/common/chat_shared.pyt   _testChannelFlag   s    c         C   s   |  | @| j S(   N(    (   RÓ   Rç   (    (    s   scripts/common/chat_shared.pyRæ   &  s    c         C   s   t  |  t ƒ S(   N(   Ré   t   CHAT_CHANNEL_DESTROYING(   Rä   (    (    s   scripts/common/chat_shared.pyt   isChannelDestroying+  s    c         C   s   t  |  t ƒ S(   N(   Ræ   Rê   (   RÓ   (    (    s   scripts/common/chat_shared.pyt   isChannelDestroyingFlags.  s    c         C   s   t  |  t ƒ S(   N(   Ré   t   CHAT_CHANNEL_PRIVATE(   Rä   (    (    s   scripts/common/chat_shared.pyt   isPrivateChannel1  s    c         C   s   t  |  t ƒ S(   N(   Ré   t   CHAT_CHANNEL_TRAINING(   Rä   (    (    s   scripts/common/chat_shared.pyt   isTrainingChannel4  s    c         C   s   t  |  t ƒ S(   N(   Ré   t   CHAT_CHANNEL_PREBATTLE(   Rä   (    (    s   scripts/common/chat_shared.pyt   isPrebattleChannel7  s    c         C   s   t  |  t ƒ S(   N(   Ræ   Rñ   (   RÓ   (    (    s   scripts/common/chat_shared.pyt   isPrebattleChannelFlags:  s    c         C   s   t  |  t ƒ S(   N(   Ré   t   CHAT_CHANNEL_SQUAD(   Rä   (    (    s   scripts/common/chat_shared.pyt   isSquadChannel=  s    c         C   s   t  |  t ƒ S(   N(   Ré   t   CHAT_CHANNEL_TEAM(   Rä   (    (    s   scripts/common/chat_shared.pyt   isTeamChannel@  s    c         C   s   t  |  t ƒ S(   N(   Ræ   t   CHAT_CHANNEL_BATTLE(   RÓ   (    (    s   scripts/common/chat_shared.pyt   isBattleTeamFlagsC  s    c         C   s   t  |  t ƒ S(   N(   Ræ   t   CHAT_CHANNEL_BATTLE_TEAM(   RÓ   (    (    s   scripts/common/chat_shared.pyt   isArenaBattleTeamFlagsF  s    c         C   s   t  |  t ƒ S(   N(   Ré   t   CHAT_CHANNEL_VOICE(   Rä   (    (    s   scripts/common/chat_shared.pyt   isChannelHasVoiceI  s    c         C   s   t  |  t ƒ S(   N(   Ræ   Rü   (   RÓ   (    (    s   scripts/common/chat_shared.pyt   isChannelHasVoiceFlagsL  s    c         C   s   t  |  t t ƒ S(   N(   Ré   t   CHAT_CHANNEL_CLANR   (   Rä   (    (    s   scripts/common/chat_shared.pyt   isClanChannelO  s    c         C   s   t  |  t ƒ S(   N(   Ræ   Rÿ   (   RÓ   (    (    s   scripts/common/chat_shared.pyt   isClanChannelFlagsR  s    c         C   s   t  |  t ƒ S(   N(   Ræ   t   CHAT_CHANNEL_TOURNAMENT(   RÓ   (    (    s   scripts/common/chat_shared.pyt   isTournamentChannelFlagsU  s    c         C   s   t  |  t ƒ S(   N(   Ræ   t   CHAT_CHANNEL_PREBATTLE_CLAN(   RÓ   (    (    s   scripts/common/chat_shared.pyt   isPrebattleClanChannelFlagsX  s    c         C   s(   |  d  j o t St |  i d d ƒ ƒ S(   NRÓ   i    (   R   R   t   isRegularChannelFlagsRÔ   (   Rä   (    (    s   scripts/common/chat_shared.pyt   isRegularChannel[  s    c         C   s
   |  d j S(   Ni    (    (   RÓ   (    (    s   scripts/common/chat_shared.pyR  `  s    t   BaseChatCommandProcessorc           B   sq   e  Z d  „  Z e d „ Z d d d d d „ Z d „  Z d „  Z d „  Z d „  Z	 d	 „  Z
 e d
 „  e
 ƒ Z RS(   c         C   s   | |  _  d  S(   N(   t   _command(   t   selft   comand(    (    s   scripts/common/chat_shared.pyt   __init__e  s    c         C   sL   | o |  i  | ƒ n |  i | ƒ } | o |  i | ƒ n |  i | ƒ S(   N(   t(   _BaseChatCommandProcessor__verifyRawDatat
   _makeTuplet   _verifyTupledDatat   _adjustTupleDataTypes(   R
  t   rawDatat
   verifyDatat
   parsedData(    (    s   scripts/common/chat_shared.pyt   parseRawDatah  s    i    RÎ   c         C   s   t  S(   N(   R   (   R
  t   int64Argt   int16argt
   stringArg1t
   stringArg2(    (    s   scripts/common/chat_shared.pyt   verifyParsedDatap  s    c         C   s&   |  i  | d | d | d | d ƒ S(   Ni   i   i   i   (   R  (   R
  t   dataAsTuple(    (    s   scripts/common/chat_shared.pyR  s  s    c         C   sP   |  i  i } t | ƒ | j o- t d t | ƒ | j  o d n d ƒ ‚ n t S(   Nt   errors   #chat:errors/toosmallargss   #chat:errors/toomanyargs(   R	  Ru   t   lent   ChatCommandErrorR   (   R
  R  Ru   (    (    s   scripts/common/chat_shared.pyt   __verifyRawDataw  s    -c         C   s   |  i  d d d d f S(   Ni    RÎ   (   R	  (   R
  R  (    (    s   scripts/common/chat_shared.pyR  ~  s    c         C   s2   |  i  t | d ƒ t | d ƒ | d | d f S(   Ni   i   i   i   (   R	  t   longRß   (   R
  t   rawTuple(    (    s   scripts/common/chat_shared.pyR  �  s    c         C   s   | |  _  d  S(   N(   t"   _BaseChatCommandProcessor__command(   R
  t   newValue(    (    s   scripts/common/chat_shared.pyt   set_command„  s    c         C   s   |  i  S(    (   R!  (   R
  (    (    s   scripts/common/chat_shared.pyt   <lambda>†  s    (   t   __name__t
   __module__R  R   R  R  R  R  R  R  R#  t   propertyR	  (    (    (    s   scripts/common/chat_shared.pyR  d  s   						t   OneStringArgCommandProcessorc           B   s   e  Z d  „  Z d „  Z RS(   c         C   s   t  i |  | ƒ d  S(   N(   R  R  (   R
  t   command(    (    s   scripts/common/chat_shared.pyR  ‹  s    c         C   s   |  i  d d | d d f S(   Ni    RÎ   (   R	  (   R
  R  (    (    s   scripts/common/chat_shared.pyR  Ž  s    (   R%  R&  R  R  (    (    (    s   scripts/common/chat_shared.pyR(  Š  s   	t   NoArgsCommandProcessorc           B   s   e  Z d  „  Z RS(   c         C   s   t  i |  | ƒ d  S(   N(   R  R  (   R
  R)  (    (    s   scripts/common/chat_shared.pyR  “  s    (   R%  R&  R  (    (    (    s   scripts/common/chat_shared.pyR*  ’  s   t   BanCommandProcessorc           B   s/   e  Z d  „  Z d „  Z d d d d d „ Z RS(   c         C   s   t  i |  t i ƒ d  S(   N(   R  R  t   CHAT_COMMANDSRw   (   R
  (    (    s   scripts/common/chat_shared.pyR  ˜  s    c         C   s:   |  i  d t | d ƒ o d n | d | d | d f S(   Ni    i   iÿÿÿÿi   (   R	  t   isPermanentBan(   R
  R  (    (    s   scripts/common/chat_shared.pyR  ›  s    i    RÎ   c         C   s    d } | } t  | t ƒ o | i ƒ  p t  | t t f ƒ oN t | ƒ } | d j o qœ | d j  p | d j o t d | ƒ ‚ qœ n t d | ƒ ‚ t S(   Ns   #chat:errors/timeincorrectiÿÿÿÿi   i   R  (   t
   isinstancet
   basestringt   isdigitRß   R  R  R   (   R
  R  R  R  R  t   errorMessaget   timeArgRÑ   (    (    s   scripts/common/chat_shared.pyR  ž  s    3(   R%  R&  R  R  R  (    (    (    s   scripts/common/chat_shared.pyR+  —  s   		t   UserCommandProcessorc           B   s4   e  Z e d  h d e i 6d e i 6ƒ Z d „  Z RS(   t   UserCommandBanTypest   gamet   chatc         C   s   t  i |  | ƒ d  S(   N(   R  R  (   R
  R)  (    (    s   scripts/common/chat_shared.pyR  ³  s    (   R%  R&  R   R   Rw   t   CHAT_BANt   _USER_BAN_TYPESR  (    (    (    s   scripts/common/chat_shared.pyR3  ¬  s   	
t   UserBanCommandProcessorc           B   sJ   e  Z d  d k Z e i d ƒ Z d „  Z d „  Z d d d d d „ Z RS(   iÿÿÿÿNs   ([-|+]?)([0-9]*)([hdwmy]?)c         C   s   t  i |  t i ƒ d  S(   N(   R3  R  R,  R    (   R
  (    (    s   scripts/common/chat_shared.pyR  »  s    c         C   s*  t  | d t ƒ o8 | d i ƒ  } | t i j o t | d ƒ ‚ q\ n t | d ƒ ‚ t t i | ƒ i ƒ  } d  } t  | d t ƒ où |  i	 i
 | d ƒ } d } | oÒ | i ƒ  \ } } }	 | p t | d ƒ ‚ n d |	 j o
 d } n] d |	 j o
 d } nF d |	 j o
 d } n/ d
 |	 j o
 d } n d |	 j o
 d } n d | j o d | } n t | ƒ | } q¹n3 t  | d t ƒ o | d } n t | d ƒ ‚ | d i ƒ  }
 |
 o< d |
 d i ƒ  j o% d | } d i |
 d ƒ | d <n |  i | | | d | d f S(   Ni    i   i   t   hi<   t   di   t   wi   t   mi   t   yt   -iÿÿÿÿi   t   kickt    i   i   i`'  i   iÀ¨  i   iÀ¨  (   R.  R/  t   lowerR3  R8  t   IncorrectCommandArgumentErrort   getattrRÕ   R   t%   _UserBanCommandProcessor__BAN_TIME_REt   matcht   groupsR  t   splitt   joinR	  (   R
  R  t   banTypet
   banTypeIdxt	   banPeriodt   rest
   multipliert   signt   amountt   timeSpect   words(    (    s   scripts/common/chat_shared.pyR  ¾  sF    





i    RÎ   c         C   sn   t  | t ƒ o | i ƒ  p t  | t t f ƒ p t | ƒ ‚ n y t i | } Wn t | ƒ ‚ n Xt S(   N(	   R.  R/  R0  Rß   R  RC  R3  R8  R   (   R
  RL  RK  t   usernamet   reasont   _(    (    s   scripts/common/chat_shared.pyR  í  s    (   R%  R&  t   ret   compileRE  R  R  R  (    (    (    s   scripts/common/chat_shared.pyR9  ¶  s
   		/t   UserUnbanCommandProcessorc           B   s/   e  Z d  „  Z d „  Z d d d d d „ Z RS(   c         C   s   t  i |  t i ƒ d  S(   N(   R3  R  R,  R¢   (   R
  (    (    s   scripts/common/chat_shared.pyR  ú  s    c         C   sŽ   t  | d t ƒ o8 | d i ƒ  } | t i j o t | d ƒ ‚ q\ n t | d ƒ ‚ t t i | ƒ i ƒ  } |  i d | | d d f S(   Ni    i   RÎ   (	   R.  R/  RB  R3  R8  RC  RD  RÕ   R	  (   R
  R  RJ  RK  (    (    s   scripts/common/chat_shared.pyR  ý  s    i    RÎ   c         C   s+   y t  i | } Wn t | ƒ ‚ n Xt S(   N(   R3  R8  RC  R   (   R
  RL  RK  RS  RT  RU  (    (    s   scripts/common/chat_shared.pyR  
  s
    (   R%  R&  R  R  R  (    (    (    s   scripts/common/chat_shared.pyRX  ø  s   		c          C   s¥   h  }  x˜ t  i ƒ  D]Š } t | d ƒ o t | d ƒ n h  } | i d d ƒ } | d j o? h | d 6| i d d ƒ d 6t i ƒ  | d 6|  | i ƒ  <q q W|  S(   NRl   Rj   iÿÿÿÿi    Rk   t   last(   R,  t   allt   hasattrRD  RÔ   RÑ   RÕ   (   t   cooldDownDataR)  t   coolDownConfigt   coolDownPeriod(    (    s   scripts/common/chat_shared.pyt   initChatCooldownData%  s     &&c   	      C   sÐ   |  i  | i ƒ  d  ƒ } | o­ t i o t n t } t i ƒ  } | i  d | ƒ } | i  d d ƒ } | i  d d ƒ } | | @| j o? | | | j o t S| o | | d <| |  | i ƒ  <qÈ qÌ n t	 S(   NRY  Rl   iÿÿÿÿRk   i    (
   RÔ   RÕ   R   t	   constantst	   IS_CLIENTt   __COOLDOWN_CHECK_CLIENTt   __COOLDOWN_CHECK_BASERÑ   R   R   (	   t   cooldownDataInfot	   operationt   updateR\  t	   checkSidet   commandTimet   lastCommandTimeR^  t   cooldownCheckSide(    (    s   scripts/common/chat_shared.pyt   __isOperationInCooldown7  s    
c         C   s   t  |  | d | ƒS(   NRf  (   Rk  (   t   cooldownDataRe  Rf  (    (    s   scripts/common/chat_shared.pyt   isOperationInCooldownJ  s    c         C   s6   t  |  d ƒ o t |  d ƒ n h  } | i d d ƒ S(   NRl   Rj   iÿÿÿÿ(   R[  RD  RÔ   (   Re  R]  (    (    s   scripts/common/chat_shared.pyt   getOperationCooldownPeriodM  s    &t   redfoxt   arst   snakec         C   s
   |  t  j S(   N(   t   _g_chatadmins(   RS  (    (    s   scripts/common/chat_shared.pyt   isChatAdminY  s    c         C   sn   y. | d  j o t i | ƒ } n t | } Wn d  } n X| d  j	 o# t | |  ƒ o t | |  ƒ d j S(   Ni   (   R   R,  t   lookupR[  RD  (   t   categoryt   cmdNamet   cmdIdxt   cmdItem(    (    s   scripts/common/chat_shared.pyt   __isCommandFromCategory]  s    
c         C   s   t  d d |  ƒS(   NR�   Rv  (   Ry  (   Rv  (    (    s   scripts/common/chat_shared.pyt   isInviteCommandi  s    c         C   s   t  d d |  ƒS(   NR�   Rw  (   Ry  (   Rw  (    (    s   scripts/common/chat_shared.pyt   isInviteCommandIdxm  s    c         C   s   t  d d |  ƒS(   NRg   Rv  (   Ry  (   Rv  (    (    s   scripts/common/chat_shared.pyt   isChannelChatCommandq  s    c         C   s   t  d d |  ƒS(   NRg   Rw  (   Ry  (   Rw  (    (    s   scripts/common/chat_shared.pyt   isChannelChatCommandIdxu  s    c         C   s   t  d d |  ƒS(   NR¡   Rv  (   Ry  (   Rv  (    (    s   scripts/common/chat_shared.pyt   isUserCommandy  s    c         C   s   t  d d |  ƒS(   NR¡   Rw  (   Ry  (   Rw  (    (    s   scripts/common/chat_shared.pyt   isUserCommandIdx}  s    c         C   s   t  d d |  ƒS(   NR|   Rv  (   Ry  (   Rv  (    (    s   scripts/common/chat_shared.pyt   isBattleChatCommand�  s    c         C   s   t  d d |  ƒS(   NR|   Rw  (   Ry  (   Rw  (    (    s   scripts/common/chat_shared.pyt   isBattleChatCommandIdx„  s    c         C   s   t  d d |  ƒS(   NR�   Rv  (   Ry  (   Rv  (    (    s   scripts/common/chat_shared.pyt   isSkipBanCheckForChatCommand‡  s    c         C   s   t  d d |  ƒS(   NR�   Rw  (   Ry  (   Rw  (    (    s   scripts/common/chat_shared.pyt   isSkipBanCheckForCommandIdxŠ  s    c         C   sl   |  i  d ƒ oX |  d i ƒ  } t | ƒ d j o1 t | d ƒ p t | d ƒ p t | d ƒ Sn t S(   Nt   /i   i    (   RÝ   RH  R  R|  R€  R~  R   (   t   messageRR  (    (    s   scripts/common/chat_shared.pyt   isCommandMessageŽ  s    "c         C   sÀ   t  |  ƒ o¯ |  d i d  d ƒ } t i | d ƒ } | i d } t | ƒ d j o | d i d  | ƒ n g  } t i | d  ƒ } | d  j o t	 d | f ƒ d S| i
 | | ƒ Sn d  S(   Ni   i    sN   Can`t process arguments: command %s hasn`t argument processor. command ignoredRÎ   (   i    i    RÎ   RÎ   (   R†  RH  R   R,  Rt  Ru   R  t   _g_chatCommandProcessorsRÔ   R   R  (   R…  t
   verifyArgsRÐ   t   cmdRu   R  t   cmdProcessor(    (    s   scripts/common/chat_shared.pyt   parseCommandMessageš  s    0RÎ   c         C   sO   t  i |  d  ƒ } | d  j o t d |  f ƒ t S| i | | | | ƒ Sd  S(   NsN   Can`t process arguments: command %s hasn`t argument processor. command ignored(   R‡  RÔ   R   R   R   R  (   R)  R  R  R  R  RŠ  (    (    s   scripts/common/chat_shared.pyt   verifyCommandData©  s
    c         C   s
   d |  j S(   Nt	   permanent(    (   t   banTime(    (    s   scripts/common/chat_shared.pyR-  ²  s    t   ChatActionHandlersc           B   sP   e  Z d  „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z	 RS(   c         C   s   d  |  _ |  i ƒ  d  S(   N(   R   t#   _ChatActionHandlers__actionHandlerst   _onEntityInit(   R
  (    (    s   scripts/common/chat_shared.pyR  ·  s    	c         C   s+   t  |  d ƒ o |  i ƒ  n h  |  _ d  S(   Nt   __actionHandlers(   R[  t   _clearR�  (   R
  (    (    s   scripts/common/chat_shared.pyR‘  »  s    c         C   s   |  i  ƒ  d  S(   N(   R‘  (   R
  (    (    s   scripts/common/chat_shared.pyt   _onEntityRestoreÀ  s    c         C   s   |  i  ƒ  d  S(   N(   R“  (   R
  (    (    s   scripts/common/chat_shared.pyt   _onEntityDestroyÃ  s    c         C   s>   x! |  i  i ƒ  D] } | i ƒ  q W|  i  i ƒ  d  |  _  d  S(   N(   R�  t   valuest   clearR   (   R
  t   handlers(    (    s   scripts/common/chat_shared.pyR“  Æ  s
     c         C   s9   | |  i  j o t ƒ  } |  i  | <n |  i  | } | S(   N(   R�  R   (   R
  t   actionIdR˜  (    (    s   scripts/common/chat_shared.pyt   _getActionHandlersÌ  s    c         C   s   |  i  | ƒ } | | 7} d  S(   N(   Rš  (   R
  R™  t   handlerR˜  (    (    s   scripts/common/chat_shared.pyt   _subscribeActionHandlerÓ  s    c         C   s   |  i  | ƒ } | | 8} d  S(   N(   Rš  (   R
  R™  R›  R˜  (    (    s   scripts/common/chat_shared.pyt   _unsubscribeActionHandler×  s    (
   R%  R&  R  R‘  R”  R•  R“  Rš  Rœ  R�  (    (    (    s   scripts/common/chat_shared.pyR�  ¶  s   							t	   ChatErrorc           B   sV   e  Z d d d d  „ Z e d „  ƒ Z d „  Z d „  Z e e ƒ Z e d „  ƒ Z	 RS(   c         C   s6   | d  j o
 t i n | |  _ | |  _ | |  _ d  S(   N(   R   R¾   RA   t   _ChatError__responset   _ChatError__auxMessaget   _messageArgs(   R
  RÄ   t
   auxMessaget   messageArgs(    (    s   scripts/common/chat_shared.pyR  Ý  s     	c         C   s   |  i  S(    (   RŸ  (   R
  (    (    s   scripts/common/chat_shared.pyR$  â  s    c         C   s&   d |  i  d  j	 o d |  i  n d S(   Ns   Internal error occurredt   :RÎ   (   R   R   (   R
  (    (    s   scripts/common/chat_shared.pyt   _getMessageä  s    c         C   s
   |  i  ƒ  S(   N(   R¥  (   R
  (    (    s   scripts/common/chat_shared.pyt   __get_messageç  s    c         C   s   |  i  S(    (   R¡  (   R
  (    (    s   scripts/common/chat_shared.pyR$  ë  s    N(
   R%  R&  R   R  R'  RÄ   R¥  t   _ChatError__get_messageR…  R£  (    (    (    s   scripts/common/chat_shared.pyRž  Ü  s   		t   UserBannedErrorc           B   s   e  Z d  „  Z d „  Z RS(   c         C   sY   t  i |  t i ƒ | |  _ | |  _ | |  _ h |  i d 6|  i d 6|  i d 6|  _ d  S(   Nt   banOwnerNickt	   banReasont
   banEndTime(   Rž  R  R¾   RF   t   _UserBannedError__banOwnerNickt   _UserBannedError__banReasont   _UserBannedError__banEndTimeR¡  (   R
  R©  Rª  R«  (    (    s   scripts/common/chat_shared.pyR  ï  s    			

c         C   sC   |  i  d  j	 o d |  i |  i  |  i f Sd |  i |  i f Sd  S(   Ns.   You are banned by user %s till %s. Reason: %s.(   R®  R   R¬  R­  (   R
  (    (    s   scripts/common/chat_shared.pyR¥  ú  s    (   R%  R&  R  R¥  (    (    (    s   scripts/common/chat_shared.pyR¨  î  s   	t   ChatBannedErrorc           B   s   e  Z d  „  Z d „  Z RS(   c         C   sF   t  i |  t i ƒ | |  _ | |  _ h |  i d 6|  i d 6|  _ d  S(   NRª  R«  (   Rž  R  R¾   RZ   t   _ChatBannedError__banReasont   _ChatBannedError__banEndTimeR¡  (   R
  Rª  R«  (    (    s   scripts/common/chat_shared.pyR    s    		
c         C   s4   |  i  d  j	 o d |  i  |  i f Sd |  i Sd  S(   Ns#   You are banned till %s. Reason: %s.s   You are banned. Reason: %s.(   R±  R   R°  (   R
  (    (    s   scripts/common/chat_shared.pyR¥    s    (   R%  R&  R  R¥  (    (    (    s   scripts/common/chat_shared.pyR¯    s   		t   ChatSQLErrorc           B   s   e  Z d d  „ Z d „  Z RS(   c         C   s0   t  i |  t i ƒ | |  _ h | d 6|  _ d  S(   NR  (   Rž  R  R¾   RN   t   _ChatSQLError__errorR¡  (   R
  R  (    (    s   scripts/common/chat_shared.pyR    s    	c         C   s   d |  i  f S(   Ns   SQL error occurred: %s(   R³  (   R
  (    (    s   scripts/common/chat_shared.pyR¥    s    N(   R%  R&  R   R  R¥  (    (    (    s   scripts/common/chat_shared.pyR²    s   t   IncorrectCharacterc           B   s   e  Z d  „  Z d „  Z RS(   c         C   s   t  i |  t i ƒ d  S(   N(   Rž  R  R¾   RO   (   R
  (    (    s   scripts/common/chat_shared.pyR    s    c         C   s   d S(   Ns&   String contains incorrect character(s)(    (   R
  (    (    s   scripts/common/chat_shared.pyR¥  !  s    (   R%  R&  R  R¥  (    (    (    s   scripts/common/chat_shared.pyR´    s   	t   AddFriendErrorc           B   s   e  Z d  „  Z d „  Z RS(   c         C   s0   t  i |  t i ƒ | |  _ h | d 6|  _ d  S(   NRT  (   Rž  R  R¾   RP   t   _AddFriendError__reasonR¡  (   R
  RT  (    (    s   scripts/common/chat_shared.pyR  &  s    	c         C   s   d |  i  S(   Ns   Can`t add user to friends: %s(   R¶  (   R
  (    (    s   scripts/common/chat_shared.pyR¥  +  s    (   R%  R&  R  R¥  (    (    (    s   scripts/common/chat_shared.pyRµ  %  s   	t   AddIgnoredErrorc           B   s   e  Z d  „  Z d „  Z RS(   c         C   s0   t  i |  t i ƒ | |  _ h | d 6|  _ d  S(   NRT  (   Rž  R  R¾   RQ   t   _AddIgnoredError__reasonR¡  (   R
  RT  (    (    s   scripts/common/chat_shared.pyR  /  s    	c         C   s   d |  i  S(   Ns(   Can`t add user to ignored users list: %s(   R¸  (   R
  (    (    s   scripts/common/chat_shared.pyR¥  4  s    (   R%  R&  R  R¥  (    (    (    s   scripts/common/chat_shared.pyR·  .  s   	t   SetMutedErrorc           B   s   e  Z d  „  Z d „  Z RS(   c         C   s0   t  i |  t i ƒ | |  _ h | d 6|  _ d  S(   NRT  (   Rž  R  R¾   Rc   t   _SetMutedError__reasonR¡  (   R
  RT  (    (    s   scripts/common/chat_shared.pyR  8  s    	c         C   s   d |  i  S(   Ns&   Can`t add user to muted users list: %s(   Rº  (   R
  (    (    s   scripts/common/chat_shared.pyR¥  =  s    (   R%  R&  R  R¥  (    (    (    s   scripts/common/chat_shared.pyR¹  7  s   	t   UnsetMutedErrorc           B   s   e  Z d  „  Z d „  Z RS(   c         C   s0   t  i |  t i ƒ | |  _ h | d 6|  _ d  S(   NRT  (   Rž  R  R¾   Rd   t   _UnsetMutedError__reasonR¡  (   R
  RT  (    (    s   scripts/common/chat_shared.pyR  A  s    	c         C   s   d |  i  S(   Ns+   Can`t remove user from muted users list: %s(   R¼  (   R
  (    (    s   scripts/common/chat_shared.pyR¥  F  s    (   R%  R&  R  R¥  (    (    (    s   scripts/common/chat_shared.pyR»  @  s   	t   UserIgnoredErrorc           B   s   e  Z d  „  Z d „  Z RS(   c         C   s0   t  i |  t i ƒ | |  _ h | d 6|  _ d  S(   Nt   ignorer(   Rž  R  R¾   RR   t   _UserIgnoredError__ignorerNameR¡  (   R
  t   ignorerName(    (    s   scripts/common/chat_shared.pyR  J  s    	c         C   s   d |  i  S(   Ns,   You are in the ignored users list of user %s(   R¿  (   R
  (    (    s   scripts/common/chat_shared.pyR¥  O  s    (   R%  R&  R  R¥  (    (    (    s   scripts/common/chat_shared.pyR½  I  s   	t   CreatePrivateErrorc           B   s   e  Z d  „  Z d „  Z RS(   c         C   s0   t  i |  t i ƒ | |  _ h | d 6|  _ d  S(   NRT  (   Rž  R  R¾   RX   t   _CreatePrivateError__reasonR¡  (   R
  RT  (    (    s   scripts/common/chat_shared.pyR  S  s    	c         C   s   d |  i  S(   Ns    Can`t create private channel: %s(   RÂ  (   R
  (    (    s   scripts/common/chat_shared.pyR¥  X  s    (   R%  R&  R  R¥  (    (    (    s   scripts/common/chat_shared.pyRÁ  R  s   	t   ActiveChannelsLimitReachedc           B   s   e  Z d  „  Z d „  Z RS(   c         C   s0   t  i |  t i ƒ | |  _ h | d 6|  _ d  S(   Nt   limit(   Rž  R  R¾   RM   t"   _ActiveChannelsLimitReached__limitR¡  (   R
  RÄ  (    (    s   scripts/common/chat_shared.pyR  ]  s    	c         C   s   d |  i  S(   Ns,   You have reached limit in %d opened channels(   RÅ  (   R
  (    (    s   scripts/common/chat_shared.pyR¥  b  s    (   R%  R&  R  R¥  (    (    (    s   scripts/common/chat_shared.pyRÃ  \  s   	t   UsersRosterLimitReachedc           B   s   e  Z d  „  Z d „  Z RS(   c         C   s0   t  i |  t i ƒ | |  _ h | d 6|  _ d  S(   NRÄ  (   Rž  R  R¾   RL   t   _UsersRosterLimitReached__limitR¡  (   R
  RÄ  (    (    s   scripts/common/chat_shared.pyR  g  s    	c         C   s   d |  i  S(   NsJ   You already have maximum number of users (friends and ignored) allowed: %d(   RÇ  (   R
  (    (    s   scripts/common/chat_shared.pyR¥  l  s    (   R%  R&  R  R¥  (    (    (    s   scripts/common/chat_shared.pyRÆ  f  s   	R  c           B   s    e  Z d d d  „ Z d „  Z RS(   c         C   sU   t  i |  | d  j o
 t i n | ƒ | |  _ | d  j	 o h | d 6|  _ n d  S(   NR  (   Rž  R  R   R¾   RS   t   _ChatCommandError__errorR¡  (   R
  RÄ   R  (    (    s   scripts/common/chat_shared.pyR  q  s    '	c         C   s   d |  i  f S(   Ns   Chat command error occurred: %s(   RÈ  (   R
  (    (    s   scripts/common/chat_shared.pyR¥  w  s    N(   R%  R&  R   R  R¥  (    (    (    s   scripts/common/chat_shared.pyR  p  s   t   InviteCommandErrorc           B   s    e  Z d d d  „ Z d „  Z RS(   c         C   sk   t  i |  | d  j o
 t i n | ƒ | |  _ | |  _ h | d 6|  _ | d  j	 o | |  i d <n d  S(   Nt   inviteIDR  (   Rž  R  R   R¾   R[   t   _InviteCommandError__errort   _InviteCommandError__inviteIDR¡  (   R
  RÊ  RÄ   R  (    (    s   scripts/common/chat_shared.pyR  |  s    '		c         C   s   d |  i  |  i f S(   NsE   Invite command error occurred: %s during processing invite wit ID: %s(   RË  RÌ  (   R
  (    (    s   scripts/common/chat_shared.pyR¥  …  s    N(   R%  R&  R   R  R¥  (    (    (    s   scripts/common/chat_shared.pyRÉ  {  s   	t   InviteCreateErrorc           B   s   e  Z d d d  „ Z RS(   c         C   s7   t  i |  d  d | d  j o
 t i n | d | ƒd  S(   NRÄ   R  (   RÉ  R  R   R¾   R]   (   R
  RÄ   R  (    (    s   scripts/common/chat_shared.pyR  ‹  s    N(   R%  R&  R   R  (    (    (    s   scripts/common/chat_shared.pyRÍ  Š  s   t   InviteCreationNotAllowedc           B   s   e  Z d d d  „ Z RS(   c         C   s4   t  i |  d | d  j o
 t i n | d | ƒd  S(   NRÄ   R  (   RÍ  R  R   R¾   R`   (   R
  RÄ   R  (    (    s   scripts/common/chat_shared.pyR  ‘  s    N(   R%  R&  R   R  (    (    (    s   scripts/common/chat_shared.pyRÎ  �  s   t   ChatCommandInCooldownc           B   s   e  Z d  „  Z RS(   c         C   sl   t  i |  t i ƒ t | d ƒ o t | d ƒ n h  } | i d d  ƒ } h | i ƒ  d 6| d 6|  _	 d  S(   NRl   Rj   R)  t   cooldownPeriod(
   R  R  R¾   RW   R[  RD  RÔ   R   t   nameR¡  (   R
  R)  R]  R^  (    (    s   scripts/common/chat_shared.pyR  —  s    &(   R%  R&  R  (    (    (    s   scripts/common/chat_shared.pyRÏ  –  s   t   ChatCommandNotAllowedErrorc           B   s   e  Z d  „  Z RS(   c         C   s   t  i |  t i d ƒ d  S(   Ns   operation not allowed to user(   R  R  R¾   RH   (   R
  (    (    s   scripts/common/chat_shared.pyR  ¡  s    (   R%  R&  R  (    (    (    s   scripts/common/chat_shared.pyRÒ     s   t   MemberAlreadyBannedc           B   s   e  Z d  „  Z RS(   c         C   s'   t  i |  t i ƒ h | d 6|  _ d  S(   Nt   user(   R  R  R¾   RT   R¡  (   R
  R·   (    (    s   scripts/common/chat_shared.pyR  ¦  s    (   R%  R&  R  (    (    (    s   scripts/common/chat_shared.pyRÓ  ¥  s   t   MemberAlreadyModeratorc           B   s   e  Z d  „  Z RS(   c         C   s'   t  i |  t i ƒ h | d 6|  _ d  S(   NRÔ  (   R  R  R¾   RU   R¡  (   R
  R·   (    (    s   scripts/common/chat_shared.pyR  ¬  s    (   R%  R&  R  (    (    (    s   scripts/common/chat_shared.pyRÕ  «  s   t   MemberNotModeratorc           B   s   e  Z d  „  Z RS(   c         C   s'   t  i |  t i ƒ h | d 6|  _ d  S(   NRÔ  (   R  R  R¾   RV   R¡  (   R
  R·   (    (    s   scripts/common/chat_shared.pyR  ²  s    (   R%  R&  R  (    (    (    s   scripts/common/chat_shared.pyRÖ  ±  s   RC  c           B   s   e  Z d  „  Z RS(   c         C   s'   t  i |  t i ƒ h | d 6|  _ d  S(   Nt   arg(   R  R  R¾   Ra   R¡  (   R
  R×  (    (    s   scripts/common/chat_shared.pyR  ¸  s    (   R%  R&  R  (    (    (    s   scripts/common/chat_shared.pyRC  ·  s   t   ChatExceptionc           B   s   e  Z d d  „ Z RS(   c         C   s   t  i |  | ƒ d  S(   N(   Rž  R  (   R
  RÄ   (    (    s   scripts/common/chat_shared.pyR  ¾  s    N(   R%  R&  R   R  (    (    (    s   scripts/common/chat_shared.pyRØ  ½  s   t   ChannelNotExistsc           B   s   e  Z d  „  Z d „  Z RS(   c         C   s    t  i |  t i ƒ | |  _ d  S(   N(   RØ  R  R¾   RE   t   _ChannelNotExists__channelId(   R
  RÛ   (    (    s   scripts/common/chat_shared.pyR  Ã  s    c         C   s   d |  i  S(   Ns   Channel with id: %s not exists(   RÚ  (   R
  (    (    s   scripts/common/chat_shared.pyR¥  Ç  s    (   R%  R&  R  R¥  (    (    (    s   scripts/common/chat_shared.pyRÙ  Â  s   	t   UserNotExistsc           B   s   e  Z d  „  Z d „  Z RS(   c         C   s0   t  i |  t i ƒ | |  _ h | d 6|  _ d  S(   NRÔ  (   RØ  R  R¾   RK   t   _UserNotExists__nicknameR¡  (   R
  t   nickname(    (    s   scripts/common/chat_shared.pyR  Ì  s    	c         C   s   d |  i  S(   Ns!   User with nickname: %s not exists(   RÜ  (   R
  (    (    s   scripts/common/chat_shared.pyR¥  Ñ  s    (   R%  R&  R  R¥  (    (    (    s   scripts/common/chat_shared.pyRÛ  Ë  s   	t   systemMessageTypet   serverReboott   serverRebootCancelledt   battleResultst   achievementst   goldReceivedt   accountTypeChangedt   adminTextMessaget   accountNameChangedt   invoiceReceivedt   giftReceivedt   autoMaintenancet   tradeOfferReceivedt   tradeOfferDeclinedt	   waresSoldt   waresBoughtt   premiumBoughtt   premiumExtendedt   premiumExpiredt   prbArenaFinisht   prbKickt   prbDestructiont   vehicleCamouflageTimedOutt   vehTypeLockExpiredt   accountDeletedt   serverDowntimeCompensationt   vehiclePlayerEmblemTimedOutt    vehiclePlayerInscriptionTimedOutt   achievementReceivedt   systemMessageImportancet   normalt   highc         C   s,   |  d  j o t St |  i d d ƒ ƒ Sd  S(   Nt   notifyFlagsi    (   R   R   t   isMembersListSupportedByFlagsRÔ   (   Rä   (    (    s   scripts/common/chat_shared.pyt   isMembersListSupportedÿ  s    c         C   s   t  |  ƒ t t f j S(   N(   t   getMembersListModet!   CHAT_CHANNEL_NOTIFY_MEMBERS_DELTAt"   CHAT_CHANNEL_NOTIFY_MEMBERS_IN_OUT(   t   channelNotifyFlags(    (    s   scripts/common/chat_shared.pyRÿ    s    	c         C   s   |  t  @S(   N(   t    CHAT_CHANNEL_NOTIFY_MEMBERS_MASK(   R  (    (    s   scripts/common/chat_shared.pyR  	  s    c         C   s"   |  t  @} |  | 8}  |  | 7}  |  S(   N(   R  (   R  t   newModet   oldMode(    (    s   scripts/common/chat_shared.pyt   setMembersListMode  s    


c         C   s   t  |  t ƒ S(   N(   t   _checkRosterAccessBitmaskt   USERS_ROSTER_FRIEND(   t
   rosterData(    (    s   scripts/common/chat_shared.pyt   isFromFriendRoster  s    c         C   s   t  |  t ƒ S(   N(   R	  t   USERS_ROSTER_IGNORED(   R  (    (    s   scripts/common/chat_shared.pyt   isFromIgnoreRoster  s    c         C   s   t  |  t ƒ S(   N(   R	  t   USERS_ROSTER_VOICE_MUTED(   R  (    (    s   scripts/common/chat_shared.pyt   isVoiceMuted  s    c         C   s4   |  d  j	 o |  i d d ƒ n d } | | @| j S(   Nt   accessFlagsi    (   R   RÔ   (   R  t   bitmaskR  (    (    s   scripts/common/chat_shared.pyR	  "  s    &t   MESSAGE_FILTER_TYPEc           B   s   e  Z d  Z d Z RS(   i   i   (   R%  R&  t   EXCLUDEt   INCLUDE(    (    (    s   scripts/common/chat_shared.pyR  '  s   (&   s   successs   internalErrorRB   R   RC   RD   s   channelNotExistss   memberBannedRG   s
   notAllowedRI   RJ   s   userNotExistss   usersRosterLimitReacheds   activeChannelsLimitReacheds   sqlErrors   incorrectCharacters   addFriendErrors   addIgnoredErrors   userIgnoredErrors   chatCommandErrors   memberAlreadyBanneds   memberAlreadyModerators   memberNotModerators   commandInCooldowns   createPrivateErrorRY   s
   chatBanneds   inviteCommandErrorR\   s   inviteCreateErrorR^   R_   s   inviteCreationNotAlloweds   incorrectCommandArgumentRb   s   setMutedErrors   unsetMutedError(    (±   t   wotdecoratorsR    RÑ   R   t   debug_utilsR   R   R`  R   R   t   enumerationsR   R   t   __all__t   NOTIFICATION_GROUPR   R   R   R   t
   IS_BASEAPPR   t   ACTIONSR
   t   MESSAGESR   t   NONER   R   R¾   t   __DEFAULT_COOLDOWNt"   __BATTLE_COMMANDS_DEFAULT_COOLDOWNt   __CHINA_USER_MESSAGE_COOLDOWNRb  Rc  t   __COOLDOWN_CHECK_ALLt   IS_CHINAR,  t   CHAT_MEMBER_STATUSESt   CHAT_MEMBER_BAN_TYPEt   CHAT_MEMBER_ROLERÖ   Rú   Rø   Rñ   Rí   Rê   Rï   Rô   Rö   Rü   Rÿ   R  R  R  R  t&   CHAT_CHANNEL_NOT_NOTIFY_MEMBERS_IN_OUTt!   CHAT_CHANNEL_NOTIFY_MEMBERS_COUNTR  RÈ   RØ   RÚ   RÜ   Râ   Rå   R   Ré   Ræ   Rë   Rì   Rî   Rð   Rò   Ró   Rõ   R÷   Rù   Rû   Rý   Rþ   R   R  R  R  R  R  t   objectR  R(  R*  R+  R3  R9  RX  Rw   Rt   Rv   Rx   Ry   Rz   R{   Rƒ   R…   R�   R‡   R‰   R‹   RŒ   R    R¢   R‡  R_  Ra  t   g_chatCooldownDataRk  Rm  Rn  Rr  Rs  Ry  Rz  R{  R|  R}  R~  R  R€  R�  R‚  Rƒ  R†  R‹  RŒ  R-  R�  Rž  R¨  R¯  R²  R´  Rµ  R·  R¹  R»  R½  RÁ  RÃ  RÆ  R  RÉ  RÍ  RÎ  RÏ  RÒ  RÓ  RÕ  RÖ  RC  t	   ExceptionRØ  RÙ  RÛ  t   SYS_MESSAGE_TYPEt   SYS_MESSAGE_IMPORTANCEt!   SM_REQUEST_PERSONAL_MESSAGES_FLAGt   SM_REQUEST_SYSTEM_MESSAGES_FLAGR   Rÿ  R  R  R
  R  R  R  R  R  R	  R  (    (    (    s   scripts/common/chat_shared.pyt   <module>   s,  				



































																																			                                     	
















		
																						&
B	
																&
					



									