Informações
Código:
Protocolo JPN - OK
Season 2 Full - OK
Golden Fenrir - OK
Wings Level 3 - OK
Mixes Novos - OK
Illusion Temple - OK
Quest Nova Classe - OK
Novos Mapas - OK
Cash Shop Seal - Ok
Mu Server Original - Sem Modificações
Download - OBJECTSTRUCT
Download - ODBC
Download - Database
Download - Cliente e Main
Fix de Salvar Seals na DB - Necessário deletar essa table e as 4 producedures
Código:
CREATE TABLE [T_PeriodItemInfo] (
[PeriodIndex] [int] IDENTITY (1, 1) NOT NULL ,
[UserGuid] [int] NOT NULL ,
[CharacterName] [char] (10) COLLATE Korean_Wansung_CI_AS NOT NULL ,
[ItemCode] [int] NOT NULL ,
[EffectType1] [tinyint] NOT NULL ,
[EffectType2] [tinyint] NULL ,
[UsedTime] [int] NOT NULL CONSTRAINT [DF_T_PeriodItemInfo_UsedTime] DEFAULT (0),
[LeftTime] [int] NOT NULL ,
[BuyDate] [smalldatetime] NOT NULL ,
[ExpireDate] [smalldatetime] NOT NULL ,
[UsedInfo] [tinyint] NOT NULL CONSTRAINT [DF_T_PeriodItemInfo_UsedInfo] DEFAULT (0),
[OptionType] [tinyint] NOT NULL CONSTRAINT [DF_T_PeriodItemInfo_OptionType] DEFAULT (2)
) ON [PRIMARY]
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE PROCEDURE dbo.WZ_PeriodItemDelete
@UserGuid int,
@CharacterName varchar(10)
AS BEGIN
DECLARE @ErrorCode int
DECLARE @ItemInfoCount int
SET @ErrorCode = 0
SET @ItemInfoCount = 0
SET nocount on
SELECT @ItemInfoCount = COUNT(*) FROM T_PeriodItemInfo where UserGuid = @UserGuid AND CharacterName = @CharacterName
IF( @ItemInfoCount < 1 )
BEGIN
SET @ErrorCode = 1
END
IF( @ErrorCode <> 1 )
BEGIN
UPDATE T_PeriodItemInfo SET UsedInfo = 0 WHERE UserGuid = @UserGuid AND CharacterName = @CharacterName
END
SELECT @ErrorCode
SET nocount off
END
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE procedure dbo.WZ_PeriodItemInsert
@UserGuid int,
@CharacterName varchar(10),
@ItemCode int,
@OptionType tinyint,
@EffectType1 tinyint,
@EffectType2 tinyint,
@TotalUsePeriod int,
@ExpireDate varchar(20)
as
BEGIN
DECLARE @ErrorCode int
DECLARE @PeriodItemIndex int
SET @ErrorCode = 0
SET @PeriodItemIndex = 0
SET XACT_ABORT ON
Set nocount on
begin transaction
-- OptionType? ?? ???? ???? ??? ????.
SELECT @PeriodItemIndex = PeriodIndex FROM T_PeriodItemInfo WHERE UserGuid = @UserGuid AND CharacterName = @CharacterName AND OptionType = @OptionType AND UsedInfo = 1
IF ( @PeriodItemIndex != 0 )
BEGIN
UPDATE T_PeriodItemInfo SET UsedInfo = 0 WHERE UserGuid = @UserGuid AND CharacterName = @CharacterName AND OptionType = @OptionType AND UsedInfo = 1
END
INSERT INTO T_PeriodItemInfo (UserGuid, CharacterName, ItemCode, OptionType, EffectType1, EffectType2, LeftTime, BuyDate, ExpireDate, UsedInfo) VALUES
( @UserGuid, @CharacterName, @ItemCode, @OptionType, @EffectType1, @EffectType2, @TotalUsePeriod, GETDATE(), @ExpireDate, 1 )
IF( @@Error <> 0 )
BEGIN
SET @ErrorCode = 2
END
IF ( @ErrorCode <> 0 )
rollback transaction
ELSE
commit transaction
SELECT @ErrorCode
Set nocount off
SET XACT_ABORT OFF
END
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE procedure dbo.WZ_PeriodItemSelect
@UserGuid int,
@CharacterName varchar(10)
as
BEGIN
DECLARE @ErrorCode int
DECLARE @ItemInfoCount int
DECLARE @PeriodIndex int
DECLARE @ExpireDate smalldatetime
DECLARE @UsedInfo tinyint
SET @PeriodIndex = 0
SET @ErrorCode = 0
SET @ItemInfoCount = 0
SET @UsedInfo = 0
Set nocount on
-- ?? ??? ?? ???? ??? ?? ???.
DECLARE CUR CURSOR FOR SELECT [PeriodIndex], [ExpireDate], [UsedInfo] FROM T_PeriodItemInfo WHERE UserGuid = @UserGuid AND CharacterName = @CharacterName AND UsedInfo = 1 FOR UPDATE
OPEN CUR
FETCH NEXT FROM CUR INTO @PeriodIndex, @ExpireDate, @UsedInfo
WHILE( @@fetch_status <> -1 )
BEGIN
IF( @@fetch_status <> -2 )
BEGIN
IF( @ExpireDate < GetDate() )
BEGIN
UPDATE T_PeriodItemInfo SET UsedInfo = 0 WHERE PeriodIndex = @PeriodIndex
END
END
FETCH NEXT FROM CUR INTO @PeriodIndex, @ExpireDate, @UsedInfo
END
-- ??? ?? ??? ?? ???? ??????.
SELECT *, DATEDIFF( minute, BuyDate, GETDATE() ) AS UsedMinutes, DATEDIFF( minute, GETDATE(), ExpireDate ) AS LeftMinutes FROM T_PeriodItemInfo where UserGuid = @UserGuid AND CharacterName = @CharacterName AND UsedInfo = 1
--SELECT * FROM T_PeriodItemInfo where UserGuid = @UserGuid AND CharacterName = @CharacterName AND UsedInfo = 1
IF( @@Error <> 0 )
BEGIN
SET @ErrorCode = -1
END
CLOSE CUR
DEALLOCATE CUR
Set nocount off
END
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE procedure dbo.WZ_PeriodItemUpdate
@UserGuid int,
@CharacterName varchar(10),
@ItemCode int,
@UsedTime int,
@LeftTime int
as
BEGIN
DECLARE @ErrorCode int
DECLARE @ItemInfoCount int
DECLARE @RetLeftTime int
SET @ErrorCode = 0
SET @ItemInfoCount = 0
SET @RetLeftTime = 0
SET XACT_ABORT ON
Set nocount on
begin transaction
SELECT @ItemInfoCount = COUNT(*) FROM T_PeriodItemInfo where UserGuid = @UserGuid AND CharacterName = @CharacterName AND UsedInfo = 1
IF( @ItemInfoCount <> 1 )
BEGIN
SET @ErrorCode = 1
END
ELSE
BEGIN
UPDATE T_PeriodItemInfo SET UsedTime = UsedTime + @UsedTime, LeftTime = @LeftTime WHERE UserGuid = @UserGuid AND CharacterName = @CharacterName AND ItemCode = @ItemCode AND UsedInfo = 1
IF( @@Error <> 0 )
BEGIN
SET @ErrorCode = 2
END
END
SELECT @RetLeftTime = LeftTime FROM T_PeriodItemInfo where UserGuid = @UserGuid AND CharacterName = @CharacterName AND ItemCode = @ItemCode AND UsedInfo = 1
IF ( @RetLeftTime <= 0 )
BEGIN
UPDATE T_PeriodItemInfo SET UsedInfo = 0, LeftTime = 0 WHERE UserGuid = @UserGuid AND CharacterName = @CharacterName AND ItemCode = @ItemCode AND UsedInfo = 1
SET @ErrorCode = 3
END
IF ( @ErrorCode <> 0 AND @ErrorCode <> 3 )
rollback transaction
ELSE
commit transaction
select @ErrorCode
Set nocount off
SET XACT_ABORT OFF
END
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
Screens:
-0000.jpg?1419430778)
-0001.jpg?1419430833)
-0003.jpg?1419430896)
-0004.jpg?1419430941)
Creditos:
Webzen
Decompilador GameServer 1.00.18/1.00.90
Sunligth - Fix e Update