noob server need help (emrgcy hlp) about time

07/31/2010 12:10 augustabyron#1
my server need to change the time of siege war, i don't know how to change.
so! i remove all data from siege_info table and siege_resault_log table, for run
siege script again

After that i got new error like this:
[Only registered and activated users can see links. Click Here To Register...]

how to fix it ?

i got this error after i use this script

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. 초기생성
  ******************************************************************************/
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

i thing something wrong on my script but i don't know where

for this error:
The conversion of a varchar data type to a datetime data type resulted in an out-of-range value.

i thing this from:
SELECT @v_strtime = SUBSTRING(@v_strtime,1,4)

bacause when i use like this:
SELECT @v_strtime = SUBSTRING(@v_strtime,4,1)


some function worked, but i don't know why i still got this error
[Only registered and activated users can see links. Click Here To Register...]
Anyone know please help me, please guide where to fix ?

please :confused:


(if i test restore new data base and new installation siege system evrything work but if i edit siege system from current system i got above error,so tried! my friend please help me)
07/31/2010 20:33 gedimazs#2
try this one for me it is working:

Code:
DECLARE @channel_no tinyint
DECLARE @guild_name char(20)
DECLARE @guild_code varchar(10)
DECLARE @v_siege_start_date varchar(14)
DECLARE @v_siege_start_time varbinary(4)
declare @o_dwRegistTime varbinary(4)
DECLARE @v_siege_no char(10)
DECLARE @o_sp_rtn int
DECLARE @v_strDate1 varchar(10)
DECLARE @i_GetDate datetime
DECLARE @V_dwstart varbinary(4)
SET @V_dwstart = cast(cast('0907092010'as int) as varbinary(4)) 
set @i_GetDate=getdate()
SET @guild_name = 'guild_name'
SET @guild_code = '0901000068'
--SET @channel_no = character.dbo.FN_GetSiegeChannelNo('[GM]xxxxxxx')
SET @v_siege_no = character.dbo.FN_DateToShortStrDate(GetDate())
SELECT @v_siege_start_date = CONVERT(VARCHAR(10), DATEADD(d, 4-DATEPART(dw, @i_GetDate), @i_GetDate), 112) + '150000'
SELECT @v_siege_start_time = SUBSTRING(@v_siege_start_date,4,1) * 100000000
+ SUBSTRING(@v_siege_start_date,5,2) * 1000000
+ SUBSTRING(@v_siege_start_date,7,2) * 10000
+ SUBSTRING(@v_siege_start_date,9,2) * 100
+ SUBSTRING(@v_siege_start_date,11,2) 
INSERT
INTO character.dbo.SIEGE_INFO(SIEGE_NO, CHANNEL_NO, GUILD_CODE, GUILD_NAME, DWSTARTTIME, BYREGISTTIMEFLAG, DEFENDER_INFO, SIEGE_TAG)
VALUES (@v_siege_no, 1, @guild_code, @guild_name,@v_siege_start_time, 1, 0x0000, 'Y')
EXEC character.dbo.SP_SIEGE_START_TIME_U @guild_code,1,0x01,@v_siege_start_time OUTPUT,@o_dwRegistTime output,@o_sp_rtn  OUTPUT
set @v_strDate1=character.dbo.FN_BinDateToDateTime(@v_siege_start_time)
declare @P1 varchar(13)
set @P1=NULL
declare @P2 varchar(33)
set @P2=NULL
declare @P3 varchar(25)
set @P3=NULL
declare @P4 varbinary(4)
set @P4=NULL
declare @P5 varbinary(4)
set @P5=NULL
declare @P6 varbinary(4)
set @P6=NULL
declare @P7 varbinary(4)
set @P7=NULL
declare @P8 varbinary(4)
set @P8=NULL
declare @P9 varbinary(4)
set @P9=NULL
declare @P10 varbinary(4)
set @P10=NULL
declare @P11 varbinary(2)
set @P11=NULL
declare @P12 varbinary(2)
set @P12=NULL
declare @P13 varbinary(2)
set @P13=NULL
declare @P14 int
set @P14=NULL
declare @P15 int
set @P15=NULL
declare @P16 varbinary(4)
set @P16=NULL
declare @P17 varbinary(996)
set @P17=NULL
declare @P18 varbinary(996)
set @P18=NULL
declare @P19 varbinary(1000)
set @P19=NULL
declare @P20 int
set @P20=NULL
exec character.dbo.SP_SIEGE_INFO_R 1, @P1 output, @P2 output, @P3 output, @P4 output, @P5 output, @P6 output, @P7 output, @P8 output, @P9 output, @P10 output, @P11 output, @P12 output, @P13 output, @P14 output, @P15 output, @P16 output, @P17 output, @P18 output, @P19 output, @P20 output
07/31/2010 22:51 augustabyron#3
ok your script worked but i still got this error:

[Only registered and activated users can see links. Click Here To Register...]


Anyone know what this mean ?
and how to fix it, when i got this error i can't open siege information,
if view siege information from NPC Bastain i'll got server disconnect.


So my test :
1. i clean all siege info then run server i got normal massage " NOT SIEGE INFO CHANEL INDEX[1] ".

after that my test :
2. i run siege script

