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,58 @@
table column_id column type max_length precision scale is_nullable is_identity default
dbo.Admin_Sys_Param 1 seq int 4 10 0 0 1
dbo.Admin_Sys_Param 2 param_name nvarchar 100 0 0 0 0
dbo.Admin_Sys_Param 3 param_value nvarchar 510 0 0 0 0
dbo.Admin_Sys_Param 4 remark1 nvarchar 100 0 0 0 0
dbo.Admin_Sys_Param 5 remark2 nvarchar 100 0 0 0 0
dbo.Admin_Sys_Param 6 read_yn int 4 10 0 1 0
dbo.Admin_Sys_Param 7 regdate datetime 8 23 3 0 0
dbo.AdminRoles 1 Idx int 4 10 0 0 1
dbo.AdminRoles 2 AdminID nvarchar 100 0 0 0 0
dbo.AdminRoles 3 AdminPW nvarchar 100 0 0 0 0
dbo.AdminRoles 4 AdminRoles nvarchar 100 0 0 0 0
dbo.AdminRoles 5 RegDate datetime 8 23 3 0 0 (getdate())
dbo.AdminRoles 6 RegName nvarchar 100 0 0 1 0
dbo.AdminRoles 7 AdminYN nchar 4 0 0 1 0 (N'N')
dbo.AdminRoles 8 accessControlYN nvarchar 4 0 0 1 0 ('N')
dbo.AdminRoles 9 ip_1 nvarchar 100 0 0 1 0 ('')
dbo.AdminRoles 10 ip_2 nvarchar 100 0 0 1 0 ('')
dbo.AdminRoles 11 ip_3 nvarchar 100 0 0 1 0 ('')
dbo.GMAudit 1 audit_id uniqueidentifier 16 0 0 0 0 (newid())
dbo.GMAudit 2 AdminID nvarchar 100 0 0 0 0
dbo.GMAudit 3 world_index int 4 10 0 0 0
dbo.GMAudit 4 bcust_id nvarchar 100 0 0 1 0 (N'None')
dbo.GMAudit 5 character_id nvarchar 100 0 0 1 0
dbo.GMAudit 6 char_name nvarchar 100 0 0 1 0
dbo.GMAudit 7 Type nvarchar 200 0 0 0 0
dbo.GMAudit 8 Modify nvarchar 3000 0 0 1 0
dbo.GMAudit 9 Memo nvarchar 400 0 0 0 0
dbo.GMAudit 10 date datetime 8 23 3 0 0 (getdate())
dbo.GMInfoTable 1 gm_id int 4 10 0 0 0
dbo.GMInfoTable 2 name nvarchar 32 0 0 0 0
dbo.GMInfoTable 3 pass nvarchar 32 0 0 0 0
dbo.GMInfoTable 4 permission int 4 10 0 0 0
dbo.GMInfoTable 5 logout_time datetime 8 23 3 0 0
dbo.GMLoginLog 1 Idx bigint 8 19 0 0 1
dbo.GMLoginLog 2 AdminID nvarchar 100 0 0 0 0
dbo.GMLoginLog 3 RegName nvarchar 100 0 0 1 0
dbo.GMLoginLog 4 accessIP nvarchar 100 0 0 1 0
dbo.GMLoginLog 5 successYN nvarchar 100 0 0 1 0
dbo.GMLoginLog 6 LogDate datetime 8 23 3 0 0 (getdate())
dbo.GMLoginLog 7 type nvarchar 100 0 0 0 0 (' ')
dbo.POPUP 1 idx int 4 10 0 0 1
dbo.POPUP 2 title nvarchar 510 0 0 1 0
dbo.POPUP 3 width int 4 10 0 1 0
dbo.POPUP 4 height int 4 10 0 1 0
dbo.POPUP 5 v_width int 4 10 0 1 0
dbo.POPUP 6 v_height int 4 10 0 1 0
dbo.POPUP 7 memo text 16 0 0 1 0
dbo.POPUP 8 apply nchar 4 0 0 1 0
dbo.POPUP 9 wdate datetime 8 23 3 1 0
dbo.WorldList 1 world_id tinyint 1 3 0 0 0
dbo.WorldList 2 world_name nvarchar 100 0 0 0 0
dbo.WorldList 3 db_id nvarchar 100 0 0 1 0 ('')
dbo.WorldList 4 db_pw nvarchar 100 0 0 1 0 ('')
dbo.WorldList 5 db_catalog nvarchar 100 0 0 1 0 ('')
dbo.WorldList 6 db_ip nvarchar 100 0 0 1 0 ('')
dbo.X_6217 1 id int 4 10 0 0 1
dbo.X_6217 2 ResultTxt nvarchar 8000 0 0 1 0
1 table column_id column type max_length precision scale is_nullable is_identity default
2 dbo.Admin_Sys_Param 1 seq int 4 10 0 0 1
3 dbo.Admin_Sys_Param 2 param_name nvarchar 100 0 0 0 0
4 dbo.Admin_Sys_Param 3 param_value nvarchar 510 0 0 0 0
5 dbo.Admin_Sys_Param 4 remark1 nvarchar 100 0 0 0 0
6 dbo.Admin_Sys_Param 5 remark2 nvarchar 100 0 0 0 0
7 dbo.Admin_Sys_Param 6 read_yn int 4 10 0 1 0
8 dbo.Admin_Sys_Param 7 regdate datetime 8 23 3 0 0
9 dbo.AdminRoles 1 Idx int 4 10 0 0 1
10 dbo.AdminRoles 2 AdminID nvarchar 100 0 0 0 0
11 dbo.AdminRoles 3 AdminPW nvarchar 100 0 0 0 0
12 dbo.AdminRoles 4 AdminRoles nvarchar 100 0 0 0 0
13 dbo.AdminRoles 5 RegDate datetime 8 23 3 0 0 (getdate())
14 dbo.AdminRoles 6 RegName nvarchar 100 0 0 1 0
15 dbo.AdminRoles 7 AdminYN nchar 4 0 0 1 0 (N'N')
16 dbo.AdminRoles 8 accessControlYN nvarchar 4 0 0 1 0 ('N')
17 dbo.AdminRoles 9 ip_1 nvarchar 100 0 0 1 0 ('')
18 dbo.AdminRoles 10 ip_2 nvarchar 100 0 0 1 0 ('')
19 dbo.AdminRoles 11 ip_3 nvarchar 100 0 0 1 0 ('')
20 dbo.GMAudit 1 audit_id uniqueidentifier 16 0 0 0 0 (newid())
21 dbo.GMAudit 2 AdminID nvarchar 100 0 0 0 0
22 dbo.GMAudit 3 world_index int 4 10 0 0 0
23 dbo.GMAudit 4 bcust_id nvarchar 100 0 0 1 0 (N'None')
24 dbo.GMAudit 5 character_id nvarchar 100 0 0 1 0
25 dbo.GMAudit 6 char_name nvarchar 100 0 0 1 0
26 dbo.GMAudit 7 Type nvarchar 200 0 0 0 0
27 dbo.GMAudit 8 Modify nvarchar 3000 0 0 1 0
28 dbo.GMAudit 9 Memo nvarchar 400 0 0 0 0
29 dbo.GMAudit 10 date datetime 8 23 3 0 0 (getdate())
30 dbo.GMInfoTable 1 gm_id int 4 10 0 0 0
31 dbo.GMInfoTable 2 name nvarchar 32 0 0 0 0
32 dbo.GMInfoTable 3 pass nvarchar 32 0 0 0 0
33 dbo.GMInfoTable 4 permission int 4 10 0 0 0
34 dbo.GMInfoTable 5 logout_time datetime 8 23 3 0 0
35 dbo.GMLoginLog 1 Idx bigint 8 19 0 0 1
36 dbo.GMLoginLog 2 AdminID nvarchar 100 0 0 0 0
37 dbo.GMLoginLog 3 RegName nvarchar 100 0 0 1 0
38 dbo.GMLoginLog 4 accessIP nvarchar 100 0 0 1 0
39 dbo.GMLoginLog 5 successYN nvarchar 100 0 0 1 0
40 dbo.GMLoginLog 6 LogDate datetime 8 23 3 0 0 (getdate())
41 dbo.GMLoginLog 7 type nvarchar 100 0 0 0 0 (' ')
42 dbo.POPUP 1 idx int 4 10 0 0 1
43 dbo.POPUP 2 title nvarchar 510 0 0 1 0
44 dbo.POPUP 3 width int 4 10 0 1 0
45 dbo.POPUP 4 height int 4 10 0 1 0
46 dbo.POPUP 5 v_width int 4 10 0 1 0
47 dbo.POPUP 6 v_height int 4 10 0 1 0
48 dbo.POPUP 7 memo text 16 0 0 1 0
49 dbo.POPUP 8 apply nchar 4 0 0 1 0
50 dbo.POPUP 9 wdate datetime 8 23 3 1 0
51 dbo.WorldList 1 world_id tinyint 1 3 0 0 0
52 dbo.WorldList 2 world_name nvarchar 100 0 0 0 0
53 dbo.WorldList 3 db_id nvarchar 100 0 0 1 0 ('')
54 dbo.WorldList 4 db_pw nvarchar 100 0 0 1 0 ('')
55 dbo.WorldList 5 db_catalog nvarchar 100 0 0 1 0 ('')
56 dbo.WorldList 6 db_ip nvarchar 100 0 0 1 0 ('')
57 dbo.X_6217 1 id int 4 10 0 0 1
58 dbo.X_6217 2 ResultTxt nvarchar 8000 0 0 1 0

View file

@ -0,0 +1 @@
child child_col parent parent_col
1 child child_col parent parent_col

View file

@ -0,0 +1,5 @@
table index type_desc is_primary_key is_unique col key_ordinal
Admin_Sys_Param PK_Admin_Sys_Param CLUSTERED 1 1 seq 1
GMInfoTable PK__GMInfoTa__49B921C107020F21 CLUSTERED 1 1 gm_id 1
GMInfoTable UQ__GMInfoTa__72E12F1B09DE7BCC NONCLUSTERED 0 1 name 1
WorldList PK_WorldList CLUSTERED 1 1 world_id 1
1 table index type_desc is_primary_key is_unique col key_ordinal
2 Admin_Sys_Param PK_Admin_Sys_Param CLUSTERED 1 1 seq 1
3 GMInfoTable PK__GMInfoTa__49B921C107020F21 CLUSTERED 1 1 gm_id 1
4 GMInfoTable UQ__GMInfoTa__72E12F1B09DE7BCC NONCLUSTERED 0 1 name 1
5 WorldList PK_WorldList CLUSTERED 1 1 world_id 1

View file

@ -0,0 +1,71 @@
CREATE PROCEDURE [dbo].[CreateCalendar]
/************************************************************************************************************
Purpose:
Given a start date and an end date, create a calendar of dates that easily traverses months and years. Is
capable of generating up to 179 years worth of calendar by month in any given run.
Usage Notes:
1. End date parameter is optional... if not provided, the start date will be used to return that one month.
2. Of the two input paramters, the lowest (earliest) date will be used as the start date regardless of the
order provided.
3. Returns a single result set containing all dates.
4. Does NOT use a Cursor, While Loop, Temp Table, or Table variable so that even really picky DBA's won't
reject the code.
5. Because only set-based code was used, returns 10 years worth of calendar in about 230 milliseconds.
A full year takes a scant 76 milliseconds and a single month takes 63 milliseconds. A hundred-year
calendar takes only 6.3 seconds.
6. The start date does NOT need to be the first of the month and the end date does NOT need to be the last
day of the month. The internal calculations will "auto-magically" include the whole month for both the
start and end dates as well as all months in between.
Revision History:
Rev 00 - 08/13/2007 - Jeff Moden - Initial creation and unit test.
************************************************************************************************************/
--===== Declare the input parameters
@pStartDate DATETIME, --Any date (can include time) in the desired start month
@pEndDate DATETIME = @pStartDate --Any date (can include time) in the desired end month
AS
--===== Create the correct environment
SET NOCOUNT ON --Suppress the auto-display of rowcounts to prevent false echos on GUI's
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED --Same as putting WITH (NOLOCK) on tables in query
--===== Create the base date that all the calculations rely on (is a Monday)
DECLARE @BaseDate DATETIME
SET @BaseDate = '1753-01-01'
--===== Make sure the inputs are in the correct order (start date must always be the earliest date)
IF @pEndDate < @pStartDate
BEGIN
DECLARE @Swap DATETIME
SELECT @Swap = @pStartDate,
@pStartDate = @pEndDate,
@pEndDate = @Swap
END
--===== Modify the start to start on the first of the same month and the end date to end on the last day
-- of the same month.
SET @pStartDate = DATEADD(mm,DATEDIFF(mm,@BaseDate,@pStartDate),@BaseDate)
SET @pEndDate = DATEADD(mm,DATEDIFF(mm,@BaseDate,@pEndDate)+1,@BaseDate)-1
--===== Create the calendar without loops, cursors, or temp tables
SELECT MAX(DATENAME(yy,d.TheDate)) AS [Year],
MAX(LEFT(DATENAME(mm,d.TheDate),3))AS [Month],
MAX(CASE WHEN DATENAME(dw,d.TheDate) = '월요일' THEN DATENAME(dd,d.TheDate) ELSE '' END) AS Mon,
MAX(CASE WHEN DATENAME(dw,d.TheDate) = '화요일' THEN DATENAME(dd,d.TheDate) ELSE '' END) AS Tue,
MAX(CASE WHEN DATENAME(dw,d.TheDate) = '수요일' THEN DATENAME(dd,d.TheDate) ELSE '' END) AS Wed,
MAX(CASE WHEN DATENAME(dw,d.TheDate) = '목요일' THEN DATENAME(dd,d.TheDate) ELSE '' END) AS Thu,
MAX(CASE WHEN DATENAME(dw,d.TheDate) = '금요일' THEN DATENAME(dd,d.TheDate) ELSE '' END) AS Fri,
MAX(CASE WHEN DATENAME(dw,d.TheDate) = '토요일' THEN DATENAME(dd,d.TheDate) ELSE '' END) AS Sat,
MAX(CASE WHEN DATENAME(dw,d.TheDate) = '일요일' THEN DATENAME(dd,d.TheDate) ELSE '' END) AS Sun
FROM (--==== Derived table "d" finds all dates for the given range of dates up to 65535 days apart
SELECT YEAR(@pStartDate+n.Number) AS TheYear,
MONTH(@pStartDate+n.Number) AS TheMonth,
DATEDIFF(dd,@BaseDate,@pStartDate+n.Number)/7 AS TheWeek,
@pStartDate+n.Number AS TheDate
FROM (--==== Derived table "n" creates numbers from 0 to 65535 (about 179 years worth of days)
SELECT t1.Number*256+t2.Number AS Number
FROM Master.dbo.spt_Values t1,
Master.dbo.spt_Values t2
WHERE t1.Type = 'P'
AND t2.Type = 'P'
)n
WHERE @pStartDate+n.Number <= @pEndDate
)d
GROUP BY d.TheYear,d.TheMonth,d.TheWeek
ORDER BY d.TheYear,d.TheMonth,d.TheWeek

View file

@ -0,0 +1,3 @@
type_desc name parameter_id param type max_length is_output
SQL_STORED_PROCEDURE CreateCalendar 1 @pStartDate datetime 8 0
SQL_STORED_PROCEDURE CreateCalendar 2 @pEndDate datetime 8 0
1 type_desc name parameter_id param type max_length is_output
2 SQL_STORED_PROCEDURE CreateCalendar 1 @pStartDate datetime 8 0
3 SQL_STORED_PROCEDURE CreateCalendar 2 @pEndDate datetime 8 0

View file

@ -0,0 +1,8 @@
X_6217 0 2
WorldList 1 6
POPUP 0 9
GMLoginLog 5 7
GMInfoTable 1 5
GMAudit 0 10
AdminRoles 1 11
Admin_Sys_Param 0 7
1 X_6217 0 2
2 WorldList 1 6
3 POPUP 0 9
4 GMLoginLog 5 7
5 GMInfoTable 1 5
6 GMAudit 0 10
7 AdminRoles 1 11
8 Admin_Sys_Param 0 7

34
decomp/schema/README.md Normal file
View file

@ -0,0 +1,34 @@
# decomp/schema — catalog dump of `schema/*.mdf`
Derived output, regenerable with `decomp/scripts/dump_schema.sh` (needs Docker).
**Method:**
1. Copy `schema/*.mdf/.ldf` to a scratch directory. The originals are never
opened in place.
2. Attach the copies to a throwaway `mcr.microsoft.com/mssql/server:2022-latest`
container. The files are database version 957 (SQL Server 2022); a 2019
instance refuses them.
3. Query `sys.*` catalogs and `OBJECT_DEFINITION`.
**No table data is exported, only row counts.** The databases contain account
and character data from the source deployment, so don't add data dumps here.
| File (per DB) | Content |
|---|---|
| `tables.tsv` | table, row count, column count |
| `columns.tsv` | schema.table, ordinal, column, type, max_length, precision, scale, nullable, identity, default |
| `indexes.tsv` | table, index, type, is_pk, is_unique, column, key ordinal |
| `foreign_keys.tsv` | none declared in any database |
| `routines.tsv` | procedure/function/view/trigger parameters |
| `procs/<name>.sql` | module definition text |
| `empty_procs.txt` | procedures with no executable statement (stubs) |
`proc_tables.tsv` (top level) is a heuristic text scan. For each procedure it
lists the tables it references (`W` = appears as an INSERT/UPDATE/DELETE/MERGE
target, `R` = otherwise) and its cross-database references. Tables built by
dynamic SQL (the per-day log tables in RustyHearts_Log) are not captured.
The procedure sources contain parameter names such as `@db_pass` (linked-server
setup). No literal credentials were found (grep for password patterns).
See `docs/DATABASE.md` for interpretation.

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,7 @@
up_LogDecrease
up_add_inquiry_count
up_insert_log_connection
up_insert_log_packet_overload
up_update_cash_mileage
up_update_event_inquiry
up_update_inquiry_count

View file

@ -0,0 +1 @@
child child_col parent parent_col
1 child child_col parent parent_col

View file

