コード例 #1
0
ファイル: chat.py プロジェクト: thooge/Wolfpack
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)
コード例 #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)
コード例 #3
0
ファイル: pages.py プロジェクト: thooge/Wolfpack
    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)
コード例 #4
0
ファイル: chat.py プロジェクト: thooge/Wolfpack
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)
コード例 #5
0
ファイル: chat.py プロジェクト: thooge/Wolfpack
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)
コード例 #6
0
ファイル: chat.py プロジェクト: thooge/Wolfpack
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
コード例 #7
0
ファイル: chat.py プロジェクト: thooge/Wolfpack
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
コード例 #8
0
ファイル: chat.py プロジェクト: thooge/Wolfpack
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)