<commit_before>//! import "LHBase.j"

library_once Continous initializer InitContinous requires  LHBase


	globals
		integer array IConDays
		integer array ILastTime
		constant integer TIMESTAMP_START = 1501027200
		86400
		57600
	endglobals
//---------------------------------------------------------------------------------------------------
	/*
	     初始化你的登录时间
	*/
	function InitContinousData takes player p returns nothing
		set IConDays[i] = DzAPI_Map_GetStoredInteger(p, "IConDays")
		set ILastTime[i] = DzAPI_Map_GetStoredInteger(p, "ILastTime")
	endfunction
//---------------------------------------------------------------------------------------------------
	/*
	    设置连续时间
	*/
	function SetDenglu takes player p returns nothing
		local integer current = DzAPI_Map_GetGameStartTime()
		local integer i = GetConvertedPlayerId(p)
		//当天则无影响
		if (current < () ) then
			// body...
		endif
		call DzAPI_Map_StoreInteger( p,  "ILastTime", current )
	endfunction
//---------------------------------------------------------------------------------------------------

	
	private function InitContinous takes nothing returns nothing
		
	endfunction

endlibrary<commit_msg>continous<commit_after>//! import "LHBase.j"

library_once Continous initializer InitContinous requires  LHBase


	globals
		integer array IConDays
		integer array ILastTime
		constant integer TIMESTAMP_START = 1500998400
	endglobals
//---------------------------------------------------------------------------------------------------
	/*
	    获取连续时间
	*/
	function GetContinousDay takes player p returns integer
		if (DzAPI_Map_GetGameStartTime() <= ILastTime[GetConvertedPlayerId(p)]) then
			return 1
		endif
		return (DzAPI_Map_GetGameStartTime() - ILastTime[GetConvertedPlayerId(p)])/86400
	endfunction
//---------------------------------------------------------------------------------------------------
	/*
	    获取当前时间的0点
	*/
	private function GetCurrentStartTime takes nothing returns integer
		return TIMESTAMP_START + ((DzAPI_Map_GetGameStartTime() - ILastTime[GetConvertedPlayerId(p)])/86400)*86400
	endfunction
//---------------------------------------------------------------------------------------------------
	/*
	     初始化你的登录时间
	*/
	function InitContinousData takes player p returns nothing
		set IConDays[i] = DzAPI_Map_GetStoredInteger(p, "IConDays")
		set ILastTime[i] = DzAPI_Map_GetStoredInteger(p, "ILastTime")
	endfunction
//---------------------------------------------------------------------------------------------------
	/*
	    保存登录状态
	*/
	function SaveLoginState takes player p returns nothing
		call DzAPI_Map_StoreInteger( p,  "IConDays", IConDays[GetConvertedPlayerId(p)] )
		call DzAPI_Map_StoreInteger( p,  "ILastTime", ILastTime[GetConvertedPlayerId(p)] )
	endfunction
//---------------------------------------------------------------------------------------------------
	/*
	    设置连续时间
	*/
	function SetDenglu takes player p returns nothing
		//活动还没开始
		if (ILastTime[GetConvertedPlayerId(p)] < TIMESTAMP_START) then
			set ILastTime[GetConvertedPlayerId(p)] = TIMESTAMP_START
			set ConDays[GetConvertedPlayerId(p)] = 1
			call SaveLoginState()
		endif
		if (current < () ) then
			// body...
		endif
	endfunction
//---------------------------------------------------------------------------------------------------

	
	private function InitContinous takes nothing returns nothing
		
	endfunction

endlibrary
{'fraction_non_alphanumeric': 0.320958783981292, 'fraction_numerical': 0.014030985092078339, 'mean_word_length': 1.4941690962099126, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4577806', 'n_tokens_mistral': 1003, 'n_tokens_neox': 915, 'n_words': 202}