![]() |
|
|
#1 |
|
Архивный участник
Join Date: Mar 2005
Posts: 442
|
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. |
|
|
|
|
#2 |
|
Архивный участник
Join Date: May 2006
Posts: 237
|
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
|
|
|
|
|
#3 |
|
Архивный участник
Join Date: Aug 2005
Posts: 1,531
|
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
|
|
|
|
|
#4 |
|
Архивный участник
Join Date: May 2005
Posts: 979
|
i have same problem on c4 pts.. and im getting errors with that procedure in cacheD
|
|
|
|
|
#5 |
|
Архивный участник
Join Date: Nov 2006
Posts: 28
|
yeah error in cached
|
|
|
|
|
#6 |
|
Архивный участник
Join Date: Nov 2006
Posts: 28
|
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
|
|
|
|
|