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!

converting DbPhoenix > DbBcstrom

Status
Not open for further replies.
Initiate Mage
Joined
Nov 2, 2011
Messages
21
Reaction score
17
Table bots
PHP:
ALTER TABLE `bots` DROP COLUMN `effect`;

Table groups
PHP:
ALTER TABLE `groups`
DROP COLUMN `locked`,
DROP COLUMN `privacy`,
CHANGE COLUMN `id` `Id`  int(11) NOT NULL AUTO_INCREMENT FIRST ,
CHANGE COLUMN `name` `Name`  varchar(50) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL AFTER `Id`,
CHANGE COLUMN `ownerid` `OwnerId`  int(11) NOT NULL AFTER `Name`,
CHANGE COLUMN `desc` `Description`  varchar(255) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL AFTER `OwnerId`,
CHANGE COLUMN `roomid` `RoomId`  int(10) UNSIGNED NOT NULL DEFAULT 0 AFTER `Description`,
CHANGE COLUMN `badge` `Image`  varchar(50) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL AFTER `RoomId`,
CHANGE COLUMN `created` `DateCreated`  varchar(50) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL AFTER `Image`,
ADD COLUMN `OwnerName`  varchar(50) NOT NULL AFTER `OwnerId`,
ADD COLUMN `CustomColor1`  int(11) NOT NULL AFTER `Image`,
ADD COLUMN `CustomColor2`  int(11) NOT NULL AFTER `CustomColor1`,
ADD COLUMN `GuildBase`  int(11) NOT NULL AFTER `CustomColor2`,
ADD COLUMN `GuildBaseColor`  int(11) NOT NULL AFTER `GuildBase`,
ADD COLUMN `GuildStates`  text NOT NULL AFTER `GuildBaseColor`,
ADD COLUMN `HtmlColor1`  varchar(10) NOT NULL AFTER `GuildStates`,
ADD COLUMN `HtmlColor2`  varchar(10) NOT NULL AFTER `HtmlColor1`,
ADD COLUMN `Petitions`  text NOT NULL AFTER `DateCreated`,
ADD COLUMN `Typee`  int(11) NOT NULL AFTER `Petitions`,
ADD COLUMN `RightsType`  int(11) NOT NULL AFTER `Typee`;

Table catalog_marketplace_offers
PHP:
ALTER TABLE `catalog_marketplace_offers`
DROP COLUMN `furni_id`;

Table messenger_friendships
PHP:
ALTER TABLE `messenger_friendships`
CHANGE COLUMN `user_one_id` `sender`  int(10) UNSIGNED NOT NULL FIRST ,
CHANGE COLUMN `user_two_id` `receiver`  int(10) UNSIGNED NOT NULL AFTER `sender`;

Table navigator_flatcats
PHP:
ALTER TABLE `navigator_flatcats`
DROP COLUMN `cantrade`;

Table room_models
PHP:
ALTER TABLE `room_models`
ADD COLUMN `poolmap`  text NOT NULL AFTER `club_only`;

Table rooms
PHP:
ALTER TABLE `rooms`
CHANGE COLUMN `floorthick` `floorthickness`  int(1) NOT NULL DEFAULT 0 AFTER `allow_hidewall`,
CHANGE COLUMN `wallthick` `wallthickness`  int(1) NOT NULL DEFAULT 0 AFTER `floorthickness`,
CHANGE COLUMN `achievement` `GroupId`  int(11) NOT NULL DEFAULT 0 AFTER `wallthickness`,
ADD COLUMN `allow_rightsoverride`  enum('0','1') NOT NULL DEFAULT '0' AFTER `allow_hidewall`;
ALTER TABLE `rooms`
MODIFY COLUMN `users_now`  int(3) NOT NULL DEFAULT 0 AFTER `state`,
MODIFY COLUMN `users_max`  int(3) NOT NULL DEFAULT 25 AFTER `users_now`,
MODIFY COLUMN `model_name`  varchar(20) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL AFTER `users_max`,
MODIFY COLUMN `public_ccts`  text CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL AFTER `model_name`,
MODIFY COLUMN `score`  int(6) NOT NULL DEFAULT 0 AFTER `public_ccts`,
MODIFY COLUMN `icon_bg`  int(2) NOT NULL DEFAULT 1 AFTER `tags`,
MODIFY COLUMN `icon_fg`  int(2) NOT NULL DEFAULT 0 AFTER `icon_bg`,
MODIFY COLUMN `icon_items`  varchar(10) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '' AFTER `icon_fg`,
MODIFY COLUMN `password`  text CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL AFTER `icon_items`,
MODIFY COLUMN `floorthickness`  int(6) NOT NULL DEFAULT 0 AFTER `allow_rightsoverride`,
MODIFY COLUMN `wallthickness`  int(6) NOT NULL DEFAULT 0 AFTER `floorthickness`,
ROW_FORMAT=DYNAMIC;

Table user_pets
PHP:
ALTER TABLE `user_pets`
ADD COLUMN `have_saddle`  int(255) NOT NULL AFTER `z`,
ADD COLUMN `hairdye`  int(11) NOT NULL AFTER `have_saddle`,
ADD COLUMN `pethair`  int(11) NOT NULL AFTER `hairdye`,
ADD COLUMN `can_all`  int(11) NOT NULL AFTER `pethair`;

