Help needed for dropcalc testing.

If something doesn't fit in any other forum then post it here.
Forum rules
READ NOW: L2j Forums Rules of Conduct
Locked
Hexa
L2j Veteran
L2j Veteran
Posts: 1217
Joined: Mon Nov 14, 2005 1:25 am

Post by Hexa »

I was on your website in the "Guest Login" area :)
msknight
Advanced User
Advanced User
Posts: 308
Joined: Wed May 10, 2006 11:40 am
Location: U.K.

Post by msknight »

Thanks - I'm on it. The database is used for testing the drop calc ... lately for the database custom extraction. I'm on the case :-) Thanks for the heads up.
My friend is a paranoid schizophrenic ... she'll take over the world, as long as nobody minds.
msknight
Advanced User
Advanced User
Posts: 308
Joined: Wed May 10, 2006 11:40 am
Location: U.K.

Post by msknight »

Found the problem - it was a knock on from the bug that Law found. I'm on the case, but while I fix it, there will be various other errors for a few minues while I change some function calls.
My friend is a paranoid schizophrenic ... she'll take over the world, as long as nobody minds.
msknight
Advanced User
Advanced User
Posts: 308
Joined: Wed May 10, 2006 11:40 am
Location: U.K.

Post by msknight »

Bug was that two functions in the conf.php file, weren't taking the variable $db_l2jdb - the functions were mobcount( and check_item( - adding ", $db_l2jdb" to the end of them both, and adding to all files that referenced them, did the trick. I'm uploading corrected code again :)

EDIT - code is up.
My friend is a paranoid schizophrenic ... she'll take over the world, as long as nobody minds.
law
Posts: 33
Joined: Wed Aug 02, 2006 8:21 pm

Post by law »

okay msknight the dropcalc is very good, but one thing is relay crap sorry :)

l2j supports splitting server, i dont see why your dropcalc dont supports it.
it would be very easyer to manage the accounts. also it would be no problem four ppl who dont splitted the server , they can insert the l2j table on both config values.

So now i coded a bit around i managed 3 it 3 ways.
(i just done that on my testserver, i dont want to screw the liveserver up :))
1. rewritten the the whole login registration etc.. code so it takes the users from account table of login server (added the fields which where needed to loginserver account table). Worked for me but i dont now if there are problems on special circumstances. (dunno if there could be a problem with l2jserver accesing the account table)
2. rewritten the code so it takes on first login the account from the account table and inserts its values into knightdrop table. (not finished but seems to be the best way).
3. builded a script that reads all accounts and put it to knightdrop table, needs to run a cronjob. (this solution sucks the most way i think.

^^ i alos have a tip for the next version , if you ever should come into the dilemma to recode the stuff , make it with a bit more oop and nix capsuling , this would make it much easier to change the code.
msknight
Advanced User
Advanced User
Posts: 308
Joined: Wed May 10, 2006 11:40 am
Location: U.K.

Post by msknight »

Hi Law,

It is actually a very good point. I was thinking about it last night.

Rather than add columns to the account table, I'll create an account registration, which populates the account table and the knightdrop table at the same time, and add a unique key on the account name in the knightdrop table ... and then write a tool to import the account table in to the knightdrop table for existing servers.

I couldn't find the explanation of how the password encryption works in the thread (it is proving heavy reading for me!)

By your meaning split server, I take it that this is where the logon servers tables are in a separate database to the gameservers tables? If this is the case, if you can tell me which tables are for the logon server, then I can recode the program to handle this.

I'm quite a newcommer to the project really, and this is also a way of me finding out how things work.

Thanks for taking the time to help with this.
My friend is a paranoid schizophrenic ... she'll take over the world, as long as nobody minds.
law
Posts: 33
Joined: Wed Aug 02, 2006 8:21 pm

Post by law »

em the split login server has teh tables : accounts & gameservers , but you should only be intrested on accounts table , hgere is the mysql structur dump:
CREATE TABLE `accounts` (
`login` varchar(45) NOT NULL default '',
`password` varchar(45) default NULL,
`lastactive` decimal(20,0) default NULL,
`access_level` int(11) default NULL,
`lastIP` varchar(20) default NULL,
`email` varchar(30) NOT NULL default '',
PRIMARY KEY (`login`)
) TYPE=MyISAM;
I´ll give you more infos on password encryption in 10 minutes :)
law
Posts: 33
Joined: Wed Aug 02, 2006 8:21 pm

