decomp DBCServer_Release and inspect/document database

This commit is contained in:
Benjamin Palko 2026-10-14 23:22:03 -04:00
parent 4b267cbe05
commit 7834b98bf0
28222 changed files with 843300 additions and 144 deletions

View file

@ -0,0 +1,52 @@
CREATE procedure [dbo].[up_insert_channelbyAuto]
@Code int,
@World int
as
set nocount on
declare @i int
declare @last int
declare @current int
declare @minid int
declare @maxid int
set @i = 1
set @last = 0
set @current = 1
set @minid = 1
set @maxid = 1
select @last = ID from ChannelSeed where Last_Seed = 1 and WorldID = @World
select @maxid = MAX(ID) from ChannelSeed where WorldID = @World
select @minid = MIN(ID) from ChannelSeed where WorldID = @World
if @last = 0
begin
set @last = @minid
end
else
begin
set @last = @last+1
end
while @i <= 3
begin
if @last > @maxid
begin
set @last = @minid
end
insert into ChannelOption( Code, CH_Group, CH_Type, MinLevel, MaxLevel, CH_NUM, WorldID )
select @Code, CH_Group, CH_Type, MinLevel, MaxLevel, Current_Num, @World from ChannelSeed where ID = @last
select @current = Current_Num from ChannelSeed where ID = @last
update ChannelSeed set Current_Num = @current+1 where ID = @last
update ChannelSeed set Last_Seed = 0 where WorldID = @World
update ChannelSeed set Last_Seed = 1 where ID = @last
set @last = @last+1
set @i = @i+1
end