Testing a herald, in need of a dolcharacter table

Discussions on various DOL development features

Moderator: Support Team

Testing a herald, in need of a dolcharacter table

Postby LifeFlight » Fri Nov 23, 2007 9:26 am

Hey guys,

I know this sounds kinda sketchy, but w/e.
I'm working on a herald that, for my specific needs, runs off of a '^' delimited .txt dump of the dolcharacters table, excluding the DOLcharacter id and Accountname field.
Only problem is that I current don't have my server up so the file I've been using to test with is a crudely made up one.

Heres a link to my herald if your interested, it's lame, but we just learned cgi in my class so it was a fun way to learn cgi.
http://z.cs.utexas.edu/users/cs329e/pdr ... herald.cgi
oh! and if you have any suggests that would be great too (I know it looks god awful in IE, what little css I have done is just tailored for FF)

So if your feeling charitable pm me or email me (ritcheypaul@gmail.com), either with suggestions about changes I should make or with a table.
^ delimited
without the AccountName or DOLCharacters_ID field


I totally understand if this is way to inappropriate.
LifeFlight's PvP.
LifeFlight
Contributor
 
Posts: 114
Joined: Wed Jan 03, 2007 6:07 am
Website: http://lifeflight.utpdr.com
Location: Texas

Re: Testing a herald, in need of a dolcharacter table

Postby Centurio » Fri Nov 23, 2007 10:09 am

Why use cgi??
I think that it isn't a good way, or better if you have more request to acces at your herald ,cgi it's a bad way :confused:
Heavy metal is The law
User avatar
Centurio
DOL Acolyte
 
Posts: 142
Joined: Tue Feb 13, 2007 10:51 pm
Website: http://www.myspace.com/pagandio

Re: Testing a herald, in need of a dolcharacter table

Postby LifeFlight » Fri Nov 23, 2007 10:23 am

hehe, its the only way I know how....

would php be significantly better?
LifeFlight's PvP.
LifeFlight
Contributor
 
Posts: 114
Joined: Wed Jan 03, 2007 6:07 am
Website: http://lifeflight.utpdr.com
Location: Texas

Re: Testing a herald, in need of a dolcharacter table

Postby rizla » Fri Nov 23, 2007 2:38 pm

well php would allow you to perform queries on the mysql db, hence you won't need the txt-file. You then can also access all tables in the database so you could show more then just the characters on ur herald.
rizla
DOL Visitor
 
Posts: 13
Joined: Fri Mar 26, 2004 6:54 pm

Re: Testing a herald, in need of a dolcharacter table

Postby Etaew » Fri Nov 23, 2007 2:47 pm

Well, from a security point of view, nothing is wrong with not querying the database, but there are certainly performance concerns. For security and performance side, the database query is still probably the best bet, either exporting to a new table only the data you want, or just being very careful about the way you program or access data.

PHP is very easy to work with to connect to MySQL, I use it all over this site, granted, I've started to hijack all of phpBB's methods instead of my own lately, there are still times when you do need to just connect and run your own query.

Let's have a look at an example shall we:
Code: Select all
<?php
$host = "localhost";
$username = "";
$password = "";
$database = "";
$connection = mysql_connect($host,$username,$password) or die(mysql_error());
mysql_select_db($database);
$result = mysql_query("SELECT c.Name,c.LastName,c.Level,g.GuildName FROM `dolcharacters` c JOIN `guild` g ON c.GuildID = g.ID WHERE c.Level = '50'") or die(mysql_error());
while ($row = mysql_fetch_assoc($result))
{
//do your thing access data via $row['Level'] etc
}
mysql_close($connection);
?>
Disclaimer: This is just off the top of my head, method names, or field names from the tables may be wrong :-)
Retired DOL Enthusiast | Blog
User avatar
Etaew
Inactive Staff Member
 
Posts: 7602
Joined: Mon Oct 13, 2003 5:04 pm
Website: http://etaew.net
Location: England

Re: Testing a herald, in need of a dolcharacter table

Postby Merec » Fri Nov 23, 2007 7:33 pm

PHP is one of the best ways to connect mysql-servers.

For work, I read a lot about it and found a very nice plugin for PEAR.
Have a look at "DB2", "Propel" and "Creole". It is an object-oriented, Hybernate like way to connect Mysql and handles data very fast, its my favorite.

Greetings
Merec
Developer
 
Posts: 428
Joined: Thu Mar 08, 2007 8:58 am
Website: http://www.merec.org
Location: NRW, Germany

Re: Testing a herald, in need of a dolcharacter table

Postby LifeFlight » Fri Nov 23, 2007 7:37 pm

I wrote my code in Ruby, so I can still access the mysql. The only reason that I didn't write it that way to begin with is that We haven't covered that in class yet lol, on monday we start that!!