@ -0,0 +1,81 @@
table index type_desc is_primary_key is_unique col key_ordinal
AuctionListTable PK_AuctionListTable CLUSTERED 1 1 item_uid 1
Base_CharacterClass PK_Base_CharacterClass CLUSTERED 1 1 language 1
Base_CharacterClass PK_Base_CharacterClass CLUSTERED 1 1 class_code 2
Base_CharacterJob PK_Base_CharacterJob CLUSTERED 1 1 job_code 1
Base_DungeonTable IX_MapID_Base_DungeonTable NONCLUSTERED 0 0 MapID 1
Base_DungeonTable PK_Base_DungeonTable CLUSTERED 1 1 MapID 1
Base_ExpTable PK_Base_ExpTable CLUSTERED 1 1 Level 1
Base_ItemOptionTable PK_Base_ItemOptionTable CLUSTERED 1 1 id 1
Base_ItemTable IX_id_Base_ItemTable NONCLUSTERED 0 0 id 1
Base_ItemTable IX_is_socket_Base_ItemTable NONCLUSTERED 0 0 is_socket 1
Base_ItemTable IX_kind_Base_ItemTable NONCLUSTERED 0 0 kind 1
Base_ItemTable PK_Base_ItemTable CLUSTERED 1 1 id 1
Base_ItemTable_All IX_id_Base_ItemTable_copy3 NONCLUSTERED 0 0 id 1
Base_ItemTable_All IX_is_socket_Base_ItemTable_copy3 NONCLUSTERED 0 0 is_socket 1
Base_ItemTable_All IX_kind_Base_ItemTable_copy3 NONCLUSTERED 0 0 kind 1
Base_ItemTable_All PK__Base_Ite__3213E83F67F5FA95 CLUSTERED 1 1 id 1
Base_ItemTable_Armor IX_id_Base_ItemTable_copy2 NONCLUSTERED 0 0 id 1
Base_ItemTable_Armor IX_is_socket_Base_ItemTable_copy2 NONCLUSTERED 0 0 is_socket 1
Base_ItemTable_Armor IX_kind_Base_ItemTable_copy2 NONCLUSTERED 0 0 kind 1
Base_ItemTable_Armor PK__Base_Ite__3213E83FC7C4DD33 CLUSTERED 1 1 id 1
Base_ItemTable_Costume IX_id_Base_ItemTable_copy1 NONCLUSTERED 0 0 id 1
Base_ItemTable_Costume IX_is_socket_Base_ItemTable_copy1 NONCLUSTERED 0 0 is_socket 1
Base_ItemTable_Costume IX_kind_Base_ItemTable_copy1 NONCLUSTERED 0 0 kind 1
Base_ItemTable_Costume PK__Base_Ite__3213E83FAB02A0E4 CLUSTERED 1 1 id 1
Base_ItemTable_Weapon IX_id_Base_ItemTable_copy2_copy1 NONCLUSTERED 0 0 id 1
Base_ItemTable_Weapon IX_is_socket_Base_ItemTable_copy2_copy1 NONCLUSTERED 0 0 is_socket 1
Base_ItemTable_Weapon IX_kind_Base_ItemTable_copy2_copy1 NONCLUSTERED 0 0 kind 1
Base_ItemTable_Weapon PK__Base_Ite__3213E83F0D9D5E27 CLUSTERED 1 1 id 1
Base_OptionGroup PK_Base_OptionGroup CLUSTERED 1 1 nID 1
Base_Quest IX_quest_code_Base_Quest NONCLUSTERED 0 0 quest_code 1
Base_Quest PK_Base_Quest CLUSTERED 1 1 quest_code 1
Base_TitleTable PK_Base_TitleTable CLUSTERED 1 1 id 1
BattleInfo PK_BattleInfo CLUSTERED 1 1 character_id 1
BattleRank PK_BattleRank CLUSTERED 1 1 index 1
BuffTable PK_BuffTable NONCLUSTERED 1 1 idx 1
Cash_EffectTable PK_Package_EffectTable NONCLUSTERED 1 1 item_uid 1
CashProductList PK_CashProductStorage CLUSTERED 1 1 ProductID 1
Character_Sanction PK_Character_Sanction CLUSTERED 1 1 uid 1
CharacterTable PK_CharacterTable NONCLUSTERED 1 1 character_id 1
CharacterTable UQ_CharacterTable NONCLUSTERED 0 1 Name 1
CharacterTable_DELETE PK_CharacterTable_DELETE CLUSTERED 1 1 character_id 1
CharacterTitle PK_CharacterTitle NONCLUSTERED 1 1 ID 1
Coupon PK_Coupon NONCLUSTERED 1 1 no 1
DungeonRank PK_DungeonRank CLUSTERED 1 1 index 1
Equip_CharacterTitle PK_Equip_CharacterTitle CLUSTERED 1 1 ID 1
FortuneTable PK_FortuneTable CLUSTERED 1 1 character_id 1
FriendTableEx PK_FriendTableEx NONCLUSTERED 1 1 index 1
GM_ItemOptionCondition PK_GM_ItemOptionCondition CLUSTERED 1 1 nID 1
GuildMemberTable PK_GuildMemberTable NONCLUSTERED 1 1 index 1
GuildTable PK_GuildTable CLUSTERED 1 1 guild_id 1
GuildTable UQ_GuildTable_Name NONCLUSTERED 0 1 name 1
GuildTable_DELETE PK_GuildTable_DELETE NONCLUSTERED 1 1 idx 1
InquiryTable PK_InquiryTable CLUSTERED 1 1 inquiry_id 1
ItemBoothTable PK_ItemBoothTable CLUSTERED 1 1 character_id 1
ItemDropGroupTable PK_ItemDropGroupTable CLUSTERED 1 1 index 1
KeyMapTable PK_KeyMapTable_AuthID CLUSTERED 1 1 AuthID 1
MailTable PK_MailTable NONCLUSTERED 1 1 ID 1
N_EquipItem PK__N_EquipI__3E522ABE14701044 NONCLUSTERED 1 1 item_uid 1
N_InventoryItem PK__N_Invent__3E522ABE25F36AF0 NONCLUSTERED 1 1 item_uid 1
N_InventoryItem_DELETE PK_N_InventoryItem_DELETE CLUSTERED 1 1 item_uid 1
N_MailItem PK_N_MailItem NONCLUSTERED 1 1 item_uid 1
PetTable PK_PetTable NONCLUSTERED 1 1 pet_id 1
QuestTable PK__QuestTab__7F667EF3A958F373 NONCLUSTERED 1 1 quest_uid 1
quickslot_list_option PK__quickslo__11D7652E01894B8F CLUSTERED 1 1 character_id 1
QuickSlotExTable PK_QuickSlotExTable CLUSTERED 1 1 character_id 1
QuickSlotExTable02 PK_QuickSlotExTable02 CLUSTERED 1 1 character_id 1
QuickSlotExTable03 PK_QuickSlotExTable03 CLUSTERED 1 1 character_id 1
RearingTable PK_RearingTable NONCLUSTERED 1 1 rearing_id 1
RearingTable_Ending PK_RearingTable_Ending CLUSTERED 1 1 rearing_id 1
RewardTable PK_RewardTable CLUSTERED 1 1 idx 1
SkillTable PK_SkillTable NONCLUSTERED 1 1 skill_id 1
SkillTable_DELETE PK_SkillTable_DELETE CLUSTERED 1 1 skill_id 1
tbl_Account_Storage PK_tbl_Account_Storage NONCLUSTERED 1 1 item_uid 1
tbl_Guild_Exp_List PK_tbl_Guild_Exp_List_Index NONCLUSTERED 1 1 index 1
tbl_Guild_Skill PK_tbl_Guild_Skill NONCLUSTERED 1 1 idx 1
tbl_Guild_Storage_Info PK_tbl_Guild_Storage_Info CLUSTERED 1 1 guild_id 1
tbl_Guild_Storage_Item PK_tbl_Guild_Storage_Item NONCLUSTERED 1 1 item_uid 1
tbl_Guild_Storage_Use_List PK_tbl_Guild_Storage_Use_List_Index NONCLUSTERED 1 1 index 1
tbl_Pet_Inventory PK_tbl_Pet_Inventory_ItemID NONCLUSTERED 1 1 item_uid 1
UniAccountInfo PK_UniAccountInfo CLUSTERED 1 1 AuthID 1
1 table index type_desc is_primary_key is_unique col key_ordinal
2 AuctionListTable PK_AuctionListTable CLUSTERED 1 1 item_uid 1
3 Base_CharacterClass PK_Base_CharacterClass CLUSTERED 1 1 language 1
4 Base_CharacterClass PK_Base_CharacterClass CLUSTERED 1 1 class_code 2
5 Base_CharacterJob PK_Base_CharacterJob CLUSTERED 1 1 job_code 1
6 Base_DungeonTable IX_MapID_Base_DungeonTable NONCLUSTERED 0 0 MapID 1
7 Base_DungeonTable PK_Base_DungeonTable CLUSTERED 1 1 MapID 1
8 Base_ExpTable PK_Base_ExpTable CLUSTERED 1 1 Level 1
9 Base_ItemOptionTable PK_Base_ItemOptionTable CLUSTERED 1 1 id 1
10 Base_ItemTable IX_id_Base_ItemTable NONCLUSTERED 0 0 id 1
11 Base_ItemTable IX_is_socket_Base_ItemTable NONCLUSTERED 0 0 is_socket 1
12 Base_ItemTable IX_kind_Base_ItemTable NONCLUSTERED 0 0 kind 1
13 Base_ItemTable PK_Base_ItemTable CLUSTERED 1 1 id 1
14 Base_ItemTable_All IX_id_Base_ItemTable_copy3 NONCLUSTERED 0 0 id 1
15 Base_ItemTable_All IX_is_socket_Base_ItemTable_copy3 NONCLUSTERED 0 0 is_socket 1
16 Base_ItemTable_All IX_kind_Base_ItemTable_copy3 NONCLUSTERED 0 0 kind 1
17 Base_ItemTable_All PK__Base_Ite__3213E83F67F5FA95 CLUSTERED 1 1 id 1
18 Base_ItemTable_Armor IX_id_Base_ItemTable_copy2 NONCLUSTERED 0 0 id 1
19 Base_ItemTable_Armor IX_is_socket_Base_ItemTable_copy2 NONCLUSTERED 0 0 is_socket 1
20 Base_ItemTable_Armor IX_kind_Base_ItemTable_copy2 NONCLUSTERED 0 0 kind 1
21 Base_ItemTable_Armor PK__Base_Ite__3213E83FC7C4DD33 CLUSTERED 1 1 id 1
22 Base_ItemTable_Costume IX_id_Base_ItemTable_copy1 NONCLUSTERED 0 0 id 1
23 Base_ItemTable_Costume IX_is_socket_Base_ItemTable_copy1 NONCLUSTERED 0 0 is_socket 1
24 Base_ItemTable_Costume IX_kind_Base_ItemTable_copy1 NONCLUSTERED 0 0 kind 1
25 Base_ItemTable_Costume PK__Base_Ite__3213E83FAB02A0E4 CLUSTERED 1 1 id 1
26 Base_ItemTable_Weapon IX_id_Base_ItemTable_copy2_copy1 NONCLUSTERED 0 0 id 1
27 Base_ItemTable_Weapon IX_is_socket_Base_ItemTable_copy2_copy1 NONCLUSTERED 0 0 is_socket 1
28 Base_ItemTable_Weapon IX_kind_Base_ItemTable_copy2_copy1 NONCLUSTERED 0 0 kind 1
29 Base_ItemTable_Weapon PK__Base_Ite__3213E83F0D9D5E27 CLUSTERED 1 1 id 1
30 Base_OptionGroup PK_Base_OptionGroup CLUSTERED 1 1 nID 1
31 Base_Quest IX_quest_code_Base_Quest NONCLUSTERED 0 0 quest_code 1
32 Base_Quest PK_Base_Quest CLUSTERED 1 1 quest_code 1
33 Base_TitleTable PK_Base_TitleTable CLUSTERED 1 1 id 1
34 BattleInfo PK_BattleInfo CLUSTERED 1 1 character_id 1
35 BattleRank PK_BattleRank CLUSTERED 1 1 index 1
36 BuffTable PK_BuffTable NONCLUSTERED 1 1 idx 1
37 Cash_EffectTable PK_Package_EffectTable NONCLUSTERED 1 1 item_uid 1
38 CashProductList PK_CashProductStorage CLUSTERED 1 1 ProductID 1
39 Character_Sanction PK_Character_Sanction CLUSTERED 1 1 uid 1
40 CharacterTable PK_CharacterTable NONCLUSTERED 1 1 character_id 1
41 CharacterTable UQ_CharacterTable NONCLUSTERED 0 1 Name 1
42 CharacterTable_DELETE PK_CharacterTable_DELETE CLUSTERED 1 1 character_id 1
43 CharacterTitle PK_CharacterTitle NONCLUSTERED 1 1 ID 1
44 Coupon PK_Coupon NONCLUSTERED 1 1 no 1
45 DungeonRank PK_DungeonRank CLUSTERED 1 1 index 1
46 Equip_CharacterTitle PK_Equip_CharacterTitle CLUSTERED 1 1 ID 1
47 FortuneTable PK_FortuneTable CLUSTERED 1 1 character_id 1
48 FriendTableEx PK_FriendTableEx NONCLUSTERED 1 1 index 1
49 GM_ItemOptionCondition PK_GM_ItemOptionCondition CLUSTERED 1 1 nID 1
50 GuildMemberTable PK_GuildMemberTable NONCLUSTERED 1 1 index 1
51 GuildTable PK_GuildTable CLUSTERED 1 1 guild_id 1
52 GuildTable UQ_GuildTable_Name NONCLUSTERED 0 1 name 1
53 GuildTable_DELETE PK_GuildTable_DELETE NONCLUSTERED 1 1 idx 1
54 InquiryTable PK_InquiryTable CLUSTERED 1 1 inquiry_id 1
55 ItemBoothTable PK_ItemBoothTable CLUSTERED 1 1 character_id 1
56 ItemDropGroupTable PK_ItemDropGroupTable CLUSTERED 1 1 index 1
57 KeyMapTable PK_KeyMapTable_AuthID CLUSTERED 1 1 AuthID 1
58 MailTable PK_MailTable NONCLUSTERED 1 1 ID 1
59 N_EquipItem PK__N_EquipI__3E522ABE14701044 NONCLUSTERED 1 1 item_uid 1
60 N_InventoryItem PK__N_Invent__3E522ABE25F36AF0 NONCLUSTERED 1 1 item_uid 1
61 N_InventoryItem_DELETE PK_N_InventoryItem_DELETE CLUSTERED 1 1 item_uid 1
62 N_MailItem PK_N_MailItem NONCLUSTERED 1 1 item_uid 1
63 PetTable PK_PetTable NONCLUSTERED 1 1 pet_id 1
64 QuestTable PK__QuestTab__7F667EF3A958F373 NONCLUSTERED 1 1 quest_uid 1
65 quickslot_list_option PK__quickslo__11D7652E01894B8F CLUSTERED 1 1 character_id 1
66 QuickSlotExTable PK_QuickSlotExTable CLUSTERED 1 1 character_id 1
67 QuickSlotExTable02 PK_QuickSlotExTable02 CLUSTERED 1 1 character_id 1
68 QuickSlotExTable03 PK_QuickSlotExTable03 CLUSTERED 1 1 character_id 1
69 RearingTable PK_RearingTable NONCLUSTERED 1 1 rearing_id 1
70 RearingTable_Ending PK_RearingTable_Ending CLUSTERED 1 1 rearing_id 1
71 RewardTable PK_RewardTable CLUSTERED 1 1 idx 1
72 SkillTable PK_SkillTable NONCLUSTERED 1 1 skill_id 1
73 SkillTable_DELETE PK_SkillTable_DELETE CLUSTERED 1 1 skill_id 1
74 tbl_Account_Storage PK_tbl_Account_Storage NONCLUSTERED 1 1 item_uid 1
75 tbl_Guild_Exp_List PK_tbl_Guild_Exp_List_Index NONCLUSTERED 1 1 index 1
76 tbl_Guild_Skill PK_tbl_Guild_Skill NONCLUSTERED 1 1 idx 1
77 tbl_Guild_Storage_Info PK_tbl_Guild_Storage_Info CLUSTERED 1 1 guild_id 1
78 tbl_Guild_Storage_Item PK_tbl_Guild_Storage_Item NONCLUSTERED 1 1 item_uid 1
79 tbl_Guild_Storage_Use_List PK_tbl_Guild_Storage_Use_List_Index NONCLUSTERED 1 1 index 1
80 tbl_Pet_Inventory PK_tbl_Pet_Inventory_ItemID NONCLUSTERED 1 1 item_uid 1
81 UniAccountInfo PK_UniAccountInfo CLUSTERED 1 1 AuthID 1

View file

@ -0,0 +1,46 @@
CREATE PROCEDURE [dbo].[schedule_duel_rank]
AS
BEGIN
delete BattleRank
-- 승점 전체
insert into BattleRank (rank_type, grade, character_id, char_name, char_class, duel_exp, total_win, total_lose)
select top(100) 0, RANK() over(order by duel_exp desc), CT.character_id, CT.Name, CT.Class, BI.duel_exp, BI.total_win, BI.total_lose
from BattleInfo BI with (nolock)
inner join CharacterTable CT on CT.character_id = BI.character_id
where BI.duel_exp > 100
-- 승점 프란츠
insert into BattleRank (rank_type, grade, character_id, char_name, char_class, duel_exp, total_win, total_lose)
select top(100) 1, RANK() over(order by duel_exp desc), CT.character_id, CT.Name, CT.Class, BI.duel_exp, BI.total_win, BI.total_lose
from BattleInfo BI with (nolock)
inner join CharacterTable CT on CT.character_id = BI.character_id
where BI.duel_exp > 100 and CT.Class = 1 or CT.Class = 101 or CT.Class = 102
-- 승점 안젤라
insert into BattleRank (rank_type, grade, character_id, char_name, char_class, duel_exp, total_win, total_lose)
select top(100) 2, RANK() over(order by duel_exp desc), CT.character_id, CT.Name, CT.Class, BI.duel_exp, BI.total_win, BI.total_lose
from BattleInfo BI with (nolock)
inner join CharacterTable CT on CT.character_id = BI.character_id
where BI.duel_exp > 100 and CT.Class =2 or CT.Class = 201 or CT.Class = 202
-- 승점 튜드
insert into BattleRank (rank_type, grade, character_id, char_name, char_class, duel_exp, total_win, total_lose)
select top(100) 3, RANK() over(order by duel_exp desc), CT.character_id, CT.Name, CT.Class, BI.duel_exp, BI.total_win, BI.total_lose
from BattleInfo BI with (nolock)
inner join CharacterTable CT on CT.character_id = BI.character_id
where BI.duel_exp > 100 and CT.Class = 3 or CT.Class = 301 or CT.Class = 302
-- 승점 나타샤
insert into BattleRank (rank_type, grade, character_id, char_name, char_class, duel_exp, total_win, total_lose)
select top(100) 4, RANK() over(order by duel_exp desc), CT.character_id, CT.Name, CT.Class, BI.duel_exp, BI.total_win, BI.total_lose
from BattleInfo BI with (nolock)
inner join CharacterTable CT on CT.character_id = BI.character_id
where BI.duel_exp > 100 and CT.Class = 4 or CT.Class = 401 or CT.Class = 402
-- 승점 Ladder
insert into BattleRank (rank_type, grade, character_id, char_name, char_class, duel_exp, total_win, total_lose)
select top(100) 100, RANK() over(order by duel_ladder_exp desc), CT.character_id, CT.Name, CT.Class, BI.duel_ladder_exp, BI.ladder_win, BI.ladder_lose
from BattleInfo BI with (nolock)
inner join CharacterTable CT on CT.character_id = BI.character_id
where BI.duel_ladder_exp > 0 and BI.ladder_win + BI.ladder_lose > 0
delete from BattleRank where total_win + total_lose = 0
return 0
END

View file

