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!

[Release] Free Silk Loaded During Registration

Newbie Spellweaver
Joined
Sep 18, 2007
Messages
20
Reaction score
10
I have decided to release a procedure that will load Gift Silk when a player registers.

this was created to work with most php registration pages and has worked great on a test server i was using it on.


here is the php code that must be input into the reg page

Code:
$serverName = "[COLOR=Red][U][B]DBServername[/B][/U][/COLOR]";
$connectionInfo = array("UID"=>"[COLOR=Red][U][B]DBUSER[/B][/U][/COLOR]", "PWD"=>"[COLOR=Red][U][B]DBPASS[/B][/U][/COLOR]", "Database"=>"SRO_VT_ACCOUNT");
$conn = sqlsrv_connect( $serverName, $connectionInfo);
if( $conn === false )
{
     echo "Could not connect.\n";
     die( print_r( sqlsrv_errors(), true));
}

/* Set up and execute the query. */
$sql = "SELECT JID
         FROM TB_User
         WHERE StrUserID='$[COLOR=Blue][U][B]USERNAME[/B][/U][/COLOR]'";
$stmt = sqlsrv_query( $conn, $sql);
if( $stmt === false ) {
     die( print_r( sqlsrv_errors(), true));
}

if( sqlsrv_fetch( $stmt ) === false) {
     die( print_r( sqlsrv_errors(), true));
}

$jid = sqlsrv_get_field( $stmt, 0);



                                     $addsilk = "exec _RegSilk '$jid', 0, 0, 0"; 
                            sqlsrv_query($conn, $addsilk);



sqlsrv_free_stmt( $stmt);
sqlsrv_close( $conn);
The bold red if for database info and the blue is for the Username
post field name.


Here is the stored procedure used with this php script
Code:
USE [SRO_VT_ACCOUNT]
GO
/****** Object:  StoredProcedure [dbo].[_RegSilk]    Script Date: 01/03/2012 23:54:36 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

ALTER                   PROCEDURE [dbo].[_RegSilk]
    @JID int,
    @silk_own int,
    @silk_gift int,
    @silk_point   int
    
as
    insert SK_Silk (JID, silk_own, silk_gift, silk_Point)
    values (@JID, 0, [COLOR=Red][U][B]GiftAmount[/B][/U][/COLOR], 0)
to keep from having people using google chrome to set there own amount of silk when they register make sure to only edit the GiftAmount in the stored procedure with the amount you want new accounts to have.

i hope this is useful for people and enjoy.
 
Newbie Spellweaver
Joined
Sep 18, 2007
Messages
20
Reaction score
10
the stored procedure i created will work to load the silk but you will have to manually enter the info.

the reg page code and stored procedure combined will automatically add the set silk amount once the player completes the registration.there for you don't have to do anything after someone has registered.
 
Junior Spellweaver
Joined
Oct 2, 2011
Messages
113
Reaction score
23
aha got it ..

btw i think this stored procedure [dbo].[_RegSilk] is not at my SRO_VT_ACCOUNT
would make a query to add it ?
 
Newbie Spellweaver
Joined
Sep 18, 2007
Messages
20
Reaction score
10
just change the
ALTER PROCEDURE [dbo].[_RegSilk]
to
CREATE PROCEDURE [dbo].[_RegSilk]

and execute it.
 
Junior Spellweaver
Joined
Dec 14, 2011
Messages
115
Reaction score
0
how i can do it in sroparadise site ?
i put the code in register page and i got error !
 
Newbie Spellweaver
Joined
May 12, 2012
Messages
74
Reaction score
2
Thank You For that Post really Helped me but i have 2 questions Because we are not Coder
1- where specifically put First Code in reg page
2-
WHERE StrUserID='$USERNAME'";
what should i write here specifically
 
Back
Top