Post Pacific

Post Pacific (https://postpacific.loc-online.com/index.php)
-   Темы без сохранившегося раздела (https://postpacific.loc-online.com/forumdisplay.php?f=10001)
-   -   [HELP] Manor System & Database (https://postpacific.loc-online.com/showthread.php?t=6792)

Osito2Dancer 07.02.2007 21:31

[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 :p.

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.

nish 08.02.2007 06:19

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


HF 08.02.2007 07:11

Quote:

Originally Posted by nish (Post 77817)
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

rodier 08.02.2007 12:28

i have same problem on c4 pts.. and im getting errors with that procedure in cacheD :(

chacina 09.02.2007 03:51

yeah error in cached :(

chacina 09.02.2007 04:58

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



All times are GMT. The time now is 15:09.