Post by law »

So here is my code how i handle my gameserver registraion:

Code: Select all

$activ_key_encrypt = base64_encode(pack("H*", sha1(utf8_encode($_POST['password']))));

	@mysql_connect("xxx", "xxx", "xxx") OR die(mysql_error());
    mysql_select_db("loginserver") OR die(mysql_error());
    $sqlexists = "SELECT * FROM accounts WHERE login = '".$wbbuserdata[username]."'";
	$result = mysql_query($sqlexists) OR die(mysql_error());

    if(!mysql_num_rows($result))
	{ // look if something is in the result
         mysql_query("INSERT INTO accounts (login,password,lastactive,access_level,lastIP,email) VALUES ('".$wbbuserdata[username]."','".$activ_key_encrypt(here is your pass^^)."','0','0','0','".$wbbuserdata[email]."')") OR die(mysql_error());
		 echo("Account aktiviert");

    }
$activ_key_encrypt contains the crypted password like it is used for l2j accounts. on login to your dropcalc just compare the hash the user entered in the pasword field with the one thats in database. (works :))[/b]
msknight
Advanced User
Advanced User
Posts: 308
Joined: Wed May 10, 2006 11:40 am
Location: U.K.

Post by msknight »

Thanks Law,

I had no idea it was a bunch of standard routines for the encryption!

If I understand it, authentication is encrypt the password given and match it against what is recorded, rather than de-encrypting the password stored?

When I get home from work tonight, (about 6 hours time) I'll work on separating the tables out (I'll have to do my development game server as well ... cross fingers I get it right!) it'll take all evening as the account table is used quite heavily throughout the system. Unfortunately, anyone wanting to view the demo system will encounter odd errors while I make the changes.

On the weekend, I'll then do the user account administration. I've got a few decisions to make about how I handle some things on the drop calc side, and work out to what degree I merge the logon servers accounts table with the drop calcs accounts table.

I'll probably have to include a tool to allow admins to alter the account level of characters as well.

I'm also thinking of doing a character, item and mob search by ID number as well ... would that be of any use? If you've got any more suggestions on stuff you'd like to see, let me have 'em!

Michelle.
My friend is a paranoid schizophrenic ... she'll take over the world, as long as nobody minds.
law
Posts: 33
Joined: Wed Aug 02, 2006 8:21 pm

Post by law »

Id search would be usefull for gms.
Another thing is , why dont you take the acces_level out of the account table of the loginserver ? would reduce the double data collection. so remove the acces_lvl table from kngihtdrop and use the one the server provides. makes it much easier to configure and administrate.

And could you please tell me why i must enter at least 3 chars in item search ? And why you dont allow search toogles like *.

Example: i want everything to be shown -> insert * in search field

I will be away for weekend so i can check the thread again on monday and hope you managed it to support split support .

if you habe any ohter question i will be there till friday highnoon :)


##Edit:
If I understand it, authentication is encrypt the password given and match it against what is recorded, rather than de-encrypting the password stored?
Right, compare the 2 hashes :)
msknight
Advanced User
Advanced User
Posts: 308
Joined: Wed May 10, 2006 11:40 am
Location: U.K.

Post by msknight »

I thought that asking for three characters as a minimum would cut down the number of items being shown in the list, otherwise it could get ludicrously big if someone wanted the full list of items. I couldn't see why someone would want the full list of everything when it is already possible to search for items by type.

