fstream/modules/connlimit.py
2022-05-29 14:31:07 +02:00

11 lines
309 B
Python

def main():
def onConnectionEvent(event,eEnv,connection,address):
count = 0
with clientDataLock:
for cID in clientData:
if getClientData(cID,"address") == address:
count += 1
if count >= maxConnections: return False
return True
addEventHandler("onConnection",onConnectionEvent)
main()