Login
User Name:

Password:



Register
Forgot your password?
Vote for Us!
auth_update crash
Dec 23, 2017, 10:15 pm
By Remcon
check_tumble
Dec 18, 2017, 7:21 pm
By Remcon
parse description bug
Dec 15, 2017, 10:08 pm
By Remcon
Couple bugs
Dec 12, 2017, 5:42 pm
By Remcon
Bug in disarm( )
Nov 12, 2017, 6:54 pm
By GatewaySysop
LoP 1.46
Author: Remcon
Submitted by: Remcon
LOP 1.45
Author: Remcon
Submitted by: Remcon
LOP Heroes Edition
Author: Vladaar
Submitted by: Vladaar
Heroes sound extras
Author: Vladaar
Submitted by: Vladaar
6Dragons 4.3
Author: Vladaar
Submitted by: Vladaar
Users Online
CommonCrawl, Yandex

Members: 0
Guests: 16
Stats
Files
Topics
Posts
Members
Newest Member
478
3,708
19,242
612
Jacki72H
Today's Birthdays
There are no member birthdays today.
Related Links
» SmaugMuds.org » General » Smaug Snippets » Clan Roster Snippet Question
Forum Rules | Mark all | Recent Posts

Clan Roster Snippet Question
< Newer Topic :: Older Topic > Names move around...

Pages:<< prev 1, 2 next >>
Post is unread #1 Jan 4, 2005, 6:18 am
Go to the top of the page
Go to the bottom of the page

Drazuk

GroupMembers
Posts4
JoinedDec 13, 2004

