Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
apfinger
Novice


Joined: 19 Nov 2006
Posts: 40

PostPosted: Thu Mar 05, 2015 8:55 am   

[Resolved] Sessions are using each other's functions
 
All of my sessions are invoking a copy of a function from one particular session, when they each should be invoking their own copies.

I recently created a super session using the following:

Connect character session Digest (Digest.pkg)
Connect character session Trachea (Trachea.pkg)
Connect character session Intestine (Intestine.pkg)
Connect character session Organ (Organ.pkg)

Add Common.pkg

Save Session As... GroupV2

Common.pkg has common stuff: shared status bar, tic timer triggers, speedwalk dirs, and so forth.

One item is an auto-assist trigger:
#TRIGGER {(*) fell into an ambush by (%w).$} { #IF (%2 = %proper(%db(@tankInfo,name))) {#IF (@InCombat = 0) {@joinBattle(%db(@tankInfo,name),%1)}}}
"The King spider fell into an ambush by Organ."
%1 --> The King spider
%2 --> Organ

@tankInfo is a DB variable in Common.pkg with, among other things, a name. So, %proper(%db(@tankInfo,name)) would return Organ
@InCombat is a variable in each session's .pkg file - 0 indicating out of combat, 1 indicating in combat
@joinBattle is a function in each session's .pkg file which tells the character how to join the battle

For weeks this has worked fine. Today, I log in and suddenly every session is using @InCombat and @joinBattle from Trachea.pkg when the trigger executes. I'm completely unaware of any changes I would have made to cause this behavioral change.

In Digest.pkg, I have:
#FUNCTION joinBattle($tank, $target) { assist $tank }
In Trachea.pkg, I have:
#FUNCTION joinBattle($tank, $target) { kill $target }

In order to clean up this problem, I know I can move @InCombat from the individual .pkg files to Common.pkg as a DB variable:
@InCombat.Digest = 1, etc.

However, I can't do that with @joinBattle function.

I've gone through and made sure only Digest.pkg and Common.pkg are available to Digest's session, yet for some reason, when Digest's session is active and the trigger fires, Digest executes the @joinBattle function from Trachea.pkg.

Anyone have any insight on this behavior, or suggestions to get around it? I'm hoping I don't need to put the joinBattle function into Common.pkg - that would require it to identify the session invoking it. I switch my characters around enough that I don't want to have a bloated central function.

If I did move the function to Common.pkg, could the function do a round-robbin through any active sessions to tell each one to execute its function? If so, is there a #command or %function to identify each active session?

Any other ideas on a fix or the cause for this issue?


Last edited by apfinger on Thu Mar 05, 2015 7:19 pm; edited 1 time in total
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4690
Location: Pensacola, FL, USA

PostPosted: Thu Mar 05, 2015 11:36 am   
 
Sometimes when windows reboots when you are AFK, the force close of CMUD can cause windows to enable every package.... make sure that your charaacter windows dont have the other character packages enables in them.
_________________
Discord: Shalimarwildcat
Reply with quote
apfinger
Novice


Joined: 19 Nov 2006
Posts: 40

PostPosted: Thu Mar 05, 2015 7:19 pm   
 
Shalimar wrote:
Sometimes when windows reboots when you are AFK, the force close of CMUD can cause windows to enable every package.... make sure that your charaacter windows dont have the other character packages enables in them.


That is excellent information! If there's a Known Issue section, I failed to look for it. I did check my character windows and unchecked other character packages, however...

apfinger wrote:
I've gone through and made sure only Digest.pkg and Common.pkg are available to Digest's session, yet for some reason, when Digest's session is active and the trigger fires, Digest executes the @joinBattle function from Trachea.pkg.


I did not restart the sessions or Cmud yesterday. I was tired by this time. Starting up Cmud today, I was able to verify that all the .pkg files were disabled for other characters, and confirmed that the problem was resolved.

Thanks! I can go about my business again.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net