5 klass = self.class.to_s.gsub(/.*::/ , '').downcase
7 @fp = 'skel/' + klass + @suffix
9 @header, @footer = true, true
16 _ << "<title>#{GAME_TITLE} #{@title}</title>\n"
18 _ << "<title>#{GAME_TITLE}</title>\n"
21 _ << HEAD2.sub(/<body.*/, '<body>')
28 FOOT + "</div></body></html>"
32 erb = Erubis::Eruby.load_file(@fp)
33 # erb = ERB.new(File.read(@fp))
36 _ << header() if @header
37 _ << erb.result(binding)
38 _ << footer() if @footer
44 def initialize(login, changes, villages)
49 changes = changes.sort {|x, y| y[0] <=> x[0]}
50 @changes = changes[0, S[:index_info]]
51 @villages = villages.reverse.each {|v|
52 np = (v['state'] == 0) ? DB::Village.players(v['vid']).size : ''
53 v['state_str'] = STATES[v['state']]
54 if v['state'] < Vil::State::Ready
55 v['state_str'] += "<br>(#{np.to_s}/#{S[:max_entries]})"
57 v['start_str'] = v['start'].strftime("%H時%M分")
67 ckey = File.mtime(S[:vilsdb_path]).to_i.to_s
68 cache = Cache::FileCache.new(:root_dir => S[:cache_dir] + 'log/')
71 @villages = cache.get_object(ckey)
72 rescue Cache::CacheMiss
74 @villages = DB::Villages.select {|v| v['state'] == 4 }
75 cache.set_object(ckey, @villages)
84 def initialize(login, history)
94 def initialize(login, changes)
103 class MakeVillage < Base
104 def initialize(login)
112 class CharList < Base
113 def initialize(login, chars)
122 class Document < Base
123 def initialize(login)
131 class Regulation < Base
132 def initialize(login)
136 ckey = File.mtime(S[:reg_file]).to_i.to_s
137 cache = Cache::FileCache.new(:root_dir => S[:cache_dir] + 'reg/')
140 @table = cache.get_object(ckey)
141 rescue Cache::CacheMiss
144 Vil::Regulation::Table.keys().sort.each {|num|
145 @table[num] = Vil::Regulation.to_str(num)
147 cache.set_object(ckey, @table)
156 def initialize(login, village, date, player)
164 @title = "#{@vil.vid} #{@vil.name}"
168 class ActionBalloon < Base
169 def initialize(player, login, village)
172 @header, @footer = false, false
180 @fp = 'skel/' + klass + @suffix
185 def initialize(login, vil)
187 @header, @footer = false, false
191 @up = @vil.update_time
192 @orders = (vil.state == 3) ? show_winner() : show_update()
193 @orders << PLEASE_LOGIN unless @login.login
200 [c(SHOW_WINNER_STATIC, @vil.winner, @up.hour, @up.min)]
206 if @vil.state == Vil::State::Welcome
207 #2009/01/25 mod tkt for min_entries by coretime|| min_entries = (@vil.first_restart) ? S[:min_entries] : S[:apply_advance_num]
208 min_entries = (@vil.first_restart) ? min_entries_num(@up, true) : S[:apply_advance_num]
209 _ << c(SHOW_UPDATE_PR_STATIC, @up.hour, @up.min, @up.sec, min_entries)
211 _ << c(SHOW_UPDATE_STATIC, @up.hour, @up.min, @up.sec)