Page 2 of 2

Re: Implementing: Channels

Posted: Tue Mar 20, 2012 8:38 am
by Scatman
Sure ill do this after work today.

Re: Implementing: Channels

Posted: Tue Mar 20, 2012 4:17 pm
by Scatman
Here are the new DB tables I'm proposing:

Code: Select all

CREATE TABLE `channels` (
	`id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
	`name` TEXT NOT NULL,
	`password` TEXT NULL,
	`level_restriction` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT '0',
	PRIMARY KEY (`id`)
)
COLLATE='latin1_swedish_ci'
ENGINE=InnoDB;

CREATE TABLE `channel_classes` (
	`id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
	`channel_id` INT(10) UNSIGNED NOT NULL,
	`class_id` INT(10) UNSIGNED NOT NULL,
	PRIMARY KEY (`id`),
	INDEX `fk_channelclasses_channelid` (`channel_id`),
	CONSTRAINT `fk_channelclasses_channelid` FOREIGN KEY (`channel_id`) REFERENCES `channels` (`id`) ON UPDATE CASCADE ON DELETE CASCADE
)
COLLATE='latin1_swedish_ci'
ENGINE=InnoDB;

CREATE TABLE `channel_races` (
	`id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
	`channel_id` INT(10) UNSIGNED NOT NULL,
	`race_id` INT(10) UNSIGNED NOT NULL,
	PRIMARY KEY (`id`),
	INDEX `fk_channelraces_channelid` (`channel_id`),
	CONSTRAINT `fk_channelraces_channelid` FOREIGN KEY (`channel_id`) REFERENCES `channels` (`id`) ON UPDATE CASCADE ON DELETE CASCADE
)
COLLATE='latin1_swedish_ci'
ENGINE=InnoDB;

Re: Implementing: Channels

Posted: Tue Mar 20, 2012 4:35 pm
by Scatman
Ok, new table to support bitwise races/classes, since John so cleverly suggested it!

Code: Select all

CREATE TABLE `channels` (
	`id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
	`name` VARCHAR(128) NOT NULL COLLATE 'latin1_general_ci',
	`password` VARCHAR(128) NULL DEFAULT NULL COLLATE 'latin1_general_ci',
	`level_restriction` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT '0',
	`classes` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0',
	`races` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0',
	PRIMARY KEY (`id`),
	UNIQUE INDEX `uk_channels_name` (`name`)
)
COLLATE='latin1_general_ci'
ENGINE=InnoDB;

Re: Implementing: Channels

Posted: Tue Mar 20, 2012 9:43 pm
by Scatman
Can't seem to send data updates to the update server

Code: Select all