I've installed the clan roster snippet into my Smaug1.4a (with manual bugfixes (; ). It compiles just fine, and the command works (well, it doesn't blow up the MUD). However, it seems to be renaming the clans to random names of the players in the clan. After looking really close at things, I can't find anywhere that would do this, but I'm obviously missing something. Anyone have any input on this one? Thanks (;

Drazuk
       
Post is unread #2 Jan 4, 2005, 6:17 pm
Go to the top of the page
Go to the bottom of the page

Samson
Black Hand
GroupAdministrators
Posts3,639
JoinedJan 1, 2002

There isn't anywhere in the code where that could happen. I'd suggest looking to other causes like memory overflows and the like. And taking a really careful look at anything that might touch clan names in your code.
       
Post is unread #3 Feb 14, 2005, 2:12 pm
Go to the top of the page
Go to the bottom of the page

Zeno
Sorcerer
GroupMembers
Posts723
JoinedMar 5, 2005

Same thing happens to me as I posted in my other topic.
       
Post is unread #4 Feb 14, 2005, 7:36 pm
Go to the top of the page
Go to the bottom of the page

Samson
Black Hand
GroupAdministrators
Posts3,639
JoinedJan 1, 2002

Well I'm not sure why it's happening to either of you. I've tested it against the FUSS code and am unable to duplicate your results in any possible way. The code snippet never modifies clan->name so I don't see how it could be happening.
       
Post is unread #5 Feb 14, 2005, 7:43 pm   Last edited Nov 25, 2007, 5:24 pm by Samson
Go to the top of the page
Go to the bottom of the page

Zeno
Sorcerer
GroupMembers
Posts723
JoinedMar 5, 2005

Well this is the odd part. It doesn't write it, I checked the clan file and it was the original name. But it is being displayed incorrectly. I'd like to find a solution ASAP, because clans are in, and rosters won't "auto-update". It sounds like something is being linked incorrectly... I'm not sure.

[EDIT] Also, I would test it on SmaugFUSS if I could. My linux machine is crap, long story short. And I don't have enough space or another port to test it on my host.
       
Post is unread #6 Feb 19, 2005, 9:51 am
Go to the top of the page
Go to the bottom of the page

Zeno
Sorcerer
GroupMembers
Posts723
JoinedMar 5, 2005

Actually, I have a feeling it has to do with update_roster... It's called if the player is in a clan, and then does add_roster... But it returns if they are already in the roster... Still not sure what's wrong.
       
Post is unread #7 Feb 19, 2005, 12:34 pm
Go to the top of the page
Go to the bottom of the page

Samson
Black Hand
GroupAdministrators
Posts3,639
JoinedJan 1, 2002

Got me, but again I cannot find any sort of problem with the code. It does exactly what it's supposed to do for me and for the test cases I've tried. Across hotboots, reboots, killed processes, crashes, you name it. There's just no way the code in the snippet can possibly do what you're saying. It has to be caused by something outside the scope of the snippet.
       
Post is unread #8 Mar 6, 2005, 4:48 pm   Last edited Sep 5, 2005, 8:43 pm by Samson
Go to the top of the page
Go to the bottom of the page

Zeno
Sorcerer
GroupMembers
Posts723
JoinedMar 5, 2005

Well I finally got a chance to test it out on a stock SmaugFUSS. I used SmaugFUSS 1.6 directly from download, on my linux machine. I installed the roster snippet exactly as it said. And the issue still happens. Where the clan name is renamed to a clan member (the first one or latest inducted?). I have sent Samson an email with some included files.

Here's the log:

As you know, some of us had problems with the roster snippet. Well I finally got a chance to test it out on a stock SmaugFUSS. I used SmaugFUSS 1.6 directly from download, on my linux machine. I installed the roster snippet exactly as it said. And the issue still happens. Where the clan name is renamed to a clan member (the first one or latest inducted?). I've included save.c and clans.c so you can look at how I installed it. Also you made an error/typo on one line:
ch_printf( ch, "%-15.15s %-15.15s %-6.6s %-6.6s -6.6s %s

", "Name", "Class", "Level", "Kills", "Deaths", "Joined on" );
Should be %-6.6s, not -6.6s. ;)

Here's the log:

 induct bob
Log: Zeno: induct bob
You induct Bob into The Ones
 
 clans
 
Clan          Deity         Leader           Pkills:    Avatar      Other
The Ones      Zeno                                           0          0
 
Use 'clans ' for detailed information and a breakdown of victories.
 
 reboot mud now
Log: Zeno: reboot mud now
Reboot by Zeno.
Connection closed by foreign host.
 
Enter your character's name, or type new: Zeno
Password:
Warning: the organization The Ones no longer exists, and therefore you no
longer belong to that organization.
Last connected from: 127.0.0.1
 
 clans
 
Clan          Deity         Leader           Pkills:    Avatar      Other
Bob           Zeno                                           0          0
 
Use 'clans ' for detailed information and a breakdown of victories.






       
Post is unread #9 Mar 6, 2005, 6:41 pm
Go to the top of the page
Go to the bottom of the page

Celestria

GroupMembers
Posts28
JoinedFeb 24, 2005

Where is the code for this snippit?
Celestria
       
Post is unread #10 Mar 6, 2005, 7:00 pm   Last edited Nov 25, 2007, 5:24 pm by Samson
Go to the top of the page
Go to the bottom of the page

Zeno
Sorcerer
GroupMembers
Posts723
JoinedMar 5, 2005

       
Post is unread #11 Mar 6, 2005, 8:05 pm   Last edited Sep 5, 2005, 8:41 pm by Samson
Go to the top of the page
Go to the bottom of the page

Samson
Black Hand
GroupAdministrators
Posts3,639
JoinedJan 1, 2002

You know, it took me eons to figure out what went wrong, since when I installed it on a fresh copy of FUSS just to see if I missed something I got the expected results. But then I was also only paying loose attention to one of the steps, which contained a rather critical error:


Then in save_clan, locate the following:

fprintf( fp, "GuardOne %d\n", clan->guard1 );
fprintf( fp, "GuardTwo %d\n", clan->guard2 );
fprintf( fp, "End\n\n" );
fprintf( fp, "#END\n" );

Above the "End" line, add the following:

fwrite_memberlist( fp, clan );


One will note that it should read Below the "End" line. Having that statement be one position off made a world of difference. Once I placed it where the instructions said to put it, I was able to duplicate your error. With that in mind the snippet file has been fixed and should plague people no more.
       
Post is unread #12 Mar 6, 2005, 8:15 pm
Go to the top of the page
Go to the bottom of the page

Zeno
Sorcerer
GroupMembers
Posts723
JoinedMar 5, 2005

Yeah I did a double take on that instruction, it just didn't seem right. Thanks, I can finally finish my clan system.
       
Post is unread #13 Mar 6, 2005, 8:16 pm
Go to the top of the page
Go to the bottom of the page

Celestria

GroupMembers
Posts28
JoinedFeb 24, 2005

You rock
       
Post is unread #14 Mar 17, 2005, 12:18 pm   Last edited Sep 5, 2005, 8:44 pm by Samson
Go to the top of the page
Go to the bottom of the page

Zeno
Sorcerer
GroupMembers
Posts723
JoinedMar 5, 2005

Now I'm having a bit of a problem of the rosters saving. They will be full with members, then I'll check them again and clan rosters will be empty.
Membership roster for the Sacred Knights Clan

Name            Race            Level  Kills  Deaths Joined on
-------------------------------------------------------------------------------------
Alexander        Hanyou          64     4042   32     Thu Mar 17 12:16:50 2005
Nes              Human           33     909    2      Thu Mar 17 12:16:50 2005


(hotboot)

Membership roster for the Sacred Knights Clan

Name            Race            Level  Kills  Deaths Joined on
-------------------------------------------------------------------------------------
Alexander        Hanyou          64     4042   32     Thu Mar 17 12:17:17 2005

There are 1 member in Sacred Knights


save_clan is called from update_roster, so this makes little sense why hotboot is resetting rosters.
       
Post is unread #15 Mar 19, 2005, 10:29 am
Go to the top of the page
Go to the bottom of the page

Samson
Black Hand
GroupAdministrators
Posts3,639
JoinedJan 1, 2002

Is it actually saving the affected rosters to disk? If so, then maybe you've got something removing the second person from the clan? If not then I'm not sure because so far I'm unable to reproduce this problem.
       
Post is unread #16 Mar 19, 2005, 8:44 pm
Go to the top of the page
Go to the bottom of the page

Zeno
Sorcerer
GroupMembers
Posts723
JoinedMar 5, 2005

Well it clears anyone who is not on during the hotboot. Nes was not on, while Alexander was.
       
Post is unread #17 Mar 23, 2005, 6:34 am
Go to the top of the page
Go to the bottom of the page

Drazuk

GroupMembers
Posts4
JoinedDec 13, 2004

Heh, i had the same thing happen Zeno, after I put in this updated version...checked the Clan files, and the Roster WAS saving correctly. Not sure if you did the same goofy thing I did, but where we needed the "fwrite_memberlist( fp, clan );" in save_clan below the "End" line, I put mine below the "#END" line...so when load_clan was doing its thing, it would see the "#END" before it got to the roster and quit...

so paying more attention to Samsons instructions, moving the fwrite_memberlist call after the "End" line, but before the "#END" line seems to keep the roster list intact between hotboots (;

Thanks Samson for another awesome snippet, and the work you went thru to help us out (:
       
Post is unread #18 Mar 24, 2005, 12:42 pm
Go to the top of the page
Go to the bottom of the page

Zeno
Sorcerer
GroupMembers
Posts723
JoinedMar 5, 2005

I'm pretty sure I have everything right.

        fprintf( fp, "Funds        %d\n",       clan->funds             );
        fprintf( fp, "Inducting    %d\n",       clan->inducting         );
        fprintf( fp, "End\n\n"                                          );
        fwrite_memberlist( fp, clan );
        fprintf( fp, "#END\n"                                           );



         word = fread_word( fp );
         if( !str_cmp( word, "CLAN" ) )
            fread_clan( clan, fp );
         else if( !str_cmp( word, "ROSTER" ) )
            fread_memberlist( clan, fp );
         else if( !str_cmp( word, "END" ) )
            break;
         else
       
Post is unread #19 Apr 3, 2005, 11:36 am
Go to the top of the page
Go to the bottom of the page

Xorith
The Null Value
GroupAFKMud Team
Posts254
JoinedFeb 23, 2003

Nope, you don't. As Samson said, the END makes a world of difference.

Instead of:

        fprintf( fp, "Funds        %d\n",      clan->funds            );
        fprintf( fp, "Inducting    %d\n",      clan->inducting        );
        fprintf( fp, "End\n\n"                                          );
        fwrite_memberlist( fp, clan );
        fprintf( fp, "#END\n"                                          );

You should try:
        fprintf( fp, "Funds        %d\n",      clan->funds            );
        fprintf( fp, "Inducting    %d\n",      clan->inducting        );
        fprintf( fp, "End\n\n"                                          );
        fprintf( fp, "#END\n"                                          );
        fwrite_memberlist( fp, clan );


Why? Well you need that #END to signify the end of the file. The first end is the section's end, the second is the file's #END. It's the way the filesystem works for Smaug-based MUDs (and I think it goes back to DIKU). Anywho, that should fix you up.
       
Post is unread #20 Apr 3, 2005, 11:42 am
Go to the top of the page
Go to the bottom of the page

Samson
Black Hand
GroupAdministrators
Posts3,639
JoinedJan 1, 2002

Actually that's not right Xorith. You can't put the fwrite_memberlist call below the #END marker because it will never load up after that. #END tells the file reader to stop reading and close - regardless of what else may follow.
       
Pages:<< prev 1, 2 next >>