- Ayarlamalı Oto Master
- Ayarlamalı Oto Uyelik
- Ayarlamalı IP Ban
- Ayarlamalı Server Limit
- Ayarlamalı Account Ban
- Ayarlamalı Bakım Modu
- Detaylı Bilgilendirme
- Problemsiz
Öncelikle şunu söyeyim prosedürde ayarlayabileceğiniz özellikler en yukarıda belirtilmiştir :
SET @OtoMaster = 0 ( Oto masterı kapatır ) , 1 ( Oto masterı açar )
SET @OtoUyelik = 0 ( Oto uyeliği kapatır ) , 1 ( oto üyeliği açar )
SET @AccountBan = 0 ( Account Ban özelliğini kapar ) , 1 ( Account ban özelliğini açar )
SET @IPBan = 0 ( IP Ban sistemini kapar ) , 1 ( IP Ban sistemini açar )
SET @ServerLimit = 0 ( Servera Herkes Girebilir ) , 0 Harici bir değer ( Server Giriş Limiti girdğiniz sayı olur )
SET @Bakim = 0 ( Servera herkes giriş yapabilir ) , 1 ( Servera sadece gm karakteri olanlar giriş yapabilir )
Kısacası 1 aktifleştirir , 0 pasifleştirir ..
Tablolarımız :
BLOCK_IP = Numara (nvarchar 21)
BLOCK_ACCOUNT = strAccountID = (nvarchar 21)
Yukarıdaki 2 tabloyu oluşturduktan sonra prosedürleri aşağıdaki gibi değiştiriyoruz :
PROC_INSERT_CURRENTUSER- CREATE PROCEDURE PROC_INSERT_CURRENTUSER
- @AccountID varchar(50),
- @CharID varchar(50),
- @ServerNo int,
- @ServerIP varchar(50),
- @ClientIP varchar(50),
- @nret smallint output
- AS
- -- Ip Ban System by Trayhoper
- DECLARE @Sayi int
- SELECT @Sayi = count(Numara) FROM BLOCK_IP WHERE Numara = @ClientIP
- IF @Sayi > 0
- BEGIN
- SET @nRet = 0
- RETURN
- END
- ELSE IF @Sayi = 0
- BEGIN
- INSERT INTO CURRENTUSER (nServerNo, strServerIP, strAccountID, strCharID, strClientIP ) Values (@ServerNo, @ServerIP, @AccountID, @CharID, @ClientIP )
- UPDATE TB_USER Set IP = @ClientIP WHERE strAccountID = @AccountID
- SET @nRet = 1
- RETURN
- END
- GO
复制代码 ACCOUNT_LOGIN- --Hazırlayan Trayhoper
- CREATE PROCEDURE ACCOUNT_LOGIN
- @AccountID varchar(21),
- @Password varchar(13),
- @nRet smallint OUTPUT
- AS
- DECLARE @OtoUyelik int,@ServerLimit int,@AccountBan int,@IPBan int,@OtoMaster int,@Bakim int
- SET @AccountBan = 0
- SET @IPBan = 0
- SET @ServerLimit = 800
- SET @OtoUyelik = 0
- SET @OtoMaster = 0
- SET @Bakim = 0
- -- Oto Uyelik
- IF @OtoUyelik = 1
- BEGIN
- SELECT @nRet = count(strAccountID) from TB_USER WHERE strAccountID = @AccountID
- IF NOT exists(SELECT strAccountID FROM TB_USER WHERE strAccountID = @AccountID)
- insert into TB_USER (strAccountID, strPassWd, strSocNo, idays) values (@AccountID, @password, 1, '6')
- END
- -- Oto Uyelik
- -- Server Limit
- DECLARE @Oyuncu int,@pwd varchar(13)
- SET @pwd = null
- IF NOT @ServerLimit = 0
- BEGIN
- SELECT @Oyuncu = Count(*) From CURRENTUSER
- IF @Oyuncu <= @ServerLimit
- BEGIN
- SELECT @pwd = strPassWd FROM [dbo].[TB_USER] WHERE strAccountID = @AccountID
- END
- ELSE IF @Oyuncu > @ServerLimit
- BEGIN
- SELECT @pwd = strPassWd FROM [dbo].[TB_USER] WHERE strAccountID = @AccountID and Premium > 0
- END
- END
- -- Server Limit
- -- Account Ban
- IF @AccountBan = 1
- BEGIN
- IF exists(SELECT strAccountID FROM BLOCK_ACCOUNT WHERE strAccountID = @AccountID)
- SET @nRet = 4
- RETURN
- END
- -- Accont Ban
- -- IP Ban
- DECLARE @CharIP varchar(50)
- SELECT @CharIP = IP FROM TB_USER WHERE strAccountID = @AccountID
- IF @IPBan = 1
- BEGIN
- IF exists(SELECT Numara FROM BLOCK_IP WHERE Numara = @CharIP)
- SET @nRet = 4
- END
- -- IP Ban
- -- Oto Master
- DECLARE @CharID1 varchar(21),@CharID2 nvarchar(21),@CharID3 nvarchar(21)
- SELECT @CharID1 = strCharID1,@CharID2 = strCharID3,@CharID3 = strCharID3 FROM ACCOUNT_CHAR WHERE strAccountID = @AccountID
- IF @OtoMaster = 1
- BEGIN
-
- UPDATE USERDATA SET class = class + 1 where class % 2 != 0 and level > 59 and strUserID = @CharID1
- UPDATE USERDATA SET class = class + 1 where class % 2 != 0 and level > 59 and strUserID = @CharID2
- UPDATE USERDATA SET class = class + 1 where class % 2 != 0 and level > 59 and strUserID = @CharID3
- END
- -- Oto Master
- -- Bakım Modu
- DECLARE @CharID1Au int,@CharID2Au int,@CharID3Au int
- SELECT @CharID1Au = Authority FROM USERDATA WHERE strUserID = @CharID1
- SELECT @CharID2Au = Authority FROM USERDATA WHERE strUserID = @CharID2
- SELECT @CharID3Au = Authority FROM USERDATA WHERE strUserID = @CharID3
- IF @Bakim = 1
- IF NOT @CharID1Au = 0 OR NOT @CharID2Au = 0 OR NOT @CharID3Au = 0
- BEGIN
- SET @nRet = 4
- RETURN
- END
- -- Bakım Modu
- DECLARE @Nation tinyint, @CharNum smallint,@Game int,@Limit int
- SET @Nation = 0
- SET @CharNum = 0
- -- Şifre Bölümü Boşsa
- IF @pwd IS null
- BEGIN
- SET @nRet = 3
- RETURN
- END
- -- Şifre Yanlışsa
- ELSE IF @pwd <> @Password
- BEGIN
- SET @nRet = 3
- RETURN
- END
- -- Hesap Kullanımdaysa
- ELSE IF exists(SELECT strAccountID FROM CURRENTUSER WHERE strAccountID = @AccountID)
- BEGIN
- SET @nRet = 5
- RETURN
- END
- -- Hesap Yoksa
- ELSE IF NOT exists(SELECT strAccountID FROM TB_USER WHERE strAccountID = @AccountID)
- BEGIN
- SET @nRet = 2
- RETURN
- END
- SELECT @Nation = bNation, @CharNum = bCharNum FROM ACCOUNT_CHAR WHERE strAccountID = @AccountID
- IF @@ROWCOUNT = 0
- BEGIN
- SET @nRet = 1
- RETURN
- END
- IF @CharNum = 0
- BEGIN
- SET @nRet = 1
- RETURN
- END
- ELSE
- BEGIN
- SET @nRet = @Nation + 1
- RETURN
- END
- GO
复制代码 |