|
You last visited: Today at 22:34
Advertisement
little help plzz
Discussion on little help plzz within the Shaiya Private Server forum part of the Shaiya category.
09/15/2011, 07:17
|
#1
|
elite*gold: 0
Join Date: Jun 2011
Posts: 108
Received Thanks: 269
|
little help plzz
Code:
ALTER Proc [dbo].[usp_Insert_Action_Log_E]
@UserID varchar(18),
@UserUID int,
@CharID int,
@CharName varchar(50),
@CharLevel tinyint,
@CharExp int,
@MapID smallint,
@PosX real,
@PosY real,
@PosZ real,
@ActionTime datetime,
@ActionType tinyint,
@Value1 bigint = null,
@Value2 int = null,
@Value3 int = null,
@Value4 bigint = null,
@Value5 int = null,
@Value6 int = null,
@Value7 int = null,
@Value8 int = null,
@Value9 int = null,
@Value10 int = null,
@Text1 varchar(100) = '',
@Text2 varchar(100) = '',
@Text3 varchar(100) = '',
@Text4 varchar(100) = '',
@Sql nvarchar(4000) = '',
@yyyy varchar(4) = '',
@mm varchar(2) = '',
@dd varchar(2) = '',
@Bucket smallint = -1
AS
SET @yyyy = datepart(yyyy, @ActionTime)
SET @mm = datepart(mm, @ActionTime)
SET @dd = datepart(dd, @ActionTime)
IF(LEN(@mm) = 1)
BEGIN
SET @mm = '0' + @mm
END
IF(LEN(@dd) = 1)
BEGIN
SET @dd = '0' + @dd
END
/*
DECLARE
@DIP varchar (100),
@UID varchar (100),
@KIP Varchar (100)
IF (@ActionType = 103)
BEGIN
SELECT @UID = um.UserID FROM PS_UserData.dbo.Users_Master as um
INNER JOIN PS_GameData.dbo.Chars as c ON c.UserUID = um.UserUID
inner join PS_GameLog.dbo.ActionLog as a on a.Value1 = c.CharID Where c.CharID = @Value1 AND ActionType = 103
END
BEGIN
SELECT @KIP = um.UserIp FROM PS_UserData.dbo.Users_Master as um
INNER JOIN PS_GameData.dbo.Chars as c ON c.UserUID = um.UserUID
inner join PS_GameLog.dbo.ActionLog as a on a.Value1 = c.CharID Where c.CharID = @Value1 AND ActionType = 103
END
BEGIN
Select @DIP = um.UserIP FROM PS_UserData.dbo.Users_Master as um
INNER JOIN PS_GameLog.dbo.ActionLog as a on um.UserID = a.UserID WHERE um.UserID=@UserID AND ActionType = 103
END
IF @DIP = @KIP
Begin
INSERT INTO GM_Stuff.dbo.StatPadder (DeadToon,DeadIP,DeadID,KillerToon,KillerIP,KillerID,Date,Map)
VALUES (@Text1,@KIP,@UID,@CharName,@DIP,@UserID,@ActionTime,@MapID)
END
*/
BEGIN
SET @Sql = N'
INSERT INTO PS_GameLog.dbo.ActionLog
(UserID, UserUID, CharID, CharName, CharLevel, CharExp, MapID, PosX, PosY, PosZ, ActionTime, ActionType,
Value1, Value2, Value3, Value4, Value5, Value6, Value7, Value8, Value9, Value10, Text1, Text2, Text3, Text4)
VALUES(@UserID, @UserUID, @CharID, @CharName, @CharLevel, @CharExp, @MapID, @PosX, @PosY, @PosZ, @ActionTime, @ActionType,
@Value1, @Value2, @Value3, @Value4, @Value5, @Value6, @Value7, @Value8, @Value9, @Value10, @Text1, @Text2, @Text3, @Text4)'
EXEC sp_executesql @Sql,
N'@UserID varchar(18), @UserUID int, @CharID int, @CharName varchar(50),
@CharLevel tinyint, @CharExp int, @MapID smallint, @PosX real, @PosY real, @PosZ real, @ActionTime datetime, @ActionType tinyint,
@Value1 bigint, @Value2 int, @Value3 int, @Value4 bigint, @Value5 int, @Value6 int, @Value7 int, @Value8 int,
@Value9 int, @Value10 int, @Text1 varchar(100), @Text2 varchar(100), @Text3 varchar(100), @Text4 varchar(100)',
"@UserID"," @UserUID", "@CharID", "@CharName", "@CharLevel", "@CharExp", "@MapID", "@PosX", "@PosY", "@PosZ", "@ActionTime",
"@ActionType", "@Value1", "@Value2", "@Value3", "@Value4", "@Value5", "@Value6", "@Value7", "@Value8", "@Value9", "@Value10",
"@Text1", "@Text2", "@Text3", "@Text4"
END
DECLARE
@DP INT
if(@ActionType = 114 AND @Value2 > 44141 AND @Value2 < 44147)
SET @DP =(
CASE
WHEN @Value2 = 44142 THEN 25
WHEN @Value2 = 44143 THEN 50
WHEN @Value2 = 44144 THEN 75
WHEN @Value2 = 44145 THEN 100
WHEN @Value2 = 44146 THEN 1000
ELSE @DP
END)
begin
UPDATE PS_UserData.dbo.Users_Master SET Point = Point + @Value4 * @DP WHERE UserID = @UserID
END
this is my actionslog proc i added a few things for my server the comented out section is an ipearch for pvp to find same ip deaths/kills also knowned as stat paddeing the part at end is myrandom dp ingame items they sell ta get dp for account.. my ishue is everything worked perfect 100% stored in actionlog pluse mytwo aditions 100% worked. now i am haveing an ishue of the dp works dose infact still add to accounts and the statpader search still works ( when not comented out ) but nomater if i coment all out ( the 2 added sections) or part or none it has not loged a singel action log in like 1 week i have checked my logs and there is nothing inthem as far as an error so can any1 plzz look thrue thi proc and letmeknowwhat i need to do to get the prock to start logeing back ingame again
|
|
|
09/15/2011, 08:56
|
#2
|
elite*gold: 0
Join Date: Sep 2010
Posts: 520
Received Thanks: 1,289
|
If it hasn't inserted anything, and you haven't commented that part out, you'd have an error stating why it can't insert I believe..
|
|
|
09/15/2011, 09:09
|
#3
|
elite*gold: 0
Join Date: Jun 2011
Posts: 108
Received Thanks: 269
|
ok i just rechecked all my logs again and its now poping in finaly with tons of errors that for sumreason wasnot there b4 and every1 is error converting nvarchar to int tho i never changed any desighn of the original prock that i can remember nore edited any info on the other aditions from when it was login tell now... any help on what is causeing the conversion error would be greatly apresheated.
|
|
|
09/15/2011, 09:46
|
#4
|
elite*gold: 0
Join Date: Sep 2010
Posts: 520
Received Thanks: 1,289
|
Ah.. I see there's something weird with your insert, you have double quotes on them, why?
PHP Code:
ALTER Proc [dbo].[usp_Insert_Action_Log_E]
@UserID varchar(18), @UserUID int, @CharID int, @CharName varchar(50), @CharLevel tinyint, @CharExp int, @MapID smallint, @PosX real, @PosY real, @PosZ real, @ActionTime datetime, @ActionType tinyint, @Value1 bigint = null, @Value2 int = null, @Value3 int = null, @Value4 bigint = null, @Value5 int = null, @Value6 int = null, @Value7 int = null, @Value8 int = null, @Value9 int = null, @Value10 int = null, @Text1 varchar(100) = '', @Text2 varchar(100) = '', @Text3 varchar(100) = '', @Text4 varchar(100) = '', @Sql nvarchar(4000) = '', @yyyy varchar(4) = '', @mm varchar(2) = '', @dd varchar(2) = '', @Bucket smallint = -1 AS
/* DECLARE @DIP varchar (100), @UID varchar (100), @KIP Varchar (100)
IF (@ActionType = 103)
BEGIN SELECT @UID = um.UserID FROM PS_UserData.dbo.Users_Master as um INNER JOIN PS_GameData.dbo.Chars as c ON c.UserUID = um.UserUID inner join PS_GameLog.dbo.ActionLog as a on a.Value1 = c.CharID Where c.CharID = @Value1 AND ActionType = 103 END BEGIN SELECT @KIP = um.UserIp FROM PS_UserData.dbo.Users_Master as um INNER JOIN PS_GameData.dbo.Chars as c ON c.UserUID = um.UserUID inner join PS_GameLog.dbo.ActionLog as a on a.Value1 = c.CharID Where c.CharID = @Value1 AND ActionType = 103 END BEGIN Select @DIP = um.UserIP FROM PS_UserData.dbo.Users_Master as um INNER JOIN PS_GameLog.dbo.ActionLog as a on um.UserID = a.UserID WHERE um.UserID=@UserID AND ActionType = 103 END IF @DIP = @KIP Begin INSERT INTO GM_Stuff.dbo.StatPadder (DeadToon,DeadIP,DeadID,KillerToon,KillerIP,KillerID,Date,Map) VALUES (@Text1,@KIP,@UID,@CharName,@DIP,@UserID,@ActionTime,@MapID) END */
BEGIN
SET @Sql = N' INSERT INTO PS_GameLog.dbo.ActionLog (UserID, UserUID, CharID, CharName, CharLevel, CharExp, MapID, PosX, PosY, PosZ, ActionTime, ActionType, Value1, Value2, Value3, Value4, Value5, Value6, Value7, Value8, Value9, Value10, Text1, Text2, Text3, Text4) VALUES(@UserID, @UserUID, @CharID, @CharName, @CharLevel, @CharExp, @MapID, @PosX, @PosY, @PosZ, @ActionTime, @ActionType, @Value1, @Value2, @Value3, @Value4, @Value5, @Value6, @Value7, @Value8, @Value9, @Value10, @Text1, @Text2, @Text3, @Text4)'
EXEC sp_executesql @Sql, N'@UserID varchar(18), @UserUID int, @CharID int, @CharName varchar(50), @CharLevel tinyint, @CharExp int, @MapID smallint, @PosX real, @PosY real, @PosZ real, @ActionTime datetime, @ActionType tinyint, @Value1 bigint, @Value2 int, @Value3 int, @Value4 bigint, @Value5 int, @Value6 int, @Value7 int, @Value8 int, @Value9 int, @Value10 int, @Text1 varchar(100), @Text2 varchar(100), @Text3 varchar(100), @Text4 varchar(100)', @UserID, @UserUID, @CharID, @CharName, @CharLevel, @CharExp, @MapID, @PosX, @PosY, @PosZ, @ActionTime, @ActionType, @Value1, @Value2, @Value3, @Value4, @Value5, @Value6, @Value7, @Value8, @Value9, @Value10, @Text1, @Text2, @Text3, @Text4
END DECLARE @DP INT
if(@ActionType = 114 AND @Value2 > 44141 AND @Value2 < 44147) SET @DP =( CASE WHEN @Value2 = 44142 THEN 25 WHEN @Value2 = 44143 THEN 50 WHEN @Value2 = 44144 THEN 75 WHEN @Value2 = 44145 THEN 100 WHEN @Value2 = 44146 THEN 1000 ELSE @DP END)
begin UPDATE PS_UserData.dbo.Users_Master SET Point = Point + @Value4 * @DP WHERE UserID = @UserID END
Try that, I replaced your insert statement with a "working" one.
|
|
|
09/15/2011, 10:19
|
#5
|
elite*gold: 0
Join Date: Jun 2011
Posts: 108
Received Thanks: 269
|
what exactly do you mean doubel quotes?? in my insert section?? im trying it now ta see but the insert section has been comented out with the */ /* portion to nullyfie that hole area so i didnt think it made any difrence how it was worded
not shure what you changed but whatever it was TY as it has fixed it and it is now loging onceagain as it should
ok just pinpointed the quotes you were refering to and reason i had thedoubel quotes is i was atempting to getrid of the invaled error for names with the 's atend of them such as a fewitems and quest names that end in the 's figuerd if i " " the value it would caus it ta insert a a hole instead of pick the 's up as a code symbel causeing errors in the inputs thought i changed that back after it didnt work TY for catching it ( latenights and medication dosent mix in quarys lol) BTW any idea how to make it store the 's and quit giveing the errors of unrecognized symbel or wtfe it says??
|
|
|
09/16/2011, 05:59
|
#6
|
elite*gold: 0
Join Date: Sep 2010
Posts: 520
Received Thanks: 1,289
|
No. Double quotes are used to delegate column names.
You can either run a query to remove all the ' from your Items/Skills/Mobs tables, or possibly have the SP remove it upon script run, but the former would be less resource using, and easier in my opinion.
|
|
|
09/16/2011, 06:05
|
#7
|
elite*gold: 0
Join Date: Jun 2011
Posts: 108
Received Thanks: 269
|
ok cool TY for you help yet again i am still a bit nub at the sql stuff slowly learning t6hrue trial and error my knowladge has became quite alot better then it was but still LOTS to learn. again TY for your help.
|
|
|
09/16/2011, 06:21
|
#8
|
elite*gold: 0
Join Date: Sep 2010
Posts: 520
Received Thanks: 1,289
|
No problem Dashy, glad I could help.
|
|
|
Similar Threads
|
plzz
03/07/2011 - Grand Chase - 2 Replies
wala na ba tlgang GCph HACK wpzlzz
|
plzz post a no recoil plzz
08/28/2010 - Soldier Front Philippines - 5 Replies
:rtfm: mag post naman kau no no recoil ohh?
|
[Help me plzz]
06/02/2009 - EO PServer Hosting - 6 Replies
Hi I do need a server which support all new configurations such as (LVL 255. item of LVL 255. xball 500%. ep auto, new pets.etc) please help me!!:)
|
All times are GMT +1. The time now is 22:34.
|
|