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.
 
 
 
 
 
 

36 lines
1.1 KiB

namespace Game
{
public static class ActivityTick
{
private static long lastTickTime;
public static int OnTick(PlayerOnGame player,long nowSecond)
{
if (lastTickTime == 0)
{
lastTickTime = nowSecond;
}
AbstractActivity.TickAll(player);
return 0;
}
public static void OnRoleEnter(PlayerOnGame player)
{
var allType = AbstractActivity.GetAllActivityTypes();
AbstractActivity.TickAll(player);//登陆之后强制tick一次,防止客户端拿不到数据
foreach (var activity in allType)
{
activity.Value.OnRoleEnter(player);
}
AbstractActivity.SyncActivity(player);
}
public static void OnSystemUnlock(PlayerOnGame player, int unlockId)
{
var allType = AbstractActivity.GetAllActivityTypes();
foreach (var activity in allType)
{
activity.Value.OnSystemUnlock(player, unlockId);
}
}
}
}