Code:
DECLARE @v_siege_no char(10)
DECLARE @guild_code varchar(10)
DECLARE @v_strDate varchar(10)
DECLARE @v_regdate varchar(10)
DECLARE @v_strChannel varchar(2)
DECLARE @i_bychannel tinyint 
DECLARE @o_dwDungeonRegistTime varbinary(4)
DECLARE @o_DeadFrontTimeInfo varbinary(1000)
DECLARE @o_sp_rtn int 
DECLARE @o_dwRegistTimeStart varbinary(4)
DECLARE @o_dwRegistTimeEnd varbinary(4)
DECLARE @o_dwTaxRegistTime varbinary(4)
declare @o_dwRegistTime varbinary(4)
DECLARE @v_strDate1 varchar(10)
DECLARE @i_GetDate datetime 
DECLARE @v_siege_start_date varchar(14)
DECLARE @v_siege_start_time varbinary(4)
declare @guild_name char(20) 
set @i_GetDate=getdate()
SELECT @v_siege_start_date = CONVERT(VARCHAR(10), DATEADD(d, 15-DATEPART(dw, @i_GetDate), @i_GetDate), 112) + '210000'
SELECT @v_siege_start_time = SUBSTRING(@v_siege_start_date,4,1) * 100000000 
+ SUBSTRING(@v_siege_start_date,5,2) * 1000000 
+ SUBSTRING(@v_siege_start_date,7,2) * 10000 
+ SUBSTRING(@v_siege_start_date,9,2) * 100 
+ SUBSTRING(@v_siege_start_date,11,2) 
SET @guild_code = '001' 
SET @guild_name = '<color=ff0000>Master'
SET @v_siege_no = SUBSTRING(dbo.FN_DateToShortStrDate(GetDate()), 3, 4) + '0001' 
INSERT 
INTO GUILD_INFO(guild_code, guild_name, guild_Level, bystate, bychannel)
VALUES (@guild_code, @guild_name, 3, 1, 1)
INSERT
INTO SIEGE_INFO(SIEGE_NO, CHANNEL_NO, GUILD_CODE, GUILD_NAME, DWSTARTTIME, BYREGISTTIMEFLAG, DEFENDER_INFO, SIEGE_TAG)
VALUES (@v_siege_no, 1, @guild_code, @guild_name,@v_siege_start_time, 1, 0X0000, 'Y') 
EXEC SP_SIEGE_START_TIME_U @guild_code,1,0x01,@v_siege_start_time output,@o_dwRegistTime output,@o_sp_rtn output 
set @v_strDate1=dbo.FN_BinDateToDateTime(@v_siege_start_time)
declare @P1 varchar(13) 
set @P1=NULL 
declare @P2 varchar(33) 
set @P2=NULL 
declare @P3 varchar(25) 
set @P3=NULL 
declare @P4 varbinary(4) 
set @P4=NULL 
declare @P5 varbinary(4) 
set @P5=NULL 
declare @P6 varbinary(4) 
set @P6=NULL 
declare @P7 varbinary(4)
set @P7=NULL 
declare @P8 varbinary(4) 
set @P8=NULL 
declare @P9 varbinary(4)
set @P9=NULL 
declare @P10 varbinary(4) 
set @P10=NULL
declare @P11 varbinary(2)
set @P11=NULL
declare @P12 varbinary(2)
set @P12=NULL 
declare @P13 varbinary(2)
set @P13=NULL 
declare @P14 int 
set @P14=NULL 
declare @P15 int 
set @P15=NULL
declare @P16 varbinary(4) 
set @P16=NULL 
declare @P17 varbinary(996) 
set @P17=NULL
declare @P18 varbinary(996) 
set @P18=NULL 
declare @P19 varbinary(1000)
set @P19=NULL 
declare @P20 int 
set @P20=NULL 
exec SP_SIEGE_INFO_R 1, @P1 output, @P2 output, @P3 output, @P4 output, @P5 output, @P6 output, @P7 output, @P8 output, @P9 output, @P10 output, @P11 output, @P12 output, @P13 output, @P14 output, @P15 output, @P16 output, @P17 output, @P18 output, @P19 output, @P20 output
After run above script and start server again then i got this error:
[Only registered and activated users can see links. Click Here To Register...]

this is new problem for me please help.
thank you.
08/01/2010 17:57 LogLife#4
h'm i got this error too , Anyone plaease guilde how to fix ?
08/02/2010 12:19 augustabyron#5
Now! i fixed above successfull by my self, but got a little bit problem
like this :
[Only registered and activated users can see links. Click Here To Register...]


how to change year 2000 to ---> yare 2010 ?
08/02/2010 14:03 gedimazs#6
Quote:
Originally Posted by augustabyron View Post
Now! i fixed above successfull by my self, but got a little bit problem
like this :
[Only registered and activated users can see links. Click Here To Register...]


how to change year 2000 to ---> yare 2010 ?
you can't, next year everything will be ok, it will be showing 2011 but you will not fix to show 2010. So wait till next year :)
08/02/2010 16:32 augustabyron#7
1.This you mean for year 2010 when we go in the game siege year will show 2000 right ?

2.But no have any problem right ?

3.So we have to wait till year 2011 then when we go in the game siege year will be change to 2011 right ?

if(
1=yes
2=yes
3=yes
){echo "are you sure ?"}else{ echo "please you explain more."}

haha
Thank you ma friend
08/02/2010 18:22 pawelxx99l#8
If only to repair twen the mistake will be enough in Querty analizer wklejić this code which I am sending:


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
08/02/2010 18:46 gedimazs#9
Quote:
Originally Posted by augustabyron View Post
1.This you mean for year 2010 when we go in the game siege year will show 2000 right ?

2.But no have any problem right ?

3.So we have to wait till year 2011 then when we go in the game siege year will be change to 2011 right ?

if(
1=yes
2=yes
3=yes
){echo "are you sure ?"}else{ echo "please you explain more."}

haha
Thank you ma friend
{echo" YES, YES, YES"} ;)
08/02/2010 20:31 augustabyron#10
love u all
Thank for share ;)