Table items :
PHP:
CREATE TABLE `items_rooms` (
  `item_id` int(10) unsigned NOT NULL,
  `room_id` int(10) unsigned NOT NULL,
  `x` decimal(4,2) NOT NULL COMMENT 'Holds data XX,YY for floor items, and width XX,YY for wall items',
  `y` decimal(4,2) NOT NULL COMMENT 'Holds data ZZ,ZZ for floor items (height), and length XX,YY for wall items	',
  `n` tinyint(2) NOT NULL COMMENT '0-6: Regular rotation for floor items, 7: left, 8: right for wall items',
  `guilds_data` varchar(50) NOT NULL DEFAULT '',
  PRIMARY KEY (`item_id`),
  UNIQUE KEY `item_id_UNIQUE` (`item_id`),
  KEY `room_id` (`room_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

CREATE TABLE `items_extradata` (
  `item_id` int(10) unsigned NOT NULL,
  `data` text NOT NULL,
  PRIMARY KEY (`item_id`),
  UNIQUE KEY `item_id_UNIQUE` (`item_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

CREATE TABLE `items_users` (
  `item_id` int(10) unsigned NOT NULL,
  `user_id` int(10) unsigned NOT NULL,
  PRIMARY KEY (`item_id`),
  UNIQUE KEY `item_id_UNIQUE` (`item_id`),
  KEY `user_id` (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

Php
PHP:
<?php 
set_time_limit(0);
mysql_connect("127.0.0.1:3306","root","password");
mysql_select_db("test");

$select = mysql_query("SELECT id, room_id, x, y, z, rot FROM items WHERE room_id > '0'");
while($insert = mysql_fetch_array($select))
{
	if($insert['y'] < 10) { $x = $insert['x'].".0".$insert['y']; } else { $x = $insert['x'].".".$insert['y']; }
	mysql_query("INSERT INTO items_rooms (item_id, room_id, x, y, n) VALUES (".$insert['id'].", ".$insert['room_id'].", ".$x.", ".$insert['z'].", ".$insert['rot'].")");
}
?>

PHP:
INSERT INTO items_users (item_id, user_id) SELECT id, user_id FROM items;
INSERT INTO items_extradata (item_id, data) SELECT id, extra_data FROM items WHERE extra_data != '';
ALTER TABLE `items`
DROP COLUMN `user_id`,
DROP COLUMN `room_id`,
DROP COLUMN `extra_data`,
DROP COLUMN `x`,
DROP COLUMN `y`,
DROP COLUMN `z`,
DROP COLUMN `rot`,
DROP COLUMN `wall_pos`,
CHANGE COLUMN `id` `item_id`  int(10) UNSIGNED NOT NULL FIRST ,
CHANGE COLUMN `base_item` `base_id`  int(11) UNSIGNED NOT NULL AFTER `item_id`,
ADD COLUMN `rareid`  int(11) NOT NULL AFTER `base_id`,
ADD COLUMN `group_data`  varchar(200) NOT NULL AFTER `rareid`,
ADD COLUMN `placedBy`  int(10) NOT NULL AFTER `group_data`;
The rest soon
 
Last edited:
Experienced Elementalist
Joined
Oct 25, 2009
Messages
205
Reaction score
106
Have you tested this? And does it work properly without missing fields or tables?
 
Junior Spellweaver
Joined
Nov 21, 2011
Messages
158
Reaction score
43
what php script?


Here Your thread now has more than that thread, but didn't before you edited it, btw good job.

Edit: Rooms is missing : `GroupId` int(11) NOT NULL DEFAULT '0',
 
Last edited:
Junior Spellweaver
Joined
Aug 22, 2007
Messages
130
Reaction score
103
The room items converting is wrong, x and y is stored in x, z is stored in y and n is actually the rotation
You can't just do x => x, y => y and z => n, then all furnis are messed up.
 
Experienced Elementalist
Joined
Oct 25, 2009
Messages
205
Reaction score
106
no it wont

why don't u look at the sql before asking pointless questions?

Relax there little one, if you've noticed he has been editing his main thread every few hours now so it could be working was just to get a simple idea of what's missing or not :love:
 
Initiate Mage
Joined
Nov 22, 2012
Messages
26
Reaction score
21
Habbix is running from the same converter or a little bit modified, just play around with this and it'll be ok.
 
Joined
Feb 5, 2010
Messages
415
Reaction score
244
For the items, instead of doing
PHP:
$select = mysql_query("SELECT id, room_id, x, y, z, rot FROM items WHERE room_id > '0'");
while($insert = mysql_fetch_array($select))
{
    if($insert['y'] < 10) { $x = $insert['x'].".0".$insert['y']; } else { $x = $insert['x'].".".$insert['y']; }
    mysql_query("INSERT INTO items_rooms (item_id, room_id, x, y, n) VALUES (".$insert['id'].", ".$insert['room_id'].", ".$x.", ".$insert['z'].", ".$insert['rot'].")");
}

You could run these queries.. Backup the table items
Code:
UPDATE items SET x = x + '.0' + y WHERE y < 10;
UPDATE items SET x = x + '.' + y WHERE y >= 10;
INSERT INTO items_rooms (item_id, room_id, x, y, n) (SELECT id, room_id, x, z, rot FROM items WHERE room_id > '0');

Not tested, will do in a few.
 
Last edited:
Status
Not open for further replies.
Back
Top