Ejemplo n.º 1
0
def changechannelpassword(socket, password):

	# Get the Player, account and Channel
	player = socket.player
	account = socket.account
	channel = socket.gettag('ChatChannel')
	
	# Check if we're Moderators or Staffers
	if account.acl != 'player' or socket.hastag('Moderator'):
		
		conferences = int(wolfpack.getoption('channels', '0'))

		for i in range(1, conferences+1):

			channelname = wolfpack.getoption('channel_name_%u' % i, '')
			channelpass = wolfpack.getoption('channel_pass_%u' % i, '0')

			if channelname == channel:
				wolfpack.setoption('channel_pass_%u' % i, password)
				break

		send_msgpasschanged(socket)

	else:

		send_refuseaction(socket)
Ejemplo n.º 2
0
	def load(self):
		count = int(wolfpack.getoption('pages', '0'))
		for i in range(1, count+1):
			pagestr = wolfpack.getoption('page_%u' % i, '')
			if pagestr == '':
				continue
			page = Page(pagestr)
			
			char = wolfpack.findchar(page.serial)
			if char:			
				self.add(page, False)
Ejemplo n.º 3
0
    def load(self):
        count = int(wolfpack.getoption('pages', '0'))
        for i in range(1, count + 1):
            pagestr = wolfpack.getoption('page_%u' % i, '')
            if pagestr == '':
                continue
            page = Page(pagestr)

            char = wolfpack.findchar(page.serial)
            if char:
                self.add(page, False)
Ejemplo n.º 4
0
def listconferences(socket):

	conferences = int(wolfpack.getoption('channels', '0'))
	
	if conferences:
		
		for i in range(1, conferences+1):
			
			channelname = wolfpack.getoption('channel_name_%u' % i, '')
			channelpass = wolfpack.getoption('channel_pass_%u' % i, '0')

			if len(channelname):

				send_conference(socket, channelname, channelpass)
Ejemplo n.º 5
0
def create_conference(socket, channelname, password, havepass):

	# Lets check if we already have a conference with this name
	if channelname == DEFAULTCHANNEL or checkchannelexist(channelname):
		send_alreadyconferencename(socket)
		return

	# Saving Channel
	conferences = int(wolfpack.getoption('channels', '0'))

	wolfpack.setoption('channel_name_' + str(conferences + 1), channelname)
	if havepass:
		wolfpack.setoption('channel_pass_' + str(conferences + 1), password)

	wolfpack.setoption('channels', str(conferences + 1))

	# Channel Spam
	spam_createchannel(channelname, havepass)

	# Getting Moderator Status
	if socket.account.acl == 'player':
		socket.settag('Moderator', 1)

	# Enter this channel
	enterchannel(socket, channelname)
Ejemplo n.º 6
0
def checkchannelexist(channel):
	
	# Flag
	exist = 0

	conferences = int(wolfpack.getoption('channels', '0'))

	for i in range(1, conferences+1):

		channelname = wolfpack.getoption('channel_name_%u' % i, '')
		channelpass = wolfpack.getoption('channel_pass_%u' % i, '0')

		if channelname == channel:
			exist = 1
			break

	return exist
Ejemplo n.º 7
0
def checkpassword(socket, channel, password):

	# Flag
	correctpass = 0

	conferences = int(wolfpack.getoption('channels', '0'))

	for i in range(1, conferences+1):

		channelname = wolfpack.getoption('channel_name_%u' % i, '')
		channelpass = wolfpack.getoption('channel_pass_%u' % i, '0')

		if channelname == channel:
			if channelpass == password:
				correctpass = 1
			break

	return correctpass
Ejemplo n.º 8
0
def destroychannel(channel):

	conferences = int(wolfpack.getoption('channels', '0'))

	for i in range(1, conferences+1):

		channelname = wolfpack.getoption('channel_name_%u' % i, '')
		channelpass = wolfpack.getoption('channel_pass_%u' % i, '0')

		if channelname == channel:
			
			for j in range(i + 1, conferences+1):

				channelname2 = wolfpack.getoption('channel_name_%u' % j, '')
				channelpass2 = wolfpack.getoption('channel_pass_%u' % j, '0')

				wolfpack.setoption('channel_name_' + str(j - 1), channelname2)
				if channelpass2:
					wolfpack.setoption('channel_pass_' + str(j - 1), channelpass2)

	wolfpack.setoption('channels', str(conferences - 1))

	# Spam Destroy
	spam_destroychannel(channel)