-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMurmur_ice.py
6757 lines (5988 loc) · 307 KB
/
Murmur_ice.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# -*- coding: utf-8 -*-
#
# Copyright (c) ZeroC, Inc. All rights reserved.
#
#
# Ice version 3.7.7
#
# <auto-generated>
#
# Generated from file `Murmur.ice'
#
# Warning: do not edit this file.
#
# </auto-generated>
#
from sys import version_info as _version_info_
import Ice, IcePy
import Ice.SliceChecksumDict_ice
# Included module Ice
_M_Ice = Ice.openModule('Ice')
# Start of module Murmur
_M_Murmur = Ice.openModule('Murmur')
__name__ = 'Murmur'
if '_t_NetAddress' not in _M_Murmur.__dict__:
_M_Murmur._t_NetAddress = IcePy.defineSequence('::Murmur::NetAddress', ('python:seq:tuple',), IcePy._t_byte)
if 'User' not in _M_Murmur.__dict__:
_M_Murmur.User = Ice.createTempClass()
class User(object):
"""
A connected user.
Members:
session -- Session ID. This identifies the connection to the server.
userid -- User ID. -1 if the user is anonymous.
mute -- Is user muted by the server?
deaf -- Is user deafened by the server? If true, this implies mute.
suppress -- Is the user suppressed by the server? This means the user is not muted, but does not have speech privileges in the current channel.
prioritySpeaker -- Is the user a priority speaker?
selfMute -- Is the user self-muted?
selfDeaf -- Is the user self-deafened? If true, this implies mute.
recording -- Is the User recording? (This flag is read-only and cannot be changed using setState().)
channel -- Channel ID the user is in. Matches Channel.id.
name -- The name of the user.
onlinesecs -- Seconds user has been online.
bytespersec -- Average transmission rate in bytes per second over the last few seconds.
version -- Client version. Major version in upper 16 bits, followed by 8 bits of minor version and 8 bits of patchlevel. Version 1.2.3 = 0x010203.
release -- Client release. For official releases, this equals the version. For snapshots and git compiles, this will be something else.
os -- Client OS.
osversion -- Client OS Version.
identity -- Plugin Identity. This will be the user's unique ID inside the current game.
context -- Base64-encoded Plugin context. This is a binary blob identifying the game and team the user is on.
The used Base64 alphabet is the one specified in RFC 2045.
Before Mumble 1.3.0, this string was not Base64-encoded. This could cause problems for some Ice
implementations, such as the .NET implementation.
If you need the exact string that is used by Mumble, you can get it by Base64-decoding this string.
If you simply need to detect whether two users are in the same game world, string comparisons will
continue to work as before.
comment -- User comment. Shown as tooltip for this user.
address -- Client address.
tcponly -- TCP only. True until UDP connectivity is established.
idlesecs -- Idle time. This is how many seconds it is since the user last spoke. Other activity is not counted.
udpPing -- UDP Ping Average. This is the average ping for the user via UDP over the duration of the connection.
tcpPing -- TCP Ping Average. This is the average ping for the user via TCP over the duration of the connection.
"""
def __init__(self, session=0, userid=0, mute=False, deaf=False, suppress=False, prioritySpeaker=False, selfMute=False, selfDeaf=False, recording=False, channel=0, name='', onlinesecs=0, bytespersec=0, version=0, release='', os='', osversion='', identity='', context='', comment='', address=None, tcponly=False, idlesecs=0, udpPing=0.0, tcpPing=0.0):
self.session = session
self.userid = userid
self.mute = mute
self.deaf = deaf
self.suppress = suppress
self.prioritySpeaker = prioritySpeaker
self.selfMute = selfMute
self.selfDeaf = selfDeaf
self.recording = recording
self.channel = channel
self.name = name
self.onlinesecs = onlinesecs
self.bytespersec = bytespersec
self.version = version
self.release = release
self.os = os
self.osversion = osversion
self.identity = identity
self.context = context
self.comment = comment
self.address = address
self.tcponly = tcponly
self.idlesecs = idlesecs
self.udpPing = udpPing
self.tcpPing = tcpPing
def __eq__(self, other):
if other is None:
return False
elif not isinstance(other, _M_Murmur.User):
return NotImplemented
else:
if self.session != other.session:
return False
if self.userid != other.userid:
return False
if self.mute != other.mute:
return False
if self.deaf != other.deaf:
return False
if self.suppress != other.suppress:
return False
if self.prioritySpeaker != other.prioritySpeaker:
return False
if self.selfMute != other.selfMute:
return False
if self.selfDeaf != other.selfDeaf:
return False
if self.recording != other.recording:
return False
if self.channel != other.channel:
return False
if self.name != other.name:
return False
if self.onlinesecs != other.onlinesecs:
return False
if self.bytespersec != other.bytespersec:
return False
if self.version != other.version:
return False
if self.release != other.release:
return False
if self.os != other.os:
return False
if self.osversion != other.osversion:
return False
if self.identity != other.identity:
return False
if self.context != other.context:
return False
if self.comment != other.comment:
return False
if self.address != other.address:
return False
if self.tcponly != other.tcponly:
return False
if self.idlesecs != other.idlesecs:
return False
if self.udpPing != other.udpPing:
return False
if self.tcpPing != other.tcpPing:
return False
return True
def __ne__(self, other):
return not self.__eq__(other)
def __str__(self):
return IcePy.stringify(self, _M_Murmur._t_User)
__repr__ = __str__
_M_Murmur._t_User = IcePy.defineStruct('::Murmur::User', User, (), (
('session', (), IcePy._t_int),
('userid', (), IcePy._t_int),
('mute', (), IcePy._t_bool),
('deaf', (), IcePy._t_bool),
('suppress', (), IcePy._t_bool),
('prioritySpeaker', (), IcePy._t_bool),
('selfMute', (), IcePy._t_bool),
('selfDeaf', (), IcePy._t_bool),
('recording', (), IcePy._t_bool),
('channel', (), IcePy._t_int),
('name', (), IcePy._t_string),
('onlinesecs', (), IcePy._t_int),
('bytespersec', (), IcePy._t_int),
('version', (), IcePy._t_int),
('release', (), IcePy._t_string),
('os', (), IcePy._t_string),
('osversion', (), IcePy._t_string),
('identity', (), IcePy._t_string),
('context', (), IcePy._t_string),
('comment', (), IcePy._t_string),
('address', (), _M_Murmur._t_NetAddress),
('tcponly', (), IcePy._t_bool),
('idlesecs', (), IcePy._t_int),
('udpPing', (), IcePy._t_float),
('tcpPing', (), IcePy._t_float)
))
_M_Murmur.User = User
del User
if '_t_IntList' not in _M_Murmur.__dict__:
_M_Murmur._t_IntList = IcePy.defineSequence('::Murmur::IntList', (), IcePy._t_int)
if 'TextMessage' not in _M_Murmur.__dict__:
_M_Murmur.TextMessage = Ice.createTempClass()
class TextMessage(object):
"""
A text message between users.
Members:
sessions -- Sessions (connected users) who were sent this message.
channels -- Channels who were sent this message.
trees -- Trees of channels who were sent this message.
text -- The contents of the message.
"""
def __init__(self, sessions=None, channels=None, trees=None, text=''):
self.sessions = sessions
self.channels = channels
self.trees = trees
self.text = text
def __hash__(self):
_h = 0
if self.sessions:
for _i0 in self.sessions:
_h = 5 * _h + Ice.getHash(_i0)
if self.channels:
for _i1 in self.channels:
_h = 5 * _h + Ice.getHash(_i1)
if self.trees:
for _i2 in self.trees:
_h = 5 * _h + Ice.getHash(_i2)
_h = 5 * _h + Ice.getHash(self.text)
return _h % 0x7fffffff
def __compare(self, other):
if other is None:
return 1
elif not isinstance(other, _M_Murmur.TextMessage):
return NotImplemented
else:
if self.sessions is None or other.sessions is None:
if self.sessions != other.sessions:
return (-1 if self.sessions is None else 1)
else:
if self.sessions < other.sessions:
return -1
elif self.sessions > other.sessions:
return 1
if self.channels is None or other.channels is None:
if self.channels != other.channels:
return (-1 if self.channels is None else 1)
else:
if self.channels < other.channels:
return -1
elif self.channels > other.channels:
return 1
if self.trees is None or other.trees is None:
if self.trees != other.trees:
return (-1 if self.trees is None else 1)
else:
if self.trees < other.trees:
return -1
elif self.trees > other.trees:
return 1
if self.text is None or other.text is None:
if self.text != other.text:
return (-1 if self.text is None else 1)
else:
if self.text < other.text:
return -1
elif self.text > other.text:
return 1
return 0
def __lt__(self, other):
r = self.__compare(other)
if r is NotImplemented:
return r
else:
return r < 0
def __le__(self, other):
r = self.__compare(other)
if r is NotImplemented:
return r
else:
return r <= 0
def __gt__(self, other):
r = self.__compare(other)
if r is NotImplemented:
return r
else:
return r > 0
def __ge__(self, other):
r = self.__compare(other)
if r is NotImplemented:
return r
else:
return r >= 0
def __eq__(self, other):
r = self.__compare(other)
if r is NotImplemented:
return r
else:
return r == 0
def __ne__(self, other):
r = self.__compare(other)
if r is NotImplemented:
return r
else:
return r != 0
def __str__(self):
return IcePy.stringify(self, _M_Murmur._t_TextMessage)
__repr__ = __str__
_M_Murmur._t_TextMessage = IcePy.defineStruct('::Murmur::TextMessage', TextMessage, (), (
('sessions', (), _M_Murmur._t_IntList),
('channels', (), _M_Murmur._t_IntList),
('trees', (), _M_Murmur._t_IntList),
('text', (), IcePy._t_string)
))
_M_Murmur.TextMessage = TextMessage
del TextMessage
if 'Channel' not in _M_Murmur.__dict__:
_M_Murmur.Channel = Ice.createTempClass()
class Channel(object):
"""
A channel.
Members:
id -- Channel ID. This is unique per channel, and the root channel is always id 0.
name -- Name of the channel. There can not be two channels with the same parent that has the same name.
parent -- ID of parent channel, or -1 if this is the root channel.
links -- List of id of linked channels.
description -- Description of channel. Shown as tooltip for this channel.
temporary -- Channel is temporary, and will be removed when the last user leaves it.
position -- Position of the channel which is used in Client for sorting.
"""
def __init__(self, id=0, name='', parent=0, links=None, description='', temporary=False, position=0):
self.id = id
self.name = name
self.parent = parent
self.links = links
self.description = description
self.temporary = temporary
self.position = position
def __hash__(self):
_h = 0
_h = 5 * _h + Ice.getHash(self.id)
_h = 5 * _h + Ice.getHash(self.name)
_h = 5 * _h + Ice.getHash(self.parent)
if self.links:
for _i0 in self.links:
_h = 5 * _h + Ice.getHash(_i0)
_h = 5 * _h + Ice.getHash(self.description)
_h = 5 * _h + Ice.getHash(self.temporary)
_h = 5 * _h + Ice.getHash(self.position)
return _h % 0x7fffffff
def __compare(self, other):
if other is None:
return 1
elif not isinstance(other, _M_Murmur.Channel):
return NotImplemented
else:
if self.id is None or other.id is None:
if self.id != other.id:
return (-1 if self.id is None else 1)
else:
if self.id < other.id:
return -1
elif self.id > other.id:
return 1
if self.name is None or other.name is None:
if self.name != other.name:
return (-1 if self.name is None else 1)
else:
if self.name < other.name:
return -1
elif self.name > other.name:
return 1
if self.parent is None or other.parent is None:
if self.parent != other.parent:
return (-1 if self.parent is None else 1)
else:
if self.parent < other.parent:
return -1
elif self.parent > other.parent:
return 1
if self.links is None or other.links is None:
if self.links != other.links:
return (-1 if self.links is None else 1)
else:
if self.links < other.links:
return -1
elif self.links > other.links:
return 1
if self.description is None or other.description is None:
if self.description != other.description:
return (-1 if self.description is None else 1)
else:
if self.description < other.description:
return -1
elif self.description > other.description:
return 1
if self.temporary is None or other.temporary is None:
if self.temporary != other.temporary:
return (-1 if self.temporary is None else 1)
else:
if self.temporary < other.temporary:
return -1
elif self.temporary > other.temporary:
return 1
if self.position is None or other.position is None:
if self.position != other.position:
return (-1 if self.position is None else 1)
else:
if self.position < other.position:
return -1
elif self.position > other.position:
return 1
return 0
def __lt__(self, other):
r = self.__compare(other)
if r is NotImplemented:
return r
else:
return r < 0
def __le__(self, other):
r = self.__compare(other)
if r is NotImplemented:
return r
else:
return r <= 0
def __gt__(self, other):
r = self.__compare(other)
if r is NotImplemented:
return r
else:
return r > 0
def __ge__(self, other):
r = self.__compare(other)
if r is NotImplemented:
return r
else:
return r >= 0
def __eq__(self, other):
r = self.__compare(other)
if r is NotImplemented:
return r
else:
return r == 0
def __ne__(self, other):
r = self.__compare(other)
if r is NotImplemented:
return r
else:
return r != 0
def __str__(self):
return IcePy.stringify(self, _M_Murmur._t_Channel)
__repr__ = __str__
_M_Murmur._t_Channel = IcePy.defineStruct('::Murmur::Channel', Channel, (), (
('id', (), IcePy._t_int),
('name', (), IcePy._t_string),
('parent', (), IcePy._t_int),
('links', (), _M_Murmur._t_IntList),
('description', (), IcePy._t_string),
('temporary', (), IcePy._t_bool),
('position', (), IcePy._t_int)
))
_M_Murmur.Channel = Channel
del Channel
if 'Group' not in _M_Murmur.__dict__:
_M_Murmur.Group = Ice.createTempClass()
class Group(object):
"""
A group. Groups are defined per channel, and can inherit members from parent channels.
Members:
name -- Group name
inherited -- Is this group inherited from a parent channel? Read-only.
inherit -- Does this group inherit members from parent channels?
inheritable -- Can subchannels inherit members from this group?
add -- List of users to add to the group.
remove -- List of inherited users to remove from the group.
members -- Current members of the group, including inherited members. Read-only.
"""
def __init__(self, name='', inherited=False, inherit=False, inheritable=False, add=None, remove=None, members=None):
self.name = name
self.inherited = inherited
self.inherit = inherit
self.inheritable = inheritable
self.add = add
self.remove = remove
self.members = members
def __hash__(self):
_h = 0
_h = 5 * _h + Ice.getHash(self.name)
_h = 5 * _h + Ice.getHash(self.inherited)
_h = 5 * _h + Ice.getHash(self.inherit)
_h = 5 * _h + Ice.getHash(self.inheritable)
if self.add:
for _i0 in self.add:
_h = 5 * _h + Ice.getHash(_i0)
if self.remove:
for _i1 in self.remove:
_h = 5 * _h + Ice.getHash(_i1)
if self.members:
for _i2 in self.members:
_h = 5 * _h + Ice.getHash(_i2)
return _h % 0x7fffffff
def __compare(self, other):
if other is None:
return 1
elif not isinstance(other, _M_Murmur.Group):
return NotImplemented
else:
if self.name is None or other.name is None:
if self.name != other.name:
return (-1 if self.name is None else 1)
else:
if self.name < other.name:
return -1
elif self.name > other.name:
return 1
if self.inherited is None or other.inherited is None:
if self.inherited != other.inherited:
return (-1 if self.inherited is None else 1)
else:
if self.inherited < other.inherited:
return -1
elif self.inherited > other.inherited:
return 1
if self.inherit is None or other.inherit is None:
if self.inherit != other.inherit:
return (-1 if self.inherit is None else 1)
else:
if self.inherit < other.inherit:
return -1
elif self.inherit > other.inherit:
return 1
if self.inheritable is None or other.inheritable is None:
if self.inheritable != other.inheritable:
return (-1 if self.inheritable is None else 1)
else:
if self.inheritable < other.inheritable:
return -1
elif self.inheritable > other.inheritable:
return 1
if self.add is None or other.add is None:
if self.add != other.add:
return (-1 if self.add is None else 1)
else:
if self.add < other.add:
return -1
elif self.add > other.add:
return 1
if self.remove is None or other.remove is None:
if self.remove != other.remove:
return (-1 if self.remove is None else 1)
else:
if self.remove < other.remove:
return -1
elif self.remove > other.remove:
return 1
if self.members is None or other.members is None:
if self.members != other.members:
return (-1 if self.members is None else 1)
else:
if self.members < other.members:
return -1
elif self.members > other.members:
return 1
return 0
def __lt__(self, other):
r = self.__compare(other)
if r is NotImplemented:
return r
else:
return r < 0
def __le__(self, other):
r = self.__compare(other)
if r is NotImplemented:
return r
else:
return r <= 0
def __gt__(self, other):
r = self.__compare(other)
if r is NotImplemented:
return r
else:
return r > 0
def __ge__(self, other):
r = self.__compare(other)
if r is NotImplemented:
return r
else:
return r >= 0
def __eq__(self, other):
r = self.__compare(other)
if r is NotImplemented:
return r
else:
return r == 0
def __ne__(self, other):
r = self.__compare(other)
if r is NotImplemented:
return r
else:
return r != 0
def __str__(self):
return IcePy.stringify(self, _M_Murmur._t_Group)
__repr__ = __str__
_M_Murmur._t_Group = IcePy.defineStruct('::Murmur::Group', Group, (), (
('name', (), IcePy._t_string),
('inherited', (), IcePy._t_bool),
('inherit', (), IcePy._t_bool),
('inheritable', (), IcePy._t_bool),
('add', (), _M_Murmur._t_IntList),
('remove', (), _M_Murmur._t_IntList),
('members', (), _M_Murmur._t_IntList)
))
_M_Murmur.Group = Group
del Group
_M_Murmur.PermissionWrite = 1
_M_Murmur.PermissionTraverse = 2
_M_Murmur.PermissionEnter = 4
_M_Murmur.PermissionSpeak = 8
_M_Murmur.PermissionWhisper = 256
_M_Murmur.PermissionMuteDeafen = 16
_M_Murmur.PermissionMove = 32
_M_Murmur.PermissionMakeChannel = 64
_M_Murmur.PermissionMakeTempChannel = 1024
_M_Murmur.PermissionLinkChannel = 128
_M_Murmur.PermissionTextMessage = 512
_M_Murmur.PermissionKick = 65536
_M_Murmur.PermissionBan = 131072
_M_Murmur.PermissionRegister = 262144
_M_Murmur.PermissionRegisterSelf = 524288
_M_Murmur.ResetUserContent = 1048576
if 'ACL' not in _M_Murmur.__dict__:
_M_Murmur.ACL = Ice.createTempClass()
class ACL(object):
"""
Access Control List for a channel. ACLs are defined per channel, and can be inherited from parent channels.
Members:
applyHere -- Does the ACL apply to this channel?
applySubs -- Does the ACL apply to subchannels?
inherited -- Is this ACL inherited from a parent channel? Read-only.
userid -- ID of user this ACL applies to. -1 if using a group name.
group -- Group this ACL applies to. Blank if using userid.
allow -- Binary mask of privileges to allow.
deny -- Binary mask of privileges to deny.
"""
def __init__(self, applyHere=False, applySubs=False, inherited=False, userid=0, group='', allow=0, deny=0):
self.applyHere = applyHere
self.applySubs = applySubs
self.inherited = inherited
self.userid = userid
self.group = group
self.allow = allow
self.deny = deny
def __hash__(self):
_h = 0
_h = 5 * _h + Ice.getHash(self.applyHere)
_h = 5 * _h + Ice.getHash(self.applySubs)
_h = 5 * _h + Ice.getHash(self.inherited)
_h = 5 * _h + Ice.getHash(self.userid)
_h = 5 * _h + Ice.getHash(self.group)
_h = 5 * _h + Ice.getHash(self.allow)
_h = 5 * _h + Ice.getHash(self.deny)
return _h % 0x7fffffff
def __compare(self, other):
if other is None:
return 1
elif not isinstance(other, _M_Murmur.ACL):
return NotImplemented
else:
if self.applyHere is None or other.applyHere is None:
if self.applyHere != other.applyHere:
return (-1 if self.applyHere is None else 1)
else:
if self.applyHere < other.applyHere:
return -1
elif self.applyHere > other.applyHere:
return 1
if self.applySubs is None or other.applySubs is None:
if self.applySubs != other.applySubs:
return (-1 if self.applySubs is None else 1)
else:
if self.applySubs < other.applySubs:
return -1
elif self.applySubs > other.applySubs:
return 1
if self.inherited is None or other.inherited is None:
if self.inherited != other.inherited:
return (-1 if self.inherited is None else 1)
else:
if self.inherited < other.inherited:
return -1
elif self.inherited > other.inherited:
return 1
if self.userid is None or other.userid is None:
if self.userid != other.userid:
return (-1 if self.userid is None else 1)
else:
if self.userid < other.userid:
return -1
elif self.userid > other.userid:
return 1
if self.group is None or other.group is None:
if self.group != other.group:
return (-1 if self.group is None else 1)
else:
if self.group < other.group:
return -1
elif self.group > other.group:
return 1
if self.allow is None or other.allow is None:
if self.allow != other.allow:
return (-1 if self.allow is None else 1)
else:
if self.allow < other.allow:
return -1
elif self.allow > other.allow:
return 1
if self.deny is None or other.deny is None:
if self.deny != other.deny:
return (-1 if self.deny is None else 1)
else:
if self.deny < other.deny:
return -1
elif self.deny > other.deny:
return 1
return 0
def __lt__(self, other):
r = self.__compare(other)
if r is NotImplemented:
return r
else:
return r < 0
def __le__(self, other):
r = self.__compare(other)
if r is NotImplemented:
return r
else:
return r <= 0
def __gt__(self, other):
r = self.__compare(other)
if r is NotImplemented:
return r
else:
return r > 0
def __ge__(self, other):
r = self.__compare(other)
if r is NotImplemented:
return r
else:
return r >= 0
def __eq__(self, other):
r = self.__compare(other)
if r is NotImplemented:
return r
else:
return r == 0
def __ne__(self, other):
r = self.__compare(other)
if r is NotImplemented:
return r
else:
return r != 0
def __str__(self):
return IcePy.stringify(self, _M_Murmur._t_ACL)
__repr__ = __str__
_M_Murmur._t_ACL = IcePy.defineStruct('::Murmur::ACL', ACL, (), (
('applyHere', (), IcePy._t_bool),
('applySubs', (), IcePy._t_bool),
('inherited', (), IcePy._t_bool),
('userid', (), IcePy._t_int),
('group', (), IcePy._t_string),
('allow', (), IcePy._t_int),
('deny', (), IcePy._t_int)
))
_M_Murmur.ACL = ACL
del ACL
if 'Ban' not in _M_Murmur.__dict__:
_M_Murmur.Ban = Ice.createTempClass()
class Ban(object):
"""
A single ip mask for a ban.
Members:
address -- Address to ban.
bits -- Number of bits in ban to apply.
name -- Username associated with ban.
hash -- Hash of banned user.
reason -- Reason for ban.
start -- Date ban was applied in unix time format.
duration -- Duration of ban.
"""
def __init__(self, address=None, bits=0, name='', hash='', reason='', start=0, duration=0):
self.address = address
self.bits = bits
self.name = name
self.hash = hash
self.reason = reason
self.start = start
self.duration = duration
def __hash__(self):
_h = 0
if self.address:
for _i0 in self.address:
_h = 5 * _h + Ice.getHash(_i0)
_h = 5 * _h + Ice.getHash(self.bits)
_h = 5 * _h + Ice.getHash(self.name)
_h = 5 * _h + Ice.getHash(self.hash)
_h = 5 * _h + Ice.getHash(self.reason)
_h = 5 * _h + Ice.getHash(self.start)
_h = 5 * _h + Ice.getHash(self.duration)
return _h % 0x7fffffff
def __compare(self, other):
if other is None:
return 1
elif not isinstance(other, _M_Murmur.Ban):
return NotImplemented
else:
if self.address is None or other.address is None:
if self.address != other.address:
return (-1 if self.address is None else 1)
else:
if self.address < other.address:
return -1
elif self.address > other.address:
return 1
if self.bits is None or other.bits is None:
if self.bits != other.bits:
return (-1 if self.bits is None else 1)
else:
if self.bits < other.bits:
return -1
elif self.bits > other.bits:
return 1
if self.name is None or other.name is None:
if self.name != other.name:
return (-1 if self.name is None else 1)
else:
if self.name < other.name:
return -1
elif self.name > other.name:
return 1
if self.hash is None or other.hash is None:
if self.hash != other.hash:
return (-1 if self.hash is None else 1)
else:
if self.hash < other.hash:
return -1
elif self.hash > other.hash:
return 1
if self.reason is None or other.reason is None:
if self.reason != other.reason:
return (-1 if self.reason is None else 1)
else:
if self.reason < other.reason:
return -1
elif self.reason > other.reason:
return 1
if self.start is None or other.start is None:
if self.start != other.start:
return (-1 if self.start is None else 1)
else:
if self.start < other.start:
return -1
elif self.start > other.start:
return 1
if self.duration is None or other.duration is None:
if self.duration != other.duration:
return (-1 if self.duration is None else 1)
else:
if self.duration < other.duration:
return -1
elif self.duration > other.duration:
return 1
return 0
def __lt__(self, other):
r = self.__compare(other)
if r is NotImplemented:
return r
else:
return r < 0
def __le__(self, other):
r = self.__compare(other)
if r is NotImplemented:
return r
else:
return r <= 0
def __gt__(self, other):
r = self.__compare(other)
if r is NotImplemented:
return r
else:
return r > 0
def __ge__(self, other):
r = self.__compare(other)
if r is NotImplemented:
return r
else:
return r >= 0
def __eq__(self, other):
r = self.__compare(other)
if r is NotImplemented:
return r
else:
return r == 0
def __ne__(self, other):
r = self.__compare(other)
if r is NotImplemented:
return r
else:
return r != 0
def __str__(self):
return IcePy.stringify(self, _M_Murmur._t_Ban)
__repr__ = __str__
_M_Murmur._t_Ban = IcePy.defineStruct('::Murmur::Ban', Ban, (), (
('address', (), _M_Murmur._t_NetAddress),
('bits', (), IcePy._t_int),
('name', (), IcePy._t_string),
('hash', (), IcePy._t_string),
('reason', (), IcePy._t_string),
('start', (), IcePy._t_int),
('duration', (), IcePy._t_int)
))
_M_Murmur.Ban = Ban
del Ban
if 'LogEntry' not in _M_Murmur.__dict__:
_M_Murmur.LogEntry = Ice.createTempClass()
class LogEntry(object):