PDA

View Full Version : [SHARE] Petition + database schema


aralyon
03.09.2006, 14:42
This is my very first bigger share, so be patient please, I’m not so skilled like others are :)
This is complete tutorial how to install PetitionD server and how to configure it. The server is from NCSoft, I haven’t changed anything. The database is my own work, because standard database schema is for old petition server, which doesn’t work with C4 retail. So I had to make totally different database schema, compatible with this client.
So let’s start with database:

PART I – DATABASE
Everything is tested on MS SQL server 2005, I was too lazy to looking for 2000 and installing it.
1. Create empty database for petition (in my examples it is call called ‘petition’)
http://aralyon.ratafak.net/peti/1a.jpg
http://aralyon.ratafak.net/peti/1b.jpg
2. Think out connection string – it’s string containing all information about connecting to database (Petition server DOESN’T use DSN like other parts of L2 server)
There are 2 ways how to connect
a) Windows authentication
You authenticate to mssql with your windows username and password - the connection string is
SERVER=(Server name);DATABASE=(Database name);Integrated security=true

EXAMPLE: SERVER=.;DATABASE=petition;Integrated security=true
b) Classic authetification using SQL login (recommended) and password
SERVER=(Server name);DATABASE=(Database name);UID=User name;PWD=Password

EXAMPLE: SERVER=hades;DATABASE=petidb;UID=sysdev;PWD=tltmxp aroqkftlf1234!

3. Open db_schema\petition_schema.sql in MSSQL Management studio (or Query Analyzer in MSSQL2000)
4. Write connection string to INSERT INTO statement, as shown below:
http://aralyon.ratafak.net/peti/1c.jpg
5. Set current database to your petition database in toolbar
http://aralyon.ratafak.net/peti/1d.jpg
6. Execute it, it should return no error

PART II – SERVER
1) Choose mode - you can use it like service (originally) or (with my loader) like console program.
2) Installing service - skip if you want to use it like console program
Use InstallUtil from .NET installation directory (I think that it is explained somewhere in other topic.
Syntax is: InstallUtil.exe c:\yourL2server\PetitionD\PetitionD.exe
Some informations about it - http://msdn2.microsoft.com/en-us/library/50614e95.aspx

3) Make encrypted connection string:
1) Write your connection string from step 1.2 to a text file (e.g. connstr.txt)
2) Encrypt it with DES.exe many thanks to Digital - write name of the text file with connection string to field "File to encrypt" and then click on "Encrypt" button. It should show you a "Done" message and create .enc file (e.g. connstr.txt.enc)
http://aralyon.ratafak.net/peti/2a.jpg
3) it contains encrypted connection string.

4) Edit PetitionD.exe.config (for service version) or PetitionConsole.exe.config (for console version). Configuration options are in format <add key="Name" value="Value"></add>
Description of configuration file:
GmServicePort - port for connecting from GM client
WorldServicePort - port for connection from gameserver, it must be the same as [PetitionD] - port in l2server.ini
NoticeServicePort - I don't know yet, I'll have a look later
AuthIp - Ip address of AuthD (It needs auth to authenticate GM client)
AuthPort - admin port of AuthD
AuthConnCount - size of connection pool
LogDirectory - directory to store log files
EnableQuota, MaxQuota - Quote about number of petitions from one player, leave it off, because it isn't done yet
RunMode - can be "test" or "normal", it is highly recommended to set it on "normal"
DumpPacket - enables dumping packets to log file (I recommend to disable, it is for debugging purposes only)
ServerStatusRefreshInterval - ???
DatabaseConnString - encrypted connection string - you MUST change it to corrent values, otherwise it doesnt work!
DatabaseConnName - leave it, it is name of the connection string in NCDBA7
DatabaseConnCount,DatabaseConnTimeout - leave it
MaxActivePetition - maximum number of petitions
MinimumGmClientBuildNumber - minimum version of GM client
EnableGmStatusDump - ???
EnableAssignment - ???
MaxAssignmentPerGm - ???
EnableOnlineCheck - ???

So it is everyting, now petition server is configured. you can start console version with PetitionConsole.exe and service version in service manager in control panel.
It is not still fully tested, but I hope there is no more bugs. If you find anything, please write it to this topic or send me icq or msn message

There is one big problem related to it - It looks like external gm client is needed, because the only method which can get petition into state 3 (petition after submitting is in state 2) is called from gm client listener handler (=invoked by gm client).
But gm client supplied with server doesnt work, probably it is intended to use with old petitionD.
I wrote one, it is here - https://postpacific.mmorpg-game.online/forums/showthread.php?p=66313. GMs can't do nearly anything with submitted petition with L2 client, you have to use GM client. The only builder command related to petition (which I know what it si doing is //force_peti <charname> <petition content> which forces player to submit a petition.
Security notice - for security reasons restrict database access for petition server, there might be security issues, it is unlikely,but it is possible.

Enjoy it :)

Download: http://aralyon.ratafak.net/peti/PetitionD.rar
- password: postpacifik
- it includes all files and tools described in this topic

