Solo usuarios registrados pueden comentar y agradecer, Logueate o Registrate

Autor Topic: Anti-Dup problemas  (Visto 1425 veces)

0 Miembros and 1 Guest are viewing this topic.

Offline mochaso05 Posteado: May 29, 2019, 10:40:31 AM | Modificado: May 29, 2019, 12:32:54 PM by mochaso05

  • 0 puntos por ventas
  • *
  • Rank: Puto amo
  • Posts: 278
  • Gracias recibida: 31
  • ar
HOLA, BUENOS DIAS  DISCULPEN QUE MOLESTE, TENGO PROBLEMAS PUSE ESTA SENTENCIA QUE ES ANTIDUP EN SQL Y ME BANEO TODO LOS PERSONAJE Y TAMBIEN BORRA TODO LOS ITEMS DEL BAUL, COMO JAWELS Y EVOS ETC ,  COMO HAGO PARA DESACTIVAR ESTO O BORRARLO NO QUIERO PERDER LAS CUENTAS NI PERSONAJES.
Code: [Select]
use muonline 
if exists(select * from dbo.sysobjects where type='p' and name='WZ_GetItemSerial')
drop procedure WZ_GetItemSerial
go
CREATE procedure WZ_GetItemSerial
as
BEGIN
DECLARE @ItemSerial int
set nocount on
begin transaction
update GameServerInfo set @ItemSerial = ItemCount = (case when ItemCount < 0x7effffff then ItemCount+1
else 1
end )
if(@@error <> 0)
begin
rollback transaction
select-1
end
else
begin
commit transaction
select @ItemSerial
end
END

GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[trg_CheckSameID]') and OBJECTPROPERTY(id, N'IsTrigger') = 1)
drop trigger [dbo].[trg_CheckSameID]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[AllItemsLog]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[AllItemsLog]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[CopyLog]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[CopyLog]
GO

CREATE TABLE [dbo].[AllItemsLog] (
[items_id] [int] IDENTITY (1, 1) NOT NULL ,
[items_type]  (1) NOT NULL ,
[items_serial]  (4) NOT NULL ,
[items_acid]  (10) COLLATE Chinese_PRC_CI_AS NOT NULL
) ON 
GO

CREATE TABLE [dbo].[CopyLog] (
[copy_id] [int] IDENTITY (1, 1) NOT NULL ,
[copy_acid]  (10) COLLATE Chinese_PRC_CI_AS NOT NULL ,
[copy_whdata]  (1200) NOT NULL ,
[copy_date] [datetime] NOT NULL
) ON 
GO

ALTER TABLE [dbo].[AllItemsLog] ADD
CONSTRAINT [DF_CT_ITEM_item] DEFAULT (0) FOR [items_type],
CONSTRAINT [DF_CT_ITEM_itemid] DEFAULT (0) FOR [items_serial],
CONSTRAINT [DF_CT_ITEM_itemrole] DEFAULT ('') FOR [items_acid]
GO

CREATE INDEX [IX_CT_ITEM] ON [dbo].[AllItemsLog]([items_type], [items_serial]) ON 
GO

ALTER TABLE [dbo].[CopyLog] ADD
CONSTRAINT [DF_CopyLog_copy_date] DEFAULT (getdate()) FOR [copy_date]
GO


SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO

CREATE TRIGGER [dbo].[trg_CheckSameID] ON [dbo].
FOR UPDATE
AS
BEGIN
IF UPDATE(inventory)
BEGIN
SET NOCOUNT ON
DECLARE
@wh_acid varchar(10),
@wh_data binary(1200),
@wh_type binary(1),
@wh_serial binary(4),

@cr_user varchar(10),
@cr_acid varchar(10),
@cr_data binary(760),
@cr_type binary(1),
@cr_serial binary(4),

@al_acid varchar(10),
@j int,
@k int,
@find bit

SELECT @cr_acid=i.accountid,
@cr_data=i.inventory
FROM inserted i

SET @j=0
SET @find=0

WHILE @j<76 AND @cr_data IS NOT NULL
BEGIN
SET @cr_type=SUBSTRING(@cr_data,@j*10+1,1)
SET @cr_serial=SUBSTRING(@cr_data,@j*10+4,4)
IF @cr_type<>0xFF AND @cr_serial<>0x00000000
BEGIN
SELECT @al_acid=items_acid FROM allitemslog WHERE items_type=@cr_type AND items_serial=@cr_serial


