Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

[Tutorial]Char Delete LOG

Newbie Spellweaver
Joined
Sep 6, 2014
Messages
35
Reaction score
10
This Tutorial for make Char Delete Logs in DB

Table by obamabf2
Code:
USE [warz]GO



/****** Object:  Table [dbo].[CharsLog]    Script Date: 08/29/2015 22:23:44 ******/
SET ANSI_NULLS ON
GO




SET QUOTED_IDENTIFIER ON
GO




CREATE TABLE [dbo].[CharsLog](
    [id] [int] IDENTITY(1,1) NOT NULL,
    [CharMessage] [nvarchar](50) NOT NULL,
    [CustomerID] [int] NOT NULL,
    [CharID] [int] NOT NULL,
    [GamerTag] [nvarchar](64) NOT NULL,
    [time] [datetime] NOT NULL,
PRIMARY KEY CLUSTERED 
(
    [id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]




GO

Step 1 Open warz.sln and find this
Code:
int CClientUserProfile::ApiCharDelete()

and reply to
Code:
int CClientUserProfile::ApiCharDelete(const char* Gamertag)

and you see the line for
Code:
CWOBackendReq req(this, "api_CharSlots.aspx");    req.AddParam("func",   "delete");
    req.AddParam("CharID", w.LoadoutID);

now add under this
Code:
req.AddParam("Gamertag", Gamertag);

find this
Code:
int        ApiCharDelete();

and reply to
Code:
int        ApiCharDelete(const char* Gamertag);

find this
Code:
unsigned int WINAPI FrontendWarZ::as_DeleteCharThread(void* in_data)

and see the line
Code:
int apiCode = gUserProfile.ApiCharDelete();

and reply to
Code:
int apiCode = gUserProfile.ApiCharDelete(This->m_CreateGamerTag);

Step 2 Open WZBackend-ASP.NET.sln and api_CharSlots.aspx.cs Find this
Code:
void CharDelete()

see the line
Code:
string CustomerID = web.CustomerID();

and add this under
Code:
string Gamertag = web.Param("Gamertag");

and see
Code:
sqcmd.Parameters.AddWithValue("@in_CustomerID", CustomerID);

add this under
Code:
sqcmd.Parameters.AddWithValue("@in_Gamertag", Gamertag);

Step 3 Open WZ_CharDelete Procedure in DB and add this under @in_CustomerID int,
Code:
@in_Gamertag nvarchar(64),

find this
Code:
delete from UsersChars where CharID=@in_CharID

and this on top line
Code:
declare @[I][B][URL="https://forum.ragezone.com/members/1333464006.html"]old[/URL][/B][/I]Gamertag nvarchar(64)    
select @[I][B][URL="https://forum.ragezone.com/members/1333464006.html"]old[/URL][/B][/I]Gamertag=Gamertag from UsersChars where CharID=@in_CharID
INSERT INTO CharsLog (CharMessage, CustomerID, CharID, GamerTag, time) VALUES ('Delete', @in_CustomerID, @in_CharID, @[I][B][URL="https://forum.ragezone.com/members/1333464006.html"]old[/URL][/B][/I]Gamertag, GETDATE())
 
Last edited:
Junior Spellweaver
Joined
Aug 2, 2004
Messages
125
Reaction score
16
why ?

why don't just edit store procedure WZ_CharDelete

add:
Code:
declare [USER=551894]Char[/USER]Name nvarchar(64) = ''

edit :
Code:
select @ClanID=ClanID, @ClanRank=ClanRank from UsersChars where CharID=@in_CharID
 to
select @ClanID=ClanID, @ClanRank=ClanRank, [USER=551894]Char[/USER]Name=Gamertag from UsersChars where CharID=@in_CharID

and then :

Code:
insert into DBG_CharDelete values (GETDATE(), @in_CustomerID, @in_CharID, [USER=551894]Char[/USER]Name)

simple
 
Back
Top