GM Petition client:
forum thread - https://postpacific.mmorpg-game.online/forums/showthread.php?p=66313
direct download - http://aralyon.ratafak.net/peti/gmclient.rar

Do you have problems with submitting petitions with UnexpectedCategory error?
The problem is that you shouldn't have a empty PetitionCategory.txt in the /script/ folder. If you have that, delete it and done

Cardon
03.09.2006, 14:56
Very fascinating, and a great share/research indeed.

You have my respect mate.

Great work!

mantrastic
03.09.2006, 15:05
nice, been looking for that info,
great work! =D

MuNLoK
03.09.2006, 15:52
Wow, really good share... I go to test now. Thank you aralyon ;)

godfather
03.09.2006, 16:09
nice share ty :)

is it secure ? (sql injection etc)

FidoW
03.09.2006, 16:20
Good share, but petition_schema.sql isnt compatible with SQL2k :P

MuNLoK
03.09.2006, 16:29
Ok, tested, work perfectly :D The l2server is connecting good to the petition, but I have a problem.

When I tried to send one petition in the game, with a player, I get "Already applied for petition", and I see in the log:

2006-09-03 18:26:38 D [World: Lineage2 (1)] RECV: W_SUBMIT_PETITION6(169)
2006-09-03 18:26:38 I Fail Log: UnexpectedCategory
2006-09-03 18:26:38 D [World: Lineage2 (1)] SEND: W_SUBMIT_PETITION_FAIL4(142)

Is it a error? What happens? Perhaps one incorrect config?

Thank you for this share, is great!

aralyon
03.09.2006, 16:39
Ok, tested, work perfectly :D The l2server is connecting good to the petition, but I have a problem.

When I try tro send one petition in the game, with a player, I get "Already applied for petition", and I see in the log:

2006-09-03 18:26:38 D [World: Lineage2 (1)] RECV: W_SUBMIT_PETITION6(169)
2006-09-03 18:26:38 I Fail Log: UnexpectedCategory
2006-09-03 18:26:38 D [World: Lineage2 (1)] SEND: W_SUBMIT_PETITION_FAIL4(142)

Is it a error? What happens? Perhaps one incorrect config?

Thank you for this share, is great!

A category (in table category) is missing. I tried every category and it was ok .... which category did you selected? And do you have data in category table?

mantrastic
03.09.2006, 16:46
ye he said he made it for sql2k5 :P

Onepex
03.09.2006, 16:50
Nice work.

MuNLoK
03.09.2006, 16:53
I tried every category and all give me the same error. I have this data in category table:

2 1 Immobility False
2 2 Game tips False
2 3 Bug report False
2 4 Quest related False
2 5 Suggestions False
2 6 Report a bad user False
2 8 Recovery related False
2 9 Operation related False
2 255 Other False

Complete log file:


2006-09-03 18:20:22 N Petition Service Start (build 20011)
2006-09-03 18:20:22 N Make Database 10 Connections
2006-09-03 18:20:22 N Clear GM Status
2006-09-03 18:20:22 I Load Petition Category
2006-09-03 18:20:22 I 1: Immobility
2006-09-03 18:20:22 I 2: Game tips
2006-09-03 18:20:22 I 3: Bug report
2006-09-03 18:20:22 I 4: Quest related
2006-09-03 18:20:22 I 5: Suggestions
2006-09-03 18:20:22 I 6: Report a bad user
2006-09-03 18:20:22 I 8: Recovery related
2006-09-03 18:20:22 I 9: Operation related
2006-09-03 18:20:22 I 255: Other
2006-09-03 18:20:22 I Initial Petition Sequence No: 20060903000001
2006-09-03 18:20:22 N Server Name: ignis01, Server IP: 10.0.0.10
2006-09-03 18:20:22 N Starting World Service at 0.0.0.0:2107
2006-09-03 18:20:22 N Starting GM Service at 0.0.0.0:3109
2006-09-03 18:20:22 N Starting Notice Service at 0.0.0.0:3121
2006-09-03 18:20:28 D [World: Unknown(0)] SEND: W_SERVER_VER(101)
2006-09-03 18:20:28 D [World: Unknown(0)] RECV: W_CONNECT_WORLD2(137)
2006-09-03 18:20:28 I [World: Lineage2 (1)] 0 petitions loaded.
2006-09-03 18:20:28 D [World: Lineage2 (1)] SEND: W_ACCEPT_WORLD(103)
2006-09-03 18:26:38 D [World: Lineage2 (1)] RECV: W_SUBMIT_PETITION6(169)
2006-09-03 18:26:38 I Fail Log: UnexpectedCategory
2006-09-03 18:26:38 D [World: Lineage2 (1)] SEND: W_SUBMIT_PETITION_FAIL4(142)

demon
03.09.2006, 17:05
use that xls

create db petition, then use IMPORT, choose XLS 97-2000 choose file then choose all tables and press ok


also u dont need loader u can simply do a sortcut of petitiond.exe and in command change
to PATH\petitiond.exe /console

and it runs as console and not as service ^^

Вложения из исходного сообщения (сами файлы в копии отсутствуют):
petion.xls.rar — 4114 байт