INSERT INTO `channels` (`id`, `name`, `password`, `level_restriction`, `classes`, `races`) VALUES
	(1, 'Level_1-9', NULL, 1, 0, 0),
	(2, 'Level_10-19', NULL, 10, 0, 0),
	(3, 'Level_20-29', NULL, 20, 0, 0),
	(4, 'Level_30-39', NULL, 30, 0, 0),
	(5, 'Level_40-49', NULL, 40, 0, 0),
	(6, 'Level_50-59', NULL, 50, 0, 0),
	(7, 'Level_60-69', NULL, 60, 0, 0),
	(8, 'Level_70-79', NULL, 70, 0, 0),
	(9, 'Level_80-89', NULL, 80, 0, 0),
	(10, 'Level_90', NULL, 90, 0, 0),
	(11, 'Barbarian', NULL, 0, 0, 1),
	(12, 'Dark Elf', NULL, 0, 0, 2),
	(13, 'Dwarf', NULL, 0, 0, 4),
	(14, 'Erudite', NULL, 0, 0, 8),
	(15, 'Froglok', NULL, 0, 0, 16),
	(16, 'Gnome', NULL, 0, 0, 32),
	(17, 'Half Elf', NULL, 0, 0, 64),
	(18, 'Halfling', NULL, 0, 0, 128),
	(19, 'High Elf', NULL, 0, 0, 256),
	(20, 'Human', NULL, 0, 0, 512),
	(21, 'Iksar', NULL, 0, 0, 1024),
	(22, 'Kerra', NULL, 0, 0, 2048),
	(23, 'Ogre', NULL, 0, 0, 4096),
	(24, 'Ratonga', NULL, 0, 0, 8192),
	(25, 'Troll', NULL, 0, 0, 16384),
	(26, 'Wood Elf', NULL, 0, 0, 32768),
	(27, 'Fae', NULL, 0, 0, 65536),
	(28, 'Arasai', NULL, 0, 0, 131072),
	(29, 'Sarnak', NULL, 0, 0, 262144),
	(30, 'Vampire', NULL, 0, 0, 524288),
	(31, 'Guardian', NULL, 0, 8, 0),
	(32, 'Berserker', NULL, 0, 16, 0),
	(33, 'Monk', NULL, 0, 64, 0),
	(34, 'Bruiser', NULL, 0, 128, 0),
	(35, 'Shadowknight', NULL, 0, 512, 0),
	(36, 'Paladin', NULL, 0, 1024, 0),
	(37, 'Templar', NULL, 0, 8192, 0),
	(38, 'Inquisitor', NULL, 0, 16384, 0),
	(39, 'Warden', NULL, 0, 65536, 0),
	(40, 'Fury', NULL, 0, 131072, 0),
	(41, 'Mystic', NULL, 0, 524288, 0),
	(42, 'Defiler', NULL, 0, 1048576, 0),
	(43, 'Wizard', NULL, 0, 8388608, 0),
	(44, 'Warlock', NULL, 0, 16777216, 0),
	(45, 'Illusionist', NULL, 0, 67108864, 0),
	(46, 'Coercer', NULL, 0, 134217728, 0),
	(47, 'Conjuror', NULL, 0, 536870912, 0),
	(48, 'Necromancer', NULL, 0, 1073741824, 0),
	(49, 'Swashbuckler', NULL, 0, 8589934592, 0),
	(50, 'Brigand', NULL, 0, 17179869184, 0),
	(51, 'Troubador', NULL, 0, 68719476736, 0),
	(52, 'Dirge', NULL, 0, 137438953472, 0),
	(53, 'Ranger', NULL, 0, 549755813888, 0),
	(54, 'Assasin', NULL, 0, 1099511627776, 0),
	(55, 'Animalist', NULL, 0, 2199023255552, 0),
	(56, 'Beastlord', NULL, 0, 4398046511104, 0),
	(57, 'Auction', NULL, 0, 0, 0),
	(58, 'Crafting', NULL, 0, 0, 0),
	(59, 'Help', NULL, 0, 0, 0),
	(60, 'Noobie', NULL, 0, 0, 0),
	(61, 'Trading', NULL, 0, 0, 0),
	(62, 'Scat\'s_Channel_of_UBERNESS', NULL, 0, 0, 0);

Re: Implementing: Channels

Posted: Wed Mar 21, 2012 7:28 am
by John Adams
Damnit. That script bug still isn't fixed... I may need to re-write the module to NOT use PHPBB3's db object, since it traps errors and won't let me auto-correct in the script. I'll fix this and submit the data for you, Scatto.

Edit:
Of course, you HAD to have a channel name with an apostrophe, didn't you! haha... dunno why that is rejected. Will look into it, well, someday.

Sumitted.

Re: Implementing: Channels

Posted: Wed Mar 21, 2012 8:37 am
by Scatman
Haha thanks!

Re: Implementing: Channels

Posted: Wed Mar 21, 2012 2:12 pm
by alfa
Scat, never got /whochannel working, not implement ?

Re: Implementing: Channels

Posted: Wed Mar 21, 2012 2:33 pm
by Scatman
I did not know about that command! I'll get on it now thanks. Any others I missed? And does /whochannel list the channels you're in or who's in the channel?

Edit:
Really weird. They call it 'chatwho', heh. They are so inconsistent. The other commands have 'channel' in them.

Re: Implementing: Channels

Posted: Wed Mar 21, 2012 4:04 pm
by John Adams
Typical. Whatever mood the 14th dev to work on Chat was that day, got the command.

WHO QA'S THIS CLIENT?! I'd be freaking out if I worked for SOE QA ;)

Re: Implementing: Channels

Posted: Sat Jan 18, 2014 2:08 pm
by John Adams
Figured I'd bump this thread vs corrupt the IRC dev thread with chat stuff... but here's the weird thing.

I swear, I have seen the CHAT__DEBUG lines that say a new player logs in and joins all these channels... 1_9, 10-19, etc... but when I look at this thread, or the code, nothing "magically" joins them that I can see. So, 2 questions...

1) In order to have the default World Channels in the Emu, do I need this Channels table filled with data?
2) or is the client somehow pushing a /join {blah} itself on new character create and thus I have never noticed this until now? :oops:

And lastly (Jab) how does this affect your new IRC global channel? If it doesn't, then I'll get the data back into Channels and see how it works.


Edit: Wow, Scat or I added those channels to DB Patcher almost 2 years ago, and I never included it in the downloadable data. Not sure how I was ever seeing players joining stock channels then.

Re: Implementing: Channels

Posted: Sat Jan 18, 2014 2:56 pm
by John Adams
TODO:
Add Alignment for Good, Evil, Neutral to channel restrictions.
chat2.jpg