Bom galera, tentei resolver sozinho essa parada e não consegui.. e como sempre encontra alguma alma boa aqui pra ajudar rsrs. Estou tentando criar alguns rankings novos no servidor, e queria ter noção de como adicionar por exemplo mr mensal etc, pk mensal etc, por ai vai, no caso do reset é mais fácil pois tem a procedure dos resets então é só adicionar a linha da nova coluna, agora no caso do pk e do mr não encontrei em lugar algum, caso alguem já tenha, e possa disponibilizar fico muito agradecido !
no caso da procedure que conta o OnlineTime, se eu quizer colocar pra marcar tbm no OnlineTimeDay, OnlineTimeWeek, OnlineTimeMonth teria que modificar o que aqui: set ANSI_NULLS ON set QUOTED_IDENTIFIER ON go --//************************************************** ********************** --// Reviewed and Optimized by X-Team --// [Somente usuários registrados podem vem os links. ] --//************************************************** ********************** ALTER PROCEDURE [dbo].[WZ_DISCONNECT_MEMB] @memb___id varchar(10) AS Begin set nocount on Declare @find_id varchar(10) Declare @ConnectStat tinyint Declare @con_tm DATETIME Set @ConnectStat = 0 Set @find_id = 'NOT' select @find_id = S.memb___id, @con_tm = S.ConnectTM from MEMB_STAT S INNER JOIN MEMB_INFO I ON S.memb___id = I.memb___id where I.memb___id = @memb___id if( @find_id <> 'NOT' ) begin --ATUALIZA status da conta UPDATE MEMB_STAT SET ConnectStat = @ConnectStat, DisconnectTM = getdate(), OnlineTime = OnlineTime+(DATEDIFF(mi,@con_tm,getdate())) WHERE memb___id = @memb___id --ATUALIZA minutos online do char UPDATE Character SET OnlineTime = OnlineTime+(DATEDIFF(mi,@con_tm,getdate())) FROM Character as c INNER JOIN AccountCharacter as ac ON c.Name = ac.GameIDC WHERE c.accountid = @memb___id end end
Basta uma simples olhada: --ATUALIZA status da conta UPDATE MEMB_STAT SET ConnectStat = @ConnectStat, DisconnectTM = getdate(), OnlineTime = OnlineTime+(DATEDIFF(mi,@con_tm,getdate())) WHERE memb___id = @memb___id --ATUALIZA minutos online do char UPDATE Character SET OnlineTime = OnlineTime+(DATEDIFF(mi,@con_tm,getdate())) FROM Character as c INNER JOIN AccountCharacter as ac ON c.Name = ac.GameIDC WHERE c.accountid = @memb___id veja isso: SET OnlineTime = OnlineTime+(DATEDIFF(mi,@con_tm,getdate())) Para min adicionar + 1 table ficaria assim: SET OnlineTime = OnlineTime+(DATEDIFF(mi,@con_tm,getdate())) + OnlineTimeDay = OnlineTimeDay+(DATEDIFF(mi,@con_tm,getdate())) simples e fácil
Fox Mu Team: Hidden Content
Msg 102, Level 15, State 1, Procedure WZ_DISCONNECT_MEMB, Line 37 Incorrect syntax near '='.
--//************************************************** ********************** --// Reviewed and Optimized by X-Team --// [Somente usuários registrados podem vem os links. ] --//************************************************** ********************** ALTER PROCEDURE [dbo].[WZ_DISCONNECT_MEMB] @memb___id varchar(10) AS Begin set nocount on Declare @find_id varchar(10) Declare @ConnectStat tinyint Declare @con_tm DATETIME Set @ConnectStat = 0 Set @find_id = 'NOT' select @find_id = S.memb___id, @con_tm = S.ConnectTM from MEMB_STAT S INNER JOIN MEMB_INFO I ON S.memb___id = I.memb___id where I.memb___id = @memb___id if( @find_id <> 'NOT' ) begin --ATUALIZA status da conta UPDATE MEMB_STAT SET ConnectStat = @ConnectStat, DisconnectTM = getdate(), OnlineTime = OnlineTime+(DATEDIFF(mi,@con_tm,getdate())) WHERE memb___id = @memb___id --ATUALIZA minutos online do char UPDATE Character SET OnlineTime = OnlineTime+(DATEDIFF(mi,@con_tm,getdate())), OnlineTimeDay = OnlineTimeDay+(DATEDIFF(mi,@con_tm,getdate())), OnlineTimeWeek = OnlineTimeWeek+(DATEDIFF(mi,@con_tm,getdate())) FROM Character as c INNER JOIN AccountCharacter as ac ON c.Name = ac.GameIDC WHERE c.accountid = @memb___id end end
Shadows
Agora está correto, muito obrigado! no caso dos outros rankings sabe como eu faria?
veja se essa trigger lhe ajuda: [Somente usuários registrados podem vem os links. ]
Há 1 usuários navegando neste tópico. (0 registrados e 1 visitantes)
Regras do Fórum