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!

Drop at every 2 minuts ..

Status
Not open for further replies.
Newbie Spellweaver
Joined
May 28, 2009
Messages
15
Reaction score
0
My server drops at every 2 minutes i think i drops only me ... when i made the server he was perfect no bugs like this but from 1 day it drops me every 2 minutes:<::<::<: can any one hellp me i use 99d and 97i ...
 
Newbie Spellweaver
Joined
May 28, 2009
Messages
15
Reaction score
0
Ok i will try

Where can i find this file ?
 
Last edited:
Upvote 0
Newbie Spellweaver
Joined
May 28, 2009
Messages
15
Reaction score
0
I don't have this file.. i also go to start -> Search and search every localtion of my computer there is no file with this name ..
 
Upvote 0
Newbie Spellweaver
Joined
May 28, 2009
Messages
15
Reaction score
0
Zloto - Drop at every 2 minuts .. - RaGEZONE Forums
This is all i have in this folder ...
 
Upvote 0
Newbie Spellweaver
Joined
May 28, 2009
Messages
15
Reaction score
0
I found this line
EventChipServerConnect = 0
and fix it on
EventChipServerConnect = 1
but no efect i restart the server and again it drop me..
I also find a
EventChipEvent = 1
it was on default 1 ...
 
Upvote 0
Newbie Spellweaver
Joined
May 28, 2009
Messages
15
Reaction score
0
I change it to 0 but no effect...
here u go the code from the file please try to fix it ... :S:S


[GameServerInfo]
Language = 3
ItemSerialCheck = 0
SpeedHackPlayerBlock = 0
AddExperience = 200
StalkProtocol = 0
StalkProtocolId = gg
CharacterDeleteMinLevel = 39
CreateCharacter = 1
GuildCreateLevel = 150
GuildCreate = 1
GuildDestroy = 1
Trade = 1
ChaosBox = 1
ChaosEvent = 1
ChaosEventServer = 94.73.44.185
AttackEventRegenTime = 30
PKTIME = 1
PKItemDrop = 0
MonsterHp = 80
ItemDropPer = 50
ZenDurationTime = 30
MerryXMasTalkNpc = 0
HappyNewYearTalkNpc = 0
EnableEventNPCTalk = 1
AttackSpeedTimeLimit = 45000
IsIgnorePacketHackDetect = 1
HackCheckCount = 0
MinimumAttackSpeedTime = 200
DecTimePerAttackSpeed = 5.33
SpeedHackPenalty = 0
DetectedHackKickCount = 0
IsKickDetecHackCountLimit = 0
EVENT1 = 0
Event1ItemDropTodayMax = 0
Event1ItemDropTodayPercent = 0
XMasEvent = 1
XMasEvent_StarOfXMasDropRate = 40
XMasEvent_ItemDropRateForStarOfXMas = 80
FireCrackerEvent = 1
FireCrackerDropRate = 40
ItemDropRateForFireCracker = 80
DevilSquareEvent = 1
DevilSquareEventServer = 94.73.44.185
DevilSquareEventConnect = 1
EyesOfDevilSquareDropRate = 3
KeyOfDevilSquareDropRate = 3
MedalEvent = 1
GoldMedalDropRate = 40
SilverMedalDropRate = 40
ItemDropRateForGoldMedal = 80
ItemDropRateForSilverMedal = 80
EventChipServerConnect = 0
EventChipServerIp = 94.73.44.185
EventChipEvent = 0
BoxOfGoldDropRate = 40
ItemDropRateForBoxOfGold = 80
EventChipDropRateForBoxOfGold = 80
HeartOfLoveEvent = 1
HeartOfLoveDropRate = 40
ItemDropRateForHeartOfLove = 80
IsEledoradoEvent = 1
EledoradoGoldGoblenRegenTime = 30
EledoradoTitanRegenTime = 30
EledoradoGoldDerconRegenTime = 30
EledoradoDevilLizardKingRegenTime = 30
EledoradoDevilTantarosRegenTime = 30
EledoradoGoldGoblenItemDropRate = 100
EledoradoGoldGoblenExItemDropRate = 100
EledoradoTitanItemDropRate = 100
EledoradoTitanExItemDropRate = 100
EledoradoGoldDerconItemDropRate = 100
EledoradoGoldDerconExItemDropRate = 100
EledoradoDevilLizardKingItemDropRate = 100
EledoradoDevilLizardKingExItemDropRate = 100
EledoradoDevilTantarosItemDropRate = 100
EledoradoDevilTantarosExItemDropRate = 100
BloodCastleEvent = 1
BloodCastleStartHour = 30
AngelKingsPaperDropRate = 100
BloodBoneDropRate = 100
StoneItemDrop = 0
StoneDropRate = 0
 
Upvote 0
Experienced Elementalist
Joined
Oct 18, 2008
Messages
206
Reaction score
19
[GameServerInfo]
Language = 0
ItemSerialCheck = 0
SpeedHackPlayerBlock = 0
AddExperience = 200
StalkProtocol = 0
StalkProtocolId = gg
CharacterDeleteMinLevel = 39
CreateCharacter = 1
GuildCreateLevel = 150
GuildCreate = 1
GuildDestroy = 1
Trade = 1
ChaosBox = 1
ChaosEvent = 1
ChaosEventServer = 94.73.44.185
AttackEventRegenTime = 30
PKTIME = 1
PKItemDrop = 0
MonsterHp = 80
ItemDropPer = 50
ZenDurationTime = 30
MerryXMasTalkNpc = 0
HappyNewYearTalkNpc = 0
EnableEventNPCTalk = 1
AttackSpeedTimeLimit = 45000
IsIgnorePacketHackDetect = 1
HackCheckCount = 0
MinimumAttackSpeedTime = 200
DecTimePerAttackSpeed = 5.33
SpeedHackPenalty = 0
DetectedHackKickCount = 0
IsKickDetecHackCountLimit = 0
EVENT1 = 0
Event1ItemDropTodayMax = 0
Event1ItemDropTodayPercent = 0
XMasEvent = 1
XMasEvent_StarOfXMasDropRate = 40
XMasEvent_ItemDropRateForStarOfXMas = 80
FireCrackerEvent = 1
FireCrackerDropRate = 40
ItemDropRateForFireCracker = 80
DevilSquareEvent = 1
DevilSquareEventServer = 94.73.44.185
DevilSquareEventConnect = 1
EyesOfDevilSquareDropRate = 3
KeyOfDevilSquareDropRate = 3
MedalEvent = 1
GoldMedalDropRate = 40
SilverMedalDropRate = 40
ItemDropRateForGoldMedal = 80
ItemDropRateForSilverMedal = 80
EventChipServerConnect = 0
EventChipServerIp = 94.73.44.185
EventChipEvent = 0
BoxOfGoldDropRate = 40
ItemDropRateForBoxOfGold = 80
EventChipDropRateForBoxOfGold = 80
HeartOfLoveEvent = 1
HeartOfLoveDropRate = 40
ItemDropRateForHeartOfLove = 80
IsEledoradoEvent = 1
EledoradoGoldGoblenRegenTime = 30
EledoradoTitanRegenTime = 30
EledoradoGoldDerconRegenTime = 30
EledoradoDevilLizardKingRegenTime = 30
EledoradoDevilTantarosRegenTime = 30
EledoradoGoldGoblenItemDropRate = 100
EledoradoGoldGoblenExItemDropRate = 100
EledoradoTitanItemDropRate = 100
EledoradoTitanExItemDropRate = 100
EledoradoGoldDerconItemDropRate = 100
EledoradoGoldDerconExItemDropRate = 100
EledoradoDevilLizardKingItemDropRate = 100
EledoradoDevilLizardKingExItemDropRate = 100
EledoradoDevilTantarosItemDropRate = 100
EledoradoDevilTantarosExItemDropRate = 100
BloodCastleEvent = 1
BloodCastleStartHour = 30
AngelKingsPaperDropRate = 100
BloodBoneDropRate = 100
StoneItemDrop = 0
StoneDropRate = 0
 