MuNLoK
03.09.2006, 17:27
Ok, I found the problem :) . The problem is that you shouldn't have a empty PetitionCategory.txt in the /script/ folder. If you have that, delete it and done.

Thank you!!!

godfather
03.09.2006, 17:37
does it work with sql2000 or only with sql2005?

aralyon
03.09.2006, 18:19
does it work with sql2000 or only with sql2005?
In theory, server should work with sql2000, but I made database with sql2k5, and export it with sql2k5, so it isn't probably 2k compatible. But I don't use 2k5 features, so if anyone can modify my .sql file and make it compatible, I would appreciate it. I can't do it, because I don't have 2k, and I'm too lazy to get it and install it.

godfather
03.09.2006, 18:49
yes a sql2k compatible script will be usefull

paul
03.09.2006, 19:00
This is good work aralyon congrats =D

Can't wait for the gm client. I'm tryin to work on a sql2k compatible script but i suck :(

midnight
03.09.2006, 20:00
when i run the PetitionConsole, the petition server crash

aralyon
03.09.2006, 20:08
when i run the PetitionConsole, the petition server crash

And any messages? Any errors? Did you set log folder correctly?

palace
03.09.2006, 20:46
3) Make encrypted connection string:

1) Write your connection string from step 1.2 to a text file (e.g. connstr.txt)
2) Encrypt it with DES.exe many thanks to Digital - write name of the text file with connection string to field "File to encrypt" and then click on "Encrypt" button. It should show you a "Done" message and create .enc file (e.g. connstr.txt.enc)
http://aralyon.ratafak.net/peti/2a.jpg
3) it contains encrypted connection string.
************************************************** ******
some person can explain better east happens at great length but. Really not of where to remove the data for connstr.txt

midnight
03.09.2006, 21:21
It does not give messages in logs, it spends a little time after initiating and crash, the folder log this located good.

palace
03.09.2006, 22:21
http://img373.imageshack.us/img373/4227/dibujocr3.png (http://imageshack.us)


after following the guide and installing everything, it gives error me, I use SQL 2005 enterprice sp1 and xp x64. I have reviewed but profit again not to find the error

paul
04.09.2006, 02:16
Actually i installed mssql 2005 (i'm lazy hehe) and works great! GOOD JOB =D =D =D

seraphii
04.09.2006, 04:35
Hi i tried execute in query analiser the script of petition. and return thias folow erros:
Server: Msg 170, Level 15, State 1, Line 3
Line 3: Incorrect syntax near 'TYPE'.
Server: Msg 170, Level 15, State 1, Line 4
Line 4: Incorrect syntax near 'max'.
Server: Msg 170, Level 15, State 1, Line 7
Line 7: Incorrect syntax near 'max'.
Server: Msg 170, Level 15, State 1, Line 6
Line 6: Incorrect syntax near 'max'.
Server: Msg 170, Level 15, State 1, Line 5
Line 5: Incorrect syntax near 'max'.
Server: Msg 170, Level 15, State 1, Line 7
Line 7: Incorrect syntax near 'max'.
Server: Msg 170, Level 15, State 1, Line 4
Line 4: Incorrect syntax near 'max'.
Server: Msg 170, Level 15, State 1, Line 7
Line 7: Incorrect syntax near '('.
Server: Msg 170, Level 15, State 1, Line 11
Line 11: Incorrect syntax near 'max'.
Server: Msg 170, Level 15, State 1, Line 10
Line 10: Incorrect syntax near '('.
Server: Msg 170, Level 15, State 1, Line 5
Line 5: Incorrect syntax near 'max'.
Server: Msg 170, Level 15, State 1, Line 5
Line 5: Incorrect syntax near 'max'.
Server: Msg 170, Level 15, State 1, Line 12
Line 12: Incorrect syntax near '('.

paul
04.09.2006, 07:16
*points to the first few posts on the thread talking about it does NOT work for 2k*

aralyon
04.09.2006, 09:03
after following the guide and installing everything, it gives error me, I use SQL 2005 enterprice sp1 and xp x64. I have reviewed but profit again not to find the error

Error in the encrypted connection string in .config file. Did you set i correctly?

mantrastic
04.09.2006, 10:03
im gonna make it for 2k, hold on

ShinHawk
04.09.2006, 10:05
im gonna make it for 2k, hold on

holding on :D

Cardon
04.09.2006, 13:54
In-game petition notice...

"Petition is not available for 5 to 13"

What could that possibly mean?

aralyon
04.09.2006, 14:01
In-game petition notice...

"Petition is not available for 5 to 13"

What could that possibly mean?
It means that you have to set DisableStart and DisableEnd in l2server.ini to different values (or delete it?) .

Cardon
04.09.2006, 14:07
Ahhh, thanks.

Digital
04.09.2006, 15:19
nice sharing spirit and good start :)
thank god ppl understood the program i made :x
(was beginning to worry) lol

p.s u'll need to set ip and the revelent ports,
and if i'm not wrong... u might need to insert sql statements
(like how u add ur world info into sql) <-- not so sure abt this one... hopefully it's not missing any sql scripts... but it's not like we cant reconstruct it... just require some time.

