Post Pacific  

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

Notices

 
 
Thread Tools Search this Thread Display Modes
Old 07.03.2007, 16:43   #1
kin
Архивный участник
 
Join Date: Sep 2006
Posts: 882
Default Problem with manor system. What could you suggest?

Every time the clan leader (owner of the castle) puts some seeds to sell. He gets an answer that the seeds will be on sell next day, but nothing happens! Where could be the problem?
kin is offline  
Old 07.03.2007, 17:28   #2
FidoW
Архивный участник
 
Join Date: Sep 2005
Posts: 1,014
Default

Your server is restarted each day after that ?

Have you SQL Store Procs with datetime vars corrected ?
FidoW is offline  
Old 07.03.2007, 17:52   #3
kin
Архивный участник
 
Join Date: Sep 2006
Posts: 882
Default

No, server doesn't restart every day and yes, I have the procedure fix.

And here some of my procedures:
Code:
/********************************************    
lin_LoadLastTaxUpdate  
     
INPUT     
OUTPUT    
made by    
 carrot    
date    
 2004-02-29  
********************************************/    
create PROCEDURE [DBO].[lin_LoadLastTaxUpdate]  
AS    
 SET NOCOUNT ON    
 SELECT TOP 1  
 YEAR(income_update), MONTH(income_update), DAY(income_update),   
 DATEPART ( hh , income_update ), DATEPART ( mi , income_update ), DATEPART ( ss , income_update ),  
 YEAR(tax_change), MONTH(tax_change), DAY(tax_change),   
 DATEPART ( hh , tax_change ), DATEPART ( mi , tax_change), DATEPART ( ss , tax_change),  
 YEAR(manor_reset), MONTH(manor_reset), DAY(manor_reset),   
 DATEPART ( hh , manor_reset ), DATEPART ( mi , manor_reset), DATEPART ( ss , manor_reset)  
FROM   
 castle_tax
Code:
/********************************************        
lin_LoadManorInfo
 load manor seed next
INPUT        
 @manor_id
OUTPUT        
return        
made by        
 carrot        
date        
 2004-07-4
change        
********************************************/        
CREATE  PROCEDURE [DBO].[lin_LoadManorInfo]
(        
 @manor_id INT
)        
AS        
        
SET NOCOUNT ON        

IF EXISTS(SELECT * FROM manor_info WHERE manor_id = @manor_id)
BEGIN
	SELECT 
		residence_id, adena_vault, crop_buy_vault, change_state, convert(nvarchar(19), last_changed, 121)
	FROM 
		manor_info
	WHERE 
		manor_id = @manor_id
END
ELSE
BEGIN
	SELECT 0, 0, 0, 0, '0000-00-00 00:00:00'

END
GO
Code:
/********************************************        
lin_LoadManorSeed
 load manor seed
INPUT        
 @manor_id
OUTPUT        
return        
       
made by        
 carrot        
date        
 2004-07-4
change        
********************************************/        
CREATE PROCEDURE [DBO].[lin_LoadManorSeed]
(        
 @manor_id INT
)        
AS        
        
SET NOCOUNT ON        

SELECT 
	data_index, seed_id, seed_price, seed_sell_count, seed_remain_count, 
	crop_id, crop_price, crop_buy_count, crop_remain_count, crop_type, crop_deposit
FROM 
	manor_data
WHERE 
	manor_id = @manor_id
ORDER BY data_index
GO
Code:
/********************************************        
lin_LoadManorSeed_N
 load manor seed next
INPUT        
 @manor_id
OUTPUT        
return        
       
made by        
 carrot        
date        
 2004-07-4
change        
********************************************/        
CREATE PROCEDURE [DBO].[lin_LoadManorSeed_N]
(        
 @manor_id INT
)        
AS        
        
SET NOCOUNT ON        

SELECT 
	data_index, seed_id_n, seed_price_n, seed_sell_count_n,
	crop_id_n, crop_buy_count_n, crop_price_n, crop_type_n
FROM 
	manor_data_n
WHERE 
	manor_id = @manor_id
ORDER BY 
	data_index
GO
Code:
/********************************************      
lin_SaveCastleIncome      
       
INPUT       
 @crop_income int,      
 @shop_income int,      
 @castle_id int      
OUTPUT      
return      
made by      
 carrot      
date      
 2002-06-16      
change 2003-12-22 carrot    
 add about agit income    
change 2004-03-02 carrot    
 add taxincomeTemp   
 ********************************************/      
create PROCEDURE [DBO].[lin_SaveCastleIncome]      
(      
 @crop_income int,      
 @shop_income int,      
 @castle_id int  ,    
 @crop_income_temp int,      
 @is_castle int    
)      
AS      
SET NOCOUNT ON      
      
if (@is_castle = 1) -- castle    
 UPDATE castle SET crop_income = @crop_income, shop_income = @shop_income, shop_income_temp = @crop_income_temp WHERE id = @castle_id      
else -- agit    
 UPDATE agit SET shop_income = @shop_income, shop_income_temp = @crop_income_temp WHERE id = @castle_id      

GO
Code:
/********************************************        
lin_SaveManorInfo

INPUT        
 @manor_id
 
OUTPUT        
return        
       
made by        
 carrot        
date        
 2004-07-4
change        
********************************************/        
CREATE  PROCEDURE [DBO].[lin_SaveManorInfo]
(        
 @manor_id INT,
 @residence_id INT,
 @AdenaSeedSell INT,
 @AdenaCropBuy INT,
 @change_state TINYINT,
 @last_changed DATETIME
)        
AS        
        
SET NOCOUNT ON        

IF EXISTS(SELECT * FROM manor_info WHERE manor_id = @manor_id)
BEGIN
	UPDATE
		manor_info
	SET
		residence_id = @residence_id,
		adena_vault = @AdenaSeedSell,
		crop_buy_vault = @AdenaCropBuy,
		change_state = @change_state,
		last_changed = @last_changed
	WHERE
		manor_id = @manor_id
END
ELSE
BEGIN
	INSERT INTO manor_info (manor_id, residence_id, adena_vault, crop_buy_vault, change_state, last_changed) 
	VALUES (@manor_id, @residence_id,@AdenaSeedSell,@AdenaCropBuy, @change_state, @last_changed)
END
GO
Code:
/********************************************        
lin_SaveManorSeed
 save manor seed crop data
INPUT
	
OUTPUT        
return        
       
made by        
 carrot        
date        
 2004-06-21
change        
********************************************/        
CREATE PROCEDURE [DBO].[lin_SaveManorSeed]
(
@manor_id INT,
@data_index INT,
@seed_id INT,
@seed_price INT,
@seed_sell_count INT,
@seed_remain_count INT,
@crop_id INT,
@crop_buy_count INT,
@crop_remain_count INT,
@crop_price INT,
@crop_type INT,
@crop_deposit INT
)
AS        
        
SET NOCOUNT ON        

IF EXISTS(SELECT * FROM manor_data WHERE manor_id = @manor_id AND data_index =@data_index)
BEGIN
	UPDATE	
		manor_data
	SET 
		seed_id = @seed_id, 
		seed_price = @seed_price, 
		seed_sell_count = @seed_sell_count, 
		seed_remain_count = @seed_remain_count, 
		crop_id = @crop_id, 
		crop_buy_count = @crop_buy_count, 
		crop_price = @crop_price, 
		crop_type = @crop_type, 
		crop_remain_count = @crop_remain_count, 
		crop_deposit = @crop_deposit
	WHERE
		manor_id = @manor_id AND data_index = @data_index
END
ELSE
BEGIN
	INSERT INTO 
	manor_data 
	(manor_id, data_index, seed_id, seed_price, seed_sell_count, seed_remain_count, crop_id, crop_buy_count, crop_price, crop_type, crop_remain_count, crop_deposit) 
	VALUES 
	(@manor_id, @data_index, @seed_id, @seed_price, @seed_sell_count, @seed_remain_count, @crop_id, @crop_buy_count, @crop_price, @crop_type, @crop_remain_count, @crop_deposit)
END
GO
Code:
/********************************************        
lin_SaveManorSeed_N
 save manor seed crop data next
INPUT
	
OUTPUT        
return        
       
made by        
 carrot        
date        
 2004-07-4
change        
********************************************/        
CREATE PROCEDURE [DBO].[lin_SaveManorSeed_N]
(
@manor_id INT,
@data_index INT,
@seed_id_n INT,
@seed_price_n INT,
@seed_sell_count_n INT,
@crop_id_n INT,
@crop_buy_count_n INT,
@crop_price_n INT,
@crop_type_n INT
)
AS        
        
SET NOCOUNT ON        

IF EXISTS(SELECT * FROM manor_data_n WHERE manor_id = @manor_id AND data_index =@data_index)
BEGIN
	UPDATE	
		manor_data_n
	SET 
		seed_id_n = @seed_id_n, 
		seed_price_n = @seed_price_n, 
		seed_sell_count_n = @seed_sell_count_n, 
		crop_id_n = @crop_id_n, 
		crop_buy_count_n = @crop_buy_count_n, 
		crop_price_n = @crop_price_n, 
		crop_type_n = @crop_type_n
	WHERE
		manor_id = @manor_id AND data_index = @data_index
END
ELSE
BEGIN
	INSERT INTO 
	manor_data_n
	(manor_id, data_index, seed_id_n, seed_price_n, seed_sell_count_n, crop_id_n, crop_buy_count_n, crop_price_n, crop_type_n) 
	VALUES 
	(@manor_id, @data_index, @seed_id_n, @seed_price_n, @seed_sell_count_n, @crop_id_n, @crop_buy_count_n, @crop_price_n, @crop_type_n)
END
GO
Anything wrong there?
kin is offline  
Old 07.03.2007, 23:54   #4
djvogans
Архивный участник
 
Join Date: Apr 2005
Posts: 306
Default

check your manor htmls
djvogans is offline  
Old 08.03.2007, 06:28   #5
Mio
Архивный участник
 
Join Date: Feb 2007
Posts: 202
Default

I guess his problem is solved coz in same topic in Russian Section it is solved. The problem was in owners of castle, players need to learn how to play...
Mio is offline  
Old 08.03.2007, 08:03   #6
kin
Архивный участник
 
Join Date: Sep 2006
Posts: 882
Default

COULD be an answer, but I double check before I say that everything is Ok.
kin is offline  
Old 09.05.2007, 04:21   #7
khelben
Архивный участник
 
Join Date: Mar 2006
Posts: 104
Default

So what was the issue?
khelben is offline  
Old 21.05.2007, 19:03   #8
trashsk
Архивный участник
 
Join Date: Jan 2007
Posts: 4
Default

I have the some problem, what is it pls|?
trashsk is offline  
Old 21.05.2007, 19:28   #9
khelben
Архивный участник
 
Join Date: Mar 2006
Posts: 104
Default

My users were just retarded.
Check for seeds in your world, someone bought them all and is hording them.
khelben is offline  
Old 21.05.2007, 21:07   #10
trashsk
Архивный участник
 
Join Date: Jan 2007
Posts: 4
Default

but my users have revenou for seeds sale 0 adena in castle vault report. It is refreshing after 24h or no?
trashsk is offline  
Old 11.07.2007, 04:19   #11
rodier
Архивный участник
 
Join Date: May 2005
Posts: 979
Default

I have problem my manor reset every 24h so castle owner must set it again and again every day.. i cant find fix.. can I fix it using these procedures?
rodier is offline  
Old 11.07.2007, 09:41   #12
madar
Архивный участник
 
Join Date: Dec 2005
Posts: 156
Default

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
madar is offline  
Old 13.07.2007, 06:35   #13
rodier
Архивный участник
 
Join Date: May 2005
Posts: 979
Default

thanks a lot/. i dont have that procedure :-D so I must created it..
rodier is offline  
Old 13.07.2007, 07:24   #14
madar
Архивный участник
 
Join Date: Dec 2005
Posts: 156
Default

credits goes to someone else but np
madar 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 19:46.