Post Pacific  

Go Back   Post Pacific > Восстановленный архив > Темы без сохранившегося раздела

Notices

 
 
Thread Tools Search this Thread Display Modes
Old 07.02.2007, 21:31   #1
Osito2Dancer
Архивный участник
 
Join Date: Mar 2005
Posts: 442
Default [HELP] Manor System & Database

Hello to all:

Ill explain my problem: An alliance has captured Giran Castle on my server. Now, they want to set up crop & seed (Manor System), but everytime server restarts, the changes dont get saved. I guess is a problem with DB stored procedures, but i dont know which one, and how does it get called. So my question is for those who know how .

My server was a C1.4 modded, but i created the C4 retail DB from scratch and imported only the tables and such (and made the neccesary adjustments to work), but i might have missed something.

Atte

Oso

PD: If you port from C1.4 to C4, remember to set subjob0_class = class, or else the PC starts like its buried waist-deep onto the ground.
Osito2Dancer is offline  
Old 08.02.2007, 06:19   #2
nish
Архивный участник
 
Join Date: May 2006
Posts: 237
Default

here you go just add this to your DB

Code:
ALTER PROCEDURE dbo.lin_SetLastTaxUpdate
(
@income datetime,
@tax datetime,
@manor datetime
)
AS
declare @income_ varchar(100)
declare @tax_ varchar(100)
set @income_ = cast(@income as varchar)
set @tax_ = cast(@tax as varchar)

set @income =cast( (left(@income_,5) + cast((cast(replace(substring(@income_,6,2),'-','') as int) + 1) as varchar) + substring(@income_, charindex ('-', @income_, 6),100)) as datetime)
set @tax =cast( (left(@tax_,5) + cast((cast(replace(substring(@tax_,6,2),'-','') as int) + 1) as varchar) + substring(@tax_, charindex ('-', @tax_, 6),100)) as datetime)


SET NOCOUNT ON
IF EXISTS(SELECT * FROM castle_tax)
BEGIN
UPDATE castle_tax SET income_update = @income, tax_change = @tax, manor_reset = @manor
END
ELSE
BEGIN
INSERT INTO castle_tax VALUES
( @income, @tax, @manor)

END
GO
nish is offline  
Old 08.02.2007, 07:11   #3
HF
Архивный участник
 
Join Date: Aug 2005
Posts: 1,531
Default

Quote:
Originally Posted by nish View Post
here you go just add this to your DB

Code:
ALTER PROCEDURE dbo.lin_SetLastTaxUpdate
(
@income datetime,
@tax datetime,
@manor datetime
)
AS
....
And this work in January? I'm not sure, because date 2007-0-2 cause error on your cached server with source vars with datetime type
HF is offline  
Old 08.02.2007, 12:28   #4
rodier
Архивный участник
 
Join Date: May 2005
Posts: 979
Default

i have same problem on c4 pts.. and im getting errors with that procedure in cacheD
rodier is offline  
Old 09.02.2007, 03:51   #5
chacina
Архивный участник
 
Join Date: Nov 2006
Posts: 28
Default

yeah error in cached
chacina is offline  
Old 09.02.2007, 04:58   #6
chacina
Архивный участник
 
Join Date: Nov 2006
Posts: 28
Default

i found another procedure but i dont test it...

Code:
ALTER PROCEDURE dbo.lin_SetLastTaxUpdate
(
@income varchar(100),
@tax varchar(100),
@manor varchar(100)
)
AS

declare @income_ datetime
declare @tax_ datetime
declare @manor_ datetime

set @income =left(@income,5) + cast((cast(replace(substring(@income,6,2),'-','') as int) + 1) as varchar) + substring(@income, charindex ('-', @income, 6),100)
set @tax =left(@tax,5) + cast((cast(replace(substring(@tax,6,2),'-','') as int) + 1) as varchar) + substring(@tax, charindex ('-', @tax, 6),100)
set @manor =left(@manor,5) + cast((cast(replace(substring(@manor,6,2),'-','') as int) + 1) as varchar) + substring(@tax, charindex ('-', @tax, 6),100)

set @income_ = convert(datetime, @income)
set @tax_ = convert(datetime, @tax)
set @manor_ = convert(datetime, @manor)


SET NOCOUNT ON
IF EXISTS(SELECT * FROM castle_tax)
BEGIN
UPDATE castle_tax SET income_update = @income_, tax_change = @tax_, manor_reset = @manor_
END
ELSE
BEGIN
INSERT INTO castle_tax VALUES
( @income_, @tax_, @manor_)

END
chacina is offline  
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 17:29.