Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

SW Administration Panel

Status
Not open for further replies.
Joined
Jan 4, 2007
Messages
1,600
Reaction score
217
Tested it out, it's awesome but..

Issues/Bugs that need fixing:

  • Make the Name hyperlink more obvious in the panel's results. (I thought nothing was click-able when I first tested it =P)
  • Search does not work that well. (e.g. Try typing 252, select account, UGradeID. Nothing shows up and when you click search, it refreshes with nothing. You need to select account, UGradeID and then type 252, to make Search work.)
  • Use session_unset() before session_destroy() to unset all session variables in the panel. In some cases while doing an action on the panel, you might randomly get an error message "Login first", and when you try to relogin, it repeats that message over and over again.
  • Last Login Date issue. Some users who last logged in over a year ago are seen in the Last 20 Online on Accounts and Characters.
  • convertgrade() does not have a default return value for custom UGradeIDs due to hard-coded returns? (View the code all the way below)

Last Login Date Issue (template_account.php, template_character.php)

Do not use:
template_character.php
PHP:
SELECT TOP(20)* FROM Account WHERE LastLoginTime > LastLogoutTime
instead, use
template_character.php
PHP:
SELECT TOP(20)* FROM Login ORDER BY LastConnDate DESC
The same can be done to template_account.php by doing an INNER JOIN on the query, and not using LastLoginTime from the Account table in the query result as it is inaccurate:

PHP:
SELECT TOP(20) a.AID, a.UserID, a.UGradeID, l.LastConnDate, a.Email FROM Account a INNER JOIN Login l ON a.AID = l.AID ORDER BY l.LastConnDate DESC


Things you can add:


  • Add an advanced configuration section.
    Allow the customization of UGradeIDs in a variable so that it can be used in the "Account" UGradeID tab without editing the hard-coded definitions, if the user has custom UGradeIDs. Then, you can list each element with its sub-element in the array in convertgrade(). (Example below)
  • Add a $coinstable variable in settings.php for users with "Coins" on a different table.
  • Add a "Previous / Next 50" to select the previous/next 50 results in Search.
  • Add an [x] beside the name in Notes From Staff, if the user is in $admins at settings.php, to allow the removal of messages.

PHP:
// Configuration
$config_UGID = array(0 => "Normal Member",
                     255 => "Administrator");

// Listing at convertgrade()
public function convertgrade($grade)
{
    $parsed = "";
    $found = 0;

    foreach ($config_UGID as $uid => $value)
    {
        if ($grade == $uid)
        {
            $found = 1;
            $parsed .= '<option value="' . $uid . '" SELECTED>' . $value . '(' . $uid . ')</option>';
        }
        else
            $parsed .= '<option value="' . $uid . '">' . $value . '(' . $uid . ')</option>';
    }

    if ($found == 0)
        $parsed .= '<option value="' . $uid . '" SELECTED>Unknown (' . $grade . ')</option>';
        
    return $parsed;
}
Just whipped up that code - it's pretty much pseudo, so pardon me if I have any errors/syntax errors.

:)
 
Last edited:
Pee Aitch Pee
Joined
Mar 30, 2011
Messages
630
Reaction score
422
@Linear
Thanks, once I've installed all my poop on my SSD I will add/fix some things and change how some of the functions work.
 
Pee Aitch Pee
Joined
Mar 30, 2011
Messages
630
Reaction score
422
Updated the admin panel to V1.1

Changes:
- Account/character/clan names are now the color Maroon at the search function so it's obvious you can click on it.
- Added session_unset(); before all session_destroy();.
- Fixed last login date issue at account and character.
- Configuration settings are now stored in the $_CONFIG array.
- Added $_CONFIG['coinstable'] variable. I guess I don't need to explain what it does.
- In case you got custom UGradeID's you can add them with ease in the $_CONFIG['uids'] array.
- Admins can now delete messages in the notice box by pressing the X behind the name.
- At the admin part at the view log entries function you can change the url &amount= to a number to show a specific amount.
- Fixed the sql.txt so you can execute it without problems.

Thanks to Linear for suggestions.
Next version will have some -non important- changes in functions.

@bajay0124
Simply connect to your GunzDB, press "New Query" and paste it all there and press the red !.
 
Last edited:
Joined
Jan 4, 2007
Messages
1,600
Reaction score
217
Thanks for considering my suggestions. :)

There's a frustrating issue: Search - select the option Character and Name, type something, erase/add text.

It doesn't return any result in some cases and when you click "Search" on the nav bar again, it gives an error "Login first", and when you Login, you might get "Login IP and current IP do not match".

Another bug:

  • Character gender - convertgender2()
    - The values were filled wrongly.

Fixed code below: (fixed options, added support for Unknown gender in it)
PHP:
  public function convertgender2($gender)
  {
    if($gender == 1)
    {
      return '<option value="1" SELECTED>Female</option><option value="0">Male</option>';
    }
    elseif($gender == 0)
    {
      return '<option value="1">Female</option><option value="0" SELECTED>Male</option>';
    }
    else
    {
      return '<option value="' . $gender . '">UNKNOWN ("' . $gender . '")</option><option value="0">Female</option><option value="1">Male</option>';
    }
  }

EDIT: More bugs.


  • Login IP checking is inaccurate, sometimes, $_SERVER['REMOTE_ADDR'] returns a wrong IP, invalidating the session.
  • Logging off will produce a blank page.
 
Last edited:
Pee Aitch Pee
Joined
Mar 30, 2011
Messages
630
Reaction score
422
- Yea $_SERVER['REMOTE_ADDR'] sometimes doesn't give the correct IP, since that's the only way I know to get an IP in PHP, I will remove the IP check function.
- Logout function works normally to me. Can't reproduce the problem. (It redirects you to index.php after logging out.)
- Can't reproduce the problem with the search function either. I will remove the "Search" button since it's not needed and doesn't work anyways.
 
Last edited:
Joined
Jan 4, 2007
Messages
1,600
Reaction score
217
- Yea $_SERVER['REMOTE_ADDR'] sometimes doesn't give the correct IP, since that's the only way I know to get an IP in PHP, I will remove the IP check function.
- Logout function works normally to me. Can't reproduce the problem. (It redirects you to index.php after logging out.)
- Can't reproduce the problem with the search function either. I will remove the "Search" button since it's not needed and doesn't work anyways.

Search works, but random errors sometimes.
 
Pee Aitch Pee
Joined
Mar 30, 2011
Messages
630
Reaction score
422
Quick few changes, changed the download link.

Changes:
- Changed convert gender function. Thanks to Linear.
- Removed IP check function since it doesn't grab the correct IP sometimes.
- Removed the "Search" button at the search page since it's not needed and didn't work.
 
Pee Aitch Pee
Joined
Mar 30, 2011
Messages
630
Reaction score
422
More details could be useful.
 
Status
Not open for further replies.
Back
Top