- 7A172DDFD99E3C419BDCA866441AD222790353CA0EDDCB452B6D607E1998041AC0D61E8841D23E82D7C13E850CF7FF01BBFCBA5D1924169795A100C4674BBCB5
+ F36BF2D21B07D0A2E017B7C0A1F7C8784DED0A4539F2E6CB9DAC2B834F2909686B0AB3CFA28A64B35DB83C16018B049F99DA69B4EEB61EF238C5FE90555927E3
blatta/lib/server.py
(1 . 4)(1 . 4)
92 VERSION = "9990"
93 VERSION = "9989"
94
95 import os
96 import select
(36 . 6)(36 . 7)
98 def __init__(self, options):
99 self.irc_ports = options.irc_ports
100 self.udp_port = options.udp_port
101 self.channel_name = options.channel_name
102 self.password = options.password
103 self.motdfile = options.motd
104 self.verbose = options.verbose
(163 . 18)(164 . 7)
106 if(error_code == None):
107 self.print_debug("[%s] -> %s" % (peer.handles[0], message.body))
108
109 # we only update the address table if the speaker is same as peer
110
111 try:
112 idx = peer.handles.index(message.speaker)
113 except:
114 idx = None
115
116 if idx != None:
117 self.state.update_address_table({"handle": message.speaker,
118 "address": address[0],
119 "port": address[1]
120 })
121 self.conditionally_update_address_table(peer, message, address)
122 # send the message to all clients
123 for c in self.clients:
124 if (self.clients[c].is_addressed_to_me(message.body)):
(193 . 12)(183 . 26)
126 self.print_debug("[%s:%d] -> malformed packet: %s" % packet_info)
127 return
128 elif error_code == IGNORED:
129 self.conditionally_update_address_table(peer, message, address)
130 self.print_debug("[%s:%d] -> ignoring packet: %s" % packet_info)
131 return
132 elif error_code == INVALID_SIGNATURE:
133 pass
134 self.print_debug("[%s:%d] -> martian packet: %s" % packet_info)
135
136 # we only update the address table if the speaker is same as peer
137
138 def conditionally_update_address_table(self, peer, message, address):
139 try:
140 idx = peer.handles.index(message.speaker)
141 except:
142 idx = None
143
144 if idx != None:
145 self.state.update_address_table({"handle": message.speaker,
146 "address": address[0],
147 "port": address[1]
148 })
149 def peer_message(self, message):
150 message.original = True
151 if message.command == DIRECT: