Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

[New problem] never saw this... SQL error

Custom Title Activated
Loyal Member
Joined
Aug 16, 2007
Messages
1,378
Reaction score
581
DB:{call sp_LogAction_Insert(1427,1,0,4,2330,0,0,0)}
DB:40001, NativeError:1205, [Microsoft][SQL Native Client][SQL Server]Transaction (Process ID 53) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction.

an SQL function failed to process making rollback thats what agent and field server displays
WHAT IS THIS?
how to get rid of it... its the first time it happens to me and it won't stop
 
Custom Title Activated
Loyal Member
Joined
Aug 16, 2007
Messages
1,378
Reaction score
581
are you SURE that its a virus??
The server pc doesn't download anything its just a server machine

I tryed antivirus check : No result.....
 
Last edited:
Upvote 0
Newbie Spellweaver
Joined
Sep 7, 2005
Messages
82
Reaction score
4
Check your error log on /program files/microsoft sql server/MSSQl.1/MSSQL/LOG

What does it print?
 
Upvote 0
Newbie Spellweaver
Joined
Aug 30, 2007
Messages
90
Reaction score
2
DB:{call sp_LogAction_Insert(1427,1,0,4,2330,0,0,0)}
DB:40001, NativeError:1205, [Microsoft][SQL Native Client][SQL Server]Transaction (Process ID 53) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction.

an SQL function failed to process making rollback thats what agent and field server displays
WHAT IS THIS?
how to get rid of it... its the first time it happens to me and it won't stop

you know what all the problem u post are the same as mine, all ur errors are also appearing on mine, do you think some one one is trying to that in our server? i know some private server also experience that kind ko problem while i'm searching for the solution but no one have the answer, what do u think? i know ur server specs are capable of accommodating more players but same as mine having this errors..Is it possible some one is sabotaging our server?
 
Upvote 0
Custom Title Activated
Loyal Member
Joined
Aug 16, 2007
Messages
1,378
Reaction score
581
its not somebody nor a virus, its the REBORN QUERY that isn't properly made (or any other triggers) you need build triggers in a way to read as low as possible rows when being executed :

update [chainfo] set [chainfo].ChaReborn = [chainfo].ChaReborn +1,
[chainfo].ChaLevel = 100,
[chainfo].ChaStRemain = ([chainfo].ChaPower + [chainfo].ChaDex + [chainfo].ChaSpirit + [chainfo].ChaStrong + [chainfo].ChaStrength+ [chainfo].ChaStRemain) -1935 ,
[chainfo].ChaPower = 0,
[chainfo].ChaSpirit = 0,
[chainfo].ChaDex = 0,
[chainfo].ChaStrength = 0,
[chainfo].ChaStrong = 1000,
[chainfo].Chaintel = [chainfo].ChaReborn +1
from inserted
where inserted.ChaLevel = 300
and inserted.ChaReborn < 180


you see that "INSERTED"? that makes the trigger only read the char that logged off right now instead of each char of the whole database
with that little detail you fix that problem

ps : why each time I post a problem I end up finding the solution myself and all the hints I get are the wrong ones Quote "Its a virus"
 
Upvote 0
Retired Developer
Joined
Jun 16, 2005
Messages
496
Reaction score
213
ps : why each time I post a problem I end up finding the solution myself and all the hints I get are the wrong ones Quote "Its a virus"

Funny part from you really appreciate it will help you more now
 
Upvote 0
Newbie Spellweaver
Joined
Aug 30, 2007
Messages
90
Reaction score
2
its not somebody nor a virus, its the REBORN QUERY that isn't properly made (or any other triggers) you need build triggers in a way to read as low as possible rows when being executed :

update [chainfo] set [chainfo].ChaReborn = [chainfo].ChaReborn +1,
[chainfo].ChaLevel = 100,
[chainfo].ChaStRemain = ([chainfo].ChaPower + [chainfo].ChaDex + [chainfo].ChaSpirit + [chainfo].ChaStrong + [chainfo].ChaStrength+ [chainfo].ChaStRemain) -1935 ,
[chainfo].ChaPower = 0,
[chainfo].ChaSpirit = 0,
[chainfo].ChaDex = 0,
[chainfo].ChaStrength = 0,
[chainfo].ChaStrong = 1000,
[chainfo].Chaintel = [chainfo].ChaReborn +1
from inserted
where inserted.ChaLevel = 300
and inserted.ChaReborn < 180


you see that "INSERTED"? that makes the trigger only read the char that logged off right now instead of each char of the whole database
with that little detail you fix that problem

ps : why each time I post a problem I end up finding the solution myself and all the hints I get are the wrong ones Quote "Its a virus"

what do you mean, how can i fix that? sorry i dont know about queries i just copy them and put it in my database
 
Upvote 0
Custom Title Activated
Loyal Member
Joined
Aug 16, 2007
Messages
1,378
Reaction score
581
just give me your query and I will recode it to be working
 
Upvote 0
Retired Developer
Joined
Jun 16, 2005
Messages
496
Reaction score
213
what do you mean, how can i fix that? sorry i dont know about queries i just copy them and put it in my database

Here a good code for you just run it in ur SQL Query
Code:
/****** Object:  Trigger dbo.Auto_Reborn    Script Date: 3/3/2008 11:19:33 PM ******/
CREATE TRIGGER [dbo].[Auto_Reborn] ON dbo.ChaInfo
after update
as
BEGIN

Update [ChaInfo] set [ChaInfo].ChaLevel = 1, -- Level that you get after reborn
[ChaInfo].ChaReborn = [ChaInfo].ChaReborn + 1, -- Reborn counter
[ChaInfo].ChaExp = 0, -- Set Exp back to 0
[ChaInfo].ChaStRemain = ([ChaInfo].ChaStRemain + [ChaInfo].ChaPower + [ChaInfo].ChaStrong + [ChaInfo].ChaStrength + [ChaInfo].ChaSpirit + [ChaInfo].ChaDex ), -- how many stat points you get per reborn
[ChaInfo].ChaPower = 0, -- Set the number of Pow you added to 0
[ChaInfo].ChaStrong = 0, -- Set the number of Vit you added to 0
[ChaInfo].ChaStrength = 0, -- Set the number of Stm you added to 0
[ChaInfo].ChaSpirit = 0, -- Set the number of Int you added to 0
[ChaInfo].ChaDex = 0, -- Set the number of Dex you added to 0
[ChaInfo].ChaMoney = [ChaInfo].ChaMoney - 2000000, -- Optional : Reborn cost 2m
[ChaInfo].ChaSkillPoint = ([ChaInfo].ChaSkillPoint + (10*[ChaInfo].ChaReborn)), -- Set the Skillpoints per reborn
[ChaInfo].ChaQuest = NULL -- Optional : Delete quest list (need restart all quests) after reborn
From Inserted
Where Inserted.ChaLevel = 300 -- Level to reborn
and [ChaInfo].ChaReborn < 10 -- Max Reborn number
and [ChaInfo].ChaName = inserted.ChaName
and [ChaInfo].UserNum = inserted.UserNum
and [ChaInfo].ChaMoney >= 2000000 -- Optional : Require 2m gold for reborn

End
 
Upvote 0
Junior Spellweaver
Joined
Jan 22, 2008
Messages
119
Reaction score
0
guyz why is it the giving of stats points after reborn in my server isn't equal. I mean one guy reborn(2nd reborn) he got 400Stat points, the other guy got reborn(2nd times also) but got 1000 stats point.. whats wrong with my trigger? can u help me guyz? i know ur pro at .php scripts..
 
Upvote 0
Custom Title Activated
Loyal Member
Joined
Aug 16, 2007
Messages
1,378
Reaction score
581
if you don't post the trigger how can I know whats wrong?
 
Upvote 0
Junior Spellweaver
Joined
Jan 22, 2008
Messages
119
Reaction score
0
sorry here it is..




USE [RanGame1]
GO
/****** Object: Trigger [dbo].[Auto_Reborn] Script Date: 03/09/2008 13:53:24 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author: <Author,,Name>
-- Create date: <Create Date,,>
-- Description: <Description,,>
-- =============================================
ALTER TRIGGER [dbo].[Auto_Reborn] ON [dbo].[ChaInfo]
after update
as
BEGIN

Update [ChaInfo] set [ChaInfo].ChaLevel=1, -- Level that you get after reborn
[ChaInfo].ChaReborn=[ChaInfo].ChaReborn + 1, -- Reborn counter
[ChaInfo].ChaExp=0, -- Set Exp back to 0
[ChaInfo].ChaStRemain = (200*[ChaInfo].ChaReborn), -- how many stat points you get per reborn
[ChaInfo].ChaPower = 0, -- Set the number of Pow you added to 0
[ChaInfo].ChaStrong = 0, -- Set the number of Vit you added to 0
[ChaInfo].ChaStrength = 0, -- Set the number of Stm you added to 0
[ChaInfo].ChaSpirit = 0, -- Set the number of Int you added to 0
[ChaInfo].ChaDex = 0, -- Set the number of Dex you added to 0
[ChaInfo].ChaMoney = [ChaInfo].ChaMoney - 100000000, -- Optional : Reborn cost 100m
[ChaInfo].ChaSkillPoint = (20*[ChaInfo].ChaReborn), -- Set the Skillpoints per reborn
[ChaInfo].ChaSkills = NULL, -- Optional : Forget all skills after reborn
[ChaInfo].ChaSkillSlot = NULL, -- Optional : Delete shortcut list of skills
[ChaInfo].ChaQuest = NULL -- Optional : Delete quest list (need restart all quests) after reborn
From Inserted
Where Inserted.ChaLevel >= 230 -- Level to 1x reborn
and [ChaInfo].ChaLevel < 300 -- Limitation of 1x Reborn
and [ChaInfo].ChaReborn < 25 -- Max Reborn number
and [ChaInfo].ChaName=inserted.ChaName
and [ChaInfo].UserNum =inserted.UserNum
and [ChaInfo].ChaBright >= 0 -- Optional : Require 0 or more attr for reborn
and [ChaInfo].ChaMoney >= 100000000 -- Optional : Require 100m gold for reborn

Update [ChaInfo] set [ChaInfo].ChaLevel=1, -- Level that you get after reborn
[ChaInfo].ChaReborn=[ChaInfo].ChaReborn + 2, -- Reborn counter -- NO need to change anything beside of THIS you get automatically more stat points if you put the reborn counter +2
[ChaInfo].ChaExp=0, -- Set Exp back to 0
[ChaInfo].ChaStRemain = (200*[ChaInfo].ChaReborn), -- how many stat points you get per reborn
[ChaInfo].ChaPower = 0, -- Set the number of Pow you added to 0
[ChaInfo].ChaStrong = 0, -- Set the number of Vit you added to 0
[ChaInfo].ChaStrength = 0, -- Set the number of Stm you added to 0
[ChaInfo].ChaSpirit = 0, -- Set the number of Int you added to 0
[ChaInfo].ChaDex = 0, -- Set the number of Dex you added to 0
[ChaInfo].ChaMoney = [ChaInfo].ChaMoney - 100000000, -- Optional : Reborn cost 100m
[ChaInfo].ChaSkillPoint = (20*[ChaInfo].ChaReborn), -- Set the Skillpoints per reborn
[ChaInfo].ChaSkills = NULL, -- Optional : Forget all skills after reborn
[ChaInfo].ChaSkillSlot = NULL, -- Optional : Delete shortcut list of skills
[ChaInfo].ChaQuest = NULL -- Optional : Delete quest list (need restart all quests) after reborn
From Inserted
Where Inserted.ChaLevel >= 230 -- Level to 2x reborn
and [ChaInfo].ChaLevel < 300 -- Limitation of 2x Reborn
and [ChaInfo].ChaReborn < 25 -- Max reborn number
and [ChaInfo].ChaName=inserted.ChaName
and [ChaInfo].UserNum =inserted.UserNum
and [ChaInfo].ChaBright >= 0 -- Optional : Require 0 or more attr for reborn
and [ChaInfo].ChaMoney >= 100000000 -- Optional : Require 100m gold for double reborn

END
 
Upvote 0
Retired Developer
Joined
Jun 16, 2005
Messages
496
Reaction score
213
lol ?
Code:
[ChaInfo].ChaStRemain = (200*[ChaInfo].ChaReborn), -- how many stat points you get per reborn

that mean he will get 200 time the reborn for point

if he reborn first time he will get 200 point
reborn 2x = 400
reborn 3x = 600
reborn 4x = 800
reborn 5x = 1000

that mean the one who get 1000 point it's his 5th x reborn and the otehr one is the 2x reborn that it your code is really not good

use mine

Code:
/****** Object:  Trigger dbo.Auto_Reborn    Script Date: 3/3/2008 11:19:33 PM ******/
CREATE TRIGGER [dbo].[Auto_Reborn] ON dbo.ChaInfo
after update
as
BEGIN

Update [ChaInfo] set [ChaInfo].ChaLevel = 1, -- Level that you get after reborn
[ChaInfo].ChaReborn = [ChaInfo].ChaReborn + 1, -- Reborn counter
[ChaInfo].ChaExp = 0, -- Set Exp back to 0
[ChaInfo].ChaStRemain = ([ChaInfo].ChaStRemain + [ChaInfo].ChaPower + [ChaInfo].ChaStrong + [ChaInfo].ChaStrength + [ChaInfo].ChaSpirit + [ChaInfo].ChaDex [COLOR="Red"]+200[/COLOR] ), -- how many stat points you get per reborn
[ChaInfo].ChaPower = 0, -- Set the number of Pow you added to 0
[ChaInfo].ChaStrong = 0, -- Set the number of Vit you added to 0
[ChaInfo].ChaStrength = 0, -- Set the number of Stm you added to 0
[ChaInfo].ChaSpirit = 0, -- Set the number of Int you added to 0
[ChaInfo].ChaDex = 0, -- Set the number of Dex you added to 0
[ChaInfo].ChaMoney = [ChaInfo].ChaMoney - 2000000, -- Optional : Reborn cost 2m
[ChaInfo].ChaSkillPoint = ([ChaInfo].ChaSkillPoint + (10*[ChaInfo].ChaReborn)), -- Set the Skillpoints per reborn
[ChaInfo].ChaQuest = NULL -- Optional : Delete quest list (need restart all quests) after reborn
From Inserted
Where Inserted.ChaLevel = 300 -- Level to reborn
and [ChaInfo].ChaReborn < 10 -- Max Reborn number
and [ChaInfo].ChaName = inserted.ChaName
and [ChaInfo].UserNum = inserted.UserNum
and [ChaInfo].ChaMoney >= 2000000 -- Optional : Require 2m gold for reborn

End
 
Upvote 0
Junior Spellweaver
Joined
Jan 22, 2008
Messages
119
Reaction score
0
thnx bro but is there wrong with my code? cause as i observe from my players they are in the same reborn but they don't have equal points that was given by the trigger

is ur code remain stats after reborn?
 
Upvote 0
Junior Spellweaver
Joined
Sep 16, 2006
Messages
123
Reaction score
3
lol ?
Code:
[ChaInfo].ChaStRemain = (200*[ChaInfo].ChaReborn), -- how many stat points you get per reborn
that mean he will get 200 time the reborn for point

if he reborn first time he will get 200 point
reborn 2x = 400
reborn 3x = 600
reborn 4x = 800
reborn 5x = 1000

that mean the one who get 1000 point it's his 5th x reborn and the otehr one is the 2x reborn that it your code is really not good

use mine

Code:
/****** Object:  Trigger dbo.Auto_Reborn    Script Date: 3/3/2008 11:19:33 PM ******/
CREATE TRIGGER [dbo].[Auto_Reborn] ON dbo.ChaInfo
after update
as
BEGIN

Update [ChaInfo] set [ChaInfo].ChaLevel = 1, -- Level that you get after reborn
[ChaInfo].ChaReborn = [ChaInfo].ChaReborn + 1, -- Reborn counter
[ChaInfo].ChaExp = 0, -- Set Exp back to 0
[ChaInfo].ChaStRemain = ([ChaInfo].ChaStRemain + [ChaInfo].ChaPower + [ChaInfo].ChaStrong + [ChaInfo].ChaStrength + [ChaInfo].ChaSpirit + [ChaInfo].ChaDex [COLOR=Red]+200[/COLOR] ), -- how many stat points you get per reborn
[ChaInfo].ChaPower = 0, -- Set the number of Pow you added to 0
[ChaInfo].ChaStrong = 0, -- Set the number of Vit you added to 0
[ChaInfo].ChaStrength = 0, -- Set the number of Stm you added to 0
[ChaInfo].ChaSpirit = 0, -- Set the number of Int you added to 0
[ChaInfo].ChaDex = 0, -- Set the number of Dex you added to 0
[ChaInfo].ChaMoney = [ChaInfo].ChaMoney - 2000000, -- Optional : Reborn cost 2m
[ChaInfo].ChaSkillPoint = ([ChaInfo].ChaSkillPoint + (10*[ChaInfo].ChaReborn)), -- Set the Skillpoints per reborn
[ChaInfo].ChaQuest = NULL -- Optional : Delete quest list (need restart all quests) after reborn
From Inserted
Where Inserted.ChaLevel = 300 -- Level to reborn
and [ChaInfo].ChaReborn < 10 -- Max Reborn number
and [ChaInfo].ChaName = inserted.ChaName
and [ChaInfo].UserNum = inserted.UserNum
and [ChaInfo].ChaMoney >= 2000000 -- Optional : Require 2m gold for reborn

End

bro how to enable this part
[ChaInfo].ChaQuest = NULL -- Optional : Delete quest list (need restart all quests) after reborn
when i change NULL into 1 theres a error.
 
Upvote 0
Junior Spellweaver
Joined
Sep 16, 2006
Messages
123
Reaction score
3
NULL mean no change all your quest will stay
If you put 0 = all quest gone and you need play all quest

but when i put 0 this error will appear
Jolin88 - [New problem] never saw this... SQL error - RaGEZONE Forums


i used your trigger

here:

CREATE TRIGGER [dbo].[Auto_Reborn] ON [dbo].[ChaInfo]
after update
as
BEGIN

Update [ChaInfo] set [ChaInfo].ChaLevel = 1, -- Level that you get after reborn
[ChaInfo].ChaReborn = [ChaInfo].ChaReborn + 1, -- Reborn counter
[ChaInfo].ChaExp = 0, -- Set Exp back to 0
[ChaInfo].ChaStRemain = ([ChaInfo].ChaStRemain + [ChaInfo].ChaPower + [ChaInfo].ChaStrong + [ChaInfo].ChaStrength + [ChaInfo].ChaSpirit + [ChaInfo].ChaDex + 0), -- how many stat points you get per reborn
[ChaInfo].ChaPower = 0, -- Set the number of Pow you added to 0
[ChaInfo].ChaStrong = 0, -- Set the number of Vit you added to 0
[ChaInfo].ChaStrength = 0, -- Set the number of Stm you added to 0
[ChaInfo].ChaSpirit = 0, -- Set the number of Int you added to 0
[ChaInfo].ChaDex = 0, -- Set the number of Dex you added to 0
[ChaInfo].ChaMoney = [ChaInfo].ChaMoney - 120000000, -- Optional : Reborn cost 2m
[ChaInfo].ChaSkillPoint = ([ChaInfo].ChaSkillPoint + (10*[ChaInfo].ChaReborn)), -- Set the Skillpoints per reborn
[ChaInfo].ChaQuest = 0, -- Optional : Delete quest list (need restart all quests) after reborn
From Inserted
Where Inserted.ChaLevel = 300 -- Level to reborn
and [ChaInfo].ChaReborn < 100 -- Max Reborn number
and [ChaInfo].ChaName = inserted.ChaName
and [ChaInfo].UserNum = inserted.UserNum
and [ChaInfo].ChaMoney >= 120000000 -- Optional : Require 2m gold for reborn

End
 
Upvote 0
Newbie Spellweaver
Joined
Aug 30, 2007
Messages
90
Reaction score
2
Here a good code for you just run it in ur SQL Query
Code:
/****** Object:  Trigger dbo.Auto_Reborn    Script Date: 3/3/2008 11:19:33 PM ******/
CREATE TRIGGER [dbo].[Auto_Reborn] ON dbo.ChaInfo
after update
as
BEGIN

Update [ChaInfo] set [ChaInfo].ChaLevel = 1, -- Level that you get after reborn
[ChaInfo].ChaReborn = [ChaInfo].ChaReborn + 1, -- Reborn counter
[ChaInfo].ChaExp = 0, -- Set Exp back to 0
[ChaInfo].ChaStRemain = ([ChaInfo].ChaStRemain + [ChaInfo].ChaPower + [ChaInfo].ChaStrong + [ChaInfo].ChaStrength + [ChaInfo].ChaSpirit + [ChaInfo].ChaDex ), -- how many stat points you get per reborn
[ChaInfo].ChaPower = 0, -- Set the number of Pow you added to 0
[ChaInfo].ChaStrong = 0, -- Set the number of Vit you added to 0
[ChaInfo].ChaStrength = 0, -- Set the number of Stm you added to 0
[ChaInfo].ChaSpirit = 0, -- Set the number of Int you added to 0
[ChaInfo].ChaDex = 0, -- Set the number of Dex you added to 0
[ChaInfo].ChaMoney = [ChaInfo].ChaMoney - 2000000, -- Optional : Reborn cost 2m
[ChaInfo].ChaSkillPoint = ([ChaInfo].ChaSkillPoint + (10*[ChaInfo].ChaReborn)), -- Set the Skillpoints per reborn
[ChaInfo].ChaQuest = NULL -- Optional : Delete quest list (need restart all quests) after reborn
From Inserted
Where Inserted.ChaLevel = 300 -- Level to reborn
and [ChaInfo].ChaReborn < 10 -- Max Reborn number
and [ChaInfo].ChaName = inserted.ChaName
and [ChaInfo].UserNum = inserted.UserNum
and [ChaInfo].ChaMoney >= 2000000 -- Optional : Require 2m gold for reborn

End

wow tnx. Is this the query that will just reset the level after reborn and not the stats & skill points?
 
Upvote 0
Back
Top