fix
This commit is contained in:
parent
8680079893
commit
970b35d4c7
15
server.py
15
server.py
@ -3,22 +3,23 @@
|
|||||||
from irc import client, connection
|
from irc import client, connection
|
||||||
from socket import socket, AF_INET, SOCK_DGRAM
|
from socket import socket, AF_INET, SOCK_DGRAM
|
||||||
|
|
||||||
from os import chdir, path
|
#from os import chdir, path
|
||||||
from threading import Thread
|
from threading import Thread
|
||||||
|
|
||||||
host = '10.10.13.8'
|
host = '10.10.13.2'
|
||||||
port = '7777'
|
port = 7747
|
||||||
addr = (host,port)
|
addr = (host,port)
|
||||||
|
|
||||||
irc_host = 's1.tomasgl.piv'
|
irc_host = '10.200.201.4'
|
||||||
irc_port = '6667'
|
irc_port = 6667
|
||||||
irc_chat_name = '#notifications'
|
irc_chat_name = '#notifications'
|
||||||
irc_bot_nickname = 'GandC_LogMon_Bot'
|
irc_bot_nickname = 'GandC_LogMon_Bot'
|
||||||
|
|
||||||
s = socket(AF_INET, SOCK_DGRAM) # Socket creation
|
s = socket(AF_INET, SOCK_DGRAM) # Socket creation
|
||||||
s.bind(addr) # Bind socket to ip
|
s.bind(addr) # Bind socket to ip
|
||||||
|
|
||||||
|
|
||||||
chdir(path.dirname(path.abspath(__file__)))
|
#chdir(path.dirname(path.abspath(__file__)))
|
||||||
|
|
||||||
def on_connect(connection, event):
|
def on_connect(connection, event):
|
||||||
connection.mode(irc_bot_nickname, '+B')
|
connection.mode(irc_bot_nickname, '+B')
|
||||||
@ -32,7 +33,7 @@ def on_disconnect(connection, event):
|
|||||||
|
|
||||||
reactor = client.Reactor()
|
reactor = client.Reactor()
|
||||||
irc = reactor.server()
|
irc = reactor.server()
|
||||||
irc.connect(irc_host, int(irc_port), irc_bot_nickname)
|
irc.connect(irc_host, irc_port, irc_bot_nickname)
|
||||||
irc.add_global_handler("welcome", on_connect)
|
irc.add_global_handler("welcome", on_connect)
|
||||||
irc.add_global_handler("join", on_join)
|
irc.add_global_handler("join", on_join)
|
||||||
irc.add_global_handler('disconnect', on_disconnect)
|
irc.add_global_handler('disconnect', on_disconnect)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user