The item graphics already slow down the item search lists a fair bit. I suppose I could kill the graphics if a search resulted in more than, say, fifty or a hundred items in total. Take a look at the combined file size of those little icon graphics ... it's a fair few meg to download over the web, and as the chapters progress, there is going to be more of them.

Why would you want to list all the items in one go? Do you use such a search frequently?

Re. the access level, I'm still thinking of that ... Tying the drop calc access privs to the logon server account privs has both advantages and disadvantages. I am leaning to doing what you suggest, but I'm thinking hard about it.
My friend is a paranoid schizophrenic ... she'll take over the world, as long as nobody minds.
law
Posts: 33
Joined: Wed Aug 02, 2006 8:21 pm

Post by law »

I dont see a problem of showing all items. just make a site which only shows 10 entrys , and at the bottom make a site nummeration 1.2.3.4.5.6

like on board threads with much posts.

Its not a must but maybe you want to include that in a further version.
Also i got a idea for another project, i want to develop a ticketsystem that can be filled from ingame.
I want to make a custom box where users can enter their problems and when they klick okay it is saved into a mysql table.

And the gms and admin can see it from a browser online. I want to do this cause my gamers are lazy guys and dont realy use the bug forum or bugtrackin system. They only tell the problems to the gms when they are online. Thats not good cause in this way many bugs / problems/ suggestions get lost.

I´d like to here from you , yes nice , i want to help you :)
msknight
Advanced User
Advanced User
Posts: 308
Joined: Wed May 10, 2006 11:40 am
Location: U.K.

Post by msknight »

law wrote:I dont see a problem of showing all items. just make a site which only shows 10 entrys , and at the bottom make a site nummeration 1.2.3.4.5.6
There is more than 800 armor, more than 1,000 weapons and more than 6,000 etcitems. Even at a generous 50 items per page, that is more than 120 pages !!! Who is really going to look through all those? :D Far better to have a more efficient search :wink:

Managed to get the logon and gameserver running with the tables split, just have to reprogram the drop calc now!
My friend is a paranoid schizophrenic ... she'll take over the world, as long as nobody minds.
msknight
Advanced User
Advanced User
Posts: 308
Joined: Wed May 10, 2006 11:40 am
Location: U.K.

Post by msknight »

Law,

Thanks very much for the information you've posted. I've now separated the logon server tables, made a registration section and also created an import tool. The drop calc access levels now run off the accounts table as well. You only need to make sure you've got an entry in the knightdrop table for a user that exists in the accounts field, so that you can log on to the dropcalc in order to run the import routine, which is in the server tools section ... and the account needs to have an access level of 130 or greater. I've uploaded the new files to my web site but haven't updated the documentation yet.

This weekend, I'll put in character and account deletion routines (that clean up the characters items) plus routines to delete accounts inactive for more than three months, and accounts which have been created for more than two weeks, but don't have any characters on them. Also the ability for admins to change the access levels of acounts and characters.

I was concerned that my logon server stopped at one point, but I'll have to check that again later.

It does mean that everyone has access to the maps for the moment ... I'm going to have to rethink how I handle that ... I've got plans for how I handle access to the forthcoming recipe calculator as well, so I might bring those ideas forward. See what happens, but there will probably have to be more fields in the knightdrop table to handle it.
My friend is a paranoid schizophrenic ... she'll take over the world, as long as nobody minds.
msknight
Advanced User
Advanced User
Posts: 308
Joined: Wed May 10, 2006 11:40 am
Location: U.K.

Post by msknight »

I've been thinking over the reporting thing. It is going to take me some time to get to the level you need, but there is a shorthand way of doing it by using the dropcalc.

Make yourself a character called "fault". When someone finds a problem in game, they send a whisper to fault. Even though "fault" is not on line, the whisper is still recorded, so you can go on to the drop calc at any time and review "fault"'s chat record.

Gets the job done in the short term. :D
My friend is a paranoid schizophrenic ... she'll take over the world, as long as nobody minds.
Locked