Remove duplicate timestamp to avoid close messages to pass

This commit is contained in:
AnthorNet 2018-12-13 09:01:01 +01:00
parent 193b90fcaf
commit a54b0bd04e

View File

@ -32,7 +32,7 @@ class DuplicateMessages(Thread):
def isDuplicated(self, json):
with self.lock:
# Test messages are not duplicate
# Test messages are never duplicate, would be a pain to wait for another test :D
if re.search('test', json['$schemaRef'], re.I):
return False
@ -50,6 +50,10 @@ class DuplicateMessages(Thread):
if 'DistFromStarLS' in jsonTest['message']:
jsonTest['message']['DistFromStarLS'] = int(jsonTest['message']['DistFromStarLS'] + 0.5)
# Remove journal timestamp (Mainly to avoid multiple scan messages and faction influences)
if 'timestamp' in jsonTest['message']:
del jsonTest['message']['timestamp']
message = simplejson.dumps(jsonTest, sort_keys=True) # Ensure most duplicate messages will get the same key
key = hashlib.sha256(message).hexdigest()