Beispiel #1
0
def delta(fro, chan, message):
	if chan.startswith("#"):
		return
	if not glob.conf.config["server"]["deltaurl"].strip():
		return "Delta is disabled."
	userToken = glob.tokens.getTokenFromUserID(userUtils.getID(fro), ignoreIRC=True, _all=False)
	if userToken is None:
		return "You must be connected from a game client to switch to delta"
	if not generalUtils.stringToBool(glob.conf.config["server"]["publicdelta"]) and not userToken.admin:
		return "You can't use delta yet. Try again later."
	userToken.enqueue(serverPackets.switchServer(glob.conf.config["server"]["deltaurl"]))
	return "Connecting to delta..."
Beispiel #2
0
def switchServer(fro, chan, message):
    # Get target user ID
    target = message[0]
    newServer = message[1]
    targetUserID = userUtils.getIDSafe(target)
    userID = userUtils.getID(fro)

    # Make sure the user exists
    if not targetUserID:
        return "{}: user not found".format(target)

    # Connect the user to the end server
    userToken = glob.tokens.getTokenFromUserID(userID,
                                               ignoreIRC=True,
                                               _all=False)
    userToken.enqueue(serverPackets.switchServer(newServer))

    # Disconnect the user from the origin server
    # userToken.kick()
    return "{} has been connected to {}".format(target, newServer)