@ -0,0 +1,195 @@
CREATE PROCEDURE [dbo].[skill_learn_base]
@char_id [uniqueidentifier],
@class int
as
begin
set nocount on
declare @skillid00 nvarchar(50),
@skillid01 nvarchar(50),
@skillid02 nvarchar(50),
@skillid03 nvarchar(50),
@skillid04 nvarchar(50),
@skillid05 nvarchar(50),
@skillid06 nvarchar(50),
@skillid07 nvarchar(50),
@skillid08 nvarchar(50);
set @skillid00 = convert( nvarchar(50), newid() );
set @skillid01 = convert( nvarchar(50), newid() );
set @skillid02 = convert( nvarchar(50), newid() );
set @skillid03 = convert( nvarchar(50), newid() );
set @skillid04 = convert( nvarchar(50), newid() );
set @skillid05 = convert( nvarchar(50), newid() );
set @skillid06 = convert( nvarchar(50), newid() );
set @skillid07 = convert( nvarchar(50), newid() );
set @skillid08 = convert( nvarchar(50), newid() );
declare @updatesql nvarchar(2500),
@char_char_id nvarchar(50);
set @char_char_id = convert( nvarchar(50), @char_id );
if @class = 1 or @class = 101 or @class = 102
begin
SET @updatesql = 'insert into [dbo].SkillTable values ( ''' + @skillid00 + ''',''' + @char_char_id + ''', 0, -1, 20001, 1, GetDate(), 1 )'
EXEC sp_executesql @updatesql
SET @updatesql = 'insert into [dbo].SkillTable values ( ''' + @skillid01 + ''',''' + @char_char_id + ''', 0, -1, 20051, 1, GetDate(), 1 )'
EXEC sp_executesql @updatesql
SET @updatesql = 'insert into [dbo].SkillTable values ( ''' + @skillid02 + ''',''' + @char_char_id + ''', 0, 0, 10001, 1, GetDate(), 1 )';
EXEC sp_executesql @updatesql
SET @updatesql = 'insert into [dbo].SkillTable values ( ''' + @skillid03 + ''',''' + @char_char_id + ''', 0, 1, 10002, 1, GetDate(), 1 )';
EXEC sp_executesql @updatesql
SET @updatesql = 'insert into [dbo].SkillTable values ( ''' + @skillid04 + ''',''' + @char_char_id + ''', 0, -1, 10051, 1, GetDate(), 1 )';
EXEC sp_executesql @updatesql
SET @updatesql = 'insert into [dbo].SkillTable values ( ''' + @skillid05 + ''',''' + @char_char_id + ''', 0, -1, 10052, 1, GetDate(), 1 )';
EXEC sp_executesql @updatesql
end
else if @class = 2 or @class = 201 or @class = 202
begin
SET @updatesql = 'insert into [dbo].SkillTable values ( ''' + @skillid00 + ''',''' + @char_char_id + ''', 0, -1, 20051, 1, GetDate(), 1 )';
EXEC sp_executesql @updatesql
SET @updatesql = 'insert into [dbo].SkillTable values ( ''' + @skillid01 + ''',''' + @char_char_id + ''', 0, -1, 60001, 1, GetDate(), 1 )';
EXEC sp_executesql @updatesql
SET @updatesql = 'insert into [dbo].SkillTable values ( ''' + @skillid02 + ''',''' + @char_char_id + ''', 0, 0, 10001, 1, GetDate(), 1 )';
EXEC sp_executesql @updatesql
SET @updatesql = 'insert into [dbo].SkillTable values ( ''' + @skillid03 + ''',''' + @char_char_id + ''', 0, 1, 10002, 1, GetDate(), 1 )';
EXEC sp_executesql @updatesql
SET @updatesql = 'insert into [dbo].SkillTable values ( ''' + @skillid04 + ''',''' + @char_char_id + ''', 0, -1, 10051, 1, GetDate(), 1 )';
EXEC sp_executesql @updatesql
SET @updatesql = 'insert into [dbo].SkillTable values ( ''' + @skillid05 + ''',''' + @char_char_id + ''', 0, -1, 10052, 1, GetDate(), 1 )';
EXEC sp_executesql @updatesql
end
else if @class = 3 or @class = 301 or @class = 302
begin
SET @updatesql = 'insert into [dbo].SkillTable values ( ''' + @skillid00 + ''',''' + @char_char_id + ''', 0, -1, 20001, 1, GetDate(), 1 )';
EXEC sp_executesql @updatesql
SET @updatesql = 'insert into [dbo].SkillTable values ( ''' + @skillid01 + ''',''' + @char_char_id + ''', 0, -1, 20002, 1, GetDate(), 1 )';
EXEC sp_executesql @updatesql
SET @updatesql = 'insert into [dbo].SkillTable values ( ''' + @skillid02 + ''',''' + @char_char_id + ''', 0, 0, 10001, 1, GetDate(), 1 )';
EXEC sp_executesql @updatesql
SET @updatesql = 'insert into [dbo].SkillTable values ( ''' + @skillid03 + ''',''' + @char_char_id + ''', 0, 1, 10002, 1, GetDate(), 1 )';
EXEC sp_executesql @updatesql
SET @updatesql = 'insert into [dbo].SkillTable values ( ''' + @skillid04 + ''',''' + @char_char_id + ''', 0, -1, 10051, 1, GetDate(), 1 )';
EXEC sp_executesql @updatesql
SET @updatesql = 'insert into [dbo].SkillTable values ( ''' + @skillid05 + ''',''' + @char_char_id + ''', 0, -1, 10052, 1, GetDate(), 1 )';
EXEC sp_executesql @updatesql
end
else if @class = 4 or @class = 401 or @class = 402
begin
SET @updatesql = 'insert into [dbo].SkillTable values ( ''' + @skillid00 + ''',''' + @char_char_id + ''', 0, -1, 40001, 1, GetDate(), 1 )';
EXEC sp_executesql @updatesql
SET @updatesql = 'insert into [dbo].SkillTable values ( ''' + @skillid01 + ''',''' + @char_char_id + ''', 0, -1, 50001, 1, GetDate(), 1 )';
EXEC sp_executesql @updatesql
SET @updatesql = 'insert into [dbo].SkillTable values ( ''' + @skillid02 + ''',''' + @char_char_id + ''', 0, 0, 10001, 1, GetDate(), 1 )';
EXEC sp_executesql @updatesql
SET @updatesql = 'insert into [dbo].SkillTable values ( ''' + @skillid03 + ''',''' + @char_char_id + ''', 0, 1, 10002, 1, GetDate(), 1 )';
EXEC sp_executesql @updatesql
SET @updatesql = 'insert into [dbo].SkillTable values ( ''' + @skillid04 + ''',''' + @char_char_id + ''', 0, -1, 10051, 1, GetDate(), 1 )';
EXEC sp_executesql @updatesql
SET @updatesql = 'insert into [dbo].SkillTable values ( ''' + @skillid05 + ''',''' + @char_char_id + ''', 0, -1, 10052, 1, GetDate(), 1 )';
EXEC sp_executesql @updatesql
end
insert into dbo.QuickSlotExTable
values
( @char_id, --0
0,
NULL, --1
0, --2
NULL, --3
0, --4
NULL, --5
0, --6
NULL, --7
0, --8
NULL, --9
0, --10
NULL, --11
0, --12
NULL, --13
0, --14
NULL, --15
2, --16
convert( [uniqueidentifier], @skillid00 ), --17
2, --18
convert( [uniqueidentifier], @skillid01 ), --19
0, --20
NULL, --21
0, --22
NULL, --23
0, --24
NULL, --25
0, --26
NULL, --1
0, --2
NULL, --3
0, --4
NULL, --5
0, --6
NULL, --7
0, --8
NULL, --9
0, --10
NULL, --11
0, --12
NULL, --13
0, --14
NULL, --15
0, --16
NULL, --17
0, --18
NULL, --19
0, --20
NULL, --21
0, --22
NULL, --23
0, --24
NULL, --25
0, --22
NULL, --23
0, --22
NULL, --23
0, --22
NULL, --23
0, --22
NULL, --23
0, --22
NULL, --23
0, --24
NULL
);
end

View file

@ -0,0 +1,213 @@
CREATE PROCEDURE [dbo].[up_ItemMove]
@character_id [uniqueidentifier],
@item_uid [uniqueidentifier],
@item_count int,
@inven_dest_type tinyint,
@inven_dest_page tinyint,
@inven_dest_slot tinyint,
@inven_src_type tinyint,
@inven_src_page tinyint,
@inven_src_slot tinyint
as
set nocount on
declare @char_id nvarchar(50)
declare @item_id nvarchar(50)
declare @TableName_Src nvarchar(50)
declare @TableName_Dest nvarchar(50)
declare @SQL nvarchar(500)
declare @src_item_count int
declare @get_item_code int
set @get_item_code = 0
set @char_id = CONVERT(NVARCHAR(50), @character_id)
set @item_id = CONVERT(NVARCHAR(50), @item_uid)
-- 1-인벤, 2-창고, 3-장착
if(@inven_src_type = 1)
Set @TableName_Src = 'N_InventoryItem'
else if(@inven_src_type = 2)
Set @TableName_Src = 'N_StorageItem'
else if(@inven_src_type = 3)
Set @TableName_Src = 'N_EquipItem'
else
return
if(@inven_dest_type = 1)
Set @TableName_Dest = 'N_InventoryItem'
else if(@inven_dest_type = 2)
Set @TableName_Dest = 'N_StorageItem'
else if(@inven_dest_type = 3)
Set @TableName_Dest = 'N_EquipItem'
else
return
begin tran
-- Dest에 아이템이 있는지 알아본다.
set @SQL = 'select '
+@get_item_code
+' = [code] as variable'
+'from '
+@TableName_Dest
+' with (READUNCOMMITTED) where [character_id] ='
+@char_id
+' and [page_index] = '
+@inven_dest_page
+' and [slot_index] = '
+@inven_dest_slot
exec(@SQL)
-- dest에 이미 아이템이 있으면 개수를 업데이트 해준다.
if(@get_item_code > 0)
begin
set @SQL = 'update'+ ' '
+@TableName_Dest
+'set [use_cnt] = '
+'[use_cnt]'+@item_count
+' where [character_id] ='
+@char_id
+' and [page_index] = '
+@inven_dest_page
+' and [slot_index] = '
+@inven_dest_slot
exec(@SQL)
end
-- dest에 아이템이 없으면 인서트 시켜준다.
else
begin
set @SQL = 'insert'+ ' '
+@TableName_Dest+ ' '
+'[item_uid], '
+'[character_id], '
+'[auth_id], '
+'[page_index], '
+'[slot_index], '
+'[code], '
+'[use_cnt], '
+'[remain_time], '
+'[create_time], '
+'[update_time], '
+'[gcode], '
+'[durability], '
+'[enhance_level], '
+'[option_1_code], '
+'[option_1_value], '
+'[option_2_code], '
+'[option_2_value], '
+'[option_3_code], '
+'[option_3_value], '
+'[wa_grade], '
+'[identity], '
+'[socket_count], '
+'[socket_1_code], '
+'[socket_1_value], '
+'[socket_2_code], '
+'[socket_2_value], '
+'[socket_3_code], '
+'[socket_3_value], '
+'[rank], '
+'[acquireroute], '
+'[physical], '
+'[magical], '
+'[durabilitymax], '
+'[weight]) '
+'select '
+'[item_uid], '
+'[character_id], '
+'[auth_id], '
+@inven_dest_page
+','
+@inven_dest_slot
+', '
+'[code],'
+@item_count
+', '
+'[remain_time], '
+'[create_time], '
+'[update_time], '
+'[gcode], '
+'[durability], '
+'[enhance_level], '
+'[option_1_code], '
+'[option_1_value], '
+'[option_2_code], '
+'[option_2_value], '
+'[option_3_code], '
+'[option_3_value], '
+'[wa_grade], '
+'[identity], '
+'[socket_count], '
+'[socket_1_code], '
+'[socket_1_value], '
+'[socket_2_code], '
+'[socket_2_value], '
+'[socket_3_code], '
+'[socket_3_value], '
+'[rank], '
+'[acquireroute], '
+'[physical], '
+'[magical], '
+'[durabilitymax], '
+'[weight]'
+'from '
+@TableName_Src
+' where [item_uid] ='
+ @item_id
exec(@SQL)
end
--
set @SQL = 'select'+ ' '
+@src_item_count+ ' = [use_cnt]'
+'from '
+@TableName_Src
+' with (READUNCOMMITTED) where [item_uid] ='
+@item_id
exec(@SQL)
-- 모두 옮겼으면 옮긴 아이템을 삭제한다.
if @src_item_count <= @item_count
begin
set @SQL = 'delete from'+ ' '
+@TableName_Src
+' where [item_uid] ='
+@item_id
exec(@SQL)
end
-- 특정 몇개만 옮겼으면 개수를 빼준다.
else if @src_item_count > @item_count
begin
set @SQL = 'update'+ ' '
+@TableName_Src
+'set [use_cnt] = '
+@src_item_count-@item_count
+' where [item_uid] ='
+@item_id
exec(@SQL)
end
declare @ERR int
SET @ERR = @@ERROR
IF @ERR <> 0 BEGIN
RAISERROR('처리오류', 16, 10)
IF @@TRANCOUNT <> 0 ROLLBACK
RETURN (@ERR)
END
COMMIT TRAN

View file

@ -0,0 +1,219 @@
CREATE PROCEDURE [dbo].[up_ItemMoveToMailItem]
@character_id [uniqueidentifier],
@auth_id [uniqueidentifier],
@item_id [uniqueidentifier],
@use_cnt int,
@NewMailID [uniqueidentifier],
@slot_index tinyint
as
set nocount on
declare @src_item_count int
declare @new_item_id [uniqueidentifier]
select @src_item_count = [use_cnt] from N_InventoryItem with (READUNCOMMITTED) where [item_uid] = @item_id
begin tran
if @src_item_count <= @use_cnt
begin
insert dbo.N_MailItem
([item_uid],
[character_id],
[auth_id],
[page_index],
[slot_index],
[code],
[use_cnt],
[remain_time],
[create_time],
[update_time],
[gcode],
[durability],
[enhance_level],
[option_1_code],
[option_1_value],
[option_2_code],
[option_2_value],
[option_3_code],
[option_3_value],
[option_group],
[ReconNum],
[ReconState],
[socket_count],
[socket_1_code],
[socket_1_value],
[socket_2_code],
[socket_2_value],
[socket_3_code],
[socket_3_value],
[expire_time],
[activity_value], --활성석 20100928 jojo
[link_id],
[socket_1_color],
[socket_2_color],
[socket_3_color],
[rank],
[acquireroute],
[physical],
[magical],
[durabilitymax],
[weight]
)
select
[item_uid],
@character_id,
@auth_id,
61,--[page_index],
@slot_index, --[slot_index],
[code],
[use_cnt],
[remain_time],
[create_time],
[update_time],
[gcode],
[durability],
[enhance_level],
[option_1_code],
[option_1_value],
[option_2_code],
[option_2_value],
[option_3_code],
[option_3_value],
[option_group],
[ReconNum],
[ReconState],
[socket_count],
[socket_1_code],
[socket_1_value],
[socket_2_code],
[socket_2_value],
[socket_3_code],
[socket_3_value],
[expire_time],
[activity_value], --활성석 20100928 jojo
[link_id],
[socket_1_color],
[socket_2_color],
[socket_3_color],
[rank],
[acquireroute],
[physical],
[magical],
[durabilitymax],
[weight]
from N_InventoryItem where [item_uid] = @item_id
--메일아이템을 메일과 연결
UPDATE [dbo].[N_MailItem] SET [mail_uid] = @NewMailID WHERE [item_uid] = @item_id
delete from N_InventoryItem where [item_uid] = @item_id --모두 옮겼으므로 삭제
end
else
begin
set @new_item_id = NEWID()
--일부만 옮기는 것은 새로 만들어 준다
insert dbo.N_MailItem
([item_uid],
[character_id],
[auth_id],
[page_index],
[slot_index],
[code],
[use_cnt],
[remain_time],
[create_time],
[update_time],
[gcode],
[durability],
[enhance_level],
[option_1_code],
[option_1_value],
[option_2_code],
[option_2_value],
[option_3_code],
[option_3_value],
[option_group],
[ReconNum],
[ReconState],
[socket_count],
[socket_1_code],
[socket_1_value],
[socket_2_code],
[socket_2_value],
[socket_3_code],
[socket_3_value],
[expire_time],
[socket_1_color],
[socket_2_color],
[socket_3_color],
[rank],
[acquireroute],
[physical],
[magical],
[durabilitymax],
[weight],
[link_id]
)
select
@new_item_id,
@character_id,
@auth_id,
61,--[page_index],
@slot_index, --[slot_index],
[code],
@use_cnt,
[remain_time],
GetDate(),
[update_time],
4, --[gcode], c_nGen_SendMail = 4;
[durability],
[enhance_level],
[option_1_code],
[option_1_value],
[option_2_code],
[option_2_value],
[option_3_code],
[option_3_value],
[option_group],
[ReconNum],
[ReconState],
[socket_count],
[socket_1_code],
[socket_1_value],
[socket_2_code],
[socket_2_value],
[socket_3_code],
[socket_3_value],
[expire_time],
[socket_1_color],
[socket_2_color],
[socket_3_color],
[rank],
[acquireroute],
[physical],
[magical],
[durabilitymax],
[weight],
'00000000-0000-0000-0000-000000000000'
from N_InventoryItem where [item_uid] = @item_id
--메일아이템을 메일과 연결
UPDATE [dbo].[N_MailItem] SET [mail_uid] = @NewMailID WHERE [item_uid] = @new_item_id
--기존 아이템에서 갯수를 줄인다
update [dbo].[N_InventoryItem] Set [use_cnt] = @src_item_count-@use_cnt where [item_uid] = @item_id
end
declare @ERR int
SET @ERR = @@ERROR
IF @ERR <> 0 BEGIN
RAISERROR('처리오류', 16, 10)
IF @@TRANCOUNT <> 0 ROLLBACK
RETURN (@ERR)
END
COMMIT TRAN

View file

@ -0,0 +1,8 @@
CREATE PROCEDURE [dbo].[up_LogDecrease]
as
set nocount on
DBCC SHRINKfile ([RustyHearts_Log], 10)

View file

@ -0,0 +1,42 @@
CREATE PROCEDURE [dbo].[up_add_ban]
(
@character_id [uniqueidentifier],
@ban_name nvarchar(16),
@ban_memo nvarchar(32)
)
as
set nocount on
declare @ban_id [uniqueidentifier];
declare @ban_class int;
SET @ban_id = NULL;
SELECT TOP 1 @ban_id = [character_id], @ban_class = [class] FROM CharacterTable WITH(NOLOCK) WHERE [Name] = @ban_name and Block_Type = 0;
IF( @ban_id IS NOT NULL )
BEGIN
IF not EXISTS ( SELECT TOP 1 character_id FROM FriendTableEx with (READUNCOMMITTED) WHERE character_id = @character_id and friend_id = @ban_id )
BEGIN
INSERT INTO FriendTableEx VALUES ( @character_id,
@ban_id,
@ban_name,
@ban_class,
1,
@ban_memo,
GetDate()
);
END
ELSE
BEGIN
UPDATE [FriendTableEx]
SET [IsCut] = 1
,[CutReason] = @ban_memo
WHERE character_id = @character_id and friend_id = @ban_id;
END
SELECT TOP 1 [character_id], [class], [level] FROM CharacterTable WITH(NOLOCK) WHERE [Name] = @ban_name;
END
ELSE
BEGIN
SELECT @ban_id, @ban_class, 0
END

View file

@ -0,0 +1,19 @@
CREATE PROCEDURE [dbo].[up_add_character_title]
@character_id [uniqueidentifier],
@new_id [uniqueidentifier],
@title_code int,
@remain_time int,
@expire_time int
AS
SET NOCOUNT ON
INSERT INTO CharacterTitle
VALUES(
@new_id,
@character_id,
@title_code,
@remain_time,
@expire_time
);
RETURN @@ERROR

View file

@ -0,0 +1,56 @@
CREATE PROCEDURE [dbo].[up_add_friend]
(
@character_id [uniqueidentifier],
@friend_name nvarchar(16)
)
as
set nocount on
declare @friend_id [uniqueidentifier];
declare @friend_class int
, @Block_Type tinyint
, @friend_level int;
set @friend_id = NULL
select TOP 1 @friend_id = [character_id]
, @friend_class = [class]
, @friend_level = [level]
, @Block_Type = Block_Type
from dbo.CharacterTable WITH(READUNCOMMITTED)
WHERE [Name] = @friend_name
IF( @friend_id IS NOT NULL AND @Block_Type = 0 )
BEGIN
if NOT EXISTS ( select TOP 1 character_id
from dbo.FriendTableEx WITH(READUNCOMMITTED)
where character_id = @character_id
and friend_id = @friend_id )
BEGIN
insert into dbo.FriendTableEx
values(
@character_id,
@friend_id,
@friend_name,
@friend_class,
0,
'',
GetDate()
);
IF EXISTS ( SELECT TOP 1 [character_id] FROM dbo.FriendTableEx WITH(READUNCOMMITTED) WHERE [Name] = @friend_name )
BEGIN
SELECT @friend_id [character_id], @friend_class [class], @friend_level [level]
RETURN;
END
END
END
SELECT @friend_id , @friend_class , @friend_level
RETURN;

View file

@ -0,0 +1,13 @@
CREATE PROCEDURE [dbo].[up_add_inquiry_count]
@auth_id uniqueidentifier
as
set nocount on
--declare @inquiry_count tinyint
--select @inquiry_count = [InquiryCount] from [RustyHeartsLinkAuth].[RustyHearts_Auth].[dbo].[AuthTable] with (READUNCOMMITTED) where [AuthID] = @auth_id
--UPDATE [RustyHeartsLinkAuth].[RustyHearts_Auth].[dbo].[AuthTable] SET [InquiryCount] = @inquiry_count + 1 WHERE [AuthID] = @auth_id
return @@error

View file

@ -0,0 +1,7 @@
CREATE PROCEDURE [dbo].[up_all_delete_quest]
@character_id [uniqueidentifier]
as
set nocount on
delete dbo.QuestTable where character_id = @character_id
return @@error

View file

@ -0,0 +1,150 @@
CREATE PROCEDURE [dbo].[up_auctionitemMoveToMailitem]
@item_id [uniqueidentifier],
@character_id [uniqueidentifier],
@auth_id [uniqueidentifier],
@page_index int,
@slot_index int,
@code int,
@use_cnt int,
@remain_time int,
@gcode int,
@durability int,
@enhance_level int,
@option_1_code int,
@option_1_value int,
@option_2_code int,
@option_2_value int,
@option_3_code int,
@option_3_value int,
@OptionGroup int,
@ReconNum int,
@ReconState int,
@Socket_count int,
@Socket_1_code int,
@Socket_1_value int,
@Socket_2_code int,
@Socket_2_value int,
@Socket_3_code int,
@Socket_3_value int,
@expire_time int,
@NewMailID [uniqueidentifier],
@activity_value int, --활성석 20100928 jojo
@socket_1_color tinyint,
@socket_2_color tinyint,
@socket_3_color tinyint,
@rank tinyint,
@acquireroute tinyint,
@physical int,
@magical int,
@durabilitymax int,
@weight int
as
set nocount on
set xact_abort on
begin tran
begin
insert dbo.N_MailItem
(
[item_uid],
[mail_uid],
[character_id],
[auth_id],
[page_index],
[slot_index],
[code],
[use_cnt],
[remain_time],
[create_time],
[update_time],
[gcode],
[durability],
[enhance_level],
[option_1_code],
[option_1_value],
[option_2_code],
[option_2_value],
[option_3_code],
[option_3_value],
[option_group],
[ReconNum],
[ReconState],
[socket_count],
[socket_1_code],
[socket_1_value],
[socket_2_code],
[socket_2_value],
[socket_3_code],
[socket_3_value],
[expire_time],
[activity_value], --활성석 20100928 jojo
[socket_1_color], -- 소켓
[socket_2_color],
[socket_3_color],
[rank],
[acquireroute],
[physical],
[magical],
[durabilitymax],
[weight],
[link_id]
)
values(
@item_id,
@NewMailID,
@character_id,
@auth_id,
61,
0,
@code,
@use_cnt,
@remain_time,
getdate(),
getdate(),
@gcode,
@durability,
@enhance_level,
@option_1_code,
@option_1_value,
@option_2_code,
@option_2_value,
@option_3_code,
@option_3_value,
@OptionGroup,
@ReconNum,
@ReconState,
@socket_count,
@socket_1_code,
@socket_1_value,
@socket_2_code,
@socket_2_value,
@socket_3_code,
@socket_3_value,
@expire_time,
@activity_value, --활성석 20100928 jojo
@socket_1_color,
@socket_2_color,
@socket_3_color,
@rank,
@acquireroute,
@physical,
@magical,
@durabilitymax,
@weight,
'00000000-0000-0000-0000-000000000000'
)
--메일아이템을 메일과 연결
UPDATE [dbo].[N_MailItem] SET [mail_uid] = @NewMailID WHERE [item_uid] = @item_id
delete from N_InventoryItem where [item_uid] = @item_id --모두 옮겼으므로 삭제
end
declare @ERR int
SET @ERR = @@ERROR
IF @ERR <> 0 BEGIN
RAISERROR('처리오류', 16, 10)
IF @@TRANCOUNT <> 0 ROLLBACK
RETURN (@ERR)
END
COMMIT TRAN

View file

@ -0,0 +1,138 @@
CREATE PROCEDURE [dbo].[up_char_sanction]
@kind tinyint, -- 1 : sanction, 2:release
@sanction_uid uniqueidentifier,
@personnel nvarchar(50),
@releaser nvarchar(50),
@comment nvarchar(128),
@character_id uniqueidentifier,
@sanction_type tinyint,
@sanction_count tinyint,
@sanction_period_type tinyint
as
set nocount on
begin tran
declare @get_uid uniqueidentifier,
@period int,
@cur_time datetime,
@end_time datetime,
@new_uid uniqueidentifier,
@is_insert tinyint
set @get_uid = '00000000-0000-0000-0000-000000000000'
if @sanction_period_type = 1 set @period = 3
if @sanction_period_type = 2 set @period = 7
if @sanction_period_type = 3 set @period = 10
if @sanction_period_type = 4 set @period = 15
if @sanction_period_type = 5 set @period = -1
-- select @get_uid=uid from Character_Sanction where
-- character_id = @character_id and sanction_count=@sanction_count
set @cur_time = getdate()
if @sanction_type <> 5
begin
set @end_time = dateadd(day, @period, @cur_time)
end
else
begin
set @end_time = NULL
end
set @new_uid = '00000000-0000-0000-0000-000000000000'
set @is_insert = 0
if @kind = 1
begin
if @get_uid <> '00000000-0000-0000-0000-000000000000'
begin
set @new_uid = @get_uid
set @is_insert = 1
update Character_Sanction set
sanction_type = @sanction_type,
sanction_count = @sanction_count,
sanction_period_type = @sanction_period_type,
period = @period,
start_time = @cur_time,
end_time = @end_time,
personnel = @personnel,
releaser = '', -- Rlease init
comment = '',
is_apply = 1,
reg_date = @cur_time
where uid = @get_uid
end
else
begin
set @new_uid = NEWID()
set @is_insert = 1
insert into Character_Sanction(
uid,
sanction_type,
sanction_count,
sanction_period_type,
period,
character_id,
start_time,
end_time,
personnel,
releaser,
comment,
is_apply,
reg_date)
values(
@new_uid,
@sanction_type,
@sanction_count,
@sanction_period_type,
@period,
@character_id,
@cur_time,
@end_time,
@personnel,
'', -- Rlease init
'',
1,
@cur_time)
end
end
else
begin
set @new_uid = @sanction_uid
set @is_insert = 0
select @new_uid = uid from Character_Sanction with (READUNCOMMITTED) where
character_id = @character_id and is_apply = 1
update Character_Sanction set
releaser = @releaser,
comment = @comment,
is_apply = 0
where character_id = @character_id
-- where uid = @sanction_uid
end
if EXISTS (select uid from Character_Sanction with (READUNCOMMITTED) where
character_id = @character_id and is_apply = 1)
begin
update CharacterTable set Block_YN = 'Y' where character_id=@character_id
end
else
begin
update CharacterTable set Block_YN = 'N' where character_id=@character_id
end
declare @ERR int
SET @ERR = @@ERROR
IF @ERR <> 0 BEGIN
RAISERROR('처리오류', 16, 10)
IF @@TRANCOUNT <> 0 ROLLBACK
RETURN (@ERR)
END
COMMIT TRAN
select NEW_ID = @new_uid, IS_INSERT = @is_insert

View file

@ -0,0 +1,22 @@
CREATE PROCEDURE [dbo].[up_character_rob]
@bcust_id nvarchar(50),
@auth_id [uniqueidentifier],
@name nvarchar(16)
as begin
set nocount on
declare @char_id uniqueidentifier
--declare @WindyCode nvarchar(50)
select @char_id = character_id from CharacterTable with (READUNCOMMITTED) where [name] = @name
--select @WindyCode = WindyCode from [RustyHeartsLinkAuth].[RustyHearts_Auth].[dbo].[AuthTable] with (READUNCOMMITTED) where AuthID = @auth_id
-- 사용할수 있는 이름인지 체크.
UPDATE [dbo].[CharacterTable]
SET
[bcust_id] = @bcust_id --@WindyCode
,[AuthID] = @auth_id
WHERE character_id = @char_id
end

View file

@ -0,0 +1,135 @@
CREATE PROCEDURE [dbo].[up_create_account_storage_item]
@auth_id [uniqueidentifier],
@page_index int,
@slot_index int,
@item_id [uniqueidentifier],
@code int,
@use_cnt int,
@remain_time int,
@gcode int,
@durability int,
@enhance_level int,
@option_1_code int,
@option_1_value int,
@option_2_code int,
@option_2_value int,
@option_3_code int,
@option_3_value int,
@OptionGroup int,
@ReconNum int,
@ReconState int,
@Socket_count int,
@Socket_1_code int,
@Socket_1_value int,
@Socket_2_code int,
@Socket_2_value int,
@Socket_3_code int,
@Socket_3_value int,
--시간제 관련 추가 20102519 jojo
@expire_time int,
@activity_value int, --활성석 20100928 jojo
@socket_1_color tinyint,
@socket_2_color tinyint,
@socket_3_color tinyint,
@rank tinyint,
@acquireroute tinyint,
@physical int,
@magical int,
@durabilitymax int,
@weight int
as
set nocount on
begin
begin tran
INSERT tbl_account_storage( item_uid
,auth_id
,page_index
,slot_index
,code
,use_cnt
,remain_time
,create_time
,update_time
,gcode
,durability
,enhance_level
,option_1_code
,option_1_value
,option_2_code
,option_2_value
,option_3_code
,option_3_value
,option_group
,ReconNum
,ReconState
,socket_count
,socket_1_code
,socket_1_value
,socket_2_code
,socket_2_value
,socket_3_code
,socket_3_value
,expire_time
,activity_value --활성석 20100928 jojo
,socket_1_color
,socket_2_color
,socket_3_color
,rank
,acquireroute
,physical
,magical
,durabilitymax
,weight
) VALUES( @item_id
,@auth_id
,@page_index
,@slot_index
,@code
,@use_cnt
,@remain_time
,GetDate()
,GetDate()
,@gcode
,@durability
,@enhance_level
,@option_1_code
,@option_1_value
,@option_2_code
,@option_2_value
,@option_3_code
,@option_3_value
,@OptionGroup
,@ReconNum
,@ReconState
,@Socket_count
,@Socket_1_code
,@Socket_1_value
,@Socket_2_code
,@Socket_2_value
,@Socket_3_code
,@Socket_3_value
,@expire_time
,@activity_value --활성석 20100928 jojo
,@socket_1_color
,@socket_2_color
,@socket_3_color
,@rank
,@acquireroute
,@physical
,@magical
,@durabilitymax
,@weight
)
if(@@error <> 0)
begin
rollback
return
end
delete from N_InventoryItem where [item_uid] = @item_id --모두 옮겼으므로 삭제
commit
end

View file

@ -0,0 +1,25 @@
CREATE PROCEDURE [dbo].[up_create_booth]
@character_id [uniqueidentifier]
as
set nocount on
insert into dbo.ItemBoothTable
values
( @character_id, --0
4,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
);
return @@error

View file

@ -0,0 +1,118 @@
CREATE PROCEDURE [dbo].[up_create_character]
@bcust_id nvarchar(50),
@auth_id [uniqueidentifier],
@char_id [uniqueidentifier],
@name nvarchar(16),
@class int,
@server smallint,
@lobby_id int
as
begin
declare @get_AuthID [uniqueidentifier]
--declare @bcust_id nvarchar(50)
set @get_AuthID = NULL
set nocount on
--select @bcust_id = WindyCode from [RustyHeartsLinkAuth].[RustyHearts_Auth].[dbo].[AuthTable] with (READUNCOMMITTED) where AuthID = @auth_id;
BEGIN TRAN
declare @out_first_char int;
SET @out_first_char = 0;
select @get_AuthID = AuthID from KeyMapTable with (READUNCOMMITTED) where AuthID = @auth_id;
if( @get_AuthID IS NULL )
begin
SET @out_first_char = 255;
insert into KeyMapTable
values( @auth_id, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 );
end
-- 사용할수 있는 이름인지 체크.
if EXISTS (select character_id from CharacterTable with (READUNCOMMITTED) WHERE [Name] = @name)
begin
SET @out_first_char = -1;
select FIRST_CHARACTER = @out_first_char;
ROLLBACK TRAN
return;
end
insert into CharacterTable
values( @char_id, --character_id
@bcust_id,
@auth_id, --AuthID
@server, --server
@name, --Name
@class, --Class
0, --Job
1, --Level
0, --Experience
0, --Stamina
0, --SP
0, --Total_SP
1000, --Fatigue
@lobby_id, --LobbyID 엘마에서->상가로 변경
1, --StartPoint
0, --gold
4000000, --individual_roomID
NULL, --GuildID
GETDATE(), --CreateTime
GETDATE(), --LastLogin
10, --Coin
1, --first_login
1, --tutotial
0, --give_up
0, --Block_Type
'N', --Block_YN
'N', --IsConnect
0, --storage_gold
12, --storage_count
'Y', --IsTradeEnable
0, --Expire_Time
0, --event_fatigue
0, --event_hearts
0, --dice_point
0, --Addition_HP
0, --Addition_MP
0, --Addition_Physic_Attack
0, --Addition_Physic_Defense
0, --Addition_Magic_Attack
0, --Addition_Magic_Defense
0, --Permission
0, --FatigueStorage
0, --DayAttachGold
0, --DayAttachItem
0, --ReservedGuildPoint jojo
0, --event_fortune
1, --fortune
'N', --IsMoveEnable
0, --event_mailattach
0, --tutorial_step
0, --daypartymission
0, --event_daypartymission
0); --time_sp
exec [skill_learn_base] @char_id, @class
-- pvp 테이블 생성
insert into dbo.BattleInfo (character_id, char_class, duel_ladder_exp) values( @char_id, @class, 1000 );
select FIRST_CHARACTER = @out_first_char, * from CharacterTable with (READUNCOMMITTED) where character_id = @char_id;
declare @ERR int
SET @ERR = @@ERROR
IF @ERR <> 0 BEGIN
RAISERROR('처리오류', 16, 10)
IF @@TRANCOUNT <> 0
BEGIN
ROLLBACK TRAN
END
RETURN
END
COMMIT TRAN
end

View file

@ -0,0 +1,117 @@
CREATE PROCEDURE [dbo].[up_create_guild]
@guild_name nvarchar(20),
@character_id [uniqueidentifier],
@guild_id [uniqueidentifier],
@master_name nvarchar(16),
@cost_money int,
@server smallint,
@max_member int,
@group_id smallint
AS
BEGIN
SET NOCOUNT ON;
SET XACT_ABORT ON;
DECLARE @my_money int,
@error_code int,
@Class int,
@Level int,
@check_guild_id uniqueidentifier,
@check_character_id uniqueidentifier,
@check_member_id uniqueidentifier
SET @check_guild_id = NULL;
SET @check_character_id = NULL;
SET @check_member_id = NULL;
BEGIN TRY
BEGIN TRAN;
SET @error_code = 1;
SELECT @check_character_id = [character_id], @Class = [Class], @Level = [level], @my_money = [gold] FROM [dbo].[CharacterTable] WITH (READUNCOMMITTED) WHERE [character_id] = @character_id;
SELECT @check_guild_id = [guild_id] FROM GuildTable WITH (READUNCOMMITTED) WHERE [name] = @guild_name;
SELECT @check_member_id = [character_id] FROM GuildMemberTable WITH (READUNCOMMITTED) WHERE [character_id] = @character_id;
IF (@check_character_id IS NOT NULL) AND (@check_guild_id IS NULL) AND (@check_member_id IS NULL)
BEGIN
-- 돈 삭제 및 길드 설정
IF (@my_money - @cost_money) > 0
BEGIN
UPDATE [dbo].[CharacterTable] SET [gold] = (@my_money - @cost_money), [GuildID]=@guild_id WHERE [character_id] = @character_id
END
ELSE
BEGIN
UPDATE [dbo].[CharacterTable] SET [gold] = 0, [GuildID]=@guild_id WHERE [character_id] = @character_id
END
-- INSERT 길드 정보
INSERT INTO GuildTable
VALUES
( @guild_id, --0
@server,
@guild_name, --1
@character_id, --2 Master
0, --3 Exp
10000, --4 Point
4000100, --5 room_id
@max_member, --6 Max Member
'', --7 notice
'url', --8 icon
0, -- block_type
8191, -- permission01
2028, -- permission02
1920, -- permission03
1920, -- permission04
1920, -- permission05
1920, -- permission06
1920, -- permission07
0, -- permission08
1, -- level
@group_id,
0
);
-- INSERT 길드 멤버 정보
INSERT INTO GuildMemberTable
VALUES
( @guild_id,
@character_id,
@master_name,
'',
0,
@Class,
@Level,
GetDate()
);
--길드 창고 정보 추가
-- INSERT INTO tbl_Guild_Storage_Info VALUES (@guild_id, 1, 0, 0, 1)
SELECT ERROR_CODE = @error_code, * FROM GuildTable WITH (READUNCOMMITTED) WHERE guild_id = @guild_id
END
ELSE
BEGIN
SET @error_code = -1
SELECT ERROR_CODE = @error_code;
END
COMMIT TRAN;
END TRY
BEGIN CATCH
ROLLBACK TRAN;
SET @error_code = -1
SELECT ERROR_CODE = @error_code;
END CATCH
END

View file

@ -0,0 +1,39 @@
CREATE PROCEDURE [dbo].[up_create_guild_storage]
(
@guild_id [uniqueidentifier]
,@character_id [uniqueidentifier]
,@slot_count INT
,@cost_money INT
)
AS
SET NOCOUNT ON
declare @my_money int
IF NOT EXISTS (SELECT guild_id FROM tbl_Guild_Storage_Info with (READUNCOMMITTED) WHERE guild_id = @guild_id)
BEGIN
-- 비용 제거해야함
SELECT @my_money = [gold] FROM [dbo].[CharacterTable] with (READUNCOMMITTED) where [character_id] = @character_id
-- 돈 삭제 및 길드 설정
if (@my_money - @cost_money) > 0
begin
UPDATE [dbo].[CharacterTable] SET [gold] = (@my_money - @cost_money) WHERE [character_id] = @character_id
end
else
begin
UPDATE [dbo].[CharacterTable] SET [gold] = 0 WHERE [character_id] = @character_id
end
--길드 창과 관련 수정 jojo
UPDATE [dbo].[GuildTable] SET [Storage] = 1 WHERE [guild_id] = @guild_id
INSERT INTO tbl_Guild_Storage_Info VALUES( @guild_id --길드 아이디
,1 --페이지 수
,@slot_count --슬롯 수
,0 --돈
,1) --레벨
END
RETURN

View file

@ -0,0 +1,413 @@
CREATE PROCEDURE [dbo].[up_create_item]
@character_id [uniqueidentifier],
@auth_id [uniqueidentifier],
@page_index int,
@slot_index int,
--@code int,
--@use_cnt int,
@item_id [uniqueidentifier],
@code int,
@use_cnt int,
@remain_time int,
@gcode int,
@durability int,
@enhance_level int,
@option_1_code int,
@option_1_value int,
@option_2_code int,
@option_2_value int,
@option_3_code int,
@option_3_value int,
@OptionGroup int,
@ReconNum int,
@ReconState int,
@Socket_count int,
@Socket_1_code int,
@Socket_1_value int,
@Socket_2_code int,
@Socket_2_value int,
@Socket_3_code int,
@Socket_3_value int,
@expire_time int,
@activity_value int,
--@link_id1 int,--2022
@link_id [uniqueidentifier],
@socket_1_color tinyint,
@socket_2_color tinyint,
@socket_3_color tinyint,
@deferment_time int,
@rank tinyint,
@acquireroute tinyint,
@physical int,
@magical int,
@durabilitymax int,
--@link_id [uniqueidentifier],
--@ttt nvarchar(50),--[uniqueidentifier],--2022
@weight int
as
set nocount on
set xact_abort on
if(@page_index = 0) --??
begin
begin tran
insert N_EquipItem(
item_uid ,
character_id ,
auth_id ,
page_index ,
slot_index ,
code ,
use_cnt ,
remain_time ,
create_time ,
update_time ,
gcode ,
durability ,
enhance_level ,
option_1_code ,
option_1_value,
option_2_code ,
option_2_value,
option_3_code ,
option_3_value,
option_group ,
ReconNum ,
ReconState ,
socket_count ,
socket_1_code ,
socket_1_value,
socket_2_code ,
socket_2_value,
socket_3_code ,
socket_3_value,
expire_time,
activity_value, --??? 20100928 jojo
link_id,
socket_1_color, -- ??
socket_2_color,
socket_3_color,
deferment_time,
rank,
acquireroute,
physical ,
magical ,
durabilitymax,
weight
)
values(
@item_id ,
@character_id ,
@auth_id ,
@page_index ,
@slot_index ,
@code ,
@use_cnt ,
@remain_time ,
GetDate() ,
GetDate() ,
@gcode ,
@durability ,
@enhance_level ,
@option_1_code ,
@option_1_value,
@option_2_code ,
@option_2_value,
@option_3_code ,
@option_3_value,
@OptionGroup ,
@ReconNum ,
@ReconState ,
@Socket_count ,
@Socket_1_code ,
@Socket_1_value,
@Socket_2_code ,
@Socket_2_value,
@Socket_3_code ,
@Socket_3_value,
@expire_time,
@activity_value, --??? 20100928 jojo
@link_id,
@socket_1_color, -- ??
@socket_2_color,
@socket_3_color,
@deferment_time,
@rank,
@acquireroute,
@physical ,
@magical ,
@durabilitymax ,
@weight
)
if(@@error <> 0)
begin
rollback
return
end
commit
select * from N_EquipItem where item_uid = @item_id
end
else if(@page_index = 21) --??
begin
begin tran
insert N_InventoryItem(
item_uid ,
character_id ,
auth_id ,
page_index ,
slot_index ,
code ,
use_cnt ,
remain_time ,
create_time ,
update_time ,
gcode ,
durability ,
enhance_level ,
option_1_code ,
option_1_value,
option_2_code ,
option_2_value,
option_3_code ,
option_3_value,
option_group ,
ReconNum ,
ReconState ,
socket_count ,
socket_1_code ,
socket_1_value,
socket_2_code ,
socket_2_value,
socket_3_code ,
socket_3_value,
expire_time,
activity_value, --??? 20100928 jojo
link_id,
socket_1_color, -- ??
socket_2_color,
socket_3_color,
deferment_time,
rank,
acquireroute,
physical ,
magical ,
durabilitymax,
weight
)
values(
@item_id ,
@character_id ,
@auth_id ,
@page_index ,
@slot_index ,
@code ,
@use_cnt ,
@remain_time ,
GetDate() ,
GetDate() ,
@gcode ,
@durability ,
@enhance_level ,
@option_1_code ,
@option_1_value,
@option_2_code ,
@option_2_value,
@option_3_code ,
@option_3_value,
@OptionGroup ,
@ReconNum ,
@ReconState ,
@Socket_count ,
@Socket_1_code ,
@Socket_1_value,
@Socket_2_code ,
@Socket_2_value,
@Socket_3_code ,
@Socket_3_value,
@expire_time,
@activity_value, --??? 20100928 jojo
@link_id,
@socket_1_color, -- ??
@socket_2_color,
@socket_3_color,
@deferment_time,
@rank,
@acquireroute,
@physical ,
@magical ,
@durabilitymax ,
@weight
)
if(@@error <> 0)
begin
rollback
return
end
commit
select * from N_StorageItem where item_uid = @item_id
end
else if(@page_index = 61) --??
begin
declare @gg int
---- begin tran
----
---- insert into N_MailItem
---- values(
-- @item_id ,
-- @character_id ,
-- @auth_id ,
-- @page_index ,
-- @slot_index ,
-- @code ,
-- @use_cnt ,
-- @remain_time ,
-- GetDate() ,
-- GetDate() ,
-- @gcode ,
-- @durability ,
-- @enhance_level ,
-- @option_1_code ,
-- @option_1_value,
-- @option_2_code ,
-- @option_2_value,
-- @option_3_code ,
-- @option_3_value,
-- @OptionGroup ,
-- @ReconNum ,
-- @ReconState ,
-- @Socket_count ,
-- @Socket_1_code ,
-- @Socket_1_value,
-- @Socket_2_code ,
-- @Socket_2_value,
-- @Socket_3_code ,
-- @Socket_3_value
---- )
----
---- if(@@error <> 0)
---- begin
---- rollback
---- return
---- end
--select * from N_MailItem where item_uid = @item_id
end
else --?? ????
begin
begin tran
insert N_InventoryItem(
item_uid ,
character_id ,
auth_id ,
page_index ,
slot_index ,
code ,
use_cnt ,
remain_time ,
create_time ,
update_time ,
gcode ,
durability ,
enhance_level ,
option_1_code ,
option_1_value,
option_2_code ,
option_2_value,
option_3_code ,
option_3_value,
option_group ,
ReconNum ,
ReconState ,
socket_count ,
socket_1_code ,
socket_1_value,
socket_2_code ,
socket_2_value,
socket_3_code ,
socket_3_value,
expire_time,
activity_value, --??? 20100928 jojo
link_id,
socket_1_color, -- ??
socket_2_color,
socket_3_color,
deferment_time,
rank,
acquireroute,
physical ,
magical ,
durabilitymax ,
weight
)
values(
@item_id ,
@character_id ,
@auth_id ,
@page_index ,
@slot_index ,
@code ,
@use_cnt ,
@remain_time ,
GetDate() ,
GetDate() ,
@gcode ,
@durability ,
@enhance_level ,
@option_1_code ,
@option_1_value,
@option_2_code ,
@option_2_value,
@option_3_code ,
@option_3_value,
@OptionGroup ,
@ReconNum ,
@ReconState ,
@Socket_count ,
@Socket_1_code ,
@Socket_1_value,
@Socket_2_code ,
@Socket_2_value,
@Socket_3_code ,
@Socket_3_value,
@expire_time,
@activity_value, --??? 20100928 jojo
@link_id,
@socket_1_color, -- ??
@socket_2_color,
@socket_3_color,
@deferment_time,
@rank,
@acquireroute,
@physical ,
@magical ,
@durabilitymax ,
@weight
)
if(@@error <> 0)
begin
rollback
return
end
commit
select * from N_InventoryItem where item_uid = @item_id
end

View file

@ -0,0 +1,409 @@
CREATE PROCEDURE [dbo].[up_create_item_chn]
@character_id [uniqueidentifier],
@auth_id [uniqueidentifier],
@page_index int,
@slot_index int,
@code int,
@use_cnt int,
@item_id [uniqueidentifier],
@remain_time int,
@gcode int,
@durability int,
@enhance_level int,
@option_1_code int,
@option_1_value int,
@option_2_code int,
@option_2_value int,
@option_3_code int,
@option_3_value int,
@OptionGroup int,
@ReconNum int,
@ReconState int,
@Socket_count int,
@Socket_1_code int,
@Socket_1_value int,
@Socket_2_code int,
@Socket_2_value int,
@Socket_3_code int,
@Socket_3_value int,
@expire_time int,
@activity_value int,
@link_id1 int,--2022
@socket_1_color tinyint,
@socket_2_color tinyint,
@socket_3_color tinyint,
@deferment_time int,
@rank tinyint,
@acquireroute tinyint,
@physical int,
@magical int,
@durabilitymax int,
@link_id [uniqueidentifier],
@ttt nvarchar(50),--[uniqueidentifier],--2022
@weight int
as
set nocount on
set xact_abort on
if(@page_index = 0) --??
begin
begin tran
insert N_EquipItem(
item_uid ,
character_id ,
auth_id ,
page_index ,
slot_index ,
code ,
use_cnt ,
remain_time ,
create_time ,
update_time ,
gcode ,
durability ,
enhance_level ,
option_1_code ,
option_1_value,
option_2_code ,
option_2_value,
option_3_code ,
option_3_value,
option_group ,
ReconNum ,
ReconState ,
socket_count ,
socket_1_code ,
socket_1_value,
socket_2_code ,
socket_2_value,
socket_3_code ,
socket_3_value,
expire_time,
activity_value, --??? 20100928 jojo
link_id,
socket_1_color, -- ??
socket_2_color,
socket_3_color,
deferment_time,
rank,
acquireroute,
physical ,
magical ,
durabilitymax,
weight
)
values(
@item_id ,
@character_id ,
@auth_id ,
@page_index ,
@slot_index ,
@code ,
@use_cnt ,
@remain_time ,
GetDate() ,
GetDate() ,
@gcode ,
@durability ,
@enhance_level ,
@option_1_code ,
@option_1_value,
@option_2_code ,
@option_2_value,
@option_3_code ,
@option_3_value,
@OptionGroup ,
@ReconNum ,
@ReconState ,
@Socket_count ,
@Socket_1_code ,
@Socket_1_value,
@Socket_2_code ,
@Socket_2_value,
@Socket_3_code ,
@Socket_3_value,
@expire_time,
@activity_value, --??? 20100928 jojo
@link_id,
@socket_1_color, -- ??
@socket_2_color,
@socket_3_color,
@deferment_time,
@rank,
@acquireroute,
@physical ,
@magical ,
@durabilitymax ,
@weight
)
if(@@error <> 0)
begin
rollback
return
end
commit
select * from N_EquipItem where item_uid = @item_id
end
else if(@page_index = 21) --??
begin
begin tran
insert N_InventoryItem(
item_uid ,
character_id ,
auth_id ,
page_index ,
slot_index ,
code ,
use_cnt ,
remain_time ,
create_time ,
update_time ,
gcode ,
durability ,
enhance_level ,
option_1_code ,
option_1_value,
option_2_code ,
option_2_value,
option_3_code ,
option_3_value,
option_group ,
ReconNum ,
ReconState ,
socket_count ,
socket_1_code ,
socket_1_value,
socket_2_code ,
socket_2_value,
socket_3_code ,
socket_3_value,
expire_time,
activity_value, --??? 20100928 jojo
link_id,
socket_1_color, -- ??
socket_2_color,
socket_3_color,
deferment_time,
rank,
acquireroute,
physical ,
magical ,
durabilitymax,
weight
)
values(
@item_id ,
@character_id ,
@auth_id ,
@page_index ,
@slot_index ,
@code ,
@use_cnt ,
@remain_time ,
GetDate() ,
GetDate() ,
@gcode ,
@durability ,
@enhance_level ,
@option_1_code ,
@option_1_value,
@option_2_code ,
@option_2_value,
@option_3_code ,
@option_3_value,
@OptionGroup ,
@ReconNum ,
@ReconState ,
@Socket_count ,
@Socket_1_code ,
@Socket_1_value,
@Socket_2_code ,
@Socket_2_value,
@Socket_3_code ,
@Socket_3_value,
@expire_time,
@activity_value, --??? 20100928 jojo
@link_id,
@socket_1_color, -- ??
@socket_2_color,
@socket_3_color,
@deferment_time,
@rank,
@acquireroute,
@physical ,
@magical ,
@durabilitymax ,
@weight
)
if(@@error <> 0)
begin
rollback
return
end
commit
select * from N_StorageItem where item_uid = @item_id
end
else if(@page_index = 61) --??
begin
declare @gg int
---- begin tran
----
---- insert into N_MailItem
---- values(
-- @item_id ,
-- @character_id ,
-- @auth_id ,
-- @page_index ,
-- @slot_index ,
-- @code ,
-- @use_cnt ,
-- @remain_time ,
-- GetDate() ,
-- GetDate() ,
-- @gcode ,
-- @durability ,
-- @enhance_level ,
-- @option_1_code ,
-- @option_1_value,
-- @option_2_code ,
-- @option_2_value,
-- @option_3_code ,
-- @option_3_value,
-- @OptionGroup ,
-- @ReconNum ,
-- @ReconState ,
-- @Socket_count ,
-- @Socket_1_code ,
-- @Socket_1_value,
-- @Socket_2_code ,
-- @Socket_2_value,
-- @Socket_3_code ,
-- @Socket_3_value
---- )
----
---- if(@@error <> 0)
---- begin
---- rollback
---- return
---- end
--select * from N_MailItem where item_uid = @item_id
end
else --?? ????
begin
begin tran
insert N_InventoryItem(
item_uid ,
character_id ,
auth_id ,
page_index ,
slot_index ,
code ,
use_cnt ,
remain_time ,
create_time ,
update_time ,
gcode ,
durability ,
enhance_level ,
option_1_code ,
option_1_value,
option_2_code ,
option_2_value,
option_3_code ,
option_3_value,
option_group ,
ReconNum ,
ReconState ,
socket_count ,
socket_1_code ,
socket_1_value,
socket_2_code ,
socket_2_value,
socket_3_code ,
socket_3_value,
expire_time,
activity_value, --??? 20100928 jojo
link_id,
socket_1_color, -- ??
socket_2_color,
socket_3_color,
deferment_time,
rank,
acquireroute,
physical ,
magical ,
durabilitymax ,
weight
)
values(
@item_id ,
@character_id ,
@auth_id ,
@page_index ,
@slot_index ,
@code ,
@use_cnt ,
@remain_time ,
GetDate() ,
GetDate() ,
@gcode ,
@durability ,
@enhance_level ,
@option_1_code ,
@option_1_value,
@option_2_code ,
@option_2_value,
@option_3_code ,
@option_3_value,
@OptionGroup ,
@ReconNum ,
@ReconState ,
@Socket_count ,
@Socket_1_code ,
@Socket_1_value,
@Socket_2_code ,
@Socket_2_value,
@Socket_3_code ,
@Socket_3_value,
@expire_time,
@activity_value, --??? 20100928 jojo
@link_id,
@socket_1_color, -- ??
@socket_2_color,
@socket_3_color,
@deferment_time,
@rank,
@acquireroute,
@physical ,
@magical ,
@durabilitymax ,
@weight
)
if(@@error <> 0)
begin
rollback
return
end
commit
select * from N_InventoryItem where item_uid = @item_id
end

View file

@ -0,0 +1,119 @@
CREATE PROCEDURE [dbo].[up_create_item_sales]
@character_id [uniqueidentifier],
@auth_id [uniqueidentifier],
@page_index int,
@slot_index int,
@code int
as
set nocount on
set xact_abort on
begin
begin tran
insert N_InventoryItem(
item_uid ,
character_id ,
auth_id ,
page_index ,
slot_index ,
code ,
use_cnt ,
remain_time ,
create_time ,
update_time ,
gcode ,
durability ,
enhance_level ,
option_1_code ,
option_1_value,
option_2_code ,
option_2_value,
option_3_code ,
option_3_value,
option_group ,
ReconNum ,
ReconState ,
socket_count ,
socket_1_code ,
socket_1_value,
socket_2_code ,
socket_2_value,
socket_3_code ,
socket_3_value,
expire_time ,
lock_pwd ,
activity_value,
link_id ,
is_seizure ,
socket_1_color,
socket_2_color,
socket_3_color,
deferment_time,
rank,
acquireroute,
physical,
magical,
durabilitymax,
weight
)
values(
NEWID() , --item_uid
@character_id , --character_id
@auth_id , --auth_id
@page_index , --page_index
@slot_index , --slot_index
@code , --code
1 , --use_cnt
0 , --remain_time
GetDate() , --create_time
GetDate() , --update_time
8989 , --gcode
5000 , --durability
0 , --enhance_level
0 , --option_1_code
0, --option_1_value
0, --option_2_code
0, --option_2_value
0, --option_3_code
0, --option_3_value
0, --option_group
0, --ReconNum
0, --ReconState
0, --socket_count
0, --socket_1_code
0, --socket_1_value
0, --socket_2_code
0, --socket_2_value
0, --socket_3_code
0, --socket_3_value
0, --expire_time
'', --lock_pwd
0, --activity_value
NULL, --link_id
0, --is_seizure
0, --socket_1_color
0, --socket_2_color
0, --socket_3_color
0, --deferment_time
1, --rank
0,
0,
0,
0,
0
)
if(@@error <> 0)
begin
rollback
return
end
commit
--select * from N_InventoryItem where item_uid = @item_id
end

View file

@ -0,0 +1,47 @@
CREATE PROCEDURE [dbo].[up_create_item_sales_set_angela]
@character_id [uniqueidentifier],
@auth_id [uniqueidentifier]
as
set nocount on
set xact_abort on
begin
exec dbo.up_create_item_sales @character_id, @auth_id, 1, 0, 11032024
exec dbo.up_create_item_sales @character_id, @auth_id, 1, 1, 11032025
exec dbo.up_create_item_sales @character_id, @auth_id, 1, 2, 11045005
exec dbo.up_create_item_sales @character_id, @auth_id, 1, 3, 11045006
exec dbo.up_create_item_sales @character_id, @auth_id, 1, 4, 12012010
exec dbo.up_create_item_sales @character_id, @auth_id, 1, 5, 13012010
exec dbo.up_create_item_sales @character_id, @auth_id, 1, 6, 14012010
exec dbo.up_create_item_sales @character_id, @auth_id, 1, 7, 15012010
exec dbo.up_create_item_sales @character_id, @auth_id, 1, 8, 16012010
exec dbo.up_create_item_sales @character_id, @auth_id, 1, 9, 20012010
exec dbo.up_create_item_sales @character_id, @auth_id, 5, 0, 70101
exec dbo.up_create_item_sales @character_id, @auth_id, 5, 1, 70102
exec dbo.up_create_item_sales @character_id, @auth_id, 5, 2, 70103
exec dbo.up_create_item_sales @character_id, @auth_id, 5, 3, 70104
exec dbo.up_create_item_sales @character_id, @auth_id, 5, 4, 70105
exec dbo.up_create_item_sales @character_id, @auth_id, 5, 5, 70106
exec dbo.up_create_item_sales @character_id, @auth_id, 5, 6, 70107
exec dbo.up_create_item_sales @character_id, @auth_id, 5, 7, 70282
exec dbo.up_create_item_sales @character_id, @auth_id, 5, 8, 70283
exec dbo.up_create_item_sales @character_id, @auth_id, 5, 9, 70284
exec dbo.up_create_item_sales @character_id, @auth_id, 5, 10, 70285
exec dbo.up_create_item_sales @character_id, @auth_id, 5, 11, 70286
exec dbo.up_create_item_sales @character_id, @auth_id, 5, 12, 70287
exec dbo.up_create_item_sales @character_id, @auth_id, 5, 13, 70288
exec dbo.up_create_item_sales @character_id, @auth_id, 5, 14, 70289
exec dbo.up_create_item_sales @character_id, @auth_id, 5, 15, 70290
exec dbo.up_create_item_sales @character_id, @auth_id, 5, 16, 70291
exec dbo.up_create_item_sales @character_id, @auth_id, 5, 17, 70292
exec dbo.up_create_item_sales @character_id, @auth_id, 5, 18, 70293
end

View file

@ -0,0 +1,43 @@
CREATE PROCEDURE [dbo].[up_create_item_sales_set_frantz]
@character_id [uniqueidentifier],
@auth_id [uniqueidentifier]
as
set nocount on
set xact_abort on
begin
exec dbo.up_create_item_sales @character_id, @auth_id, 1, 0, 11012024
exec dbo.up_create_item_sales @character_id, @auth_id, 1, 1, 11012025
exec dbo.up_create_item_sales @character_id, @auth_id, 1, 2, 11025005
exec dbo.up_create_item_sales @character_id, @auth_id, 1, 3, 11025006
exec dbo.up_create_item_sales @character_id, @auth_id, 1, 4, 12042010
exec dbo.up_create_item_sales @character_id, @auth_id, 1, 5, 13042010
exec dbo.up_create_item_sales @character_id, @auth_id, 1, 6, 14042010
exec dbo.up_create_item_sales @character_id, @auth_id, 1, 7, 15042010
exec dbo.up_create_item_sales @character_id, @auth_id, 1, 8, 16042010
exec dbo.up_create_item_sales @character_id, @auth_id, 1, 9, 20042010
exec dbo.up_create_item_sales @character_id, @auth_id, 5, 0, 70058
exec dbo.up_create_item_sales @character_id, @auth_id, 5, 1, 70059
exec dbo.up_create_item_sales @character_id, @auth_id, 5, 2, 70060
exec dbo.up_create_item_sales @character_id, @auth_id, 5, 3, 70061
exec dbo.up_create_item_sales @character_id, @auth_id, 5, 4, 70062
exec dbo.up_create_item_sales @character_id, @auth_id, 5, 5, 70063
exec dbo.up_create_item_sales @character_id, @auth_id, 5, 6, 70064
exec dbo.up_create_item_sales @character_id, @auth_id, 5, 7, 70267
exec dbo.up_create_item_sales @character_id, @auth_id, 5, 8, 70268
exec dbo.up_create_item_sales @character_id, @auth_id, 5, 9, 70269
exec dbo.up_create_item_sales @character_id, @auth_id, 5, 10, 70270
exec dbo.up_create_item_sales @character_id, @auth_id, 5, 11, 70271
exec dbo.up_create_item_sales @character_id, @auth_id, 5, 12, 70272
exec dbo.up_create_item_sales @character_id, @auth_id, 5, 13, 70273
exec dbo.up_create_item_sales @character_id, @auth_id, 5, 14, 70260
exec dbo.up_create_item_sales @character_id, @auth_id, 5, 15, 70261
exec dbo.up_create_item_sales @character_id, @auth_id, 5, 16, 70262
exec dbo.up_create_item_sales @character_id, @auth_id, 5, 17, 70263
exec dbo.up_create_item_sales @character_id, @auth_id, 5, 18, 70264
exec dbo.up_create_item_sales @character_id, @auth_id, 5, 19, 70265
exec dbo.up_create_item_sales @character_id, @auth_id, 5, 20, 70266
end

View file

@ -0,0 +1,42 @@
CREATE PROCEDURE [dbo].[up_create_item_sales_set_tude]
@character_id [uniqueidentifier],
@auth_id [uniqueidentifier]
as
set nocount on
set xact_abort on
begin
exec dbo.up_create_item_sales @character_id, @auth_id, 1, 0, 11052024
exec dbo.up_create_item_sales @character_id, @auth_id, 1, 1, 11052025
exec dbo.up_create_item_sales @character_id, @auth_id, 1, 2, 11065005
exec dbo.up_create_item_sales @character_id, @auth_id, 1, 3, 11065006
exec dbo.up_create_item_sales @character_id, @auth_id, 1, 4, 12022010
exec dbo.up_create_item_sales @character_id, @auth_id, 1, 5, 13022010
exec dbo.up_create_item_sales @character_id, @auth_id, 1, 6, 14022010
exec dbo.up_create_item_sales @character_id, @auth_id, 1, 7, 15022010
exec dbo.up_create_item_sales @character_id, @auth_id, 1, 8, 16022010
exec dbo.up_create_item_sales @character_id, @auth_id, 1, 9, 20022010
exec dbo.up_create_item_sales @character_id, @auth_id, 5, 0, 70275
exec dbo.up_create_item_sales @character_id, @auth_id, 5, 1, 70276
exec dbo.up_create_item_sales @character_id, @auth_id, 5, 2, 70277
exec dbo.up_create_item_sales @character_id, @auth_id, 5, 3, 70278
exec dbo.up_create_item_sales @character_id, @auth_id, 5, 4, 70279
exec dbo.up_create_item_sales @character_id, @auth_id, 5, 5, 70280
exec dbo.up_create_item_sales @character_id, @auth_id, 5, 6, 70108
exec dbo.up_create_item_sales @character_id, @auth_id, 5, 7, 70109
exec dbo.up_create_item_sales @character_id, @auth_id, 5, 8, 70110
exec dbo.up_create_item_sales @character_id, @auth_id, 5, 9, 70144
exec dbo.up_create_item_sales @character_id, @auth_id, 5, 10, 70112
exec dbo.up_create_item_sales @character_id, @auth_id, 5, 11, 70113
exec dbo.up_create_item_sales @character_id, @auth_id, 5, 12, 70111
exec dbo.up_create_item_sales @character_id, @auth_id, 5, 13, 70114
exec dbo.up_create_item_sales @character_id, @auth_id, 5, 14, 70115
exec dbo.up_create_item_sales @character_id, @auth_id, 5, 15, 70116
exec dbo.up_create_item_sales @character_id, @auth_id, 5, 16, 70145
exec dbo.up_create_item_sales @character_id, @auth_id, 5, 17, 70118
exec dbo.up_create_item_sales @character_id, @auth_id, 5, 18, 70119
exec dbo.up_create_item_sales @character_id, @auth_id, 5, 18, 70117
end

View file

@ -0,0 +1,131 @@
CREATE PROCEDURE [dbo].[up_create_item_test]
@character_id [uniqueidentifier],
@auth_id [uniqueidentifier],
@page_index int,
@slot_index int,
@item_id [uniqueidentifier],
@code int,
@use_cnt int,
@remain_time int,
@gcode int,
@durability int,
@enhance_level int,
@option_1_code int,
@option_1_value int,
@option_2_code int,
@option_2_value int,
@option_3_code int,
@option_3_value int,
@OptionGroup int,
@ReconNum int,
@ReconState int,
@Socket_count int,
@Socket_1_code int,
@Socket_1_value int,
@Socket_2_code int,
@Socket_2_value int,
@Socket_3_code int,
@Socket_3_value int,
@socket_1_color tinyint,
@socket_2_color tinyint,
@socket_3_color tinyint,
@rank tinyint,
@acquireroute tinyint,
@physical int,
@magical int,
@durabilitymax int,
@weight int
as
set nocount on
set xact_abort on
begin tran
insert N_EquipItem_Test(
item_uid ,
character_id ,
auth_id ,
page_index ,
slot_index ,
code ,
use_cnt ,
remain_time ,
create_time ,
update_time ,
gcode ,
durability ,
enhance_level ,
option_1_code ,
option_1_value,
option_2_code ,
option_2_value,
option_3_code ,
option_3_value,
option_group ,
ReconNum ,
ReconState ,
socket_count ,
socket_1_code ,
socket_1_value,
socket_2_code ,
socket_2_value,
socket_3_code ,
socket_3_value,
socket_1_color,
socket_2_color,
socket_3_color,
rank,
acquireroute,
physical,
magical,
durabilitymax,
weight
)
values(
@item_id ,
@character_id ,
@auth_id ,
@page_index ,
@slot_index ,
@code ,
@use_cnt ,
@remain_time ,
GetDate() ,
GetDate() ,
@gcode ,
@durability ,
@enhance_level ,
@option_1_code ,
@option_1_value,
@option_2_code ,
@option_2_value,
@option_3_code ,
@option_3_value,
@OptionGroup ,
@ReconNum ,
@ReconState ,
@Socket_count ,
@Socket_1_code ,
@Socket_1_value,
@Socket_2_code ,
@Socket_2_value,
@Socket_3_code ,
@Socket_3_value,
@socket_1_color,
@socket_2_color,
@socket_3_color,
@rank,
@acquireroute,
@physical,
@magical,
@durabilitymax,
@weight
)
if(@@error <> 0)
begin
rollback
return
end
commit

View file

@ -0,0 +1,75 @@
CREATE PROCEDURE [dbo].[up_create_pet]
@pet_id [uniqueidentifier]
,@character_id [uniqueidentifier]
,@AuthID [uniqueidentifier]
,@server smallint
,@Name nvarchar(16)
,@Job int
,@inventory_count tinyint
,@Expire_Time int
--펫 기본 정보 추가 jojo
,@Vital INT
,@Intelligence INT
,@Strength INT
,@Resilient INT
,@Eloquence INT
,@Charm INT
,@Temper INT
,@fHeight FLOAT
,@fWeight FLOAT
,@hp INT
,@mp INT
,@physical_attack FLOAT
,@physical_defence FLOAT
,@magical_attack FLOAT
,@magical_defence FLOAT
,@loyalty FLOAT
,@Level int
,@exp int
as
set nocount on
insert into PetTable
values
(
@pet_id
,@character_id
,null
,@AuthID
,@server
,@Name
,@Job
,@Level
,@exp
,@inventory_count
,GetDate()
,@Expire_Time
--펫 기본 정보 추가
,@Vital
,@Intelligence
,@Strength
,@Resilient
,@Eloquence
,@Charm
,@Temper
,@fHeight
,@fWeight
,0
--펫 추가 정보
,@hp
,@mp
,@physical_attack
,@physical_defence
,@magical_attack
,@magical_defence
,@loyalty
);
select * from PetTable with (READUNCOMMITTED) where pet_id = @pet_id
return @@error

View file

@ -0,0 +1,138 @@
CREATE PROCEDURE [dbo].[up_create_pet_inventory_item]
@pet_id [uniqueidentifier],
@auth_id [uniqueidentifier],
@page_index int,
@slot_index int,
@item_id [uniqueidentifier],
@code int,
@use_cnt int,
@remain_time int,
@gcode int,
@durability int,
@enhance_level int,
@option_1_code int,
@option_1_value int,
@option_2_code int,
@option_2_value int,
@option_3_code int,
@option_3_value int,
@OptionGroup int,
@ReconNum int,
@ReconState int,
@Socket_count int,
@Socket_1_code int,
@Socket_1_value int,
@Socket_2_code int,
@Socket_2_value int,
@Socket_3_code int,
@Socket_3_value int,
--시간제 관련 추가 20102519 jojo
@expire_time int,
@activity_value int, --활성석 20100928 jojo
@socket_1_color tinyint,
@socket_2_color tinyint,
@socket_3_color tinyint,
@rank tinyint,
@acquireroute tinyint,
@physical int,
@magical int,
@durabilitymax int,
@weight int
as
set nocount on
begin
begin tran
INSERT tbl_pet_inventory( item_uid
,pet_id
,auth_id
,page_index
,slot_index
,code
,use_cnt
,remain_time
,create_time
,update_time
,gcode
,durability
,enhance_level
,option_1_code
,option_1_value
,option_2_code
,option_2_value
,option_3_code
,option_3_value
,option_group
,ReconNum
,ReconState
,socket_count
,socket_1_code
,socket_1_value
,socket_2_code
,socket_2_value
,socket_3_code
,socket_3_value
,expire_time
,activity_value --활성석 20100928 jojo
,socket_1_color
,socket_2_color
,socket_3_color
,rank
,acquireroute
,physical
,magical
,durabilitymax
,weight
) VALUES( @item_id
,@pet_id
,@auth_id
,@page_index
,@slot_index
,@code
,@use_cnt
,@remain_time
,GetDate()
,GetDate()
,@gcode
,@durability
,@enhance_level
,@option_1_code
,@option_1_value
,@option_2_code
,@option_2_value
,@option_3_code
,@option_3_value
,@OptionGroup
,@ReconNum
,@ReconState
,@Socket_count
,@Socket_1_code
,@Socket_1_value
,@Socket_2_code
,@Socket_2_value
,@Socket_3_code
,@Socket_3_value
,@expire_time
,@activity_value --활성석 20100928 jojo
,@socket_1_color
,@socket_2_color
,@socket_3_color
,@rank
,@acquireroute
,@physical
,@magical
,@durabilitymax
,@weight
)
if(@@error <> 0)
begin
rollback
return
end
delete from N_InventoryItem where [item_uid] = @item_id --모두 옮겼으므로 삭제
commit
end

View file

@ -0,0 +1,10 @@
CREATE PROCEDURE [dbo].[up_del_ban]
@character_id [uniqueidentifier],
@ban_id [uniqueidentifier]
as
set nocount on
delete dbo.FriendTableEx where character_id = @character_id and friend_id = @ban_id
return @@error

View file

@ -0,0 +1,10 @@
CREATE PROCEDURE [dbo].[up_del_friend]
@character_id [uniqueidentifier],
@friend_id [uniqueidentifier]
as
set nocount on
delete dbo.FriendTableEx where character_id = @character_id and friend_id = @friend_id
return @@error

View file

@ -0,0 +1,13 @@
CREATE PROCEDURE [dbo].[up_delet_guild_storage]
(
@guild_id [uniqueidentifier]
,@item_id [uniqueidentifier]
)
AS
SET NOCOUNT ON
DELETE tbl_Guild_Storage_Item
WHERE guild_id = @guild_id AND item_uid = @item_id
RETURN @@error

View file

@ -0,0 +1,9 @@
CREATE PROCEDURE [dbo].[up_delete_account_storage_item]
@auth_id [uniqueidentifier]
,@item_id [uniqueidentifier]
as
set nocount on
delete dbo.tbl_Account_Storage where auth_id = @auth_id AND item_uid = @item_id
return @@error

View file

@ -0,0 +1,8 @@
CREATE PROCEDURE [dbo].[up_delete_auctionarticle]
@item_uid [uniqueidentifier]
as
set nocount on
delete dbo.AuctionListTable where item_uid = @item_uid
return @@error

View file

@ -0,0 +1,10 @@
CREATE PROCEDURE [dbo].[up_delete_buff]
@character_id uniqueidentifier,
@buff_type int,
@buff_id int
as
set nocount on
delete dbo.BuffTable where character_id = @character_id and buff_id = @buff_id and buff_type = @buff_type
return @@error

View file

@ -0,0 +1,8 @@
CREATE PROCEDURE [dbo].[up_delete_cash_effectinfo]
@item_uid [uniqueidentifier]
as
set nocount on
delete dbo.Cash_EffectTable where item_uid = @item_uid
return @@error

View file

@ -0,0 +1,11 @@
CREATE PROCEDURE [dbo].[up_delete_character]
@auth_id [uniqueidentifier],
@character_id [uniqueidentifier]
as begin
set nocount on
insert into CharacterTable_DELETE select * from CharacterTable with (READUNCOMMITTED) where character_id = @character_id
delete from [dbo].[CharacterTable] WHERE character_id = @character_id
end

View file

@ -0,0 +1,26 @@
CREATE PROCEDURE [dbo].[up_delete_character_title]
@character_id [uniqueidentifier],
@del_title_id [uniqueidentifier]
as
set nocount on
begin tran
DELETE FROM CharacterTitle WHERE [id] = @del_title_id
DECLARE @ERR int
SET @ERR = @@ERROR
IF @ERR <> 0
BEGIN
--RAISERROR('처리오류', 16, 10)
IF @@TRANCOUNT <> 0
BEGIN
ROLLBACK TRAN
END
RETURN (@ERR)
END
COMMIT TRAN
RETURN (@ERR)

View file

@ -0,0 +1,8 @@
CREATE PROCEDURE [dbo].[up_delete_inquiry]
@character_id uniqueidentifier
as
set nocount on
delete from [dbo].[InquiryTable] where [character_id] = @character_id
return @@error

View file

@ -0,0 +1,10 @@
CREATE PROCEDURE [dbo].[up_delete_mail]
@mail_id [uniqueidentifier]
as
set nocount on
delete dbo.MailTable where ID = @mail_id;
DELETE FROM [dbo].[N_MailItem] WHERE mail_uid = @mail_id;
return @@error

View file

@ -0,0 +1,9 @@
CREATE PROCEDURE [dbo].[up_delete_pet]
@pet_id [uniqueidentifier]
as
set nocount on
delete dbo.PetTable where pet_id = @pet_id
delete dbo.tbl_pet_inventory where pet_id = @pet_id
return @@error

View file

@ -0,0 +1,8 @@
CREATE PROCEDURE [dbo].[up_delete_pet_inventory]
@pet_id [uniqueidentifier]
,@item_id [uniqueidentifier]
as
set nocount on
delete dbo.tbl_pet_Inventory where pet_id = @pet_id AND item_uid = @item_id
return @@error

View file

@ -0,0 +1,8 @@
CREATE PROCEDURE [dbo].[up_delete_quest]
@quest_uid [uniqueidentifier],
@character_id [uniqueidentifier]
as
set nocount on
delete dbo.QuestTable where quest_uid = @quest_uid and character_id = @character_id
return @@error

View file

@ -0,0 +1,9 @@
CREATE PROCEDURE [dbo].[up_delete_rearing_info]
@rearing_id [uniqueidentifier]
as
set nocount on
delete dbo.RearingTable where rearing_id = @rearing_id;
return @@error

View file

@ -0,0 +1,9 @@
CREATE PROCEDURE [dbo].[up_delete_reward]
@type tinyint
as
set nocount on
delete RewardTable
return @@error

View file

@ -0,0 +1,6 @@
CREATE PROCEDURE [dbo].[up_delete_skill]
@skill_id [uniqueidentifier]
as
set nocount on
delete SkillTable where skill_id = @skill_id
return @@error

View file

@ -0,0 +1,38 @@
CREATE PROCEDURE [dbo].[up_equip_character_title]
@title_id [uniqueidentifier],
@character_id [uniqueidentifier]
AS
SET NOCOUNT ON
BEGIN TRAN
DELETE FROM Equip_CharacterTitle WHERE [character_id] = @character_id
INSERT Equip_CharacterTitle
(
[ID],
[character_id],
[title_code],
[remain_time],
[expire_time]
)
SELECT
[ID],
[character_id],
[title_code],
[remain_time],
[expire_time]
FROM CharacterTitle with (READUNCOMMITTED) WHERE [ID] = @title_id
DECLARE @ERR INT
SET @ERR = @@ERROR
IF @ERR <> 0
BEGIN
--RAISERROR('처리오류', 16, 10)
IF @@TRANCOUNT <> 0
ROLLBACK TRAN
RETURN (@ERR)
END
COMMIT TRAN
RETURN @ERR

View file

@ -0,0 +1,21 @@
CREATE PROCEDURE [dbo].[up_event_character_setting]
as begin
set nocount on
UPDATE [dbo].[CharacterTable]
SET
[Job] = 0
,[Level] = 20
,[Experience] = 1131750
,[SP] = 400
,[Total_SP] = 400
,[gold] = 1000000
,[Hearts] = 500
WHERE name like 'test5%'
end

View file

@ -0,0 +1,90 @@
CREATE PROCEDURE [dbo].[up_get_all_character]
@AuthID [uniqueidentifier],
@server int
as
begin
set nocount on
set transaction isolation level read uncommitted
-- -------------------------------------------------------
-- -- 접속 유저 로그 DB로 보내기
-- declare @srvname nvarchar(128)
-- declare @srvid smallint
-- declare @bcust_id nvarchar(50)
-- declare @char_name nvarchar(30)
-- declare @character_id [uniqueidentifier]
-- set @bcust_id = ''
-- set @char_name = ''
-- set @character_id = '00000000-0000-0000-0000-000000000000'
--
-- set @srvid = -1
-- SELECT @srvid = srvid FROM master.dbo.sysservers where srvname = 'RustyHearts_LogDB'
-- if(@srvid <> -1)
-- begin
-- select top 1 @bcust_id=bcust_id from CharacterTable where AuthID = @AuthID
-- exec RustyHearts_LogDB.RustyHearts_Log.dbo.sp_SetConnectionUV 1, @server, @AuthID, @bcust_id,
-- @character_id, @char_name, 1, ''
-- end
-- -------------------------------------------------------
select C.[character_id]
,C.[AuthID]
,C.[server]
,C.[Name]
,C.[Class]
,C.[Job]
,C.[Level]
,C.[Experience]
,C.[Stamina]
,C.[SP]
,C.[Total_SP]
,C.[Fatigue]
,C.[LobbyID]
,C.[StartPoint]
,C.[gold]
,C.[individual_roomID]
,C.[GuildID]
,C.[Hearts]
,C.[first_login]
,C.[tutorial]
,C.[give_up]
,C.[Block_Type]
,C.[storage_gold]
,C.[storage_count]
,C.[IsTradeEnable]
,C.[CreateTime]
,C.[LastLogin]
,C.[Expire_Time]
--시간 이벤트 관련 추가 [2010/05/27 jojo]
,C.[event_fatigue]
,C.[event_hearts]
,C.[event_fortune]
,C.[dice_point]
,C.[Addition_HP]
,C.[Addition_MP]
,C.[Addition_Physic_Attack]
,C.[Addition_Physic_Defense]
,C.[Addition_Magic_Attack]
,C.[Addition_Magic_Defense]
,C.[Permission]
,C.[FatigueStorage]
,C.[DayAttachGold]
,C.[DayAttachItem]
,C.[GuildPoint] --길드 포인트 추가
,C.[Fortune] --운세
,C.[IsMoveEnable] --이동불가
,C.[event_mailattach]
,C.[Block_YN]
,C.[tutorial_step]
,C.[daypartymission]
,C.[event_daypartymission]
,C.[time_sp]
,ISNULL(G.[grade],7) as guild_grade --길드 등급 추가(테스트용-작업자 문의:김진영)
,ISNULL(G.alias_name, '') as guild_alias_name --길드 별명 추가(테스트용-작업자 문의:김진영)
,ISNULL(GT.name, '') as guild_name --길드 이름 - 이후 추가시 담당에게 문의 : 김진영
from CharacterTable AS C WITH (NOLOCK)
LEFT OUTER JOIN GuildMemberTable AS G WITH (NOLOCK) ON G.[character_id]=C.[character_id] --WHERE C.[AuthID]=@AuthID and C.[server]=@server
LEFT OUTER JOIN GuildTable AS GT WITH (NOLOCK) ON GT.[guild_id]=C.[GuildID] WHERE C.[AuthID]=@AuthID --and C.[server]=@server
--from CharacterTable WITH (NOLOCK) where AuthID = @AuthID and server = @server
end

View file

@ -0,0 +1,12 @@
CREATE PROCEDURE [dbo].[up_get_all_character_statistics]
as
begin
set nocount on
set transaction isolation level read uncommitted
select *
from CharacterTable
end

View file

@ -0,0 +1,12 @@
CREATE PROCEDURE [dbo].[up_get_all_guild_count]
AS
BEGIN
SET NOCOUNT ON
set transaction isolation level read uncommitted
--SELECT count(*) COUNT FROM GuildTable WHERE [block_type] = 0 --and [server] = @server
select count(*) guild_count FROM
( select G.[guild_id] from GuildMemberTable M INNER JOIN GuildTable G ON G.[guild_id]=M.[guild_id] AND G.[block_type]=0 GROUP BY G.guild_id ) A;
END

View file

@ -0,0 +1,83 @@
CREATE PROCEDURE [dbo].[up_get_character]
@character_id [uniqueidentifier],
@server smallint
as
begin
set nocount on
set transaction isolation level read uncommitted
-- declare @temp_lastloginDiff int
-- SELECT @temp_lastloginDiff = DATEDIFF(day, [LastLogin], GETDATE()) FROM [CharacterTable] WHERE [character_id] = @character_id
-- if @temp_lastloginDiff != 0
-- begin
-- UPDATE [CharacterTable] SET [Fatigue] = 1000, [LastLogin] = GETDATE() WHERE [character_id] = @character_id
-- UPDATE [CharacterTable] SET [Hearts] = 10 WHERE [character_id] = @character_id and [Hearts] < 10
-- UPDATE [CharacterTable] SET [DayAttachGold] = 0 WHERE [character_id] = @character_id
-- UPDATE [CharacterTable] SET [DayAttachItem] = 0 WHERE [character_id] = @character_id
-- end
-- else
-- begin
-- UPDATE [CharacterTable] SET [LastLogin] = GETDATE() WHERE [character_id] = @character_id
-- end
select C.[character_id]
,C.[AuthID]
,C.[server]
,C.[Name]
,C.[Class]
,C.[Job]
,C.[Level]
,C.[Experience]
,C.[Stamina]
,C.[SP]
,C.[Total_SP]
,C.[Fatigue]
,C.[LobbyID]
,C.[StartPoint]
,C.[gold]
,C.[individual_roomID]
,C.[GuildID]
,C.[CreateTime]
,C.[LastLogin]
,C.[Hearts]
,C.[first_login]
,C.[tutorial]
,C.[give_up]
,C.[Block_Type]
,C.[storage_gold]
,C.[storage_count]
,C.[IsTradeEnable]
,C.[Expire_Time]
--시간 이벤트 관련 추가 [2010/05/27 jojo]
,C.[event_fatigue]
,C.[event_hearts]
,C.[event_fortune]
,C.[dice_point]
,C.[Addition_HP]
,C.[Addition_MP]
,C.[Addition_Physic_Attack]
,C.[Addition_Physic_Defense]
,C.[Addition_Magic_Attack]
,C.[Addition_Magic_Defense]
,C.[Permission]
,C.[FatigueStorage]
,C.[DayAttachGold]
,C.[DayAttachItem]
,C.[GuildPoint] --길드 경험치 jojo
,C.[Fortune] --운세
,C.[IsMoveEnable] --이동불가
,C.[event_mailattach]
,C.[tutorial_step]
,C.[daypartymission]
,C.[event_daypartymission]
,C.[time_sp]
--데이터 추가 시 뒤쪽에!!
,ISNULL(G.[grade],7) as guild_grade --길드 등급 - 이후 추가시 담당에게 문의 : 김진영
,ISNULL(G.alias_name, '') as guild_alias_name --길드 별명 - 이후 추가시 담당에게 문의 : 김진영
,ISNULL(GT.name, '') as guild_name --길드 이름 - 이후 추가시 담당에게 문의 : 김진영
FROM CharacterTable AS C WITH (NOLOCK)
LEFT OUTER JOIN GuildMemberTable AS G WITH (NOLOCK) ON G.[character_id]=C.[character_id] --WHERE C.[character_id]=@character_id and C.[server]=@server
LEFT OUTER JOIN GuildTable AS GT WITH (NOLOCK) ON GT.[guild_id]=C.[GuildID] WHERE C.[character_id]=@character_id --and C.[server]=@server
end

View file

@ -0,0 +1,66 @@
CREATE PROCEDURE [dbo].[up_get_character_by_name]
@name nvarchar(16),
@server smallint
as
begin
set nocount on
set transaction isolation level read uncommitted
select C.[character_id]
,C.[AuthID]
,C.[server]
,C.[Name]
,C.[Class]
,C.[Job]
,C.[Level]
,C.[Experience]
,C.[Stamina]
,C.[SP]
,C.[Total_SP]
,C.[Fatigue]
,C.[LobbyID]
,C.[StartPoint]
,C.[gold]
,C.[individual_roomID]
,C.[GuildID]
,C.[Hearts]
,C.[first_login]
,C.[tutorial]
,C.[give_up]
,C.[Block_Type]
,C.[storage_gold]
,C.[storage_count]
,C.[IsTradeEnable]
,C.[Expire_Time]
--시간 이벤트 관련 추가 [2010/05/27 jojo]
,C.[event_fatigue]
,C.[event_hearts]
,C.[event_fortune]
,C.[dice_point]
,C.[Addition_HP]
,C.[Addition_MP]
,C.[Addition_Physic_Attack]
,C.[Addition_Physic_Defense]
,C.[Addition_Magic_Attack]
,C.[Addition_Magic_Defense]
,C.[Permission]
,C.[FatigueStorage]
,C.[DayAttachGold]
,C.[DayAttachItem]
,C.[GuildPoint] --길드 경험치 jojo
,C.[Fortune] --운세
,C.[IsMoveEnable] --이동불가
,C.[event_mailattach]
,C.[tutorial_step]
,C.[daypartymission]
,C.[event_daypartymission]
,C.[time_sp]
--데이터 추가 시 뒤쪽에!!
,ISNULL(G.[grade],7) as guild_grade --길드 등급 - 이후 추가시 담당에게 문의 : 김진영
,ISNULL(G.alias_name, '') as guild_alias_name --길드 별명 - 이후 추가시 담당에게 문의 : 김진영
,ISNULL(GT.name, '') as guild_name --길드 이름 - 이후 추가시 담당에게 문의 : 김진영
FROM CharacterTable AS C WITH (NOLOCK)
LEFT OUTER JOIN GuildMemberTable AS G WITH (NOLOCK) ON G.[character_id]=C.[character_id] --WHERE Name = @name and C.[server]=@server
LEFT OUTER JOIN GuildTable AS GT WITH (NOLOCK) ON GT.[guild_id]=C.[GuildID] WHERE C.[Name] = @name --and C.[server]=@server
end

View file

@ -0,0 +1,16 @@
CREATE PROCEDURE [dbo].[up_get_character_simpleinfo]
@name nvarchar(16),
@server smallint
as begin
set nocount on
set transaction isolation level read uncommitted
select [Name]
,[Class]
,[Job]
,[Level]
from CharacterTable WITH (NOLOCK) where Name = @name --and [server] = @server
end

View file

@ -0,0 +1,19 @@
CREATE PROCEDURE [dbo].[up_get_duel_info]
@character_id [uniqueidentifier]
AS
BEGIN
SET NOCOUNT ON;
set transaction isolation level read uncommitted
SELECT duel_exp, duel_point, duel_disconnect, duel_pannelty_time,
total_win, total_lose,
pvp_win, pvp_lose,
team_win, team_lose,
leader_win, leader_lose,
tag_win, tag_lose,
death_win, death_lose,
ladder_win, ladder_lose, duel_ladder_point, duel_ladder_exp
FROM BattleInfo
WHERE character_id = @character_id
RETURN 0;
END

View file

@ -0,0 +1,11 @@
CREATE PROCEDURE [dbo].[up_get_duel_info_statistics]
AS
BEGIN
SET NOCOUNT ON;
set transaction isolation level read uncommitted
SELECT *
FROM BattleInfo
RETURN 0;
END

View file

@ -0,0 +1,16 @@
CREATE PROCEDURE [dbo].[up_get_guild_increase_exp]
(
@guild_id [uniqueidentifier]
)
AS BEGIN
SET NOCOUNT ON
set transaction isolation level read uncommitted
SELECT TOP 100 *
FROM tbl_Guild_Exp_List
WHERE guild_id = @guild_id ORDER BY [index] DESC
END

View file

@ -0,0 +1,27 @@
CREATE PROCEDURE [dbo].[up_get_guild_load_info]
(
@server SMALLINT
)
AS
BEGIN
SET NOCOUNT ON
set transaction isolation level read uncommitted
SELECT T.[guild_id],
C.[member_cnt],
ISNULL(S.[s_cnt],0) AS is_storage_own,
ISNULL(SI.s_cnt, 0) AS storage_item_cnt,
CASE WHEN ISNULL(SL.[s_cnt],0)>100 THEN 100 WHEN ISNULL(SL.[s_cnt],0)>0 THEN ISNULL(SL.[s_cnt],0) ELSE 0 END AS storage_log_cnt,
CASE WHEN ISNULL(E.[s_cnt],0)>100 THEN 100 WHEN ISNULL(E.[s_cnt],0)>0 THEN ISNULL(E.[s_cnt],0) ELSE 0 END AS exp_log_cnt,
ISNULL(K.[s_cnt], 0) AS skill_cnt
FROM GuildTable AS T WITH (NOLOCK)
INNER JOIN ( SELECT M.[guild_id], count(M.[guild_id]) AS member_cnt FROM GuildMemberTable AS M WITH (NOLOCK) GROUP BY M.[guild_id] ) AS C ON C.[guild_id]=T.[guild_id] AND T.[server]=@server AND T.[block_type]=0
LEFT OUTER JOIN ( SELECT t1.[guild_id], count(t1.[guild_id]) AS s_cnt FROM tbl_Guild_Storage_Info AS t1 WITH (NOLOCK) GROUP BY t1.[guild_id] ) AS S ON S.[guild_id]=C.[guild_id]
LEFT OUTER JOIN ( SELECT t2.[guild_id], count(t2.[guild_id]) AS s_cnt FROM tbl_Guild_Storage_Item AS t2 WITH (NOLOCK) GROUP BY t2.[guild_id] ) AS SI ON SI.[guild_id]=S.[guild_id]
LEFT OUTER JOIN ( SELECT t3.[guild_id], count(t3.[guild_id]) AS s_cnt FROM tbl_Guild_Storage_Use_List AS t3 WITH (NOLOCK) WHERE t3.[use_type] IN (0, 1) GROUP BY t3.[guild_id] ) AS SL ON SL.[guild_id]=S.[guild_id]
LEFT OUTER JOIN ( SELECT t4.[guild_id], count(t4.[guild_id]) AS s_cnt FROM tbl_Guild_Exp_List AS t4 WITH (NOLOCK) GROUP BY t4.[guild_id] ) AS E ON E.[guild_id]=C.[guild_id]
LEFT OUTER JOIN ( SELECT t5.[guild_id], count(t5.[guild_id]) AS s_cnt FROM tbl_Guild_Skill AS t5 WITH (NOLOCK) GROUP BY t5.[guild_id] ) AS K ON K.[guild_id]=C.[guild_id]
--주의 : t3.[use_type] IN (0, 1) 변경 시 [up_get_guild_storage_use_list] 프로시저도 내부도 변경할것!
END

View file

@ -0,0 +1,12 @@
CREATE PROCEDURE [dbo].[up_get_guild_skill]
(
@guild_id [uniqueidentifier]
)
AS
BEGIN
SET NOCOUNT ON
set transaction isolation level read uncommitted
SELECT skill_table_id, skill_id, skill_level FROM dbo.tbl_Guild_Skill WITH (READUNCOMMITTED) WHERE guild_id = @guild_id
END

View file

@ -0,0 +1,11 @@
CREATE PROCEDURE [dbo].[up_get_guild_storage_info]
(
@guild_id [uniqueidentifier]
)
AS
SET NOCOUNT ON
set transaction isolation level read uncommitted
SELECT * FROM tbl_Guild_Storage_Info WHERE guild_id = @guild_id
RETURN @@error

View file

@ -0,0 +1,50 @@
CREATE PROCEDURE [dbo].[up_get_guild_storage_item_list]
(
@guild_id [uniqueidentifier]
)
AS
SET NOCOUNT ON
set transaction isolation level read uncommitted
SELECT item_uid
,page_index
,slot_index
,code
,use_cnt
,remain_time
,durability
,enhance_level
,option_1_code
,option_1_value
,option_2_code
,option_2_value
,option_3_code
,option_3_value
,option_group
,ReconNum
,ReconState
,socket_count
,socket_1_code
,socket_1_value
,socket_2_code
,socket_2_value
,socket_3_code
,socket_3_value
,expire_time
,lock_pwd
,activity_value --활성석 20100928 jojo
,link_id
,socket_1_color
,socket_2_color
,socket_3_color
,[rank]
,[acquireroute]
,[physical]
,[magical]
,[durabilitymax]
,[weight]
FROM tbl_Guild_Storage_Item
WHERE guild_id = @guild_id
RETURN @@error

View file

@ -0,0 +1,17 @@
CREATE PROCEDURE [dbo].[up_get_guild_storage_use_list]
(
@guild_id [uniqueidentifier]
)
AS
BEGIN
SET NOCOUNT ON
set transaction isolation level read uncommitted
SELECT TOP 100 *
FROM tbl_Guild_Storage_Use_List WITH (NOLOCK)
WHERE guild_id = @guild_id and use_type IN (0, 1) ORDER BY [index] DESC
--주의 : IN (0, 1) 변경 시 [up_get_guild_load_info] 프로시저도 내부도 변경할것!
RETURN @@error
END

View file

@ -0,0 +1,19 @@
CREATE PROCEDURE [dbo].[up_get_guild_total_count]
(
@server SMALLINT
)
AS
BEGIN
SET NOCOUNT ON
set transaction isolation level read uncommitted
SELECT count(T.[guild_id]) AS total_cnt FROM GuildTable AS T WITH (NOLOCK)
INNER JOIN
(
SELECT M.[guild_id], count(M.[guild_id]) AS member_cnt
FROM GuildMemberTable AS M WITH (NOLOCK) GROUP BY M.[guild_id]
) AS C
ON C.[guild_id]=T.[guild_id] AND T.[server]=@server AND T.[block_type]=0
END

View file

@ -0,0 +1,25 @@
CREATE PROCEDURE [dbo].[up_get_keymap]
(
@auth_id [uniqueidentifier]
)
AS
BEGIN
set nocount on
declare @get_AuthID [uniqueidentifier];
SET @get_AuthID = NULL;
SELECT TOP 1 @get_AuthID = AuthID FROM KeyMapTable with (READUNCOMMITTED) WHERE AuthID = @auth_id;
IF( @get_AuthID IS NULL )
BEGIN
insert into KeyMapTable
values( @auth_id, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 );
END
SELECT TOP 1 * FROM KeyMapTable with (READUNCOMMITTED) WHERE AuthID = @auth_id
END

View file

@ -0,0 +1,15 @@
CREATE PROCEDURE [dbo].[up_get_other_character]
@character_id [uniqueidentifier],
@server smallint
as begin
set nocount on
set transaction isolation level read uncommitted
select
[Name]
,[Class]
,[Job]
,[Level]
from CharacterTable where character_id = @character_id --and server = @server
end

View file

@ -0,0 +1,53 @@
CREATE PROCEDURE [dbo].[up_guild_disband]
@guild_id [uniqueidentifier],
@character_id [uniqueidentifier]
AS
BEGIN
SET NOCOUNT ON;
SET XACT_ABORT ON;
DECLARE @result_code INT;
SET @result_code = 1; --1 : 성공 / -1 : 프로시저 오류 / -2 : INSERT 실패 / -3 : UPDATE 실패
BEGIN TRY
BEGIN TRAN;
--DELETE FROM [dbo].[GuildMemberTable] WHERE guild_id = @guild_id
--Update [dbo].[GuildTable] set [name] = '___'+[name], [master_id] = NULL, [block_type]=1 WHERE guild_id = @guild_id
--UPDATE [dbo].[CharacterTable] SET [GuildID] = NULL
-- ,[GuildPoint] = 0 WHERE [character_id] = @character_id
--캐릭터 테이블의 길드 정보 삭제
UPDATE [dbo].[CharacterTable] SET [GuildID] = NULL ,[GuildPoint] = 0 WHERE [character_id] = @character_id
--길드 삭제 테이블에 길드 정보 이동
INSERT INTO [dbo].[GuildTable_DELETE] SELECT *, GETDATE() FROM [dbo].[GuildTable] AS S with (READUNCOMMITTED) WHERE S.[guild_id] = @guild_id
--길드 관련 테이블 삭제
DELETE FROM [dbo].[tbl_Guild_Exp_List] WHERE [guild_id] = @guild_id
DELETE FROM [dbo].[tbl_Guild_Skill] WHERE [guild_id] = @guild_id
DELETE FROM [dbo].[tbl_Guild_Storage_Info] WHERE [guild_id] = @guild_id
DELETE FROM [dbo].[tbl_Guild_Storage_Item] WHERE [guild_id] = @guild_id
DELETE FROM [dbo].[tbl_Guild_Storage_Use_List] WHERE [guild_id] = @guild_id
DELETE FROM [dbo].[GuildMemberTable] WHERE [guild_id] = @guild_id
--길드 테이블 삭제
DELETE FROM [dbo].[GuildTable] WHERE [guild_id] = @guild_id
COMMIT TRAN;
SELECT result_code = @result_code; --결과 코드 전달
END TRY
BEGIN CATCH
ROLLBACK TRAN;
SELECT result_code = -1;
END CATCH
END

View file

@ -0,0 +1,18 @@
CREATE PROCEDURE [dbo].[up_guild_leader_change]
@guild_id [uniqueidentifier],
@character_id [uniqueidentifier]
as
set nocount on
declare @oldMaster [uniqueidentifier]
select @oldMaster = master_id from dbo.GuildTable with (READUNCOMMITTED) where guild_id = @guild_id --기존 마스터의 캐릭터 아이디를 구한다. jojo
update dbo.GuildTable set master_id = @character_id where guild_id = @guild_id
update dbo.GuildMemberTable set grade = 0 where guild_id = @guild_id and character_id = @character_id
--기존 마스터의 등급을 신입으로 변경한다. jojo
update dbo.GuildMemberTable set grade = 7 where guild_id = @guild_id and character_id = @oldMaster
return @@error

View file

@ -0,0 +1,36 @@
CREATE PROCEDURE [dbo].[up_guild_member_remove]
@guild_id [uniqueidentifier],
@character_id [uniqueidentifier]
AS
BEGIN
SET NOCOUNT ON;
SET XACT_ABORT ON;
DECLARE @result_code INT;
SET @result_code = 1; --1 : 성공 / -1 : 프로시저 오류 / -2 : INSERT 실패 / -3 : UPDATE 실패
BEGIN TRY
BEGIN TRAN;
DELETE FROM dbo.GuildMemberTable WHERE guild_id = @guild_id and character_id = @character_id
--탈퇴/삭제된 유저의 길드포인트는 0으로 변경 jojo
UPDATE [dbo].[CharacterTable] SET [GuildID] = NULL, [GuildPoint] = 0 WHERE [character_id] = @character_id
COMMIT TRAN;
SELECT result_code = @result_code; --결과 코드 전달
END TRY
BEGIN CATCH
ROLLBACK TRAN;
SELECT result_code = -1;
END CATCH
END

View file

@ -0,0 +1,36 @@
CREATE PROCEDURE [dbo].[up_guild_storage_extension]
(
@guild_id [uniqueidentifier]
,@character_id [uniqueidentifier]
,@slot_count INT
,@cost_money INT
,@page_count TINYINT
,@level INT
)
AS
SET NOCOUNT ON
declare @my_money int
BEGIN
-- 비용 제거해야함
SELECT @my_money = [gold] FROM [dbo].[tbl_Guild_Storage_info] with (READUNCOMMITTED) where [guild_id] = @guild_id
-- 돈 삭제 및 길드 설정
if (@my_money - @cost_money) > 0
begin
UPDATE [dbo].[tbl_Guild_Storage_info] SET [gold] = (@my_money - @cost_money) WHERE [guild_id] = @guild_id
end
else
begin
UPDATE [dbo].[tbl_Guild_Storage_info] SET [gold] = 0 WHERE [guild_id] = @guild_id
end
UPDATE tbl_Guild_Storage_Info SET [page_count] = @page_count
,[slot_count] = @slot_count
,[level] = @level
WHERE [guild_id] = @guild_id
END
RETURN

View file

@ -0,0 +1,35 @@
CREATE PROCEDURE [dbo].[up_init_auth_link]
@db_src nvarchar(32),
@db_account nvarchar(32),
@db_pass nvarchar(32)
as
set nocount on
--링크드 서버 설정
--서버등록
EXEC sp_addlinkedserver
@server='RustyHeartsLinkAuth', -- 링크드서버이름, 기본값없음
@srvproduct = '', -- OLEDB 데이터원본제품이름, 기본값NULL
@provider = 'SQLOLEDB', -- 공급자고유식별자
@datasrc = @db_src, -- 데이터원본이름
@provstr='', -- OLEDB 공급자연결문자열, 기본값NULL
@catalog='RustyHearts_Auth' -- 공급자연결카다로그, 데이터베이스이름
--서버등록확인
SELECT * FROM master.dbo.sysservers
--연결계정등록
EXEC sp_addlinkedsrvlogin
@rmtsrvname = 'RustyHeartsLinkAuth', -- 링크드서버이름, 기본값없음
@useself = 'false', -- 로그인이름사용유무, 기본값true
@locallogin = NULL, -- 로컬서버로그인여부, 기본값NULL
@rmtuser = @db_account, -- 사용자이름
@rmtpassword = @db_pass -- 사용자암호
EXEC SP_SERVEROPTION [RustyHeartsLinkAuth], 'RPC OUT' , 'TRUE'
return @@error

View file

@ -0,0 +1,35 @@
CREATE PROCEDURE [dbo].[up_init_log_link]
@db_src nvarchar(32),
@db_account nvarchar(32),
@db_pass nvarchar(32)
as
set nocount on
--링크드 서버 설정
--서버등록
EXEC sp_addlinkedserver
@server='RustyHearts_LogDB', -- 링크드서버이름, 기본값없음
@srvproduct = '', -- OLEDB 데이터원본제품이름, 기본값NULL
@provider = 'SQLOLEDB', -- 공급자고유식별자
@datasrc = @db_src, -- 데이터원본이름
@provstr='', -- OLEDB 공급자연결문자열, 기본값NULL
@catalog='RustyHearts_Log' -- 공급자연결카다로그, 데이터베이스이름
--서버등록확인
SELECT * FROM master.dbo.sysservers
--연결계정등록
EXEC sp_addlinkedsrvlogin
@rmtsrvname = 'RustyHearts_LogDB', -- 링크드서버이름, 기본값없음
@useself = 'false', -- 로그인이름사용유무, 기본값true
@locallogin = NULL, -- 로컬서버로그인여부, 기본값NULL
@rmtuser = @db_account, -- 사용자이름
@rmtpassword = @db_pass -- 사용자암호
EXEC SP_SERVEROPTION [RustyHearts_LogDB], 'RPC OUT' , 'TRUE'
return @@error

View file

@ -0,0 +1,180 @@
CREATE PROCEDURE [dbo].[up_insert_auctionItem]
@seller_name nvarchar(16),
@item_id [uniqueidentifier],
@character_id [uniqueidentifier],
@auth_id [uniqueidentifier],
@page_index int,
@slot_index int,
@code int,
@use_cnt int,
@remain_time int,
@gcode int,
@durability int,
@enhance_level int,
@option_1_code int,
@option_1_value int,
@option_2_code int,
@option_2_value int,
@option_3_code int,
@option_3_value int,
@OptionGroup int,
@ReconNum int,
@ReconState int,
@Socket_count int,
@Socket_1_code int,
@Socket_1_value int,
@Socket_2_code int,
@Socket_2_value int,
@Socket_3_code int,
@Socket_3_value int,
@expire_time int,
@selling_price int,
@start_price int,
@bidder_name nvarchar(16),
@bidder_auth_uid [uniqueidentifier],
@bidder_uid [uniqueidentifier],
@bid_price int,
@periodtime int,
@registertime bigint,
@activity_value int, --활성석 20100928 jojo
@socket_1_color tinyint, --소켓
@socket_2_color tinyint,
@socket_3_color tinyint,
@item_name nvarchar(30),
@item_level tinyint,
@item_category int,
@rank tinyint,
@acquireroute tinyint,
@physical int,
@magical int,
@durabilitymax int,
@weight int
as
set nocount on
set xact_abort on
begin
begin tran
insert dbo.AuctionListTable
(
[seller_name],
[item_uid],
[character_id],
[auth_id],
[page_index],
[slot_index],
[code],
[use_cnt],
[remain_time],
[create_time],
[update_time],
[gcode],
[durability],
[enhance_level],
[option_1_code],
[option_1_value],
[option_2_code],
[option_2_value],
[option_3_code],
[option_3_value],
[option_group],
[ReconNum],
[ReconState],
[socket_count],
[socket_1_code],
[socket_1_value],
[socket_2_code],
[socket_2_value],
[socket_3_code],
[socket_3_value],
[expire_time],
[selling_price],
[start_price],
[bidder_name],
[bidder_auth_uid],
[bidder_uid],
[bid_price],
[periodtime],
[registertime],
[activity_value], --활성석 20100928 jojo
[socket_1_color],
[socket_2_color],
[socket_3_color],
[item_name],
[item_level],
[item_category],
[rank],
[acquireroute],
[physical],
[magical],
[durabilitymax],
[weight]
)
values(
@seller_name,
@item_id,
@character_id,
@auth_id,
@page_index,
@slot_index,
@code,
@use_cnt,
@remain_time,
getdate(),
getdate(),
@gcode,
@durability,
@enhance_level,
@option_1_code,
@option_1_value,
@option_2_code,
@option_2_value,
@option_3_code,
@option_3_value,
@OptionGroup,
@ReconNum,
@ReconState,
@socket_count,
@socket_1_code,
@socket_1_value,
@socket_2_code,
@socket_2_value,
@socket_3_code,
@socket_3_value,
@expire_time,
@selling_price,
@start_price,
@bidder_name,
@bidder_auth_uid,
@bidder_uid,
@bid_price,
@periodtime,
@registertime,
@activity_value, --활성석 20100928 jojo
@socket_1_color,
@socket_2_color,
@socket_3_color,
@item_name,
@item_level,
@item_category,
@rank,
@acquireroute,
@physical,
@magical,
@durabilitymax,
@weight
)
delete from N_InventoryItem where [item_uid] = @item_id --모두 옮겼으므로 삭제
if(@@error <> 0 )
begin
rollback
return
end
commit
end

View file

@ -0,0 +1,124 @@
CREATE PROCEDURE [dbo].[up_insert_auctionsendmail]
@money int,
@NewMailID [uniqueidentifier],
@item_id [uniqueidentifier],
@character_id [uniqueidentifier],
@page_index int,
@slot_index int,
@code int,
@use_cnt int,
@remain_time int,
@gcode int,
@durability int,
@enhance_level int,
@option_1_code int,
@option_1_value int,
@option_2_code int,
@option_2_value int,
@option_3_code int,
@option_3_value int,
@OptionGroup int,
@ReconNum int,
@ReconState int,
@Socket_count int,
@Socket_1_code int,
@Socket_1_value int,
@Socket_2_code int,
@Socket_2_value int,
@Socket_3_code int,
@Socket_3_value int,
@expire_time int,
@recver_name nvarchar(16),
@msg nvarchar(100),
@mailtype int,
@activity_value int,--활성석 20100928 jojo
@socket_1_color tinyint, --소켓
@socket_2_color tinyint,
@socket_3_color tinyint,
@rank tinyint,
@acquireroute tinyint,
@physical int,
@magical int,
@durabilitymax int,
@weight int
as
set nocount on
declare @auth_id [uniqueidentifier]
set @auth_id = NULL
select @auth_id = [AuthID] from CharacterTable with (READUNCOMMITTED) where [Name] = @recver_name
begin tran
begin
insert into MailTable
values
( @NewMailID, --0
@character_id, --1
@recver_name, --2
@character_id, --3
@recver_name, --4
@msg, --3
@money, --4
9,
0,
0, --8
GETDATE(),
@mailtype
);
Exec dbo.up_auctionitemMoveToMailitem @item_id,
@character_id,
@auth_id,
@page_index,
@slot_index,
@code,
@use_cnt,
@remain_time,
@gcode,
@durability,
@enhance_level,
@option_1_code,
@option_1_value,
@option_2_code,
@option_2_value,
@option_3_code,
@option_3_value,
@OptionGroup,
@ReconNum,
@ReconState,
@Socket_count,
@Socket_1_code,
@Socket_1_value,
@Socket_2_code,
@Socket_2_value,
@Socket_3_code,
@Socket_3_value,
@expire_time,
@NewMailID,
@activity_value, --활성석 20100928 jojo
@socket_1_color, --소켓
@socket_2_color,
@socket_3_color,
@rank,
@acquireroute,
@physical,
@magical,
@durabilitymax,
@weight
end
declare @ERR int
SET @ERR = @@ERROR
IF @ERR <> 0 BEGIN
RAISERROR('처리오류', 16, 10)
IF @@TRANCOUNT <> 0 ROLLBACK
RETURN (@ERR)
END
COMMIT TRAN

View file

@ -0,0 +1,124 @@
CREATE PROCEDURE [dbo].[up_insert_auctionsendmail_copy1]
@money int,
@NewMailID [uniqueidentifier],
@item_id [uniqueidentifier],
@character_id [uniqueidentifier],
@page_index int,
@slot_index int,
@code int,
@use_cnt int,
@remain_time int,
@gcode int,
@durability int,
@enhance_level int,
@option_1_code int,
@option_1_value int,
@option_2_code int,
@option_2_value int,
@option_3_code int,
@option_3_value int,
@OptionGroup int,
@ReconNum int,
@ReconState int,
@Socket_count int,
@Socket_1_code int,
@Socket_1_value int,
@Socket_2_code int,
@Socket_2_value int,
@Socket_3_code int,
@Socket_3_value int,
@expire_time int,
@recver_name nvarchar(16),
@msg nvarchar(100),
@mailtype int,
@activity_value int,--활성석 20100928 jojo
@socket_1_color tinyint, --소켓
@socket_2_color tinyint,
@socket_3_color tinyint,
@rank tinyint,
@acquireroute tinyint,
@physical int,
@magical int,
@durabilitymax int,
@weight int
as
set nocount on
declare @auth_id [uniqueidentifier]
set @auth_id = NULL
select @auth_id = [AuthID] from CharacterTable with (READUNCOMMITTED) where [Name] = @recver_name
begin tran
begin
insert into MailTable
values
( @NewMailID, --0
@character_id, --1
@recver_name, --2
@character_id, --3
@recver_name, --4
@msg, --3
@money, --4
9,
0,
0, --8
GETDATE(),
@mailtype
);
Exec dbo.up_auctionitemMoveToMailitem @item_id,
@character_id,
@auth_id,
@page_index,
@slot_index,
@code,
@use_cnt,
@remain_time,
@gcode,
@durability,
@enhance_level,
@option_1_code,
@option_1_value,
@option_2_code,
@option_2_value,
@option_3_code,
@option_3_value,
@OptionGroup,
@ReconNum,
@ReconState,
@Socket_count,
@Socket_1_code,
@Socket_1_value,
@Socket_2_code,
@Socket_2_value,
@Socket_3_code,
@Socket_3_value,
@expire_time,
@NewMailID,
@activity_value, --활성석 20100928 jojo
@socket_1_color, --소켓
@socket_2_color,
@socket_3_color,
@rank,
@acquireroute,
@physical,
@magical,
@durabilitymax,
@weight
end
declare @ERR int
SET @ERR = @@ERROR
IF @ERR <> 0 BEGIN
RAISERROR('처리오류', 16, 10)
IF @@TRANCOUNT <> 0 ROLLBACK
RETURN (@ERR)
END
COMMIT TRAN

View file

@ -0,0 +1,21 @@
CREATE PROCEDURE [dbo].[up_insert_buff]
@character_id uniqueidentifier,
@type int,
@id int,
@time int
as
set nocount on
if NOT EXISTS (select @character_id from [dbo].[BuffTable] with (READUNCOMMITTED) where [character_id] = @character_id and [buff_type] = @type and [buff_id] = @id )
begin
insert into BuffTable
values
(
@character_id,
@type,
@id,
@time
);
end
return @@error

View file

@ -0,0 +1,37 @@
CREATE PROCEDURE [dbo].[up_insert_cash_effectinfo]
@item_id [uniqueidentifier],
@character_id [uniqueidentifier],
@package_code int,
@expire_time int
as
set nocount on
set xact_abort on
begin
begin tran
insert dbo.Cash_EffectTable
(
[item_uid],
[cha_uid],
[package_code],
[expire_time]
)
values(
@item_id,
@character_id,
@package_code,
@expire_time
)
if(@@error <> 0 )
begin
rollback
return
end
commit
end

View file

@ -0,0 +1,63 @@
CREATE PROCEDURE [dbo].[up_insert_cash_product_list]
@GiveCharName varchar(19),
@ProductID [uniqueidentifier],
@AuthID [uniqueidentifier],
@CashCode int,
@GiftRecvName nvarchar(16),
@AddOpt1 int,
@AddOpt2 int,
@AddOpt3 int
as
set nocount on
declare @auth_id [uniqueidentifier]
set xact_abort on
if @GiftRecvName = ''
begin
set @auth_id = @AuthID
set @GiveCharName = ''
end
else
begin
select @auth_id = [AuthID] from CharacterTable with (READUNCOMMITTED) where [Name] = @GiftRecvName
end
begin
begin tran
insert dbo.CashProductList
(
[ProductID],
[AuthID],
[CashCode],
[Date],
[State],
[GiveCharName],
[AddOpt1],
[AddOpt2],
[AddOpt3]
)
values(
@ProductID,
@auth_id,
@CashCode,
getdate(),
0,
@GiveCharName,
@AddOpt1,
@AddOpt2,
@AddOpt3
)
if(@@error <> 0 )
begin
rollback
return
end
commit
end

View file

@ -0,0 +1,48 @@
CREATE PROCEDURE [dbo].[up_insert_guild_increase_exp]
(
@guild_id [uniqueidentifier]
,@character_id [uniqueidentifier]
,@exp int
,@time NVARCHAR(20)
,@character_name nvarchar(16)
)
AS
declare @experience bigint
declare @charexp int
SET NOCOUNT ON
IF EXISTS(select guild_id from GuildTable with (READUNCOMMITTED) where guild_id = @guild_id)
BEGIN
--캐릭터의 길드 포인트를 감소 시킨다
SELECT @charexp = GuildPoint FROM CharacterTable with (READUNCOMMITTED) WHERE character_ID = @character_id
IF( 0>=@charexp OR 0>=(@charexp - @exp) )
BEGIN
SET @charexp = 0
END
ELSE
BEGIN
SET @charexp = @charexp - @exp
END
UPDATE CharacterTable SET GuildPoint = @charexp WHERE character_ID = @character_id
--길드 포인트 주입
SELECT @experience = experience FROM GuildTable with (READUNCOMMITTED) WHERE guild_id = @guild_id
SET @experience = @experience + @exp
UPDATE GuildTable SET experience = @experience WHERE guild_id = @guild_id
INSERT INTO tbl_Guild_Exp_List VALUES ( @guild_id
,@character_id
,@exp
,@time
,@character_name
)
END
RETURN @@error

View file

@ -0,0 +1,64 @@
CREATE PROCEDURE [dbo].[up_insert_guild_member]
@guild_id [uniqueidentifier],
@character_id [uniqueidentifier],
@name nvarchar(16),
@alias_name nvarchar(16),
@grade int,
@class int,
@level int
AS
BEGIN
SET NOCOUNT ON;
SET XACT_ABORT ON;
DECLARE @check_character_id [uniqueidentifier];
DECLARE @result_code INT;
SET @check_character_id = NULL;
SET @result_code = 1; --1 : 성공 / -1 : 프로시저 오류 / -2 : INSERT 실패 / -3 : UPDATE 실패
BEGIN TRY
BEGIN TRAN;
SELECT @check_character_id = [character_id] from GuildMemberTable with (READUNCOMMITTED) where [character_id] = @character_id; --AND [guild_id] = @guild_id
IF( @check_character_id IS NULL )
BEGIN
INSERT INTO GuildMemberTable
VALUES
( @guild_id, --0
@character_id, --1
@name, --2
@alias_name, --3
@grade,
@class, --4
@level,
GetDate()
);
UPDATE [dbo].[CharacterTable] SET [GuildID]=@guild_id WHERE [character_id] = @character_id
END
ELSE
BEGIN
SET @result_code = -2;
END
COMMIT TRAN;
SELECT result_code = @result_code; --결과 코드 전달
END TRY
BEGIN CATCH
ROLLBACK TRAN;
SELECT result_code = -1;
END CATCH
END

View file

@ -0,0 +1,114 @@
CREATE PROCEDURE [dbo].[up_insert_guild_skill]
(
@guild_id [uniqueidentifier],
@learn_user_id [uniqueidentifier],
@skill_table_id int,
@skill_id int,
@skill_level tinyint,
@learn_cost int,
@is_update tinyint -- 0 이면 INSERT, 1 이면 UPDATE
)
AS
BEGIN
SET NOCOUNT ON;
SET XACT_ABORT ON;
DECLARE @check_user_id UNIQUEIDENTIFIER;
DECLARE @check_user_gold INT;
DECLARE @old_skill_id INT;
DECLARE @guild_gold INT;
DECLARE @result_code INT;
SET @check_user_gold = 0;
SET @check_user_id = NULL;
SET @check_user_gold = 0;
SET @old_skill_id = NULL;
SET @guild_gold = 0;
SET @result_code = 1;
BEGIN TRY
BEGIN TRAN;
SELECT TOP 1 @check_user_id=[character_id], @check_user_gold=[gold] FROM CharacterTable WITH (READUNCOMMITTED) WHERE [character_id] = @learn_user_id;
SELECT TOP 1 @old_skill_id = [skill_id] FROM dbo.tbl_Guild_Skill WITH (READUNCOMMITTED) WHERE [guild_id]=@guild_id and [skill_id]=@skill_id;
IF( (@check_user_id IS NOT NULL) AND (@check_user_gold >= @learn_cost) )
BEGIN
-- UPDATE 요청일 경우
IF 1 = @is_update
BEGIN
IF @old_skill_id IS NULL
BEGIN
-- 길드 스킬이 이미 존재하지 않다면 에러 전달
SET @result_code = -3;
END
ELSE
BEGIN
UPDATE dbo.tbl_Guild_Skill SET
[skill_table_id] = @skill_table_id,
[skill_level] = @skill_level,
[skill_learn_time] = GETDATE()
WHERE [guild_id]=@guild_id AND [skill_id]=@skill_id
END
END
-- INSERT 요청 처리
ELSE
BEGIN
IF @old_skill_id IS NULL
BEGIN
INSERT INTO tbl_Guild_Skill ( [guild_id], [skill_table_id], [skill_id], [skill_level], [skill_learn_time] )
VALUES ( @guild_id, @skill_table_id, @skill_id, @skill_level, GETDATE() )
END
ELSE
BEGIN
-- 길드 스킬이 존재 한다면 에러 전달
SET @result_code = -2;
END
END
-- 비용 차감
IF 1 = @result_code
BEGIN
DECLARE @result_gold INT;
SET @result_gold = (@check_user_gold - @learn_cost);
IF( @result_gold < 0 )
BEGIN
SET @result_gold = 0;
END
UPDATE [dbo].[CharacterTable] SET [gold] = @result_gold WHERE [character_id] = @learn_user_id
END
END
ELSE
BEGIN
-- 프로시저 조건 검사 실패
SET @result_code = -5;
END
COMMIT TRAN;
SELECT result_code = @result_code; --결과 코드 전달
END TRY
BEGIN CATCH
ROLLBACK TRAN;
SELECT result_code = -1;
END CATCH
END

View file

@ -0,0 +1,144 @@
CREATE PROCEDURE [dbo].[up_insert_guild_storage]
(
@item_uid uniqueidentifier
,@character_id uniqueidentifier
,@auth_id uniqueidentifier
,@page_index int
,@slot_index int
,@code int
,@use_cnt int
,@remain_time int
,@gcode int
,@durability int
,@enhance_level int
,@option_1_code int
,@option_1_value int
,@option_2_code int
,@option_2_value int
,@option_3_code int
,@option_3_value int
,@option_group int
,@ReconNum int
,@ReconState tinyint
,@socket_count int
,@socket_1_code int
,@socket_1_value int
,@socket_2_code int
,@socket_2_value int
,@socket_3_code int
,@socket_3_value int
,@expire_time int
,@guild_id uniqueidentifier
,@activity_value int
,@link_id uniqueidentifier
,@socket_1_color tinyint
,@socket_2_color tinyint
,@socket_3_color tinyint
,@rank tinyint
,@acquireroute tinyint
,@physical int
,@magical int
,@durabilitymax int
,@weight int
)
AS
SET NOCOUNT ON
INSERT into tbl_Guild_Storage_Item ( item_uid
,character_id
,auth_id
,page_index
,slot_index
,code
,use_cnt
,remain_time
,create_time
,update_time
,gcode
,durability
,enhance_level
,option_1_code
,option_1_value
,option_2_code
,option_2_value
,option_3_code
,option_3_value
,option_group
,ReconNum
,ReconState
,socket_count
,socket_1_code
,socket_1_value
,socket_2_code
,socket_2_value
,socket_3_code
,socket_3_value
,expire_time
,guild_id
,activity_value
,link_id
,socket_1_color
,socket_2_color
,socket_3_color
,rank
,acquireroute
,physical
,magical
,durabilitymax
,weight
)values( @item_uid
,@character_id
,@auth_id
,@page_index
,@slot_index
,@code
,@use_cnt
,@remain_time
,getdate()
,getdate()
,@gcode
,@durability
,@enhance_level
,@option_1_code
,@option_1_value
,@option_2_code
,@option_2_value
,@option_3_code
,@option_3_value
,@option_group
,@ReconNum
,@ReconState
,@socket_count
,@socket_1_code
,@socket_1_value
,@socket_2_code
,@socket_2_value
,@socket_3_code
,@socket_3_value
,@expire_time
,@guild_id
,@activity_value
,@link_id
,@socket_1_color
,@socket_2_color
,@socket_3_color
,@rank
,@acquireroute
,@physical
,@magical
,@durabilitymax
,@weight
)
--길드 창고에 아이템 INSERT 성공 시 유저의 인벤토리 아이템 삭제 처리
IF EXISTS (select [item_uid] from tbl_Guild_Storage_Item with (READUNCOMMITTED) WHERE [item_uid]=@item_uid )
BEGIN
IF EXISTS (select [item_uid] from N_InventoryItem with (READUNCOMMITTED) WHERE [item_uid]=@item_uid )
BEGIN
delete from N_InventoryItem where [item_uid]=@item_uid --모두 옮겼으므로 삭제
END
END
RETURN @@error

View file

@ -0,0 +1,19 @@
CREATE PROCEDURE [dbo].[up_insert_guild_storage_use_log]
(
@guild_id [uniqueidentifier]
,@use_type TINYINT
,@use_time NVARCHAR(20)
,@character_name NVARCHAR(16)
,@description NVARCHAR(30)
)
AS
SET NOCOUNT ON
INSERT INTO tbl_Guild_Storage_Use_List VALUES ( @guild_id
,@use_type
,@use_time
,@character_name
,@description
)
RETURN @@error

View file

@ -0,0 +1,31 @@
CREATE PROCEDURE [dbo].[up_insert_inquiry]
@auth_id uniqueidentifier,
@character_id uniqueidentifier,
@type tinyint,
@character_name nvarchar(16),
@bcust_id nvarchar(50),
@count tinyint,
@memo nvarchar(255),
@compulsion tinyint,
@registertime datetime
as
set nocount on
if NOT EXISTS (select @character_id from [dbo].[InquiryTable] with (READUNCOMMITTED) where [character_id] = @character_id)
begin
insert into InquiryTable
values
(
@auth_id,
@character_id,
@type,
@character_name,
@bcust_id,
@count,
@memo,
@compulsion,
@registertime
);
end
return @@error

View file

@ -0,0 +1,40 @@
CREATE PROCEDURE [dbo].[up_insert_inquiry_by_gm]
@type tinyint,
@character_name nvarchar(16),
@memo nvarchar(255),
@compulsion tinyint
as
set nocount on
declare @auth_id uniqueidentifier
declare @character_id uniqueidentifier
declare @bcust_id nvarchar(50)
declare @count tinyint
set @bcust_id = ''
select @auth_id = [AuthID], @character_id = [character_id], @bcust_id = RTRIM(bcust_id) from [dbo].[CharacterTable] with (READUNCOMMITTED) where [Name] = @character_name
select @count = [InquiryCount] from [RustyHearts_Auth].[dbo].[AuthTable] with (READUNCOMMITTED) where [AuthID] = @auth_id
set xact_abort on
if NOT EXISTS ( select @character_id from [dbo].[InquiryTable] with (READUNCOMMITTED) where [character_id] = @character_id )
begin
insert into InquiryTable
values
(
@auth_id,
@character_id,
@type,
@character_name,
@bcust_id,
@count,
@memo,
@compulsion,
GETDATE()
);
end
select * from [dbo].[InquiryTable] with (READUNCOMMITTED) where character_id = @character_id
return @@error

View file

@ -0,0 +1,115 @@
CREATE PROCEDURE [dbo].[up_insert_item_Mail]
@sender_character_id [uniqueidentifier],
@sender_name nvarchar(16),
@recver_name nvarchar(16),
@msg nvarchar(100),
@money int,
@return_day int,
@req_money int,
@NewMailID [uniqueidentifier],
@createType int,
--------------------------------------------
@item_id [uniqueidentifier],
@code int,
@use_cnt int,
@remain_time int,
@gcode int,
@durability int,
@enhance_level int,
@option_1_code int,
@option_1_value int,
@option_2_code int,
@option_2_value int,
@option_3_code int,
@option_3_value int,
@option_group int,
@ReconNum int,
@ReconState tinyint,
@socket_count int,
@socket_1_code int,
@socket_1_value int,
@socket_2_code int,
@socket_2_value int,
@socket_3_code int,
@socket_3_value int,
@expire_time int,
@activity_value int,--활성석 20100928 jojo
@link_id [uniqueidentifier],
@socket_1_color tinyint,
@socket_2_color tinyint,
@socket_3_color tinyint,
@rank tinyint,
@acquireroute tinyint,
@physical int,
@magical int,
@durabilitymax int,
@weight int
as
set nocount on
declare @character_id [uniqueidentifier],
@auth_id [uniqueidentifier]
begin tran
select @auth_id = [AuthID], @character_id = [character_id] from CharacterTable with (READUNCOMMITTED) where [Name] = @recver_name
insert into MailTable values ( @NewMailID, --0
@character_id, --1
@recver_name, --2
@sender_character_id, --3
@sender_name, --4
@msg, --3
@money, --4
@return_day,
@req_money,
0, --8
GETDATE(),
@createType );
Exec dbo.up_insert_item_MailItem @character_id,
@auth_id,
@item_id,
@code,
@use_cnt,
@remain_time,
@gcode,
@durability,
@enhance_level,
@option_1_code,
@option_1_value,
@option_2_code,
@option_2_value,
@option_3_code,
@option_3_value,
@option_group,
@ReconNum,
@ReconState,
@socket_count,
@socket_1_code,
@socket_1_value,
@socket_2_code,
@socket_2_value,
@socket_3_code,
@socket_3_value,
@expire_time,
@NewMailID,
@activity_value, --활성석 20100928 jojo
@link_id,
@socket_1_color,
@socket_2_color,
@socket_3_color,
@rank,
@acquireroute,
@physical,
@magical,
@durabilitymax,
@weight
declare @ERR int
SET @ERR = @@ERROR
IF @ERR <> 0
BEGIN
RAISERROR('처리오류', 16, 10)
IF @@TRANCOUNT <> 0 ROLLBACK
RETURN (@ERR)
END
COMMIT TRAN

View file

@ -0,0 +1,143 @@
CREATE PROCEDURE [dbo].[up_insert_item_MailItem]
@character_id [uniqueidentifier],
@auth_id [uniqueidentifier],
@item_id [uniqueidentifier],
@code int,
@use_cnt int,
@remain_time int,
@gcode int,
@durability int,
@enhance_level int,
@option_1_code int,
@option_1_value int,
@option_2_code int,
@option_2_value int,
@option_3_code int,
@option_3_value int,
@option_group int,
@ReconNum int,
@ReconState tinyint,
@socket_count int,
@socket_1_code int,
@socket_1_value int,
@socket_2_code int,
@socket_2_value int,
@socket_3_code int,
@socket_3_value int,
@expire_time int,
@NewMailID [uniqueidentifier],
@activity_value int,--활성석 20100928 jojo
@link_id [uniqueidentifier],
@socket_1_color tinyint,
@socket_2_color tinyint,
@socket_3_color tinyint,
@rank tinyint,
@acquireroute tinyint,
@physical int,
@magical int,
@durabilitymax int,
@weight int
as
set nocount on
set xact_abort on
begin tran
insert dbo.N_MailItem
([item_uid],
[character_id],
[auth_id],
[page_index],
[slot_index],
[code],
[use_cnt],
[remain_time],
[create_time],
[update_time],
[gcode],
[durability],
[enhance_level],
[option_1_code],
[option_1_value],
[option_2_code],
[option_2_value],
[option_3_code],
[option_3_value],
[option_group],
[ReconNum],
[ReconState],
[socket_count],
[socket_1_code],
[socket_1_value],
[socket_2_code],
[socket_2_value],
[socket_3_code],
[socket_3_value],
[expire_time],
[activity_value],--활성석 20100928 jojo
[link_id],
[socket_1_color],
[socket_2_color],
[socket_3_color],
[rank],
[acquireroute],
[physical],
[magical],
[durabilitymax],
[weight]
)
select
@item_id,
@character_id,
@auth_id,
61,--[page_index],
0, --[slot_index],
@code,
@use_cnt,
@remain_time,
GetDate(),
GetDate(),
@gcode,
@durability,
@enhance_level,
@option_1_code,
@option_1_value,
@option_2_code,
@option_2_value,
@option_3_code,
@option_3_value,
@option_group,
@ReconNum,
@ReconState,
@socket_count,
@socket_1_code,
@socket_1_value,
@socket_2_code,
@socket_2_value,
@socket_3_code,
@socket_3_value,
@expire_time,
@activity_value, --활성석 20100928 jojo
@link_id,
@socket_1_color,
@socket_2_color,
@socket_3_color,
@rank,
@acquireroute,
@physical,
@magical,
@durabilitymax,
@weight
--메일아이템을 메일과 연결
UPDATE [dbo].[N_MailItem] SET [mail_uid] = @NewMailID WHERE [item_uid] = @item_id
declare @ERR int
SET @ERR = @@ERROR
IF @ERR <> 0
BEGIN
RAISERROR('처리오류', 16, 10)
IF @@TRANCOUNT <> 0 ROLLBACK
RETURN (@ERR)
END
COMMIT TRAN

View file

@ -0,0 +1,114 @@
CREATE PROCEDURE [dbo].[up_insert_item_mail_by_gm]
@sender_name nvarchar(16),
@recver_name nvarchar(16),
@msg nvarchar(100),
@money int,
@return_day int,
@req_money int,
@NewMailID [uniqueidentifier],
@createType int,
--------------------------------------------
@item_id [uniqueidentifier],
@code int,
@use_cnt int,
@remain_time int,
@gcode int,
@durability int,
@enhance_level int,
@option_1_code int,
@option_1_value int,
@option_2_code int,
@option_2_value int,
@option_3_code int,
@option_3_value int,
@option_group int,
@ReconNum int,
@ReconState tinyint,
@socket_count int,
@socket_1_code int,
@socket_1_value int,
@socket_2_code int,
@socket_2_value int,
@socket_3_code int,
@socket_3_value int,
@expire_time int,
@activity_value int,--활성석 20100928 jojo
@link_id [uniqueidentifier],
@socket_1_color tinyint,
@socket_2_color tinyint,
@socket_3_color tinyint,
@rank tinyint,
@acquireroute tinyint,
@physical int,
@magical int,
@durabilitymax int,
@weight int
as
set nocount on
declare @character_id [uniqueidentifier],
@auth_id [uniqueidentifier]
begin tran
select @auth_id = [AuthID], @character_id = [character_id] from CharacterTable with (READUNCOMMITTED) where [Name] = @recver_name
insert into MailTable values ( @NewMailID, --0
@character_id, --1
@recver_name, --2
@character_id, --3
@sender_name, --4
@msg, --3
@money, --4
@return_day,
@req_money,
0, --8
GETDATE(),
@createType );
Exec dbo.up_insert_item_MailItem @character_id,
@auth_id,
@item_id,
@code,
@use_cnt,
@remain_time,
@gcode,
@durability,
@enhance_level,
@option_1_code,
@option_1_value,
@option_2_code,
@option_2_value,
@option_3_code,
@option_3_value,
@option_group,
@ReconNum,
@ReconState,
@socket_count,
@socket_1_code,
@socket_1_value,
@socket_2_code,
@socket_2_value,
@socket_3_code,
@socket_3_value,
@expire_time,
@NewMailID,
@activity_value, --활성석 20100928 jojo
@link_id,
@socket_1_color,
@socket_2_color,
@socket_3_color,
@rank,
@acquireroute,
@physical,
@magical,
@durabilitymax,
@weight
declare @ERR int
SET @ERR = @@ERROR
IF @ERR <> 0
BEGIN
RAISERROR('처리오류', 16, 10)
IF @@TRANCOUNT <> 0 ROLLBACK
RETURN (@ERR)
END
COMMIT TRAN

View file

@ -0,0 +1,16 @@
CREATE PROCEDURE [dbo].[up_insert_log_connection]
@log_type smallint,
@auth_id [uniqueidentifier],
@character_id [uniqueidentifier],
@world_id int,
@Gold int,
@character_name nvarchar(50),
@real_ip varchar(16),
@Otherauth_id int,
@Otherbcust_id int,
@Other_id int,
@Otherch int,
@bcust_id nvarchar(50)
as

View file

@ -0,0 +1,10 @@
CREATE PROCEDURE [dbo].[up_insert_log_packet_overload]
@func_name char(100),
@time int
as begin
set nocount on
-- temp procedure
end

View file

@ -0,0 +1,70 @@
CREATE PROCEDURE [dbo].[up_insert_mail]
@sender_auth_id [uniqueidentifier],
@sender_character_id [uniqueidentifier],
@sender_name nvarchar(16),
@recver_name nvarchar(16),
@msg nvarchar(100),
@money int,
@return_day int,
@req_money int,
@NewMailID [uniqueidentifier],
@createType int
as
set nocount on
declare @character_id [uniqueidentifier]
set @character_id = NULL
begin tran
select @character_id = [character_id] from CharacterTable with (READUNCOMMITTED) where [Name] = @recver_name
if @character_id IS NULL
begin
insert into MailTable
values
( @NewMailID, --0
@sender_character_id, --1
@recver_name, --2
@sender_character_id, --3
@sender_name, --4
@msg, --3
@money, --4
@return_day,
@req_money,
0, --8
GETDATE(),
16
);
end
else
begin
insert into MailTable
values
( @NewMailID, --0
@character_id, --1
@recver_name, --2
@sender_character_id, --3
@sender_name, --4
@msg, --3
@money, --4
@return_day,
@req_money,
0, --8
GETDATE(),
@createType
);
end
declare @ERR int
SET @ERR = @@ERROR
IF @ERR <> 0 BEGIN
RAISERROR('처리오류', 16, 10)
IF @@TRANCOUNT <> 0 ROLLBACK
RETURN (@ERR)
END
COMMIT TRAN

Some files were not shown because too many files have changed in this diff Show more