Last edited:
Upvote 0
Newbie Spellweaver
Joined
May 28, 2009
Messages
15
Reaction score
0
Zloto - Drop at every 2 minuts .. - RaGEZONE Forums

I have an error.I made the Language = 0 and i Receive this error !
 
Last edited:
Upvote 0
Initiate Mage
Joined
Nov 16, 2007
Messages
4
Reaction score
0
Zloto - Drop at every 2 minuts .. - RaGEZONE Forums

I have an error.I made the Language = 0 and i Receive this error !

meke a copy man this file .wtf
copy other file with name "message_jpn.wtf" e replace with "message_kor.wtf"
 
Last edited:
Upvote 0
Retired Old Man
Loyal Member
Joined
Jun 9, 2008
Messages
761
Reaction score
706
changing protocol wont help you, copy gs log when u get DC
 
Upvote 0
Newbie Spellweaver
Joined
May 28, 2009
Messages
15
Reaction score
0
Is this what you mean ?

Code:
23:15:40 (4995)logout :  [85.217.172.224]
23:17:18 connect : [4821][127.0.0.1]
23:17:18 (4821)logout :  [127.0.0.1]
23:19:16 connect : [4822][127.0.0.1]
23:19:16 (4822)logout :  [127.0.0.1]
23:20:09 [DevilSquare] Close
23:20:09 [DevilSquare] Sync Open Time. [95]min remain
23:21:59 connect : [4823][127.0.0.1]
23:21:59 (4823)logout :  [127.0.0.1]
23:23:40 connect : [4824][127.0.0.1]
23:23:40 (4824)logout :  [127.0.0.1]
23:30:01 [Blood Castle] (1) SetState PLAYING
23:30:01 [Blood Castle] (2) SetState PLAYING
23:30:01 [Blood Castle] (3) SetState PLAYING
23:30:01 [Blood Castle] (4) SetState PLAYING
23:30:01 [Blood Castle] (5) SetState PLAYING
23:30:01 [Blood Castle] (6) SetState PLAYING
23:30:02 [Blood Castle] (1) Blood Castle Quest Fail Result -> Destroy Castle Door [][]
23:30:02 [Blood Castle] (1) Blood Castle Quest Fail Result -> Destroy Saint Status [][]
23:30:02 [Blood Castle] (1) Sync Open Time. [59] min remain
23:30:02 [Blood Castle] (1) SetState CLOSED
23:30:02 [Blood Castle] (1) Blood Castle Quest Failed -> Every User Out
23:30:02 [Blood Castle] (2) Blood Castle Quest Fail Result -> Destroy Castle Door [][]
23:30:02 [Blood Castle] (2) Blood Castle Quest Fail Result -> Destroy Saint Status [][]
23:30:02 [Blood Castle] (2) Sync Open Time. [59] min remain
23:30:02 [Blood Castle] (2) SetState CLOSED
23:30:02 [Blood Castle] (2) Blood Castle Quest Failed -> Every User Out
23:30:02 [Blood Castle] (3) Blood Castle Quest Fail Result -> Destroy Castle Door [][]
23:30:02 [Blood Castle] (3) Blood Castle Quest Fail Result -> Destroy Saint Status [][]
23:30:02 [Blood Castle] (3) Sync Open Time. [59] min remain
23:30:02 [Blood Castle] (3) SetState CLOSED
23:30:02 [Blood Castle] (3) Blood Castle Quest Failed -> Every User Out
23:30:02 [Blood Castle] (4) Blood Castle Quest Fail Result -> Destroy Castle Door [][]
23:30:02 [Blood Castle] (4) Blood Castle Quest Fail Result -> Destroy Saint Status [][]
23:30:02 [Blood Castle] (4) Sync Open Time. [59] min remain
23:30:02 [Blood Castle] (4) SetState CLOSED
23:30:02 [Blood Castle] (4) Blood Castle Quest Failed -> Every User Out
23:30:02 [Blood Castle] (5) Blood Castle Quest Fail Result -> Destroy Castle Door [][]
23:30:02 [Blood Castle] (5) Blood Castle Quest Fail Result -> Destroy Saint Status [][]
23:30:02 [Blood Castle] (5) Sync Open Time. [59] min remain
23:30:02 [Blood Castle] (5) SetState CLOSED
23:30:02 [Blood Castle] (5) Blood Castle Quest Failed -> Every User Out
23:30:02 [Blood Castle] (6) Blood Castle Quest Fail Result -> Destroy Castle Door [][]
23:30:02 [Blood Castle] (6) Blood Castle Quest Fail Result -> Destroy Saint Status [][]
23:30:02 [Blood Castle] (6) Sync Open Time. [59] min remain
23:30:02 [Blood Castle] (6) SetState CLOSED
23:30:02 [Blood Castle] (6) Blood Castle Quest Failed -> Every User Out
23:30:37 Make GoldGoblen : 0, 189,181
23:30:37 Make GoldGoblen : 3, 193,89
23:30:37 Make GoldGoblen : 0, 186,81
23:30:37 Make GoldTaitan : 2, 116,166
23:30:37 Make GoldDercon : 3, 128,162
23:30:37 Make GoldDercon : 3, 127,80
23:30:37 Make GoldDercon : 3, 163,81
23:30:37 Make GoldLizarKing : 7, 175,101
23:30:37 Make GoldTantarus : 8, 153,129
23:30:37 Make GoldTantarus : 8, 56,156
23:30:37 Make GoldTantarus : 8, 92,100
23:33:42 connect : [4825][127.0.0.1]
23:33:42 (4825)logout :  [127.0.0.1]
23:36:20 connect : [4826][127.0.0.1]
23:36:20 (4826)logout :  [127.0.0.1]
23:53:25 connect : [4827][127.0.0.1]
23:53:25 (4827)logout :  [127.0.0.1]
23:53:26 connect : [4828][127.0.0.1]
23:53:26 (4828)logout :  [127.0.0.1]
23:53:27 connect : [4829][127.0.0.1]
23:53:27 (4829)logout :  [127.0.0.1]
23:53:28 connect : [4830][127.0.0.1]
23:53:28 (4830)logout :  [127.0.0.1]
00:00:38 Make GoldGoblen : 3, 75,176
00:00:38 Make GoldGoblen : 0, 135,186
00:00:38 Make GoldGoblen : 0, 138,197
00:00:38 Make GoldTaitan : 2, ****106
00:00:38 Make GoldDercon : 0, ****85
00:00:38 Make GoldDercon : 0, 138,83
00:00:38 Make GoldDercon : 0, ****164
00:00:38 Make GoldLizarKing : 7, 106,132
00:00:38 Make GoldTantarus : 8, 65,167
00:00:38 Make GoldTantarus : 8, 162,127
00:00:38 Make GoldTantarus : 8, 68,180
 