gl

mantrastic
04.09.2006, 15:52
im converting it to 2000, just few functions of mssql 2005 not sure how they are called in 2000 =x

ebosh
04.09.2006, 17:29
good work man.
thx

darkkiss
04.09.2006, 17:37
super work
congrats ...

1 problem ... GMPetiClient sometimes closes ... when petitions have to appear .. ..

aralyon
04.09.2006, 18:04
super work
congrats ...

1 problem ... GMPetiClient sometimes closes ... when petitions have to appear .. ..
What exactly mean "when petitions have to appear"? Does it suddenly close, or some error message appears?

mantrastic
04.09.2006, 18:11
aralyon, in the servername, what exactly i gotta use, because i tried everything, machine name, ip, etc...
all i get is login failed for sa etc (using sql mode)


btw: i got it for sql 2000 but some procs doesnt work yet, basic stuff does, ill post it once its fully done, unless u want it now =x

edit2: i dont think it can work on 2000, or my settings fucked up =[ tried now windows mode aswell

pic

http://img503.imageshack.us/img503/8089/4343py1.jpg

aralyon
04.09.2006, 19:20
aralyon, in the servername, what exactly i gotta use, because i tried everything, machine name, ip, etc...
all i get is login failed for sa etc (using sql mode)


btw: i got it for sql 2000 but some procs doesnt work yet, basic stuff does, ill post it once its fully done, unless u want it now =x

edit2: i dont think it can work on 2000, or my settings fucked up =[ tried now windows mode aswell

pic


Petition cant connect do mssql - is it on the same machine? Is the mssql instance named?

login failed for sa is better, it can "see" the database, but you probably wrote bad password. Do you have mssql in mixed authencification mode or just windows auth mode?

mantrastic
04.09.2006, 19:24
mixed mode, and yes its on the same machine, and no i didnt write bad password, checked it and tested with other stuff like 10 times :S

darkkiss
04.09.2006, 21:30
What exactly mean "when petitions have to appear"? Does it suddenly close, or some error message appears?

petition client suddenly close .. no error .. no nothing ... just after i choose my GM Character ... and click OK ...
if i try to reopen client it works perfect

ohh ... and another thing .. if i try to add memo it crashes ... :(

linuxer1
05.09.2006, 03:35
It's Great!

godfather
05.09.2006, 22:47
need the schema for sql2k :/

HF
06.09.2006, 08:50
new problem

Fail Log: NotGMAccount
[GM: Unknown ] SEND: G_LOGIN_RESULT(3): 0307


Petition service check lin2world.builder_account ?
If yes, what builder level need for work with petition service?

My account in builder_account have 9 level, but characters on account have different levels.. 1,5,7,9

Stazis
06.09.2006, 09:41
read manual carefully - you should make

update lin2db.user_account set login_flag=16 where account='your_account_name';

ag1584
07.09.2006, 08:11
need the schema for sql2k :/

http://2xx.xx6.34.5/la2/petition_schema_2k.sql

FidoW
07.09.2006, 12:43
http://2xx.xx6.34.5/la2/petition_schema_2k.sql

Too many errors...

And ROW_NUMBER is 2k5 function...

mantrastic
07.09.2006, 13:14
row_number in 2k is actually few lines of code and dunno exactly what it should do in that function

GMan
08.09.2006, 09:47
all you have to do is change the 8000's fo max lengths to something more realistic and it works, got it running on my 2k the row_number error doesnt seem to cause any noticable errors.

I also need to say this must be the best share next to the C4 server files, even thoe they arnt really a share. And you freed up my time, i was orking on the C1 peteion system for a few months and just about got it 100% on our C1 modded to C4 server. so Great job man. And thanks

mantrastic
08.09.2006, 10:49
can u post your sql schema GMan?

FidoW
08.09.2006, 11:43
all you have to do is change the 8000's fo max lengths to something more realistic and it works, got it running on my 2k the row_number error doesnt seem to cause any noticable errors.

I also need to say this must be the best share next to the C4 server files, even thoe they arnt really a share. And you freed up my time, i was orking on the C1 peteion system for a few months and just about got it 100% on our C1 modded to C4 server. so Great job man. And thanks
ROW_NUMBER function is used only in one store procedure, so, when this SP is executed u get an error...

GMan
09.09.2006, 00:12
well i was going to but it looks like something went wrong, i thought i saved the sql file after i changed it but i cant fine it, then i went to just create a SQL script from my current petition DB and it has 8000's in it.

but all i did was search for 8000 in the SQLand change them to real numbers like

gmname to 20
ssq to 50
account to 20
content to 5000 - guessing here not sure how long a petition description can be.

and so on because char names acan only be 16 chars long and i think accounts could only be 18??, cant remember off the top my head

as for the row_number like i said i have not figured that out, there must be a way to do it in normal SQL it looks like its used to set the row to start on then read the next @size results. not sure bt if thats it i remember looking up a simmaler thing before with MSSQL because it does not really support the LIMIT command

IVB
13.09.2006, 09:43
I made sql schema for sql2k:

- rewrote statement to create user-defined type TSeq using 2k syntax.

- remove "EXEC dbo.sp_executesql" to creating procedures and replace them with "CREATE PROCEDURE" operators.

- rewrote procedure that uses ROW_NUMBER() to exlude this function from 2k5.

- replace varchar(max) to reasonable values.

Schema for sql2k in attachment.

But I can't test this schema - I can't run PetitionConsole.exe ;(

Immidiatelly after starting it shows error window with following text: "The application failed to initialize properly (0xc0000135). Click OK to terminate the application."

Please let me know what I doing wrong... Need help! :help:

Вложения из исходного сообщения (сами файлы в копии отсутствуют):
petition.rar — 2712 байт

mantrastic
13.09.2006, 10:43
thanks imma test it

edit: that works perfectly, thanks alot dude!

GMan
13.09.2006, 11:12
Immidiatelly after starting it shows error window with following text: "The application failed to initialize properly (0xc0000135). Click OK to terminate the application."


you have .net 2 installed? or any .net

IVB
13.09.2006, 12:10
you have .net 2 installed? or any .netNow - installed. At the time when I tested PetitionD - not installed.

Thanks for your answer, the problem was in .NET Framework. I read 1st post MANY times and don't found single word about .NET Framework required...

2 aralyon:
Please, edit 1st post and add requirements...

IVB
13.09.2006, 13:50
ServerStatusRefreshInterval - ???How often (in seconds) PetitionD checks status of L2server.

Shawnmb
14.09.2006, 23:53
and so on because char names acan only be 16 chars long and i think accounts could only be 18??, cant remember off the top my head

In the default databases you can only have an account name length of 14/16 characters, however L2server (user_data) has it's account name column set to a max of 50 characters. This leads me to believe that account names could technically be as long as the game's username box if your databases are set up properly.

top-gear
20.09.2006, 05:00
thanks for the great share! it works perfect. Just 2 questions...

1) There is a restriction for petition submitting from 5am to 1pm. can it be removed somehow? Maybe its client side I don't know...
2) Is there a way to view petition logs in a list and not shiffled through the database? It would be nice to be able to check my gms that way.

Keep up the good work

mantrastic
20.09.2006, 10:16
top gear, go to server.ini [petitionD] delete that line that says about that disable etc.

top-gear
20.09.2006, 12:18
thanks a lot :D:D

Slonik
03.10.2006, 13:12
Unhandled Exception: System.Net.Sockets.SocketException: Only one usage of each
socket address (protocol/network address/port) is normally permitted
at System.Net.Sockets.Socket.DoBind(EndPoint endPointSnapshot, SocketAddress
socketAddress)
at System.Net.Sockets.Socket.Bind(EndPoint localEP)
at NC.ToolNet.Net.Server.ListenerSocket.Start(EndPoin t localEndPoint) in d:\p
roject\hades\tool.net\library\toolnet\source\main\ nc.toolnet\net\server\listener
socket.cs:line 29
at NC.PetitionD.BusinessLogic.Start() in d:\project\hades\tool.net\applicatio
n\petition\petitiond\businesslogic.cs:line 62
at RetailPetiTest.Program.Main(String[] args)

where the trap?

HF
03.10.2006, 15:37
Unhandled Exception: System.Net.Sockets.SocketException: Only one usage of each
socket address (protocol/network address/port) is normally permitted
at System.Net.Sockets.Socket.DoBind(EndPoint endPointSnapshot, SocketAddress
socketAddress)
...

where the trap?
trap? :)

Check Task Manager. Maybe your Petition server already work as service.

Slonik
03.10.2006, 17:33
No. It's absent.

HF
03.10.2006, 17:44
No. It's absent.
check your settings for Petition Server. You have conflict for network port.

BloodLine
03.10.2006, 19:07
Thank you HF, really a nice share works great

hhk31257
17.10.2006, 01:50
hello

first of all: thx very much for this share!!!

ok, i have installed the petition server and everything seems to work.
but when i enter a petition it always says that i have 4 petitions left today and that there are 11 petitions pending...

does anyone know how to fix this?
i deleted petitioncategory.txt in the script folder.

thanks in advance

hhk31257
20.10.2006, 14:17
[wrong post]

hhk31257
27.10.2006, 11:54
i can't add notes (database fail error)
players always see that they have 4 petitions left for today
and that there are 11 petitions pending.

how to fix this?
thanks in advance.

aralyon
27.10.2006, 13:42
I'm sorry, I'm now unable to develop petition system or anything related to L2 server due to loss the server. It is nessecary to have access to live server (or test server, but I'm unable to start L2 server on my PC)

Sauron
27.10.2006, 14:06
i can't add notes (database fail error)
players always see that they have 4 petitions left for today
and that there are 11 petitions pending.

how to fix this?
thanks in advance.


/* To prevent any potential data loss issues, you should review this script in detail before running it outside the context of the database designer.*/
BEGIN TRANSACTION
SET QUOTED_IDENTIFIER ON
SET ARITHABORT ON
SET NUMERIC_ROUNDABORT OFF
SET CONCAT_NULL_YIELDS_NULL ON
SET ANSI_NULLS ON
SET ANSI_PADDING ON
SET ANSI_WARNINGS ON
COMMIT
BEGIN TRANSACTION
GO
CREATE TABLE dbo.UserQuota
(
account_id int NULL,
amount int NULL
) ON [PRIMARY]
GO
COMMIT

insert into UserQuota values(0,20061008);

IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[up_Server_GetCurrentQuota]') AND type in (N'P', N'PC'))
BEGIN
EXEC dbo.sp_executesql @statement = N'
-- =============================================
-- Author: <Sauron>
-- Create date: <10.8.2006>
-- Description: <Description,,>
-- =============================================
CREATE PROCEDURE [dbo].[up_Server_GetCurrentQuota]
-- Add the parameters for the stored procedure here
@accountuid int
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;

declare @today int;
set @today = (select (year(getdate()) * 100 + dbo.FormatNumber(month(getdate())))*100+dbo.Format Number(day(getdate())));

if(SELECT amount FROM UserQuota WHERE account_id=0) <> @today
begin
DELETE FROM UserQuota WHERE account_id <> 0;
UPDATE UserQuota SET amount = @today WHERE account_id = 0;
SELECT 0 as amount;
end;
else
SELECT isnull( sum(amount) , 0) as amount FROM UserQuota WHERE account_id = @accountuid;

END
'
END

IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[up_Server_UpdateQuota]') AND type in (N'P', N'PC'))
BEGIN
EXEC dbo.sp_executesql @statement = N'
-- =============================================
-- Author: <Sauron>
-- Create date: <10.8.2006>
-- Description: <Description,,>
-- =============================================
CREATE PROCEDURE [dbo].[up_Server_UpdateQuota]
-- Add the parameters for the stored procedure here
@accountuid int,
@amount int
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;

declare @today int;
set @today = (select (year(getdate()) * 100 + dbo.FormatNumber(month(getdate())))*100+dbo.Format Number(day(getdate())));

if(SELECT amount FROM UserQuota WHERE account_id=0) <> @today
begin
DELETE FROM UserQuota WHERE account_id <> 0;
UPDATE UserQuota SET amount = @today WHERE account_id = 0;
end;
else
begin
if exists(select * from UserQuota where account_id = @accountuid)
UPDATE UserQuota SET amount = amount + @amount WHERE account_id = @accountuid;
else
INSERT INTO UserQuota values(@accountuid,1);
end;
END
'
END


I'm sorry, I'm now unable to develop petition system or anything related to L2 server due to loss the server. It is nessecary to have access to live server (or test server, but I'm unable to start L2 server on my PC)

can you share petition client source? i could continue the work.

MuNLoK
27.10.2006, 14:50
Yes please Aralyon, share your client source, we can continue your work.

hhk31257
27.10.2006, 14:57
ty sauron, appreciated.
aralyon thanks for you works so far!, sharing your source would indeed benefit the community.

greetz.

aralyon
28.10.2006, 17:37
Yes please Aralyon, share your client source, we can continue your work.

I would prefer joining a team and continue developing there

djvogans
28.10.2006, 21:54
aralyon contact demon or HF for help.

aralyon
30.10.2006, 17:46
aralyon contact demon or HF for help.

How can I contact them?

T@LisM@N
05.01.2007, 18:18
I start the mistake, in what a problem takes off?
2007-01-05 19:51:43 E DB Fail: up_Server_UpdateGmStatus(Clear): Login failed for user 'user'.
2007-01-05 19:51:43 I Load Petition Category
2007-01-05 19:51:43 E DB Fail: up_Server_GetCurrentCategory: Login failed for user 'user'.


P.S. All has already understood

T@LisM@N
05.01.2007, 20:24
Help in tables there is nothing it will not be worn out!!!

помогите при отправлении петиции в базу нечего незаноситься

my log:
2007-01-05 22:16:27 N Petition Service Start (build 20011)
2007-01-05 22:16:27 N Make Database 10 Connections
2007-01-05 22:16:27 N Clear GM Status
2007-01-05 22:16:27 I Load Petition Category
2007-01-05 22:16:27 I 1: Immobility
2007-01-05 22:16:27 I 2: Game tips
2007-01-05 22:16:27 I 3: Bug report
2007-01-05 22:16:27 I 4: Quest related
2007-01-05 22:16:27 I 5: Suggestions
2007-01-05 22:16:27 I 6: Report a bad user
2007-01-05 22:16:27 I 8: Recovery related
2007-01-05 22:16:27 I 9: Operation related
2007-01-05 22:16:27 I 255: Other
2007-01-05 22:16:27 I Initial Petition Sequence No: 20070105000001
2007-01-05 22:16:27 N Server Name: la2, Server IP: 1xx.xx.1.10
2007-01-05 22:16:27 N Starting World Service at 0.0.0.0:2107
2007-01-05 22:16:27 N Starting GM Service at 0.0.0.0:3109
2007-01-05 22:16:27 N Starting Notice Service at 0.0.0.0:3121
2007-01-05 22:16:35 D [World: Unknown(0)] SEND: W_SERVER_VER(101): 65000000009D8685C24B9557FB
2007-01-05 22:16:35 D [World: Unknown(0)] RECV: W_CONNECT_WORLD2(137): 89102700000201094C0069006E006500610067006500320000 000100C363E766054502E782C13ABD4C67E43D
2007-01-05 22:16:35 I [World: Lineage2 (1)] 0 petitions loaded.
2007-01-05 22:16:35 D [World: Lineage2 (1)] SEND: W_ACCEPT_WORLD(103): 6700

khelben
04.03.2007, 21:50
Can anyone repost PetitionD and gmclient?

aralyon had gone link dead

I found a release that LOOKs similar to this, but all i get when i start it is this then it crashes:

2007-03-04 16:55:40 N Petition Service Start (build 20011)
2007-03-04 16:55:40 N Make Database 10 Connections
2007-03-04 16:55:40 N Clear GM Status

Lord_Neo
04.03.2007, 22:46
http://aralyon.ic.cz/peti/PetitionD.rar

http://aralyon.ic.cz/peti/gmclient.rar

khelben
04.03.2007, 23:04
Thanks! Appreciate it!

m4rk
23.03.2007, 15:49
Sorry for reviving, but I need help configuring this.

I get the following error:
Unhandled Exception: System.ArgumentException: Format of the initialization string does not conform to specification starting at index 0.
at System.Data.Common.DbConnectionOptions.GetKeyValue Pair(String connectionString, Int32 currentPosition, StringBuilder buffer, Boolean useOdbcRules, String&
keyname, String& keyvalue)
at System.Data.Common.DbConnectionOptions.ParseIntern al(Hashtable parsetable, String connectionString, Boolean buildChain, Hashtable synonyms, Boolean firstKey)
at System.Data.Common.DbConnectionOptions..ctor(Strin g connectionString, Hashtable synonyms, Boolean useOdbcRules)
at System.Data.SqlClient.SqlConnectionString..ctor(St ring connectionString)
at System.Data.SqlClient.SqlConnectionFactory.CreateC onnectionOptions(StringconnectionString, DbConnectionOptions previous)
at System.Data.ProviderBase.DbConnectionFactory.GetCo nnectionPoolGroup(String connectionString, DbConnectionPoolGroupOptions poolOptions, DbConnectionOptions& userConnectionOptions)
at System.Data.SqlClient.SqlConnection.ConnectionStri ng_Set(String value)
at NC.ToolNet.Database.DBAccess.CheckConnection(Int64 dbKey) in d:\project\hades\tool.net\library\toolnet\source\m ain\nc.toolnet\database\dbaccess.cs:line 70

at NC.ToolNet.Database.DBAccess.RunSPByName(String connName, String spName, SqlParameter[] paramArray) in d:\project\hades\tool.net\library\toolnet\source\m ain\nc.toolnet\database\dbaccess.cs:line 200
at NC.PetitionD.GmStatus.Clear() in d:\project\hades\tool.net\application\petition\pet itiond\gmstatus.cs:line 21
at NC.PetitionD.BusinessLogic.Start() in d:\project\hades\tool.net\application\petition\pet itiond\businesslogic.cs:line 45
at RetailPetiTest.Program.Main(String[] args)

and my connstring unencrypted is:
SERVER=.\SQLSERVER;DATABASE=petition;UID=sa;PWD=ps
where ps is the correct password

First I though that maybe it was the .\ in the Server name but if I don't put that then it gives a sql connection error (the one about default setting doesn't allo remote connection)

I've also tried unsuccesfully with:
SERVER=SQLSERVER2;DATABASE=petition;UID=sa;PWD=ps
(SQLSERVER2 is the Alias for .\SQLSERVER)

khelben
25.03.2007, 15:32
this is the conn string i used

SERVER=127.0.0.1;DATABASE=petition;UID=sa;PWD=pass

don't forget it need to be encrypted.

Also, I was getting a strange error that the server could neo be connected to in the error log for petitionD so I added an unencrypted connection string to the petition database in the table "NCDBA7" or something similar to that.

Then change the petitiond.exe.config string
<add key="DatabaseConnName" value="petition"></add>

make value = whatever you named the connection string in NGSD.

This is all by memory as it looks like one of the other devs on our test server has wiped out my database =/

m4rk
25.03.2007, 16:10
So true, My problem was I did not input the unencrypted connstring in the DB.

Thanks a lot Khelben and thanks aralyon for this fantastic share.

khelben
25.03.2007, 21:46
So true, My problem was I did not input the unencrypted connstring in the DB.

Thanks a lot Khelben and thanks aralyon for this fantastic share.

Yeah i don't think that step was covered in the walk-through, but i muddled through the logs and something pointed me to that... i forget what. Good to hear you got it working though.

crazed
26.03.2007, 19:26
Can anyone reshare any of these files please?

m4rk
26.03.2007, 21:05
http://aralyon.ic.cz/peti/PetitionD.rar

http://aralyon.ic.cz/peti/gmclient.rar

already reshared, just had to look through posts -.-

crazed
26.03.2007, 22:07
http://img373.imageshack.us/img373/4227/dibujocr3.png (http://imageshack.us)


after following the guide and installing everything, it gives error me, I use SQL 2005 enterprice sp1 and xp x64. I have reviewed but profit again not to find the error


i have this very same error. i have done everything listed here in everysingle thread for a possible fix and i cant figure it out. it sits there. hangs. about 20 secs. and then. same error as palace. Its possible how i have my enc key in my petitionconsole ini file. i read at the beginning of this the original post that there had to be / between chars but i dont know where to put them. heres what i have

*removed*

can anyone help me? I use SQL2000 on win xp 64 .net vers 2

khelben
26.03.2007, 22:25
i have this very same error. i have done everything listed here in everysingle thread for a possible fix and i cant figure it out. it sits there. hangs. about 20 secs. and then. same error as palace. Its possible how i have my enc key in my petitionconsole ini file. i read at the beginning of this the original post that there had to be / between chars but i dont know where to put them. heres what i have

m9Xqzn192Y8+hWHnzMRqPh60cwUNSO3bd7RsdsrUOwGAUEA0Ms 8cXiY4NVQRwqXLpJh1ctRflU15KkCaqx6thXL3HP3hQIqn

can anyone help me? I use SQL2000 on win xp 64 .net vers 2


Did you try this?

this is the conn string i used

SERVER=127.0.0.1;DATABASE=petition;UID=sa;PWD=pass

don't forget it need to be encrypted.

Also, I was getting a strange error that the server could neo be connected to in the error log for petitionD so I added an unencrypted connection string to the petition database in the table "NCDBA7" or something similar to that.

Then change the petitiond.exe.config string
<add key="DatabaseConnName" value="petition"></add>

make value = whatever you named the connection string in NCDBA7.

This is all by memory as it looks like one of the other devs on our test server has wiped out my database =/

FYI, i didn't bother unencrypting your password, but i can and if that's the password to you production box, I'd suggest changing it, cause you just posted it for the world to see.

crazed
26.03.2007, 22:42
I have tried to use this but i could not find NGSD. so therefor i can not apply this to try. however ihave tried just using ip for server name and what not and doing all over and same thing happens again.

khelben
Newbie

And no that is not the pass i use on my server box. this is pass i use on test box.


and where do i find that NGSD ?


anyways im gonna try on sql 2005 64 bit

khelben
27.03.2007, 03:21
I have tried to use this but i could not find NGSD. so therefor i can not apply this to try. however ihave tried just using ip for server name and what not and doing all over and same thing happens again.

khelben
Newbie

And no that is not the pass i use on my server box. this is pass i use on test box.


and where do i find that NGSD ?


anyways im gonna try on sql 2005 64 bit


I looked it up in the schema, the table is NCDBA7

crazed
27.03.2007, 06:22
I would personally like to take my time to thank these two people

Khelben and m4rk

because of you guys i realized that my custom programming has caused some faults and i have now fix'd this. or at least im pretty positive. anyways. because of you guys it no longer crashes. The only petition coding i had experience in was the old c1-c2 retail petition and this one was a little different. so thank you guys alot. Anyone else needing help feel free to pm me or anything. Especially if its about server help. im very good at stuff like that like assembly ect. have a great day guys.

crazed
28.03.2007, 03:55
I have played around with the petition and gm client and i can get everything to work but the fact that i cannot connect using the gmclient. heres the error i get


http://img.photobucket.com/albums/v644/sxymxd84/GMclienterror2.jpg


Any help with this would be appreciated as i have tried everything i have read here. at least i am pretty sure i did.

m4rk
28.03.2007, 07:07
Did you set login_flag=16 in user_account?

crazed
28.03.2007, 07:40
yes i did ^_^ and it still not connect. should i uninstall sql server 2k and start over?


ok heres a look at my windows all at one time.

http://img.photobucket.com/albums/v644/sxymxd84/Error3.jpg


One thing that i notice the most is the error on auth saying ipp 127.0.0.1 world server socket already used

what does that mean? thats got to be a clue that im doing something wrong right? all my ip addresses are 127.0.0.1 except the devouterip everything else is 127.0.0.1. same as in my petition server its 127.0.0.1 and when i try to connect i try connecting using my lan ip 1xx.xx8.1.103.

crazed
28.03.2007, 11:30
I fix'd my own problem. thank you all for your help and support

Osito2Dancer
28.03.2007, 18:28
Kudos to Aralyon, a very good service indeed. I tested it last night and it worked like a charm!

Everything is working correctly, so the manual is really well made.

Oso

crazed
28.03.2007, 19:30
yeh. ive gotta say i was tired as hell last night and made some stupid mistakes but after everything was said and done i got it up and running with not a single problem. congrats. and thanks for this great share and all your help.

Ryuusei841
07.08.2007, 20:47
Anyone have this still, can link me?

adriahu
08.08.2007, 08:19
Anyone have this still, can link me?

read the topic carefuly :P