summaryrefslogtreecommitdiffstats
path: root/ogclient
diff options
context:
space:
mode:
Diffstat (limited to 'ogclient')
-rwxr-xr-xogclient18
1 files changed, 0 insertions, 18 deletions
diff --git a/ogclient b/ogclient
index 4734e07..170330e 100755
--- a/ogclient
+++ b/ogclient
@@ -24,27 +24,9 @@ from src.ogClient import *
from src.log import *
-def send_event_dgram(msg, ip='127.0.0.1', port=55885):
- sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
- sock.sendto(bytes(msg, "utf-8"), (ip, port))
-
-
def create_parser():
- events = ['login', 'logout']
parser = argparse.ArgumentParser()
parser.set_defaults(func=None)
- subparsers = parser.add_subparsers()
-
- parser_event = subparsers.add_parser('event')
-
- subparsers_event = parser_event.add_subparsers()
- parser_event_login = subparsers_event.add_parser('login')
- parser_event_login.set_defaults(func=lambda x: send_event_dgram(f'session start {x.user}'))
- parser_event_login.add_argument('user', type=str)
- parser_event_logout = subparsers_event.add_parser('logout')
- parser_event_logout.set_defaults(func=lambda x: send_event_dgram(f'session stop {x.user}'))
- parser_event_logout.add_argument('user', type=str)
-
parser.add_argument('-c', '--config', default="",
help='ogClient JSON config file path')
parser.add_argument('--debug', default=False,