librelist archives

« back to archive

继续bug...

继续bug...

From:
Uno Young
Date:
2012-10-24 @ 09:32
最新的bamboo中:

mixins/custom.lua


               -- XXX: this is a odd api, useless
196                 -- TODO: add score argument appending
197                 updateCustom = function (self, key, val)
198                         I_AM_CLASS_OR_INSTANCE(self)
199                         checkType(key, 'string')
200                         local custom_key = makeCustomKey(self, key)

201
202                         if not db:exists(custom_key) then
print('[Warning] @updateCustom - This custom key does not exist.'); return
nil end
203                         local store_type = db:type(custom_key)
204                         local store_module = getStoreModule(store_type)
205                         return store_module.update(custom_key, val)
206
207                 end;
208
209                 removeCustomMember = function (self, key, val)
210                         I_AM_CLASS_OR_INSTANCE(self)
211                         checkType(key, 'string')
212                         local custom_key = makeCustomKey(self, key)

213
214                         if not db:exists(custom_key) then
print('[Warning] @removeCustomMember - This custom key does not exist.');
return nil end
215                         local store_type = db:type(custom_key)
216                         local store_module = getStoreModule(store_type)
217                         return store_module.remove(custom_key, val)
218
219                 end;
220
221                 addCustomMember = function (self, key, val, st, score)
222                         I_AM_CLASS_OR_INSTANCE(self)
223                         checkType(key, 'string')
224                         local custom_key = makeCustomKey(self, key)

225
226                         if not db:exists(custom_key) then
print('[Warning] @addCustomMember - This custom key does not exist.'); end
227                         local store_type = db:type(custom_key) ~=
'none' and db:type(custom_key) or st
228                         local store_module = getStoreModule(store_type)
229                         return store_module.add(custom_key, val, score)
230
231                 end;



红色的函数未定义,需添加  local getStoreModule = bamboo.internals.getStoreModule