27 lines
587 B
Python
27 lines
587 B
Python
from core.main import connections, help
|
|
|
|
def sendData(addr, data):
|
|
connections[addr].send(data)
|
|
|
|
def sendSuccess(addr, data):
|
|
sendData(addr, "[y] " + data)
|
|
|
|
def sendFailure(addr, data):
|
|
sendData(addr, "[n] " + data)
|
|
|
|
def sendInfo(addr, data):
|
|
sendData(addr, "[i] " + data)
|
|
|
|
def sendAll(data):
|
|
for i in connections:
|
|
connections[i].send(data)
|
|
return
|
|
|
|
def incorrectUsage(addr, mode):
|
|
if mode == None:
|
|
sendFailure(addr, "Incorrect usage")
|
|
return
|
|
if mode in help.keys():
|
|
sendFailure(addr, "Usage: " + help[mode])
|
|
return
|