[RELEASE]TEMPORARY (MAYBE OFFICIAL) FIX FOR SIEGE/DF ERRORS

01/12/2010 23:31 daddycool.#1
Hello Epvpers,
to all who are having problems with the siege script and also
Deadfront not starting properly I have here a temporary fix.
Need more tests, as my time is short, i leave it here to all try
to improve it and also test it more.

Query:

Code:
USE [Character]
GO

/****** Object:  UserDefinedFunction [dbo].[FN_BinDateToDateTime]    Script Date: 01/10/2010 19:35:14 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO




/******************************************************************************
   이  름 : dbo.FN_BinDateToDateTime
   설  명 : Binary Date를 DateTime 형식으로 반환한다.
   반환값 : 
   수정내역:
   Ver        Date        Author           Description
   ---------  ----------  ---------------  ------------------------------------
   1.0        2006-05-05  Han Ji Wook      1. 초기생성
   2.0        2010-01-10  ADM-Cyrax/Darth Nerd
 ******************************************************************************/
ALTER  FUNCTION [dbo].[FN_BinDateToDateTime] (
	@i_bin_time	binary(4)
) RETURNS datetime
AS
BEGIN
	DECLARE @v_datetime	datetime
	DECLARE @v_strAux varchar(20)
	DECLARE @v_strtime	varchar(20)
	SET @v_strAux = CAST(CAST(@i_bin_time as int) as varchar(20))
	IF len(@v_strAux) = 7	
		SELECT	@v_strtime	= '20100' + CAST(CAST(@i_bin_time as int) as varchar(20))
	ELSE
		IF len(@v_strAux) = 8 
			SELECT	@v_strtime	= '2010' + CAST(CAST(@i_bin_time as int) as varchar(20))
		ELSE
				SELECT	@v_strtime	= '201' + CAST(CAST(@i_bin_time as int) as varchar(20))

	
	SELECT	@v_strtime	= SUBSTRING(@v_strtime,1,4)
						+'-'+SUBSTRING(@v_strtime,5,2)
						+'-'+SUBSTRING(@v_strtime,7,2)
						+' '+SUBSTRING(@v_strtime,9,2)
						+':'+SUBSTRING(@v_strtime,11,2)	
	SELECT	@v_datetime = CAST(@v_strtime as datetime)
	RETURN @v_datetime
END
Don't forgot to leave "THANKS" if i help. :mofo:
01/12/2010 23:35 l2zeo#2
good job!
i heartily thank.
01/12/2010 23:38 maleket-el-oloob#3
:confused:
01/12/2010 23:57 daddycool.#4
@maleket-el-oloob
Maybe u need to re-run the querys from SN.txt and the siege script.
01/13/2010 00:14 EliteWarrior#5
Any one verified this working on sql 2005? Im busy atm with some other things so cant do it if it not works i need to again restore database wich i dont want to .
01/13/2010 00:15 Decima#6
what are you going to do next year lol
01/13/2010 00:18 l2zeo#7
Quote:
Originally Posted by Decima View Post
what are you going to do next year lol
well ..that seem to be true words .. lol
01/13/2010 00:38 maleket-el-oloob#8
Thank you :handsdown:
01/13/2010 00:45 daddycool.#9
Next year, the query will be the same... i don't remove the original statment i just add 2 more possibilities.

Sry my poor english.
01/13/2010 01:35 maleket-el-oloob#10
so if i Go to BACKUP Databases i will BACKUP Databases with u new Code ?

Quote:
Originally Posted by Darth Nerd View Post
Hello Epvpers,
to all who are having problems with the siege script and also
Deadfront not starting properly I have here a temporary fix.
Need more tests, as my time is short, i leave it here to all try
to improve it and also test it more.

Query:

Code:
USE [Character]
GO

/****** Object:  UserDefinedFunction [dbo].[FN_BinDateToDateTime]    Script Date: 01/10/2010 19:35:14 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO




/******************************************************************************
   이  름 : dbo.FN_BinDateToDateTime
   설  명 : Binary Date를 DateTime 형식으로 반환한다.
   반환값 : 
   수정내역:
   Ver        Date        Author           Description
   ---------  ----------  ---------------  ------------------------------------
   1.0        2006-05-05  Han Ji Wook      1. 초기생성
   2.0        2010-01-10  ADM-Cyrax/Darth Nerd
 ******************************************************************************/
ALTER  FUNCTION [dbo].[FN_BinDateToDateTime] (
	@i_bin_time	binary(4)
) RETURNS datetime
AS
BEGIN
	DECLARE @v_datetime	datetime
	DECLARE @v_strAux varchar(20)
	DECLARE @v_strtime	varchar(20)
	SET @v_strAux = CAST(CAST(@i_bin_time as int) as varchar(20))
	IF len(@v_strAux) = 7	
		SELECT	@v_strtime	= '20100' + CAST(CAST(@i_bin_time as int) as varchar(20))
	ELSE
		IF len(@v_strAux) = 8 
			SELECT	@v_strtime	= '2010' + CAST(CAST(@i_bin_time as int) as varchar(20))
		ELSE
				SELECT	@v_strtime	= '200' + CAST(CAST(@i_bin_time as int) as varchar(20))

	
	SELECT	@v_strtime	= SUBSTRING(@v_strtime,1,4)
						+'-'+SUBSTRING(@v_strtime,5,2)
						+'-'+SUBSTRING(@v_strtime,7,2)
						+' '+SUBSTRING(@v_strtime,9,2)
						+':'+SUBSTRING(@v_strtime,11,2)	
	SELECT	@v_datetime = CAST(@v_strtime as datetime)
	RETURN @v_datetime
END
Don't forgot to leave "THANKS" if i help. :mofo:
01/13/2010 02:15 l2zeo#11
Quote:
Originally Posted by Darth Nerd View Post
Next year, the query will be the same... i don't remove the original statment i just add 2 more possibilities.

Sry my poor english.

next siege time, error seems to become.
:0

[Only registered and activated users can see links. Click Here To Register...]
01/13/2010 03:15 Decima#12
what i mean, is 2011 isnt one of the possibilites, if im looking at it right (even tho it is poorly coded, sorry) it looks like it can either be a year that starts with '200' (i.e. 2009, 2008, 2008) or it can be 2010, so next year, even tho this one doesnt work correctly now, its not going to work . . .
01/13/2010 13:39 daddycool.#13
Okay, as i have said previously... this script needs to be tested more times, and also improved. Just a temporary fix.
01/13/2010 13:48 l2zeo#14
Quote:
Originally Posted by Darth Nerd View Post
Okay, as i have said previously... this script needs to be tested more times, and also improved. Just a temporary fix.
siege date, part is fixed by 2000.

come good result and cheers up together! lol
01/13/2010 13:49 Decima#15
Quote:
Originally Posted by Darth Nerd View Post
Okay, as i have said previously... this script needs to be tested more times, and also improved. Just a temporary fix.
hey man, at least ur making a damn good attempt at learning how it works tho, u got the right idea, just need to apply it in a different way, think outside the box ;)