import { ApiCall } from "tsrpc";
import { Reqmetrics, Resmetrics } from "../../monopoly/protocols/games/Ptlmetrics";

export default async function (call: ApiCall<Reqmetrics, Resmetrics>) {
    // 当前区服付费人数
    let now_paid_user_num = await G.mongodb.collection('payLogNew').countDocuments({})
    // 当前区服在线人数
    let now_login_user_num = await G.mongodb.collection('user').countDocuments({ newonlinetime: { $gte: G.time - 90, $lte: G.time + 30 } })
    // 当前区服注册人数
    let now_register_user_num = await G.mongodb.collection('user').countDocuments({})

    call.succ({
        now_paid_user_num: now_paid_user_num, 
        now_login_user_num: now_login_user_num,
        now_register_user_num: now_register_user_num
    });
}