IF @al_acid IS NULL
INSERT INTO allitemslog (items_type,items_serial,items_acid) VALUES (@cr_type,@cr_serial,@cr_acid)
ELSE
BEGIN
UPDATE allitemslog SET items_acid=@cr_acid WHERE items_type=@cr_type AND items_serial=@cr_serial


SELECT @wh_data=items FROM warehouse WHERE accountid=@al_acid

SET @k=0
WHILE @k<120 AND @wh_data IS NOT NULL
BEGIN
SET @wh_type=SUBSTRING(@wh_data,@k*10+1,1)
SET @wh_serial=SUBSTRING(@wh_data,@k*10+4,4)
IF @wh_type=@cr_type AND @wh_serial=@cr_serial
SET @find=1
SET @k=@k+1
END
END
END
SET @j=@j+1
END
IF @find=1
BEGIN
INSERT INTO copylog (copy_whdata,copy_acid,copy_date) VALUES (@wh_data,@al_acid,getdate())
-- this is wer u can add more punishment like ban or lock characters
UPDATE Character SET CtlCode=1 WHERE accountid=@al_acid
END
SET NOCOUNT OFF
END
END
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
DECLARE @al_acid char(50)
set @al_acid = 'ASUS'
UPDATE Character SET CtlCode=1 WHERE accountid=@al_acid
go
select * from AllItemsLog
select * from CopyLog
ESTA ES LA SENTENCIA DEL SQL QUE PUSE , PORFAVOR LE VOY A AGRADECER TODA UNA VIDA


Offline mochaso05 #1 Posteado: May 29, 2019, 11:47:03 AM

  • 0 puntos por ventas
  • *
  • Rank: Puto amo
  • Posts: 278
  • Gracias recibida: 31
  • ar
PORFAVOR ALGUIEN QUE ME PUEDA AYUDAR!


Offline RandyPiero #2 Posteado: May 29, 2019, 11:59:22 AM

  • 0 puntos por ventas
  • *
  • Rank: Puto amo
  • Posts: 338
  • Gracias recibida: 83
  • pe
Si mal no recuerdo las sentencias son irrevocable! Vas a tener que restaurar de nuevo todo


Offline mochaso05 #3 Posteado: May 29, 2019, 12:10:56 PM

  • 0 puntos por ventas
  • *
  • Rank: Puto amo
  • Posts: 278
  • Gracias recibida: 31
  • ar
me dijeron que si con el mismo codigo pero con disable algo asi no entendi


Offline mochaso05 #4 Posteado: May 29, 2019, 12:12:27 PM

  • 0 puntos por ventas
  • *
  • Rank: Puto amo
  • Posts: 278
  • Gracias recibida: 31
  • ar
tambien me dijeron que el problema es el serial de los items, lo que ami meborra son los jawels


Offline RinOv #5 Posteado: May 29, 2019, 12:18:57 PM

  • C++ Coder
  • 0 puntos por ventas
  • *
  • Rank: Liga mayor
  • Posts: 181
  • Gracias recibida: 2009
  • ru
digamos que cierta parte se puede devolver, pero cosas como esta es muy, muy delicado. si tu data base era de "varbinary" y cambiaste a un valor "varchar" es casi imposible recuperar. ya que dañaste las tablas por la conversion se corrompen.

Code: [Select]
@wh_acid varchar(10), 
@wh_data binary(1200),
@wh_type binary(1),
@wh_serial binary(4),

@cr_user varchar(10),
@cr_acid varchar(10),
@cr_data binary(760),
@cr_type binary(1),
@cr_serial binary(4),

por ejemplo tienes la ventaja que esta sentencia crea una tabla:

Code: [Select]
CREATE TABLE [dbo].[AllItemsLog] ( 
[items_id] [int] IDENTITY (1, 1) NOT NULL ,
[items_type]  (1) NOT NULL ,
[items_serial]  (4) NOT NULL ,
[items_acid]  (10) COLLATE Chinese_PRC_CI_AS NOT NULL
) ON 
GO

al final sale el codigo de bloqueo:

Code: [Select]
UPDATE Character SET CtlCode=1 WHERE accountid=@al_acid 
END
SET NOCOUNT OFF
END
END
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
DECLARE @al_acid char(50)
set @al_acid = 'ASUS'
UPDATE Character SET CtlCode=1 WHERE accountid=@al_acid
go
select * from AllItemsLog
select * from CopyLog

puedes ir y borrar las cuentas bloquedas



RinOv Group

Offline mochaso05 #6 Posteado: May 29, 2019, 12:21:27 PM

  • 0 puntos por ventas
  • *
  • Rank: Puto amo
  • Posts: 278
  • Gracias recibida: 31
  • ar
