You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
64 lines
2.0 KiB
64 lines
2.0 KiB
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace bill_statistics
|
|
{
|
|
public static class FirstPlayDeskUtils
|
|
{
|
|
|
|
|
|
public static void OnCostMoneyStartGame(DateTime curedateTime, int uid, Int64 ioldChip, Int64 inewChip, Int64 ichange)
|
|
{
|
|
if (BillAlldays.Instance.m_newUserWithDay.ContainsKey(uid) == false)
|
|
{
|
|
return;
|
|
}
|
|
|
|
int deskIndex = BillTypeUtils.GetDeskTypeIndexByCostMoney(ichange);
|
|
|
|
UserInfo info = BillAlldays.Instance.m_newUserWithDay[uid];
|
|
|
|
info.playGameCountTotalAllDay++;
|
|
|
|
if(info.firstPlayerDeskHour == null)
|
|
{
|
|
info.firstPlayerDeskHour = new int[10];
|
|
}
|
|
if(info.firstPlayerDeskRound == null)
|
|
{
|
|
info.firstPlayerDeskRound = new int[10];
|
|
}
|
|
if (info.firstPlayerDeskHour[deskIndex] == 0)
|
|
{
|
|
info.firstPlayerDeskHour[deskIndex] = info.OnlineTime / 3600 + 1;
|
|
info.firstPlayerDeskRound[deskIndex] = info.playGameCountTotalAllDay;
|
|
}
|
|
}
|
|
|
|
public static void OnLogin(int uid, DateTime curedateTime, int onlineTime)
|
|
{
|
|
if (BillAlldays.Instance.m_newUserWithDay.ContainsKey(uid) == false)
|
|
{
|
|
return;
|
|
}
|
|
|
|
UserInfo info = BillAlldays.Instance.m_newUserWithDay[uid];
|
|
|
|
info.LonginTime = curedateTime;
|
|
}
|
|
|
|
public static void OnLogout(int uid, DateTime curedateTime, int onlineTime)
|
|
{
|
|
if (BillAlldays.Instance.m_newUserWithDay.ContainsKey(uid) == false)
|
|
{
|
|
return;
|
|
}
|
|
|
|
UserInfo info = BillAlldays.Instance.m_newUserWithDay[uid];
|
|
info.OnlineTime += onlineTime;//这里的onlinetime有bug,只是这次在线的时间,所以用累加的
|
|
//info.OnlineTime += (int)(curedateTime - info.LonginTime).TotalSeconds;
|
|
}
|
|
}
|
|
}
|
|
|