vsro
vsro vsro
vsro vsro

Paylaşım Job Point System - Limitli

Katılım
27 Şub 2019
Mesajlar
40
Tepkime puanı
28
Puanları
18
Yaş
25
Konum
Bursa / Mustafakemalpaşa
vsro
Yabancı bir forum sitesindeki paylaşımın Limit işleminin karakter üzeriden değil AccountID'ye göre düzenlenmiş halidir.
Limit işlemi AccountID olarak çalışır. Aynı AccountID ile açtığınız karakterler limiti aşamaz.
Limit 500 olarak ayarlıdır.Değiştirmek için AddLogChar kısmındaki if ((select Amount from JobLog where UserJID = @JID1) >= 500) değiştirin.



SQL:
USE [SRO_VT_ACCOUNT]
GO
/****** Object:  StoredProcedure [dbo].[_AddCoin]    Script Date: 29.03.2019 23:56:26 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

CREATE PROCEDURE [dbo].[_AddCoin]

    @CharID int,
    @Point int

as

Declare @JID int;

SET @JID = (
            SELECT usert.UserJID FROM SRO_VT_SHARD.dbo._User as usert
            JOIN SRO_VT_SHARD.dbo._Char as chart on usert.CharID = chart.CharID
            WHERE chart.CharID = @CharID
            );
         
    IF not exists (SELECT JID FROM SK_Silk WHERE JID = @JID)
        BEGIN
            INSERT INTO SK_Silk SELECT @JID, 0, 0, 0
        END
         
    UPDATE SK_Silk
    SET silk_gift = silk_gift + (@Point)
    WHERE JID = @JID


SQL:
USE [SRO_VT_LOG]
GO

/****** Object:  Table [dbo].[JobLog]    Script Date: 29.03.2019 23:55:18 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE [dbo].[JobLog](
    [UserJID] [int] NOT NULL,
    [Amount] [int] NULL,
    [Limited] [int] NULL,
    [Date] [datetime] NULL,
    [TotalAmount] [int] NULL,
    [index] [int] IDENTITY(1,1) NOT NULL,
CONSTRAINT [PK_JobLog] PRIMARY KEY CLUSTERED
(
    [index] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

GO


SQL:
declare @contribution int;
declare @coinWinfortra int;
declare @coinWinforthi int;
declare @coinWinforhun int;
declare @dividerfortra int;
declare @dividerforthi int;
declare @dividerforhun int;
declare @Charname16 varchar(64);
declare @JobType int;
declare @total int;
declare @JID1 int;

SET @Charname16 =  (select CharName16 from SRO_VT_SHARD.._Char where CharID = @CharID);
set @dividerfortra = 1107512.5;
set @dividerforthi = 2816700;
set @dividerforhun = 6183274;

if( @EventID = 4 or @EventID = 6 )log out/in
    begin
        set @JID1 = (SELECT UserJID FROM [SRO_VT_SHARD].[dbo].[_User] where CharID = @CharID);
            set @contribution = (SELECT Contribution FROM [SRO_VT_SHARD].[dbo].[_CharTriJob] WHERE CharID = @CharID);
        set @coinWinfortra = ROUND( @contribution / @dividerfortra,0);
        set @coinWinforthi = ROUND (@contribution / @dividerforthi,0);
        set @coinWinforhun = ROUND (@contribution / @dividerforhun,0);
        set @JobType = (SELECT JobType FROM [SRO_VT_SHARD].[dbo].[_CharTrijob] Where CharID = @CharID);
        set @total = (select TotalAmount from JobLog where UserJID = @JID1) + (select Amount from JobLog where UserJID = @JID1);
      

        if(@coinWinfortra != 0 and @JobType = 1)
            begin
                if (@coinWinfortra > 10)
                    begin
                        set @coinWinfortra = 10
                    end
                  
                if exists (select @JID1 from [SRO_VT_LOG].[dbo].[JobLog])
                    begin
                        if ((select Amount from JobLog where UserJID = @JID1) >= 500)
                            begin
                                UPDATE JobLog SET Limited = 1 WHERE UserJID = @JID1                             
                            end
                        else
                            begin
                            UPDATE [SRO_VT_LOG].[dbo].[JobLog] SET Amount = Amount + @coinWinfortra, Date = GETDATE(), TotalAmount =  @total where UserJID = @JID1
                                exec [SRO_VT_ACCOUNT].[dbo].[_AddCoin] @CharID, @coinWinfortra;   
                            end
                        end
                    else
                        begin
                            INSERT INTO [SRO_VT_LOG].[dbo].[JobLog] VALUES (@JID1, @coinWinfortra, 0, GETDATE(), @total)
                            exec [SRO_VT_ACCOUNT].[dbo].[_AddCoin] @CharID, @coinWinfortra;
                        end
                    end --end trader coin

        if(@coinWinforthi != 0 and @JobType = 2)
            begin
                if (@coinWinforthi > 5)
                    begin
                        set @coinWinforthi = 5
                    end
                  
                if exists (select @JID1 from [SRO_VT_LOG].[dbo].[JobLog])
                    begin
                        if ((select Amount from JobLog where UserJID = @JID1) >= 500)
                            begin
                                UPDATE JobLog SET Limited = 1 WHERE UserJID = @JID1
                            end
                        else
                            begin
                        UPDATE [SRO_VT_LOG].[dbo].[JobLog] SET Amount = Amount + @coinWinforthi, Date = GETDATE(), TotalAmount =  @total where UserJID = @JID1
                                exec [SRO_VT_ACCOUNT].[dbo].[_AddCoin] @CharID, @coinWinforthi;
                            end
                        end
                    else
                        begin
                            INSERT INTO [SRO_VT_LOG].[dbo].[JobLog] VALUES (@JID1, @coinWinforthi, 0, GETDATE(), @total)
                            exec [SRO_VT_ACCOUNT].[dbo].[_AddCoin] @CharID, @coinWinforthi;
                        end
                    end --end thief coin

        if(@coinWinforhun != 0 and @JobType = 3)
            begin
                if (@coinWinforhun > 5)
                    begin
                        set @coinWinforhun = 5
                    end
                  
                if exists (select @JID1 from [SRO_VT_LOG].[dbo].[JobLog])
                    begin
                        if ((select Amount from JobLog where UserJID = @JID1) >= 500)
                            begin
                                UPDATE JobLog SET Limited = 1 WHERE UserJID = @JID1
                            end
                        else
                            begin
                            UPDATE [SRO_VT_LOG].[dbo].[JobLog] SET Amount = Amount + @coinWinforhun, Date = GETDATE(), TotalAmount =  @total where UserJID = @JID1
                                exec [SRO_VT_ACCOUNT].[dbo].[_AddCoin] @CharID, @coinWinforhun;
                            end
                        end
                    else
                        begin
                            INSERT INTO [SRO_VT_LOG].[dbo].[JobLog] VALUES (@JID1, @coinWinforhun, 0, GETDATE(), @total)
                            exec [SRO_VT_ACCOUNT].[dbo].[_AddCoin] @CharID, @coinWinforhun;
                        end
                    end --end hunter coin
                    if (@JobType != 0)
                        begin
                    UPDATE [SRO_VT_SHARD].[dbo].[_CharTriJob] set Contribution = 0 WHERE CharID = @CharID;
                    end
            end --end coin reward
  
if (@EventID = 4)
    BEGIN
        if not exists (select UserJID from JobLog where UserJID = @JID1)
            BEGIN
                INSERT INTO JobLog VALUES(@JID1, 0, 0, GETDATE(), 0)
            END
        ELSE
            BEGIN
                UPDATE JobLog SET Date = GETDATE() where UserJID = @JID1
            END
END
 
Son düzenleme:
Katılım
27 Şub 2019
Mesajlar
40
Tepkime puanı
28
Puanları
18
Yaş
25
Konum
Bursa / Mustafakemalpaşa
Belirli bir zaman dilimi yok sadece o puana ulastigi zaman puan kazanmamasini sagliyor. Ek programlar sayesinde belirledigin zamana gore tabloyu temizletip istedigin zaman araligina ayarlayabilirsin. Orn. VsroMultiTool
 
Katılım
28 May 2019
Mesajlar
99
Tepkime puanı
19
Puanları
8
Yaş
27
Konum
Brasil
thi
[QUOTE = "Economist, post: 4425, member: 404"]
if exists (select @ JID1 from [SRO_VT_LOG]. [dbo]. [JobLog]) begin if ((Select Amount from JobLog where UserJID = @ JID1)> = 500) begin UPDATE JobLog SET Limited = 1 WHERE UserJID = @ JID1 end
[/ QUOTE]
this 500 , is limit 500 for day ?
 

Dragon

.
Katılım
27 Kas 2018
Mesajlar
210
Tepkime puanı
92
Puanları
28
Konum
Wien
thi
[QUOTE = "Economist, post: 4425, member: 404"]
if exists (select @ JID1 from [SRO_VT_LOG]. [dbo]. [JobLog]) begin if ((Select Amount from JobLog where UserJID = @ JID1)> = 500) begin UPDATE JobLog SET Limited = 1 WHERE UserJID = @ JID1 end
[/ QUOTE]
this 500 , is limit 500 for day ?
When that limit was reached, no more points were received. This can be corrected with additional programs. Economist said, "This table can be cleaned periodically, for example with VsroMultiTool. That's all.
 

ILower

.
Katılım
9 May 2019
Mesajlar
61
Tepkime puanı
5
Puanları
8
Yaş
29
Konum
Türkiye
limit konusu sorunlu cunku 200 limit yapınca kervanla 190 cekıp cıkıp gırınce oyun onu 200 e tamamlamadı olarak goruyor ve bi 200 kervan daha cebılıyor
 

Benzer konular

Üst Alt