So switching the code to use the mySQL db shouldn't be a problem.
Unless you guys know something about Ruby that makes it god awful to use that my professor hasn't told us.
LifeFlight's PvP.
LifeFlight
Contributor
 
Posts: 114
Joined: Wed Jan 03, 2007 6:07 am
Website: http://lifeflight.utpdr.com
Location: Texas

Re: Testing a herald, in need of a dolcharacter table

Postby Batlas » Fri Nov 23, 2007 7:52 pm

Anyone who feels the urge to knock Ruby.. Lemme know so I can delete your post :wink: :rolleyes:
[22:29] <Arms> someones having sex upstairs -.-
[22:30] <Arms> bbl

[21:16] <Angie> do /me
[21:16] <Batlas> roflmao
[21:16] <Dalaaji> haha
[21:16] <Batlas> wow that came out bad
[21:16] <Angie> wow
[21:16] <Angie> that so came out bad
Batlas
Support Team
 
Posts: 1707
Joined: Sun Mar 21, 2004 3:11 am

Re: Testing a herald, in need of a dolcharacter table

Postby LifeFlight » Fri Nov 23, 2007 10:50 pm

so.. any comments on the herald? things I should add/improve?
LifeFlight's PvP.
LifeFlight
Contributor
 
Posts: 114
Joined: Wed Jan 03, 2007 6:07 am
Website: http://lifeflight.utpdr.com
Location: Texas

Re: Testing a herald, in need of a dolcharacter table

Postby Graveen » Sun Nov 25, 2007 2:20 pm

hehe good learning. perhaps interface is a bit...well... orange ? :D
Image
* pm me to contribute in Dawn of Light: code, database *
User avatar
Graveen
Project Leader
 
Posts: 12661
Joined: Fri Oct 19, 2007 9:22 pm
Location: France

Re: Testing a herald, in need of a dolcharacter table

Postby Dinberg » Sun Nov 25, 2007 3:28 pm

Looks nice! Well done with this ;)
The Marvelous Contraption begins to stir...
User avatar
Dinberg
Inactive Staff Member
 
Posts: 4695
Joined: Sat Mar 10, 2007 9:47 am
Yahoo Messenger: dinberg_darktouch
Location: Jordheim

Re: Testing a herald, in need of a dolcharacter table

Postby Blues » Mon Dec 03, 2007 12:07 pm

I made one with php, was originaly made for ariadolis but carni took his own one, i just didnt change the header grafic yet.

The Main Difference i see is ... well mine just looks better :D
The Functions are almost the same. What is missing in yours is a search form to find characters.

And a nice Feature i have can be seen if you go on the "Population Statistics" on the general info page, though it would look better with a real database, it is only connected to a test database with most chars filled in by hand.

EDIT:
Well maybe i should also add the link to the site: http://www.naegra.com/pfff/
By the pricking of my thumbs,
Something wicked this way comes.
User avatar
Blues
DOL Devotee
 
Posts: 391
Joined: Fri May 18, 2007 2:19 pm

Re: Testing a herald, in need of a dolcharacter table

Postby LifeFlight » Mon Dec 03, 2007 7:41 pm

Yeah, I added guild/player search ability to it recently. Just haven't finished tweaking it the way I want it.
I just haven't taken the time to worry about looks, thats an easy fix any who.


Next thing I am going to do is hook it up to MySQL, that shouldn't be hard.
LifeFlight's PvP.
LifeFlight
Contributor
 
Posts: 114
Joined: Wed Jan 03, 2007 6:07 am
Website: http://lifeflight.utpdr.com
Location: Texas

Re: Testing a herald, in need of a dolcharacter table

Postby LifeFlight » Tue Dec 04, 2007 4:40 am

LifeFlight's PvP.
LifeFlight
Contributor
 
Posts: 114
Joined: Wed Jan 03, 2007 6:07 am
Website: http://lifeflight.utpdr.com
Location: Texas

Re: Testing a herald, in need of a dolcharacter table

Postby bryon » Tue Oct 28, 2008 8:13 am

you can make a script to send only the data that you want to a separate db on certain events like PlayerQuits..

on live when the player quits or logs out.. the updated player info is sent out to a separate web server.. is really the most efficient way so that it doesnt slow down the main game server from web traffic..

i had a sample but i lost it.. its very simple to make tho.
Project Silodaira -
Ports and Jump points √
Ladder √
Dungeons √
Zone Population ~
User avatar
bryon
DOL Expert
 
Posts: 601
Joined: Tue May 01, 2007 6:42 am
Location: Albion, Dark age of Camelot


Return to “%s” DOL Development Discussion

Who is online

Users browsing this forum: No registered users and 1 guest