Пример #1
0
def send_flower_boss_mail_offline(entityID, configID, rank, damage):
    if not configID:
        return
    p = Player.simple_load(entityID, ['friendfb_kill_count'])
    p.friendfb_kill_count += 1
    config = get_config(FriendfbRewardConfig).get(configID)
    rewards = {}
    if config:
        rewards = parse_reward(config.rewards)
    p.save()
    title, content, ID = get_mail("FlowerBoss")
    content = content.format(damage, rank)
    do_send_mail(entityID, title, content, addition=rewards, configID=ID)
    return True
Пример #2
0
def invite_friend_offline(friendID, friendfbID, name, fbname):
    field = "friendfb_list"
    encode = Player.fields[field].encoder or (lambda s: s)
    key = "_".join([field, "p{%d}" % friendID])
    if not Player.pool.execute("HSET", key, encode(friendfbID), ""):
        False
    title, content, ID = get_mail("FriendInvite")
    do_send_mail(
        friendID,
        title,
        content.format(name, fbname),
        cd=FRIENDFB_INTERVAL, configID=ID)
    join_friendfb(friendfbID, friendID)
    return True
Пример #3
0
def send_flower_boss_mail(entityID, configID, rank, damage):
    if not configID:
        return
    p = g_entityManager.get_player(entityID)
    p.friendfb_kill_count += 1
    p.save()
    p.sync()
    config = get_config(FriendfbRewardConfig).get(configID)
    rewards = {}
    if config:
        rewards = parse_reward(config.rewards)
    title, content, ID = get_mail("FlowerBoss")
    content = content.format(damage, rank)
    do_send_mail(entityID, title, content, addition=rewards, configID=ID)
    return True
Пример #4
0
def invite_friend(friendID, friendfbID, name, fbname):
    f = g_entityManager.get_player(friendID)
    if friendfbID in f.friendfb_list:
        return False
    title, content, ID = get_mail("FriendInvite")
    do_send_mail(
        friendID,
        title,
        content.format(name, fbname),
        cd=FRIENDFB_INTERVAL, configID=ID)
    f.friendfb_list.add(friendfbID)
    join_friendfb(friendfbID, friendID)
    f.save()
    f.sync()
    return True
Пример #5
0
def gift_friend(friendID, name, rewards):
    title, content, ID = get_mail("FriendGift")
    do_send_mail(
        friendID, title,
        content.format(name), addition=rewards, configID=ID)
    return True