Upvote 0
Newbie Spellweaver
Joined
May 28, 2009
Messages
15
Reaction score
0
when i try to put Golden Archer i receive this problem i try to add Golden Archer from This tutorial but it didnt work so I replace the old configoration but i didn't remove this code :
Code:
USE MuOnline
GO

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

CREATE TABLE [dbo].[Admin] (
	[Id] [char] (10) NOT NULL ,
	[Pass] [char] (10) NULL ,
	[AdminLevel] [int] NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[T_BLOOD_CASTLE] (
	[AccountID] [varchar] (10) NOT NULL ,
	[StoneCount] [int] NOT NULL ,
	[Check_Code] [int] NOT NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[T_BLOOD_PLAYCOUNT] (
	[AccountId] [varchar] (50) NOT NULL ,
	[PlayCount] [int] NOT NULL ,
	[RecoverCheck] [bit] NOT NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[T_CC_OFFLINE_GIFT] (
	[Guid] [int] IDENTITY (1, 1) NOT NULL ,
	[Server] [int] NULL ,
	[AccountID] [varchar] (10) NULL ,
	[CharName] [varchar] (10) NULL ,
	[GiftKind] [int] NOT NULL ,
	[Date_Give] [smalldatetime] NOT NULL ,
	[Date_Reg] [smalldatetime] NULL ,
	[RegCheck] [tinyint] NOT NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[T_CC_OFFLINE_GIFTNAME] (
	[GiftKind] [int] NOT NULL ,
	[GiftName] [varchar] (50) NOT NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[T_DL_OFFLINE_GIFT] (
	[Guid] [int] IDENTITY (1, 1) NOT NULL ,
	[Server] [int] NULL ,
	[AccountID] [varchar] (10) NULL ,
	[CharName] [varchar] (10) NULL ,
	[GiftKind] [int] NOT NULL ,
	[Date_Give] [smalldatetime] NOT NULL ,
	[Date_Reg] [smalldatetime] NULL ,
	[RegCheck] [tinyint] NOT NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[T_DL_OFFLINE_GIFTNAME] (
	[GiftKind] [int] NOT NULL ,
	[GiftName] [varchar] (50) NOT NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[T_FRIENDSHIP_SERVERRANK] (
	[ServerCode] [smallint] NOT NULL ,
	[FriendShipStoneCount] [int] NOT NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[T_FRIENDSHIP_STONE] (
	[AccountID] [varchar] (10) NOT NULL ,
	[ServerCode] [smallint] NOT NULL ,
	[CharName] [varchar] (10) NOT NULL ,
	[FriendShipStoneCount] [int] NOT NULL ,
	[Check_Code] [tinyint] NOT NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[T_MU2003_EVENT] (
	[AccountID] [varchar] (50) NOT NULL ,
	[EventChips] [smallint] NOT NULL ,
	[MuttoIndex] [int] NOT NULL ,
	[MuttoNumber] [int] NOT NULL ,
	[Check_Code] [char] (1) NOT NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[T_RegCount_Check] (
	[AccountID] [varchar] (10) NOT NULL ,
	[RegCount] [int] NOT NULL ,
	[RegAlready] [bit] NOT NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[T_Register_Info] (
	[F_Register_Section] [smallint] NOT NULL ,
	[F_Register_Name] [varchar] (50) NOT NULL ,
	[F_Register_TotalCount] [int] NOT NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[T_RingAttackEvent_Gift] (
	[GUID] [int] IDENTITY (1, 1) NOT NULL ,
	[AccountID] [varchar] (50) NOT NULL ,
	[GiftKind] [tinyint] NOT NULL ,
	[RegisterDate] [datetime] NOT NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[T_RingEvent_GiftName] (
	[GiftKind] [tinyint] NOT NULL ,
	[GiftName] [varchar] (50) NOT NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[T_RingEvent_OfflineGift] (
	[GUID] [smallint] IDENTITY (1, 1) NOT NULL ,
	[AccountID] [varchar] (10) NULL ,
	[GiftSection] [tinyint] NOT NULL ,
	[GiftKind] [tinyint] NOT NULL ,
	[RegisterDate] [datetime] NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[T_Serial_Bank] (
	[F_Serial_Guid] [int] IDENTITY (1, 1) NOT NULL ,
	[P_Serial_1] [char] (4) NOT NULL ,
	[P_Serial_2] [char] (4) NOT NULL ,
	[P_Serial_3] [char] (4) NOT NULL ,
	[F_Serial_Section] [smallint] NOT NULL ,
	[F_Member_Guid] [int] NULL ,
	[F_Member_Id] [char] (10) NULL ,
	[F_Register_Section] [smallint] NULL ,
	[F_Register_Date] [smalldatetime] NULL ,
	[F_Create_Date] [smalldatetime] NOT NULL ,
	[F_RegisterCheck] [bit] NOT NULL 
) ON [PRIMARY]
GO

ALTER TABLE [dbo].[T_BLOOD_CASTLE] WITH NOCHECK ADD 
	CONSTRAINT [PK_T_BLOOD_CASTLE] PRIMARY KEY  CLUSTERED 
	(
		[AccountID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[T_BLOOD_PLAYCOUNT] WITH NOCHECK ADD 
	CONSTRAINT [PK_T_BLOOD_PLAYCOUNT] PRIMARY KEY  CLUSTERED 
	(
		[AccountId]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[T_CC_OFFLINE_GIFTNAME] WITH NOCHECK ADD 
	CONSTRAINT [PK_T_CC_OFFLINE_GIFTNAME] PRIMARY KEY  CLUSTERED 
	(
		[GiftKind]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[T_DL_OFFLINE_GIFTNAME] WITH NOCHECK ADD 
	CONSTRAINT [PK_T_DL_OFFLINE_GIFTNAME] PRIMARY KEY  CLUSTERED 
	(
		[GiftKind]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[T_FRIENDSHIP_SERVERRANK] WITH NOCHECK ADD 
	CONSTRAINT [PK_T_FRIENDSHIP_SERVERRANK] PRIMARY KEY  CLUSTERED 
	(
		[ServerCode]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[T_FRIENDSHIP_STONE] WITH NOCHECK ADD 
	CONSTRAINT [PK_T_T] PRIMARY KEY  CLUSTERED 
	(
		[AccountID],
		[ServerCode],
		[CharName]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[T_MU2003_EVENT] WITH NOCHECK ADD 
	CONSTRAINT [PK_T_MU2003_EVENT_1] PRIMARY KEY  CLUSTERED 
	(
		[AccountID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[T_RegCount_Check] WITH NOCHECK ADD 
	CONSTRAINT [PK_T_RegCount_Check] PRIMARY KEY  CLUSTERED 
	(
		[AccountID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[T_Register_Info] WITH NOCHECK ADD 
	CONSTRAINT [PK_T_Register_Info] PRIMARY KEY  CLUSTERED 
	(
		[F_Register_Section]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[T_RingAttackEvent_Gift] WITH NOCHECK ADD 
	CONSTRAINT [PK_T_RingAttackEvent_Gift] PRIMARY KEY  CLUSTERED 
	(
		[GUID],
		[GiftKind],
		[RegisterDate]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[T_RingEvent_OfflineGift] WITH NOCHECK ADD 
	CONSTRAINT [PK_T_RingEvent_OfflineGift] PRIMARY KEY  CLUSTERED 
	(
		[GUID],
		[GiftSection]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[T_Serial_Bank] WITH NOCHECK ADD 
	CONSTRAINT [PK_T_Serial_Bank] PRIMARY KEY  CLUSTERED 
	(
		[P_Serial_1],
		[P_Serial_2],
		[P_Serial_3]
	)  ON [PRIMARY] 
GO

 CREATE  CLUSTERED  INDEX [IX_T_CC_OFFLINE_GIFT] ON [dbo].[T_CC_OFFLINE_GIFT]([Date_Give]) ON [PRIMARY]
GO

 CREATE  CLUSTERED  INDEX [IX_T_DL_OFFLINE_GIFT] ON [dbo].[T_DL_OFFLINE_GIFT]([Date_Give]) ON [PRIMARY]
GO

ALTER TABLE [dbo].[T_BLOOD_CASTLE] ADD 
	CONSTRAINT [DF_T_BLOOD_CASTLE_StoneCount] DEFAULT (0) FOR [StoneCount],
	CONSTRAINT [DF_T_BLOOD_CASTLE_Check_Code] DEFAULT (0) FOR [Check_Code]
GO

ALTER TABLE [dbo].[T_CC_OFFLINE_GIFT] ADD 
	CONSTRAINT [DF_T_CC_OFFLINE_GIFT_Date_Reg] DEFAULT (getdate()) FOR [Date_Reg],
	CONSTRAINT [DF_T_CC_OFFLINE_GIFT_RegCheck] DEFAULT (0) FOR [RegCheck],
	CONSTRAINT [PK_T_CC_OFFLINE_GIFT] PRIMARY KEY  NONCLUSTERED 
	(
		[Guid]
	)  ON [PRIMARY] 
GO

 CREATE  INDEX [IX_T_CC_OFFLINE_GIFT_1] ON [dbo].[T_CC_OFFLINE_GIFT]([AccountID]) ON [PRIMARY]
GO

ALTER TABLE [dbo].[T_DL_OFFLINE_GIFT] ADD 
	CONSTRAINT [DF_T_DL_OFFLINE_GIFT_Date_Reg] DEFAULT (getdate()) FOR [Date_Reg],
	CONSTRAINT [DF_T_DL_OFFLINE_GIFT_RegCheck] DEFAULT (0) FOR [RegCheck],
	CONSTRAINT [PK_T_DL_OFFLINE_GIFT] PRIMARY KEY  NONCLUSTERED 
	(
		[Guid]
	)  ON [PRIMARY] 
GO

 CREATE  INDEX [IX_T_DL_OFFLINE_GIFT_1] ON [dbo].[T_DL_OFFLINE_GIFT]([AccountID]) ON [PRIMARY]
GO

ALTER TABLE [dbo].[T_FRIENDSHIP_SERVERRANK] ADD 
	CONSTRAINT [DF_T_FRIENDSHIP_SERVERRANK_FriendShipStoneCount] DEFAULT (0) FOR [FriendShipStoneCount]
GO

ALTER TABLE [dbo].[T_FRIENDSHIP_STONE] ADD 
	CONSTRAINT [DF_T_T_FriendShipStoneCount] DEFAULT (0) FOR [FriendShipStoneCount],
	CONSTRAINT [DF_T_T_Check_Code] DEFAULT (0) FOR [Check_Code]
GO

ALTER TABLE [dbo].[T_MU2003_EVENT] ADD 
	CONSTRAINT [DF_T_MU2003_EVENT_EventChips_1] DEFAULT (0) FOR [EventChips],
	CONSTRAINT [DF_T_MU2003_EVENT_MuttoIndex_1] DEFAULT ((-1)) FOR [MuttoIndex],
	CONSTRAINT [DF_T_MU2003_EVENT_MuttoNumber_1] DEFAULT (0) FOR [MuttoNumber],
	CONSTRAINT [DF_T_MU2003_EVENT_Check_Code] DEFAULT (0) FOR [Check_Code]
GO

ALTER TABLE [dbo].[T_RegCount_Check] ADD 
	CONSTRAINT [DF_T_RegCount_Check_RegCount] DEFAULT (1) FOR [RegCount],
	CONSTRAINT [DF_T_RegCount_Check_RegAlready] DEFAULT (0) FOR [RegAlready]
GO

ALTER TABLE [dbo].[T_RingAttackEvent_Gift] ADD 
	CONSTRAINT [DF_T_RingAttackEvent_Gift_RegisterDate] DEFAULT (getdate()) FOR [RegisterDate]
GO

 CREATE  INDEX [IX_T_RingAttackEvent_Gift] ON [dbo].[T_RingAttackEvent_Gift]([AccountID]) ON [PRIMARY]
GO

 CREATE  INDEX [IX_T_RingEvent_OfflineGift] ON [dbo].[T_RingEvent_OfflineGift]([AccountID]) ON [PRIMARY]
GO

ALTER TABLE [dbo].[T_Serial_Bank] ADD 
	CONSTRAINT [DF_T_Serial_Bank_F_Create_Date] DEFAULT (getdate()) FOR [F_Create_Date],
	CONSTRAINT [DF_T_Serial_Bank_F_RegisterCheck] DEFAULT (0) FOR [F_RegisterCheck]
GO

SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS ON 
GO


--//************************************************************************
--// і»   їл : №В №ЭБцАМєҐЖ® °жЗ°µо·П
--// єО   ј­ : °ФАУ°і№ЯЖА 
--// ёёµйАП : 2004.05.05
--// ёёµйАМ : БШАП
--// 
--// ё®ЕП°Є јіён
--// 
--// 	јє°шДЪµе :	0 : »уЗ°µо·П ЅЗЖР (ѕшАЅ)
--//			1 : »уЗ°µо·П јє°ш
--// 	ј±№°АМё§ :	T_CC_OFFLINE_GIFTNAME °ъ GiftKind ё¦ JOIN ЗС °б°ъ
--// 
--//************************************************************************

CREATE PROCEDURE	SP_REG_CC_OFFLINE_GIFT
	@AccountID		varchar(10),	
	@CharName		varchar(10),	
	@ServerCode		int
As
Begin
	BEGIN TRANSACTION

	DECLARE @iGIFT_GUID	INT		-- №ЮА» »уЗ°АЗ GUID
	DECLARE @iGIFT_KIND	INT		-- №ЮА» »уЗ°АЗ Бѕ·щ
	DECLARE @iGIFT_NAME	VARCHAR(50)	-- №ЮА» »уЗ°АЗ АМё§
	
	SET NOCOUNT ON

	IF EXISTS (SELECT AccountID Guid FROM T_CC_OFFLINE_GIFT WHERE AccountID = @AccountID)
	BEGIN
		-- АМ »з¶чАє АМАьїЎ ЗС№ш ґзГ·µИ »з¶чАМ№З·О ¶З °жЗ°А» БЩ јц ѕшґЩ.
		SELECT 0 As ResultCode, '' As GiftName
	END
	ELSE
	BEGIN
		IF EXISTS (SELECT TOP 1 Guid FROM T_CC_OFFLINE_GIFT WHERE Date_Give < GetDate() and RegCheck = 0 ORDER BY Guid ASC)
		BEGIN
			-- їАґГ БЩ јц АЦґВ °жЗ°АМ іІѕЖАЦґЩ.
			SELECT TOP 1 @iGIFT_GUID = Guid, @iGIFT_KIND = GiftKind  FROM T_CC_OFFLINE_GIFT WHERE Date_Give < GetDate() and RegCheck = 0 ORDER BY Guid ASC
	
			-- ї©±вј­ ЗШґз »зїлАЪАЗ °жЗ°Аё·О БцБ¤ЗШ БШґЩ.
			UPDATE T_CC_OFFLINE_GIFT SET Server = @ServerCode, AccountID = @AccountID, CharName = @CharName, Date_Reg = GetDate(), RegCheck = 1 WHERE Guid = @iGIFT_GUID
	
			SELECT @iGIFT_NAME = GiftName FROM T_CC_OFFLINE_GIFTNAME WHERE GiftKind = @iGIFT_KIND
	
			SELECT 1 As ResultCode, @iGIFT_NAME As GiftName
		END
		ELSE
		BEGIN
			-- їАґГ БЩ јц АЦґВ °жЗ°АМ ЗПіЄµµ ѕшґЩ.
			SELECT 0 As ResultCode, '' As GiftName
		END
	END


	IF(@@Error <> 0 )
		ROLLBACK TRANSACTION
	ELSE	
		COMMIT TRANSACTION
	
	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



--//************************************************************************
--// і»   їл : ґЩЕ©·ОµеАЗ ё¶АЅ АМєҐЖ® °жЗ°µо·П
--// єО   ј­ : °ФАУ°і№ЯЖА 
--// ёёµйАП : 2004.08.11
--// ёёµйАМ : БШАП
--// 
--// ё®ЕП°Є јіён
--// 
--// 	јє°шДЪµе :	0 : »уЗ°µо·П ЅЗЖР (ѕшАЅ)
--//			1 : »уЗ°µо·П јє°ш
--// 	ј±№°АМё§ :	T_DL_OFFLINE_GIFTNAME °ъ GiftKind ё¦ JOIN ЗС °б°ъ
--// 
--//************************************************************************

CREATE PROCEDURE	SP_REG_DL_OFFLINE_GIFT
	@AccountID		varchar(10),	
	@CharName		varchar(10),	
	@ServerCode		int
As
Begin
	BEGIN TRANSACTION

	DECLARE @iGIFT_GUID	INT		-- №ЮА» »уЗ°АЗ GUID
	DECLARE @iGIFT_KIND	INT		-- №ЮА» »уЗ°АЗ Бѕ·щ
	DECLARE @iGIFT_NAME	VARCHAR(50)	-- №ЮА» »уЗ°АЗ АМё§
	
	SET NOCOUNT ON

	IF EXISTS (SELECT AccountID Guid FROM T_DL_OFFLINE_GIFT WHERE AccountID = @AccountID)
	BEGIN
		-- АМ »з¶чАє АМАьїЎ ЗС№ш ґзГ·µИ »з¶чАМ№З·О ¶З °жЗ°А» БЩ јц ѕшґЩ.
		SELECT 0 As ResultCode, '' As GiftName
	END
	ELSE
	BEGIN
		IF EXISTS (SELECT TOP 1 Guid FROM T_DL_OFFLINE_GIFT WHERE Date_Give < GetDate() and RegCheck = CAST(0 AS BIT) ORDER BY Guid ASC)
		BEGIN
			-- їАґГ БЩ јц АЦґВ °жЗ°АМ іІѕЖАЦґЩ.
			SELECT TOP 1 @iGIFT_GUID = Guid, @iGIFT_KIND = GiftKind  FROM T_DL_OFFLINE_GIFT WHERE Date_Give < GetDate() and RegCheck = CAST(0 AS BIT) ORDER BY Guid ASC
	
			-- ї©±вј­ ЗШґз »зїлАЪАЗ °жЗ°Аё·О БцБ¤ЗШ БШґЩ.
			UPDATE T_DL_OFFLINE_GIFT SET Server = @ServerCode, AccountID = @AccountID, CharName = @CharName, Date_Reg = GetDate(), RegCheck = CAST(1 AS BIT) WHERE Guid = @iGIFT_GUID
	
			SELECT @iGIFT_NAME = GiftName FROM T_DL_OFFLINE_GIFTNAME WHERE GiftKind = @iGIFT_KIND
	
			SELECT 1 As ResultCode, @iGIFT_NAME As GiftName
		END
		ELSE
		BEGIN
			-- їАґГ БЩ јц АЦґВ °жЗ°АМ ЗПіЄµµ ѕшґЩ.
			SELECT 0 As ResultCode, '' As GiftName
		END
	END


	IF(@@Error <> 0 )
		ROLLBACK TRANSACTION
	ELSE	
		COMMIT TRANSACTION
	
	SET NOCOUNT OFF
End

GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS OFF 
GO




--//************************************************************************
--// і»   їл : №В ДЈ±ёАМєҐЖ®
--// єО   ј­ : °ФАУ°і№ЯЖА 
--// ёёµйАП : 2004.02.11
--// ёёµйАМ : БШАП
--// 
--//************************************************************************

CREATE PROCEDURE	SP_REG_FRIEND_STONE
	@AccountID		varchar(10),	-- °иБ¤ён
	@ServerCode		smallint,	-- ј­№цДЪµе
	@CharName		varchar(10)	-- ДЙёЇён
As
Begin
	BEGIN TRANSACTION
	
	SET NOCOUNT ON

	-- 1 . ЗШґз °иБ¤АЗ ЅєЕж°іјцё¦ Бх°ЎЅГЕґ
	IF NOT EXISTS (SELECT FriendShipStoneCount FROM T_FRIENDSHIP_STONE WHERE AccountID = @AccountID and ServerCode = @ServerCode and CharName = @CharName)
	BEGIN
		INSERT T_FRIENDSHIP_STONE (AccountID, ServerCode, CharName, FriendShipStoneCount) VALUES (@AccountID, @ServerCode, @CharName, 1)
	END
	ELSE
	BEGIN
		UPDATE T_FRIENDSHIP_STONE 
		SET FriendShipStoneCount = FriendShipStoneCount + 1
		WHERE AccountID = @AccountID and ServerCode = @ServerCode and CharName = @CharName
	END

	-- 2 . ј­№цє° ЅєЕж°іјц Бх°Ў
	IF NOT EXISTS (SELECT FriendShipStoneCount FROM T_FRIENDSHIP_SERVERRANK WHERE ServerCode = @ServerCode)
	BEGIN
		INSERT T_FRIENDSHIP_SERVERRANK VALUES (@ServerCode, 1)
	END
	ELSE
	BEGIN
		UPDATE T_FRIENDSHIP_SERVERRANK 
		SET FriendShipStoneCount = FriendShipStoneCount + 1
		WHERE ServerCode = @ServerCode
	END

	SELECT FriendShipStoneCount FROM T_FRIENDSHIP_STONE WHERE  AccountID = @AccountID and ServerCode = @ServerCode and CharName = @CharName
	
	IF(@@Error <> 0 )
		ROLLBACK TRANSACTION
	ELSE	
		COMMIT TRANSACTION
	
	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

--//************************************************************************
--// і»   їл : №В №ЭБцАМєҐЖ® °жЗ°µо·П
--// єО   ј­ : °ФАУ°і№ЯЖА 
--// ёёµйАП : 2003.12.05
--// ёёµйАМ : БШАП
--// 
--//************************************************************************

CREATE PROCEDURE	SP_REG_RINGGIFT
	@AccountID		varchar(10),	-- °иБ¤ён
	@GiftSection		tinyint		-- »уЗ°АЗ Бѕ·щ (0:їл»зАЗ№ЭБцµе·У, 1:їАЕ©БЧАУ)
As
Begin
	BEGIN TRANSACTION
	
	SET NOCOUNT ON
	
	DECLARE	@ToDay		DATETIME
	DECLARE	@strToDayStart		VARCHAR(32)
	DECLARE	@strToDayEnd		VARCHAR(32)
	DECLARE	@iToDayRegCount	INT
	DECLARE	@iMaxAllGiftNum	INT		-- ЗШґз №шИЈ »уЗ°АЗ ёрµз °іјц
	DECLARE	@iMaxTodayGiftNum	INT		-- ЗШґз №шИЈ »уЗ°АЗ їАґГАЗ °іјц

	DECLARE	@iLeftGifts		INT		-- іІАє »уЗ° °іјц
	DECLARE	@iGUID		INT		-- GUID
	DECLARE	@iGiftKind		INT		-- ґзГ·µИ »уЗ°№шИЈ

	IF @GiftSection = 0
	BEGIN
		SET @iMaxAllGiftNum = 80		
		SET @iMaxTodayGiftNum = 2		
	END	
	ELSE
	BEGIN
		SET @iMaxAllGiftNum = 160		
		SET @iMaxTodayGiftNum = 5		
	END

	-- 1> . АМБ¦ ЗШґз °жЗ°Бѕ·щАЗ іІАє °жЗ°АМ АЦґВБц И®АОЗСґЩ.
	SELECT @iLeftGifts = COUNT(*) FROM T_RingEvent_OfflineGift WHERE RegisterDate IS NULL AND GiftSection = @GiftSection

	IF @iLeftGifts = 0
	BEGIN
		SELECT 3 As RegResult, @AccountID, 0 As GiftKind	-- АМБ¦ ґх АМ»у µо·ПЗТ јц ѕшґЩёй іЄ°ЈґЩ.
	END
	ELSE
	BEGIN
		-- 2> . їАґГ µо·ПЗТ јц АЦґВ Иёјц АМ»уАё·О µо·П µЗѕъґВБц ГјЕ©
		SET @ToDay = GetDate()
		
		SET @strToDayStart = CONVERT(char(4), YEAR(@ToDay)) + '-' + CONVERT(char(2), MONTH(@ToDay)) + '-' + CONVERT(char(2), DAY(@ToDay)) + ' 00:00:00'
		SET @strToDayEnd = CONVERT(char(4), YEAR(@ToDay)) + '-' + CONVERT(char(2), MONTH(@ToDay)) + '-' + CONVERT(char(2), DAY(@ToDay)) + ' 23:59:59'
		
		SELECT @iToDayRegCount = COUNT(*)
		FROM T_RingEvent_OfflineGift
		WHERE RegisterDate between @strToDayStart and @strToDayEnd
			and @GiftSection = GiftSection
		
		IF @iToDayRegCount >= @iMaxTodayGiftNum		-- їАґГАЗ ГЦґл »уЗ° µо·П јцё¦ ГК°ъЗПёй іЄ°ЈґЩ.
		BEGIN
			SELECT 3 As RegResult, @AccountID, 0 As GiftKind
		END
		ELSE
		BEGIN
			-- 3> . АМ№М µо·ПµИ °иБ¤АОБц И®АОЗСґЩ.
			IF EXISTS ( SELECT * FROM T_RingEvent_OfflineGift  WITH (READUNCOMMITTED) 
						WHERE AccountID = @AccountID)
			BEGIN	
				-- АМ№М µо·ПµИ »з¶чАМ№З·О ±Ч»з¶чАЗ °иБ¤ён Б¤µµёё єёіЅґЩ.
				SELECT 2 As RegResult, @AccountID, 0 As GiftKind
			END
			ELSE
			BEGIN
				SELECT TOP 1 @iGUID = GUID, @iGiftKind = GiftKind
				FROM T_RingEvent_OfflineGift
				WHERE @GiftSection = GiftSection and RegisterDate IS NULL
				ORDER BY GUID

				UPDATE T_RingEvent_OfflineGift
				SET AccountID=@AccountID, RegisterDate=GetDate()
				WHERE @iGUID = GUID
		
				-- »х·О µо·ПЗПґВ »з¶чАМёз µо·П јє°ш
				SELECT 1 As RegResult, @AccountID, @iGiftKind As GiftKind
			END
	
		END
	END
	
	
	IF(@@Error <> 0 )
		ROLLBACK TRANSACTION
	ELSE	
		COMMIT TRANSACTION
	
	SET NOCOUNT OFF
End
GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS OFF 
GO



-- АъАе ЗБ·ОЅГАъ »эјє

--//************************************************************************
--// і»   їл : №В №ЭБцАМєҐЖ® °жЗ°µо·П
--// єО   ј­ : °ФАУ°і№ЯЖА 
--// ёёµйАП : 2003.12.05
--// ёёµйАМ : БШАП
--// 
--//************************************************************************

CREATE PROCEDURE	SP_REG_RINGGIFT_TEMP
	@AccountID		varchar(10),	-- °иБ¤ён
	@GiftKind		tinyint		-- »уЗ°АЗ Бѕ·щ (0:їл»зАЗ№ЭБцµе·У, 1:їАЕ©БЧАУ)
As
Begin
	BEGIN TRANSACTION
	
	SET NOCOUNT ON

	DECLARE	@ToDay		DATETIME
	DECLARE	@strToDayStart		VARCHAR(32)
	DECLARE	@strToDayEnd		VARCHAR(32)
	DECLARE	@iToDayRegCount	INT
	DECLARE	@iMaxAllGiftNum	INT		-- ЗШґз №шИЈ »уЗ°АЗ ёрµз °іјц
	DECLARE	@iMaxTodayGiftNum	INT		-- ЗШґз №шИЈ »уЗ°АЗ їАґГАЗ °іјц

	IF @GiftKind = 0
	BEGIN
		SET @iMaxAllGiftNum = 80		
		SET @iMaxTodayGiftNum = 2		
	END	
	ELSE
	BEGIN
		SET @iMaxAllGiftNum = 160		
		SET @iMaxTodayGiftNum = 3		
	END

	SELECT @iToDayRegCount = COUNT(*)
	FROM T_RingAttackEvent_Gift
	WHERE @GiftKind = GiftKind

	IF @iToDayRegCount >= @iMaxAllGiftNum		-- АьГј ГЦґл »уЗ° µо·П јцё¦ ГК°ъЗПёй іЄ°ЈґЩ.
	BEGIN
		SELECT 3 As RegResult, @AccountID
	END
	ELSE
	BEGIN
		SET @ToDay = GetDate()
		
		SET @strToDayStart = CONVERT(char(4), YEAR(@ToDay)) + '-' + CONVERT(char(2), MONTH(@ToDay)) + '-' + CONVERT(char(2), DAY(@ToDay)) + ' 00:00:00'
		SET @strToDayEnd = CONVERT(char(4), YEAR(@ToDay)) + '-' + CONVERT(char(2), MONTH(@ToDay)) + '-' + CONVERT(char(2), DAY(@ToDay)) + ' 23:59:59'
		
		SELECT @iToDayRegCount = COUNT(*)
		FROM T_RingAttackEvent_Gift
		WHERE RegisterDate between @strToDayStart and @strToDayEnd
			and @GiftKind = GiftKind
	
		IF @iToDayRegCount >= @iMaxTodayGiftNum	-- їАґГАЗ ГЦґл »уЗ° µо·П јцё¦ ГК°ъЗПёй іЄ°ЈґЩ.
		BEGIN
			SELECT 3 As RegResult, @AccountID
		END
		ELSE
		BEGIN
			IF EXISTS ( SELECT * FROM T_RingAttackEvent_Gift  WITH (READUNCOMMITTED) 
						WHERE AccountID = @AccountID)
			BEGIN	
				-- АМ№М µо·ПµИ »з¶чАМ№З·О ±Ч»з¶чАЗ °иБ¤ён Б¤µµёё єёіЅґЩ.
				SELECT 2 As RegResult, @AccountID
			END
			ELSE
			BEGIN
				INSERT INTO T_RingAttackEvent_Gift
				VALUES (@AccountID, @GiftKind, default)
		
				-- »х·О µо·ПЗПґВ »з¶чАМёз µо·П јє°ш
				SELECT 1 As RegResult, @AccountID
			END
		END
	END

	
	IF(@@Error <> 0 )
		ROLLBACK TRANSACTION
	ELSE	
		COMMIT TRANSACTION
	
	SET NOCOUNT OFF
End
GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS OFF 
GO



--//************************************************************************
--// і»   їл : №В »уїлИ­ 2БЦів ±від є№±З АМєҐЖ® °ь·Г - ЅГё®ѕу µо·П
--// єО   ј­ : °ФАУ°і№ЯЖА 
--// ёёµйАП : 2003.10.20
--// ёёµйАМ : БШАП
--// 
--//************************************************************************

CREATE PROCEDURE	SP_REG_SERIAL
	@AccountID		varchar(10),	-- °иБ¤ён
	@MembGUID		int,		-- GUID
	@SERIAL1		varchar(4),	-- ЅГё®ѕу1
	@SERIAL2		varchar(4),	-- ЅГё®ѕу2
	@SERIAL3		varchar(4)	-- ЅГё®ѕу3
As
Begin
	BEGIN TRANSACTION
	
	SET NOCOUNT ON	

	-- 1 . T_RegCount_Check ЕЧАМєнїЎј­ ЗШґз °иБ¤АМ АМ№М µо·ПЗЯґВБц, Д«їоЖ®ё¦ іСѕъґВБц ГјЕ©ЗСґЩ.
	DECLARE @MAX_REGCOUNT	INT
	DECLARE @iREG_COUNT	INT
	DECLARE @iREG_ALREADY	BIT

	SET @MAX_REGCOUNT 	= 20
	SET @iREG_ALREADY		= 0
	
	IF EXISTS ( SELECT * FROM T_RegCount_Check  WITH (READUNCOMMITTED) 
				WHERE AccountID = @AccountID)
	BEGIN	
		-- T_RegCount_Check їЎґВ АМ№М °иБ¤ёнАМ АЦА» °НАМ№З·О є°µµАЗ °ЛБхѕшАМ µо·Пї©єОё¦ єЇ°жЗСґЩ.
		SELECT @iREG_ALREADY = RegAlready FROM T_RegCount_Check WHERE AccountID = @AccountID
		
/*		IF (@iREG_ALREADY = 1 )
		BEGIN
			SELECT 5 As RegResult, 0 As F_Register_Section
		END
		ELSE
		BEGIN
*/			SELECT @iREG_COUNT = RegCount 
			FROM T_RegCount_Check
			WHERE AccountID = @AccountID
		
			IF (@iREG_COUNT >= @MAX_REGCOUNT)
			BEGIN
				SET @iREG_ALREADY = 1

				SELECT 2 As RegResult, 0 As F_Register_Section
			END
			ELSE
			BEGIN
				UPDATE T_RegCount_Check
				SET RegCount = RegCount + 1
				WHERE AccountID = @AccountID
			END
--		END
	END
	ELSE
	BEGIN
		INSERT INTO T_RegCount_Check
		VALUES (@AccountID, default, default)
	END


/*	IF (@iREG_ALREADY =1)
	BEGIN
		IF(@@Error <> 0 )
			ROLLBACK TRANSACTION
		ELSE	
			COMMIT TRANSACTION
		
		SET NOCOUNT OFF	

		RETURN
	END
*/	

	-- 2 . T_Serial_Bank ЕЧАМєнїЎ ЅГё®ѕуА» µо·ПЗСґЩ.
	DECLARE @REG_CHECK	BIT
	
	IF EXISTS ( SELECT F_RegisterCheck FROM T_Serial_Bank  WITH (READUNCOMMITTED) 
		WHERE  P_Serial_1 = @SERIAL1 and P_Serial_2 = @SERIAL2 and P_Serial_3 = @SERIAL3)
	BEGIN	
		SELECT @REG_CHECK = F_RegisterCheck FROM T_Serial_Bank  WITH (READUNCOMMITTED) 
		WHERE  P_Serial_1 = @SERIAL1 and P_Serial_2 = @SERIAL2 and P_Serial_3 = @SERIAL3

		IF (@REG_CHECK = 0)
		BEGIN
			UPDATE T_Serial_Bank
			SET F_Member_Guid = @MembGUID, F_Member_Id = @AccountID, F_RegisterCheck = 1, F_Register_Date = GetDate()
			WHERE  P_Serial_1 = @SERIAL1 and P_Serial_2 = @SERIAL2 and P_Serial_3 = @SERIAL3

			-- T_RegCount_Check їЎґВ АМ№М °иБ¤ёнАМ АЦА» °НАМ№З·О є°µµАЗ °ЛБхѕшАМ µо·Пї©єОё¦ єЇ°жЗСґЩ.
			UPDATE T_RegCount_Check
			SET RegAlready = 1
			WHERE AccountID = @AccountID
			
			SELECT 0 As RegResult, F_Register_Section
			FROM T_Serial_Bank
			WHERE  P_Serial_1 = @SERIAL1 and P_Serial_2 = @SERIAL2 and P_Serial_3 = @SERIAL3
		END
		ELSE
		BEGIN	-- АМ№М µо·ПµЗѕъґЩ.
			SELECT 1 As RegResult, 0 As F_Register_Section
		END

	END
	ELSE
	BEGIN	-- ЗШґз ЅГё®ѕуАє БёАзЗПБц ѕКґВґЩ.
		SELECT 3 As RegResult, 0  As F_Register_Section
	END

	
	IF(@@Error <> 0 )
		ROLLBACK TRANSACTION
	ELSE	
		COMMIT TRANSACTION
	
	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 ShowResourceInfo
    AS
    SET NOCOUNT ON
    print '*********************************'
    print ' 5ГК°Ј »зїлµИ ЅГЅєЕЫ АЪїш·®АФґПґЩ.'
    print '*********************************'
    SELECT spid, cpu, physical_io 
    INTO #Temp1 FROM master..sysprocesses
    WAITFOR DELAY '0:00:05'  
    SELECT P.spid, P.cpu-T.cpu AS 'cpu »зїл·®(ms)', 
    P.physical_io-T.physical_io AS 'Disk R/W·®(Page)',
    P.nt_username ' NT »зїлАЪён', P.program_name 'ААїлЗБ·О±Ч·Ґ', 
    P.hostname, P.cmd
    FROM master..sysprocesses P, #Temp1 T
    WHERE P.spid=T.spid 
    AND P.cpu-T.cpu+P.physical_io-T.physical_io+P.memusage > 0
    DROP TABLE #Temp1
    Return
    


GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS ON 
GO


CREATE PROC UP_EMP6 @JOB VARCHAR(4), @YEAR CHAR(4), @SAL BIGINT
AS
	SELECT * FROM EMP
		WHERE JOB = @JOB AND DATEPART(YY,EDATE) = @YEAR
			AND SAL > @SAL


GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

Coud it be from him ?
 
Last edited:
Upvote 0
Status
Not open for further replies.
Back
Top