digamos que cierta parte se puede devolver, pero cosas como esta es muy, muy delicado. si tu data base era de "varbinary" y cambiaste a un valor "varchar" es casi imposible recuperar. ya que dañaste las tablas por la conversion se corrompen.

Code: [Select]
@wh_acid varchar(10), 
@wh_data binary(1200),
@wh_type binary(1),
@wh_serial binary(4),

@cr_user varchar(10),
@cr_acid varchar(10),
@cr_data binary(760),
@cr_type binary(1),
@cr_serial binary(4),

por ejemplo tienes la ventaja que esta sentencia crea una tabla:

Code: [Select]
CREATE TABLE [dbo].[AllItemsLog] ( 
[items_id] [int] IDENTITY (1, 1) NOT NULL ,
[items_type]  (1) NOT NULL ,
[items_serial]  (4) NOT NULL ,
[items_acid]  (10) COLLATE Chinese_PRC_CI_AS NOT NULL
) ON 
GO

al final sale el codigo de bloqueo:

Code: [Select]
UPDATE Character SET CtlCode=1 WHERE accountid=@al_acid 
END
SET NOCOUNT OFF
END
END
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
DECLARE @al_acid char(50)
set @al_acid = 'ASUS'
UPDATE Character SET CtlCode=1 WHERE accountid=@al_acid
go
select * from AllItemsLog
select * from CopyLog

puedes ir y borrar las cuentas bloquedas



yo lo unico que quiero es que se deje de borrar los items que pongo en el baul, pongo un soul y se borra es como que detecta que esta dupeado por el serial, pero pongo otros items y no se borra


Offline RinOv #7 Posteado: May 29, 2019, 12:47:03 PM

  • C++ Coder
  • 0 puntos por ventas
  • *
  • Rank: Liga mayor
  • Posts: 181
  • Gracias recibida: 2009
  • ru
intentalo de esta forma aver

Code: [Select]
use muonline 
if exists(select * from dbo.sysobjects where type='p' and name='WZ_GetItemSerial')
drop procedure WZ_GetItemSerial
go
DELETE procedure WZ_GetItemSerial
as
BEGIN
DECLARE @ItemSerial int
set nocount on
begin transaction
update GameServerInfo set @ItemSerial = ItemCount = (case when ItemCount < 0x7effffff then ItemCount+1
else 1
end )
if(@@error <> 0)
begin
rollback transaction
select-1
end
else
begin
commit transaction
select @ItemSerial
end
END

GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[trg_CheckSameID]') and OBJECTPROPERTY(id, N'IsTrigger') = 1)
drop trigger [dbo].[trg_CheckSameID]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[AllItemsLog]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[AllItemsLog]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[CopyLog]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[CopyLog]
GO

DELETE TABLE [dbo].[AllItemsLog] (
[items_id] [int] IDENTITY (1, 1) NOT NULL ,
[items_type]  (1) NOT NULL ,
[items_serial]  (4) NOT NULL ,
[items_acid]  (10) COLLATE Chinese_PRC_CI_AS NOT NULL
) ON 
GO

DELETE TABLE [dbo].[CopyLog] (
[copy_id] [int] IDENTITY (1, 1) NOT NULL ,
[copy_acid]  (10) COLLATE Chinese_PRC_CI_AS NOT NULL ,
[copy_whdata]  (1200) NOT NULL ,
[copy_date] [datetime] NOT NULL
) ON 
GO

TRUNCATE TABLE [dbo].[AllItemsLog] ADD
CONSTRAINT [DF_CT_ITEM_item] DEFAULT (0) FOR [items_type],
CONSTRAINT [DF_CT_ITEM_itemid] DEFAULT (0) FOR [items_serial],
CONSTRAINT [DF_CT_ITEM_itemrole] DEFAULT ('') FOR [items_acid]
GO

DELETE INDEX [IX_CT_ITEM] ON [dbo].[AllItemsLog]([items_type], [items_serial]) ON 
GO

DELETE TABLE [dbo].[CopyLog] ADD
CONSTRAINT [DF_CopyLog_copy_date] DEFAULT (getdate()) FOR [copy_date]
GO


SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO

DELETE TRIGGER [dbo].[trg_CheckSameID] ON [dbo].
FOR UPDATE
AS
BEGIN
IF UPDATE(inventory)
BEGIN
SET NOCOUNT ON
DECLARE
@wh_acid varchar(10),
@wh_data binary(1200),
@wh_type binary(1),
@wh_serial binary(4),

