help for exchange bug

09/17/2014 00:13 zenilasouris#1
hello I am sorry for my english I'm french
I have a question paused
I did my shaiya server and I have a problem with the exchange when I made ​​one exchange with another character when I made ​​one deco I lose the exchange that was done I do not have the items in my inventory .
* it conneterai a solution to my problem and how to solve it?

thank you in advance
ZLS
09/17/2014 08:49 _Diavolino_#2
(effectivement, ça fait mal aux yeux... *_o)

You should to have somewhere one folder with Log in your server files... could be nice that you do one copy paste here ofthe error when you got it.

And maybe You can get directly the error and where to search for that problem.

Regards,
09/17/2014 09:44 zenilasouris#3
09/17/2014 16:21 castor4878#4
where 'Cape de l'Aube' is an invalid SQL statement (single quote shall be escaped with two single-quote characters, eg 'Cape de l''Aube').
the issue comes from the word processing made in the SQL procedure; the sentence was (initially) finely loaded into the Items table (using 'Cape de l''Aube') but when the item details are read (during the handling of the exchange) the loaded item's name is "Cape de l'Aube" (no double-single-quote), that name is tranmitted (with other parameters) to the SP usp_Insert_Action_Log_E (base PS_GameLog) and that script use it w/o any care (and doesn't re-escape the string).

change the SP to be:

Code:
USE [PS_GameLog]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

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,
	@StrActionTime varchar(20),
	@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) = ''
	
AS

DECLARE @Sql nvarchar(4000) = ''
DECLARE @ActionTime datetime = convert(datetime, @StrActionTime, 120)
DECLARE @find char(1) = char(39)
DECLARE @repl char(2) = char(39) + char(39)
DECLARE @CharLeave int = 1

-- replace single-quote by two single-quotes in received strings
set @Text1 = replace(@Text1, @find, @repl)
set @Text2 = replace(@Text2, @find, @repl)
set @Text3 = replace(@Text3, @find, @repl)
set @Text4 = replace(@Text4, @find, @repl)

... etc ...
keep your anti-dupe actions, if any, and the final INSERT or EXEC statement.