|
|
|
 |
 |
 |
 |
|
 |
 |
|
 |
 |
|
 |
|
| Development::Tools 3rd Party Tools for EQEMu (DB management tools, front ends, etc...) |
|
View Poll Results: Is this a good idea?
|
|
Yes
|
  
|
11 |
91.67% |
|
No
|
  
|
0 |
0% |
|
You are completely insane, why ould anyone want that.
|
  
|
1 |
8.33% |

02-16-2008, 05:24 AM
|
|
Forum Guide
|
|
Join Date: Sep 2003
Location: California
Posts: 1,474
|
|
Not sure if anyone uses bitwise AND SQL, but I find this info extremely useful. It makes what would take lots of code oftherwise into 1 line.
Say you want to find all items for a mage , you would enter
SELECT classes,id, name FROM items WHERE classes & '4096'
In my job, things like this makes life easier.
GeorgeS
|

02-16-2008, 09:12 PM
|
|
Developer
|
|
Join Date: Mar 2007
Location: Ohio
Posts: 648
|
|
Me too, George. I didn't even know about that little jerk until I started messing around with EQBrowser (see page 4 for a working download) and checked out some of the queries. In reality though, I'm not sure how much info is really stored as a bitmask anymore  It's just not scalable enough...
|

03-25-2008, 11:13 AM
|
|
Fire Beetle
|
|
Join Date: May 2007
Posts: 28
|
|
Sorry for the delay
I have been very busy with projects at work and sleep i have not done anything at all on this project but wanted to let everyone know it is not DEAD.
|

04-14-2008, 12:44 AM
|
|
Discordant
|
|
Join Date: Sep 2006
Location: Subsection 185.D354 C.12
Posts: 346
|
|
A ton of data is stored as bit masks in the peq database. Every class/race combo field. I use the bit mask to save me a ton of time and code. What used to be several thousand lines of code turned into JUST the sql statment and a few box fills.
Trust me, learn the bitmask. You'll be glad you did.
Also, Arrays are your friends. Don't forget that they count them selfs when doing math, store strings with those numbers and CAN be two dimensional (Even more if you need it, two is almost always enough though.)
__________________
If at first you don't succeed destroy all evidence that you ever tried.
God doesn't give second chances... Hell, he sets you up the first time.
|
 |
|
 |

04-14-2008, 01:31 PM
|
|
Demi-God
|
|
Join Date: Jul 2006
Posts: 1,552
|
|
Not sure this will help any, but I built some arrays in php for these bitwise comparisons. It was so long ago, I am not really sure why I did it this way, but here it is nonetheless.
Code:
// Gear slots
$a = 1;
$gear_slots=array(
"Charm" => $a << 0,
"Left Ear" => $a << 1,
"Head" => $a << 2,
"Face" => $a << 3,
"Right Ear" => $a << 4,
"Neck" => $a << 5,
"Shoulder" => $a << 6,
"Arms" => $a << 7,
"Back" => $a << 8,
"Left Bracer" => $a << 9,
"Right Bracer" => $a << 10,
"Range" => $a << 11,
"Hands" => $a << 12,
"Primary" => $a << 13,
"Secondary" => $a << 14,
"Left Ring" => $a << 15,
"Right Ring" => $a << 16,
"Chest" => $a << 17,
"Legs" => $a << 18,
"Feet" => $a << 19,
"Waist" => $a << 20,
"Ammo" => $a << 21
);
//foreach($gear_slots as $row=>$val) {
// echo $row.$val."<BR>";
//}
// Char Inventory slots (8)
$s=1;
for($i=22;$i<=29;$i++) {
$inv="Inventory$s";
$inv_slots[$inv]=$i;
$s++;
}
// Char Inventory bag slots (8bags * 10slots)
$b=1; // bag 1
$s=1; // slot 1
for($i=251;$i<=330;$i++) {
if($s>10) {
$s=1;
$b++;
}
$bag="Bag$b";
$bagslot="Slot$s";
// echo "$bag-$bagslot<br>";
$inv_slots["$bag-$bagslot"]=$i;
$s++;
}
// Char Bank Slots (16)
$s=1; // slot 1
for($i=2000;$i<=2015;$i++) {
$inv="BankSlot$s";
$inv_slots[$inv]=$i;
$s++;
}
// Char Bank Bag slots (16bags * 10slots)
$b=1; // bag 1
$s=1; // slot 1
for($i=2031;$i<=2190;$i++) {
if($s>10) {
$s=1;
$b++;
}
$bag="BankBag$b";
$bagslot="Slot$s";
// echo "$bag-$bagslot<br>";
$inv_slots["$bag-$bagslot"]=$i;
$s++;
}
// Create Classes Array
$a = 1;
$classes=array(
"Unknown" => 0,
"Warrior" => $a << 0,
"Cleric" => $a << 1,
"Paladin" => $a << 2,
"Ranger" => $a << 3,
"Shadowknight" => $a << 4,
"Druid" => $a << 5,
"Monk" => $a << 6,
"Bard" => $a << 7,
"Rogue" => $a << 8,
"Shaman" => $a << 9,
"Necromancer" => $a << 10,
"Wizard" => $a << 11,
"Magician" => $a << 12,
"Enchanter" => $a << 13,
"Beastlord" => $a << 14,
"Berserker" => $a << 15
);
// Create Races Array
$a = 1;
$races=array(
"Unknown" => 0,
"Human" => $a << 0,
"Barbarian" => $a << 1,
"Erudite" => $a << 2,
"Wood Elf" => $a << 3,
"High Elf" => $a << 4,
"Dark Elf" => $a << 5,
"Half Elf" => $a << 6,
"Dwarf" => $a << 7,
"Troll" => $a << 8,
"Ogre" => $a << 9,
"Halfling" => $a << 10,
"Gnome" => $a << 11,
"Iksar" => $a << 12,
"Vah Shir" => $a << 13,
"NPC" => $a << 14,
"PET" => $a << 15,
"Froglok" => $a << 16
);
I used these arrays to build the combo boxes on my lookup page. Something like this:
Code:
<select name="searchClass" class="advSearch">
<option value="-1">Pick a Class</option>
<?php
foreach($classes as $key=>$val) {
if(isset($_POST['searchClass']) && $val==$_POST['searchClass']) {
$selected=" selected";
} else {
$selected="";
}
echo '<option value="'.$val.'"'.$selected.'>'.$key.'</option>';
}
?>
</select>
Again, kinda barbaric, but it works. Good luck with the app. I like the idea.
|
 |
|
 |
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -4. The time now is 01:25 AM.
|
|
 |
|
 |
|
|
|
 |
|
 |
|
 |