@cr_user varchar(10),
@cr_acid varchar(10),
@cr_data binary(760),
@cr_type binary(1),
@cr_serial binary(4),

@al_acid varchar(10),
@j int,
@k int,
@find bit

SELECT @cr_acid=i.accountid,
@cr_data=i.inventory
FROM inserted i

SET @j=0
SET @find=0

WHILE @j<76 AND @cr_data IS NOT NULL
BEGIN
SET @cr_type=SUBSTRING(@cr_data,@j*10+1,1)
SET @cr_serial=SUBSTRING(@cr_data,@j*10+4,4)
IF @cr_type<>0xFF AND @cr_serial<>0x00000000
BEGIN
SELECT @al_acid=items_acid FROM allitemslog WHERE items_type=@cr_type AND items_serial=@cr_serial


IF @al_acid IS NULL
INSERT INTO allitemslog (items_type,items_serial,items_acid) VALUES (@cr_type,@cr_serial,@cr_acid)
ELSE
BEGIN
UPDATE allitemslog SET items_acid=@cr_acid WHERE items_type=@cr_type AND items_serial=@cr_serial


SELECT @wh_data=items FROM warehouse WHERE accountid=@al_acid

SET @k=0
WHILE @k<120 AND @wh_data IS NOT NULL
BEGIN
SET @wh_type=SUBSTRING(@wh_data,@k*10+1,1)
SET @wh_serial=SUBSTRING(@wh_data,@k*10+4,4)
IF @wh_type=@cr_type AND @wh_serial=@cr_serial
SET @find=1
SET @k=@k+1
END
END
END
SET @j=@j+1
END
IF @find=1
BEGIN
INSERT INTO copylog (copy_whdata,copy_acid,copy_date) VALUES (@wh_data,@al_acid,getdate())
-- this is wer u can add more punishment like ban or lock characters
UPDATE Character SET CtlCode=1 WHERE accountid=@al_acid
END
SET NOCOUNT OFF
END
END
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
DECLARE @al_acid char(50)
set @al_acid = 'ASUS'
UPDATE Character SET CtlCode=1 WHERE accountid=@al_acid
go
select * from AllItemsLog
select * from CopyLog

RinOv Group

Offline mochaso05 #8 Posteado: May 29, 2019, 01:10:20 PM

  • 0 puntos por ventas
  • *
  • Rank: Puto amo
  • Posts: 278
  • Gracias recibida: 31
  • ar
me salto error


Offline mochaso05 #9 Posteado: May 29, 2019, 01:26:34 PM

  • 0 puntos por ventas
  • *
  • Rank: Puto amo
  • Posts: 278
  • Gracias recibida: 31
  • ar
me aparece esto :
Code: [Select]
Mens. 156, Nivel 15, Estado 1, Línea 2
Sintaxis incorrecta cerca de la palabra clave 'procedure'.
Mens. 156, Nivel 15, Estado 1, Línea 3
Sintaxis incorrecta cerca de la palabra clave 'TABLE'.
Mens. 156, Nivel 15, Estado 1, Línea 3
Sintaxis incorrecta cerca de la palabra clave 'TABLE'.
Mens. 156, Nivel 15, Estado 1, Línea 4
Sintaxis incorrecta cerca de la palabra clave 'CONSTRAINT'.
Mens. 1018, Nivel 15, Estado 1, Línea 3
Sintaxis incorrecta cerca de 'INDEX'. Si se va a usar como parte de una sugerencia de tabla, es necesario escribir una palabra clave WITH y paréntesis. Vea los Libros en pantalla de SQL Server para conocer la sintaxis correcta.
Mens. 156, Nivel 15, Estado 1, Línea 3
Sintaxis incorrecta cerca de la palabra clave 'TABLE'.
Mens. 156, Nivel 15, Estado 1, Línea 3
Sintaxis incorrecta cerca de la palabra clave 'TRIGGER'.
Mens. 140, Nivel 15, Estado 1, Línea 7
IF UPDATE sólo puede utilizarse dentro de una instrucción CREATE TRIGGER.

(0 filas afectadas)
Mens. 208, Nivel 16, Estado 1, Línea 2
El nombre de objeto 'AllItemsLog' no es válido.


y esto :

