友情提示:奇迹私服无保障,喜爱奇迹请支持官方奇迹MU!

游戏资料库

你当前的位置:奇迹私发网 > 技术资料 > 内容

技术资料

在线时间发钱存储过程修改


IF EXISTS ( SELECT memb___id FROM MEMB_STAT WITH (READUNCOMMITTED)
WHERE memb___id = @uid )
Begin
UPDATE MEMB_STAT
SET DisConnectTM = (getdate()), connectstat = 0 WHERE memb___id = @uid


--根据在线时间发money
IF EXISTS ( SELECT UserID FROM LOG_UserLogin WITH (READUNCOMMITTED) WHERE UserID = @uid and logoutTM is null)
Begin
declare @ntm datetime
declare @otm int
declare @mny int
set @ntm=getdate()
select @otm=datediff(minute,LoginTM,@ntm) from LOG_UserLogin where UserID = @uid and logoutTM is null
set @mny=@otm*50000
--发钱到仓库
update warehouse set [money]=(case when [money">2000000000-@mny>[money] then [money]+@mny else 2000000000 end)
where accountid=@uid
--写入到登录详细记录
UPDATE LOG_UserLogin
SET LogoutTM = @ntm,OnlineSec=@otm,GiveMoney=@mny
WHERE UserID = @uid and logoutTM is null
--生成积分
declare @ll int
,@jf int
,@jfbl int
,@ctm int
set @jfbl=1 --设置积分兑换比例 1/X
select @ctm=CountTime,@ll=LastCount from ExtIdData where accountid=@uid
--写入扩展用户ID数据
if @ctm is not null begin
set @jf=cast((@ctm+@otm-@ll)/@jfbl as int)
update ExtIdData set counttime=counttime+@otm,lastlogin=getdate()
,HaveCents=HaveCents+@jf,LastCount=@ll+@jf*@jfbl
where accountid=@uid
end else begin
set @jf=cast(@otm/@jfbl as int)
insert into ExtIdData (accountid,counttime,lastlogin,LastCount,HaveCents)
values (@uid,@otm,getdate(),@jf*@jfbl,@jf)
end
End
End

最新奇迹私服

本文标签:

如需转载,请注明本文链接:http://www.598mu.com/jishu/201304033783.html



上一篇:月饼掉套装

下一篇:召唤送点