add interface legendsockssr
@@ -410,13 +410,19 @@ class DbTransfer(TransferBase):
class Dbv3Transfer(DbTransfer):
def __init__(self):
super(Dbv3Transfer, self).__init__()
- self.key_list += ['id', 'method']
+ self.update_node_state = True if get_config().API_INTERFACE != 'legendsockssr' else False
+ if self.update_node_state:
+ self.key_list += ['id']
+ self.key_list += ['method']
+ if self.update_node_state:
self.ss_node_info_name = 'ss_node_info_log'
if get_config().API_INTERFACE == 'sspanelv3ssr':
self.key_list += ['obfs', 'protocol']
if get_config().API_INTERFACE == 'glzjinmod':
self.key_list += ['obfs', 'protocol']
self.ss_node_info_name = 'ss_node_info'
+ else:
+ self.key_list += ['obfs', 'protocol']
self.start_time = time.time()
def update_all_user(self, dt_transfer):
@@ -458,6 +464,7 @@ class Dbv3Transfer(DbTransfer):
query_sub_when2 += ' WHEN %s THEN d+%s' % (id, int(transfer[1] * self.cfg["transfer_mul"]))
update_transfer[id] = transfer
+ if self.update_node_state:
cur = conn.cursor()
try:
if id in self.port_uid_table:
@@ -486,6 +493,7 @@ class Dbv3Transfer(DbTransfer):
logging.error(e)
cur.close()
+ if self.update_node_state:
try:
cur = conn.cursor()
try:
@@ -518,6 +526,7 @@ class Dbv3Transfer(DbTransfer):
cur = conn.cursor()
+ if self.update_node_state:
node_info_keys = ['traffic_rate']
try:
cur.execute("SELECT " + ','.join(node_info_keys) +" FROM ss_node where `id`='" + str(self.cfg["node_id"]) + "'")
