Implementing: Instancing

EQ2Emulator Development forum.

Moderator: Team Members

Jabantiz
Lead Developer
Posts: 2912
Joined: Wed Jul 25, 2007 2:52 pm
Location: California

Re: Implementing: Instancing

Post by Jabantiz » Sat Aug 31, 2013 7:48 pm

This is the new table I have come up with, think it covers everything needed for the packets

Code: Select all

CREATE TABLE `character_instances` (
	`id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
	`char_id` INT(10) UNSIGNED NOT NULL DEFAULT '0',
	`instance_id` INT(10) UNSIGNED NOT NULL DEFAULT '0',
	`instance_zone_name` VARCHAR(64) NOT NULL,
	`instance_type` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0',
	`last_success_timestamp` INT(10) UNSIGNED NOT NULL DEFAULT '0',
	`last_failure_timestamp` INT(10) UNSIGNED NOT NULL DEFAULT '0',
	`success_lockout_time` INT(10) UNSIGNED NOT NULL DEFAULT '0',
	`failure_lockout_time` INT(10) UNSIGNED NOT NULL DEFAULT '0',
	PRIMARY KEY (`id`),
	INDEX `CharacterIDX` (`char_id`),
	INDEX `InstanceIDX` (`instance_zone_name`)
)
COLLATE='latin1_general_ci'
ENGINE=InnoDB
Entries in this table should never be deleted as long as the character exists so my plan is to update instance_id and set it to 0 when an instance expires. I haven't committed code to support this or put it on the DB patcher yet as I would like to get base functionality before I commit my changes.

User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

Re: Implementing: Instancing

Post by John Adams » Sun Sep 01, 2013 12:45 pm

Looks good to me, Jab.

Jabantiz
Lead Developer
Posts: 2912
Joined: Wed Jul 25, 2007 2:52 pm
Location: California

Re: Implementing: Instancing

Post by Jabantiz » Sun Sep 01, 2013 8:01 pm

Making progress
EQ2EmuInstanceTest.jpg
Still have work to do as you are not actually prevented from entering an instance you are locked out of, but lock out and persistent are tracked in the window now. Also some issues with the current code with the DB updating wrong but it is slowly starting to get there, NOT on SVN yet as it is not 100% functional yet.
You do not have the required permissions to view the files attached to this post.

User avatar
thefoof
Retired
Posts: 630
Joined: Wed Nov 07, 2012 7:36 pm
Location: Florida

Re: Implementing: Instancing

Post by thefoof » Sun Sep 01, 2013 8:27 pm

Lookin good.

User avatar
alfa
Team Member
Posts: 550
Joined: Fri Jul 27, 2007 6:24 pm
Location: France
Contact:

Re: Implementing: Instancing

Post by alfa » Mon Sep 02, 2013 2:33 am

Reset button pop up when you select an item in the list too ?
Fight with me... Or die, like the rest.
J.A. say: "I think Xinux tried to tell me this, but I ignore most things he suggests."

Jabantiz
Lead Developer
Posts: 2912
Joined: Wed Jul 25, 2007 2:52 pm
Location: California

Re: Implementing: Instancing

Post by Jabantiz » Mon Sep 02, 2013 11:28 am

Is there a reset button for the lockout instances? There is one on the persistent tab but haven't worked on getting them functioning properly so not sure if there is something special needed to activate the button.

Have plans for lockout instances and hopefully will have them working tonight, I will then move on to the persistent instances and I am hoping they will be easier to deal with. Also going to add some more lua functions to set lockout / success times.

User avatar
alfa
Team Member
Posts: 550
Joined: Fri Jul 27, 2007 6:24 pm
Location: France
Contact:

Re: Implementing: Instancing

Post by alfa » Mon Sep 02, 2013 11:51 am

My bad, only on persistant
Fight with me... Or die, like the rest.
J.A. say: "I think Xinux tried to tell me this, but I ignore most things he suggests."

Jabantiz
Lead Developer
Posts: 2912
Joined: Wed Jul 25, 2007 2:52 pm
Location: California

Re: Implementing: Instancing

Post by Jabantiz » Mon Sep 02, 2013 6:07 pm

Got the DB updating properly and lockout instances will actually lock you out now. Need to get a /log or packet log of the actual messages for both being locked out of a zone do to failure and success. Still some timer update stuff I need to figure out but it is starting to come together, at least lockout instances are.

Jabantiz
Lead Developer
Posts: 2912
Joined: Wed Jul 25, 2007 2:52 pm
Location: California

Re: Implementing: Instancing

Post by Jabantiz » Tue Sep 03, 2013 4:31 pm

This ended up a lot more work then I was expecting but getting to a point where I think it is stable enough to commit, will hopefully be able to do that tonight.

Just a quick question for john, is it ok to put a drop table statement on the DB patcher to update the table or should I get the alter code for it?

User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

Re: Implementing: Instancing

Post by John Adams » Tue Sep 03, 2013 5:18 pm

If it is a currently unused table, you can do a DROP yourself (ie., don't DROP the spawn table :D)

FYI: The Alter/Update script does not assume this, but the Create script does (adds the DROP for you).

Jabantiz
Lead Developer
Posts: 2912
Joined: Wed Jul 25, 2007 2:52 pm
Location: California

Re: Implementing: Instancing

Post by Jabantiz » Tue Sep 03, 2013 7:29 pm

Table is on the DB patcher, and code is on Dev SVN.

In the zones table `default_reenter_time` = failure lockout time for lockout instances and min duration for persistent instances.
`default_lockout_time` = success lockout time for lockouts and max duration for persistent instances

Those fields may need to be renamed to make it clearer what they do, I just used what was already there.

Currently success timer will bet set when you zone into a lockout, mainly for testing, still need to implement the lua functions to set the timers. The instance window (default: alt + z) should work for lockout instances, mostly work for persistent but not 100%, can't reset an instance and doesn't show you locked to an instance currently.

Also did a lot of DB work so John may want to go over that code, I suck with DB's...

This is still a work in progress, left a lot of comments to show my intentions, most work in the future will probably be in Client::TryZoneInstance()

User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

Re: Implementing: Instancing

Post by John Adams » Tue Sep 03, 2013 7:45 pm

Jabantiz wrote:Also did a lot of DB work so John may want to go over that code, I suck with DB's...
You do just fine :) I'll take a look at it this week/weekend. Thanks!

Jabantiz
Lead Developer
Posts: 2912
Joined: Wed Jul 25, 2007 2:52 pm
Location: California

Re: Implementing: Instancing

Post by Jabantiz » Thu Sep 05, 2013 7:12 pm

Dev SVN wrote: Added: SetSuccessTimer lua function
Added: SetFailureTimer lua function
Added: Comments to CharacterInstances code
Fixed: Moved CharacterInstances code out of player.h and into Player.cpp
Fixed: Success timer will no longer be set for lockout zones when a player zones into it
Fixed: Persistent instances will display better in the zone window (default: alt + z)
Fixed: Few errors in the packet for the zone window
The persistent window now works better and the reset button activates after min duration has passed, got the command figured out, was simple 1 param command, but haven't coded it yet. Also found a bug where the timers could expire for a lockout and you could zone back in but the instance wasn't cleared from the char so you would end up in the last instance you did and not a new one.

For those of you who know instances, is the "time left" in the persistent window suppose to be red when you can't reset it? Right now on the emu it is green and haven't figured out how to make it red, if it ever is red.

User avatar
xinux
Team Member
Posts: 680
Joined: Wed Mar 10, 2010 11:10 am
Location: Destroyer of Servers

Re: Implementing: Instancing

Post by xinux » Thu Sep 05, 2013 8:02 pm

I zoned into The Estate of Unrest and i have 25 minutes left and it is green and the reset timer is greyed out but i'm pretty sure the reset timer won't be available till my time left has expired.
EQ II - Build=1360 (Orig) - Build=1360 (DoF) - Build=2654 (KoS) - Build=3375 (Classic) - Build=3554 (EoF)
EQ II - Build=4412 (RoK) - Build=5122 (TSO) - Build=6118 (SF) - Build=7628 (DoV) - Build=8295 (Aod)

User avatar
thefoof
Retired
Posts: 630
Joined: Wed Nov 07, 2012 7:36 pm
Location: Florida

Re: Implementing: Instancing

Post by thefoof » Thu Sep 05, 2013 8:16 pm

Here's a screenshot of some different messages. I think you get one in-game when an instance expires too but not 100% sure. The yes and no window is when leaving a lockout instance that isn't persistent and you have a lockout, the first message is when a lockout is set, the second is trying to go back into a locked instance.
You do not have the required permissions to view the files attached to this post.

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests