[Home] [Downloads] [Search] [Help/forum]

Gammon Software Solutions forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  SMAUG
. -> [Folder]  SMAUG coding
. . -> [Subject]  Name auth system, exploit?

Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

Name auth system, exploit?

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page


Posted by Zeno   USA  (2,868 posts)  [Biography] bio   Moderator
Date Fri 24 Sep 2004 02:32 AM (UTC)  quote  ]
Message
If I deny a name, they change it, then both characters now exist. For example, Bob renames to Bobby, both Bob and Bobby remain, so they have duplicate equipment now, etc. This is pretty bad. How would I fix this?

  oldname = ch->name;

  sprintf( fname, "%s%c/%s", PLAYER_DIR, tolower(argument[0]),
                        capitalize( argument ) );
  if ( stat( fname, &fst ) != -1 )
  {
    send_to_char("That name is already taken.  Please choose another.\n\r", ch);
    return;
  }

  STRFREE( ch->name );
  ch->name = STRALLOC( argument );
  STRFREE( ch->pcdata->filename );
  ch->pcdata->filename = STRALLOC( argument );
  send_to_char("Your name has been changed.\n\r", ch);
  ch->pcdata->auth_state = 0;
  sprintf( buf, "%s changed name to %s.", oldname, ch->name);
  to_channel( buf, CHANNEL_AUTH, "Auth", LEVEL_NEOPHYTE );
  return;
}

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
[Go to top] top

Posted by Greven   Canada  (835 posts)  [Biography] bio
Date Reply #1 on Fri 24 Sep 2004 06:05 AM (UTC)  quote  ]

Amended on Fri 24 Sep 2004 06:07 AM (UTC) by Greven

Message
You can add this in like such:
  oldname = ch->name;

  sprintf( fname, "%s%c/%s", PLAYER_DIR, tolower(argument[0]),
                        capitalize( argument ) );
  if ( stat( fname, &fst ) != -1 )
  {
    send_to_char("That name is already taken.  Please choose another.\n\r", ch);
    return;
  }

  
  sprintf( fname, "%s%c/%s", PLAYER_DIR, tolower(ch->name[0]),
                        capitalize( ch->name ) );
  if (access(fname, F_OK) == 0)
    unlink(fname);

  STRFREE( ch->name );
  ch->name = STRALLOC( argument );
  STRFREE( ch->pcdata->filename );
  ch->pcdata->filename = STRALLOC( argument );
  send_to_char("Your name has been changed.\n\r", ch);
  ch->pcdata->auth_state = 0;
  sprintf( buf, "%s changed name to %s.", oldname, ch->name);
  to_channel( buf, CHANNEL_AUTH, "Auth", LEVEL_NEOPHYTE );
  return;
}


That should check if they have a pfile (perhaps they have not been authed yet), and if they do, remove it.

Nobody ever expects the spanish inquisition!

darkwarriors.net:4848
http://darkwarriors.net
[Go to top] top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


1,148 views.

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

[Home]

Written by Nick Gammon - 5K

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( http://www.gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Internet Contents Rating Association (ICRA) - 2K]    [Web site powered by FutureQuest.Net]