Go to the documentation of this file.
23 from time
import localtime, strftime, time
26 from CFDataFile
import CFDataFile, CFData
29 sys.path.append(os.path.join(Crossfire.DataDirectory(), Crossfire.MapDirectory(),
'templates',
'guild'))
30 from guilds
import guilds
31 guildlisting =
list(
map(
lambda x: x.id, guilds))
32 Crossfire.Log(Crossfire.LogDebug,
'Found guilds: %s' % guildlisting)
33 for guild
in guildlisting:
36 Crossfire.Log(Crossfire.LogInfo,
'New Guild: %s' %guild)
40 for guild
in guildlist:
41 memberlist =
CFGuild(guild).list_members()
42 for member
in memberlist:
48 '''Inter-Guild management class'''
51 guildhousesheader= [
'Founded_Date',
'Points',
'Status',
'Quest_points']
52 self.
status=[
'active',
'suspended',
'probation',
'inactive']
69 ,
'Founded_Date' :
'never'
71 ,
'Status' :
'inactive'
81 record = self.
info(name)
82 date = strftime(
"%a, %d %b %Y", localtime(time()))
84 record[
'Founded_Date'] = date
85 record[
'Status'] =
'active'
92 record = self.
info(name)
95 record[
'Status'] = status
104 record = self.
info(name)
106 temp =
int(record[
'Quest_points'])
107 if temp + number >= self.
qpcap:
111 record[
'Quest_points'] = temp
118 record = self.
info(name)
120 temp =
int(record[
'Points'])
125 record[
'Points'] = temp
135 guildheader = [
'Join_date',
'Rank',
'Status',
'Dues',
'Demerits',
'Quest_points']
136 self.
ranks=[
'Initiate',
'Novice',
'Guildman',
'Journeyman',
'Master',
'GuildMaster']
137 self.
status=[
'suspended',
'probation',
'good']
145 date = strftime(
"%a, %d %b %Y", localtime(time()))
182 record = self.
info(name)
184 temp =
int(record[
'Demerits'])
189 record[
'Demerits'] = temp
196 record = self.
info(name)
198 temp =
int(record[
'Demerits'])
199 if temp - number <=0:
203 record[
'Demerits'] = temp
210 record = self.
info(name)
212 temp =
int(record[
'Quest_points'])
213 if temp + number >= self.
qpcap:
217 record[
'Quest_points'] = temp
224 record = self.
info(name)
226 temp =
int(record[
'Dues'])
227 if temp + number >= self.
duescap:
231 record[
'Dues'] = temp
240 record = self.
info(name)
249 record = self.
info(name)
252 record[
'Status'] = status
261 record = self.
info(name)
263 currentrank = record[
'Rank']
264 if currentrank !=
'GuildMaster':
267 record[
'Rank'] = self.
ranks[newrank]
276 record = self.
info(name)
278 currentrank = record[
'Rank']
279 if currentrank !=
'Initiate':
281 Crossfire.Log(Crossfire.LogDebug,
"ranknum = %d"%ranknum)
283 record[
'Rank'] = self.
ranks[newrank]
def clear_dues(self, name, number)
def promote_member(self, name)
def add_member(self, name, rank)
def remove_demerits(self, name, number)
def change_status(self, name, status)
def change_status(self, name, status)
def add_guild(self, name)
def update_points(self, name, number)
def remove_member(self, name)
def establish(self, name)
def pay_dues(self, name, number)
def add_questpoints(self, name, number)
def demote_member(self, name)
def __init__(self, guildname)
def add_demerits(self, name, number)
def add_questpoints(self, name, number)