Code: [Select]
La operación de asociar automáticamente al proceso '[1548] [SQL] WIN-AJVU6D1RR1S' en el equipo 'WIN-AJVU6D1RR1S' se efectuó correctamente.
El subproceso 'WIN-AJVU6D1RR1S [286]' (0x134) terminó con código 0 (0x0).
El subproceso 'WIN-AJVU6D1RR1S [286]' (0x134) terminó con código 0 (0x0).
El subproceso 'WIN-AJVU6D1RR1S [286]' (0x134) terminó con código 0 (0x0).
El subproceso 'WIN-AJVU6D1RR1S [286]' (0x134) terminó con código 0 (0x0).
El subproceso 'WIN-AJVU6D1RR1S [286]' (0x134) terminó con código 0 (0x0).
El subproceso 'WIN-AJVU6D1RR1S [286]' (0x134) terminó con código 0 (0x0).
El subproceso 'WIN-AJVU6D1RR1S [286]' (0x134) terminó con código 0 (0x0).
El subproceso 'WIN-AJVU6D1RR1S [286]' (0x134) terminó con código 0 (0x0).
El subproceso 'WIN-AJVU6D1RR1S [286]' (0x134) terminó con código 0 (0x0).
El subproceso 'WIN-AJVU6D1RR1S [286]' (0x134) terminó con código 0 (0x0).
El subproceso 'WIN-AJVU6D1RR1S [286]' (0x134) terminó con código 0 (0x0).
El subproceso 'WIN-AJVU6D1RR1S [286]' (0x134) terminó con código 0 (0x0).
El subproceso 'WIN-AJVU6D1RR1S [286]' (0x134) terminó con código 0 (0x0).
El subproceso 'WIN-AJVU6D1RR1S [286]' (0x134) terminó con código 0 (0x0).
El subproceso 'WIN-AJVU6D1RR1S [286]' (0x134) terminó con código 0 (0x0).
El subproceso 'WIN-AJVU6D1RR1S [286]' (0x134) terminó con código 0 (0x0).
El subproceso 'WIN-AJVU6D1RR1S [286]' (0x134) terminó con código 0 (0x0).
El subproceso 'WIN-AJVU6D1RR1S [286]' (0x134) terminó con código 0 (0x0).
El programa '[1548] [SQL] WIN-AJVU6D1RR1S: WIN-AJVU6D1RR1S' terminó con código 0 (0x0).


Offline mochaso05 #10 Posteado: May 29, 2019, 03:12:34 PM

  • 0 puntos por ventas
  • *
  • Rank: Puto amo
  • Posts: 278
  • Gracias recibida: 31
  • ar
ALGUNA SOLUCION?


Online ZabiinoOo #11 Posteado: May 29, 2019, 04:55:51 PM

  • MAESTRO

  • US. DE HONOR

  • LEYENDA

  • Administrador
  • 0 puntos por ventas
  • *
  • Rank: Puto amo
  • Posts: 7.311
  • Gracias recibida: 125945
  • pe
porque no usas este programa:
http://tuservermu.com.ve/index.php?topic=42

con eso borras los items dupeds y consegis las cuentas duperas




Prohibido pedir soporte via MP
Leer las reglas de cada seccion
we trust god

Offline mochaso05 #12 Posteado: May 29, 2019, 05:00:32 PM | Modificado: May 29, 2019, 05:02:27 PM by mochaso05

  • 0 puntos por ventas
  • *
  • Rank: Puto amo
  • Posts: 278
  • Gracias recibida: 31
  • ar
porque no usas este programa:
http://tuservermu.com.ve/index.php?topic=42

con eso borras los items dupeds y consegis las cuentas duperas
GRACIAS PERO AHORA LO DESCARGARE, LO QUE YO NECESITO AHORA ES ANULAR LO QUE PUSE EN LA CONSULTA SQL PORQUE JAWELS QUE GUARDO EN EL BAUL SE BORRA DE LA NADA , OSEA SI EDITO EL JAWELS NO SE BORRA PERO EL JAWELS DROPEADO SI


Solo usuarios registrados pueden comentar y agradecer, Logueate o Registrate


 

Related Topics

  Subject / Started by Replies Last post
0 Replies
1128 Views
Last post April 04, 2017, 04:18:24 PM
by fedrock
4 Replies
2572 Views
Last post April 24, 2023, 01:50:37 AM
by Azzlaer
3 Replies
1290 Views
Last post November 27, 2019, 03:37:22 AM
by BeckerIbero
2 Replies
1194 Views
Last post August 02, 2020, 11:20:36 AM
by load_01
Anti Hacker RPG

Started by Odisk « 1 2 » Antihacks

28 Replies
7668 Views
Last post July 01, 2023, 02:09:01 AM
by rowdy2014