mawelikeke / mwenhanced

Automatically exported from code.google.com/p/mwenhanced
0 stars 0 forks source link

Realmstatus on Multi-realm using same uptime for all realms. #111

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1.Configure multiple realms sharing one realmd database for login.
2.Start them all up.
3.Go to realmstatus on website and all show same time.
4.Shutdown RealmID 1
5.RealmID 1 correctly shows down while the others are still up.
6.Wait a few minutes and restart RealmID 1

What is the expected output? What do you see instead?
You would expect realmid 1 uptime to rest while the others remain counting.
Instead all realms uptime resets to realmid 1's uptime.

What revision of the product are you using? In what browser?
7993 TrinityCore, Latest HR TrinityWeb, IE8/FF/Chrome/Opera

What version are you using? MangosWeb or TrinityWeb?
TrinityWeb

Please provide any additional information below.

I would assume that for realmstatus.php you will need to lookup uptime 
from realmd based on the realmid # and not just the last one that started 
up or realmid 1. I am going back to test it with shutting down a different 
realmid and see if it restarts all uptimes.

*** YES, I shutdown realmid 4 and restarted it and all realms uptimes 
reset ***

I also noticed when a realm goes down, it reverts to PVP mode regardless 
of the mode it is set to in the servers .conf file.

Original issue reported on code.google.com by Stanbargers@gmail.com on 1 May 2010 at 5:48

GoogleCodeExporter commented 8 years ago
Hmm, good to know. Will take alook at it tomorrow.

Original comment by wilson.steven10@gmail.com on 2 May 2010 at 9:35

GoogleCodeExporter commented 8 years ago
I took a look at the code, and honestly, the original person who wrote this 
script
did a poor job. This might get fixed in the future, but for now you just have 
to take
it as it is :)

Original comment by wilson.steven10@gmail.com on 5 May 2010 at 11:42

GoogleCodeExporter commented 8 years ago
No worries... I will see if I can recode it myself. I am giving myself a crash 
course on PHP to see if I can assist you on this and a few other suggestions I 
have. 
I was thinking of a search option in VOTE and DONATION for sites hosting large 
amounts of rewards so you can SEARCH/FILTER based on keywords.

Original comment by Stanbargers@gmail.com on 6 May 2010 at 12:45

GoogleCodeExporter commented 8 years ago
I have fixed this code so it pulls the latest entry for each realmid ONCE the 
realm 
has been restarted. Would you like me to attach the file, or can I submit it 
from 
TortoiseHG?

Original comment by Stanbargers@gmail.com on 6 May 2010 at 8:46

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Have you tested this code yet?

Original comment by wilson.steven10@gmail.com on 6 May 2010 at 12:34

GoogleCodeExporter commented 8 years ago
Yes, I have periodically taken down a server and restarted it and only ITS 
uptime 
resets on the status screen

The biggest issue with the original code is it was realm NON-specific. It 
simply 
took the latest timestamp and used it for each instance.

What I did was create a new variable which stored the realmid of the realm it 
is 
pulling the data for and only pick the latest UPTIME timestamp for that realmid.

Original comment by Stanbargers@gmail.com on 6 May 2010 at 11:35

GoogleCodeExporter commented 8 years ago
Also wanted to let you know I am rewriting the VOTE system so that it tracks 
individual vote link timestamps per account number and NOT IP address (Why did 
they 
use IP to begin with for vote tracking? Yes, it is what casts the vote, but the 
account number is more crucial to keeping tabs on the votes themselves, right??

Original comment by Stanbargers@gmail.com on 8 May 2010 at 1:05

GoogleCodeExporter commented 8 years ago
The only current issue I have seen is whenever you take down or restart a 
realm, it 
resets its `icon` in the $DB to 1 (PVP). I went through all of the code and 
there is 
no place that "$DB->select("UPDATE..." exists in regards to the realm type. Is 
it 
possible this problem is in the TC code itself, not the website PHP?

Original comment by Stanbargers@gmail.com on 9 May 2010 at 9:00

GoogleCodeExporter commented 8 years ago
I would say yes it is a trinity problem

Original comment by wilson.steven10@gmail.com on 11 May 2010 at 5:27

GoogleCodeExporter commented 8 years ago
Also, about the vote system, i think using the account number is good too, but 
IP
address prevents people from taking advantage of the vote system because vote 
sites
use IP address, so it made sense for the site to use the IP address as well

Original comment by wilson.steven10@gmail.com on 11 May 2010 at 5:29

GoogleCodeExporter commented 8 years ago
I looked over your code here and cant really see what you did. When it gets the
Uptime, its still not realm specific:

your code:

$uptime = time () - $DB->selectCell("select starttime FROM 'uptime' ORDER BY
starttime DESC LIMIT 9");

Original code:

$uptime = time () - $DB->selectCell("select starttime FROM uptime ORDER BY 
starttime
DESC LIMIT 1");

Original comment by wilson.steven10@gmail.com on 11 May 2010 at 5:41

GoogleCodeExporter commented 8 years ago
I took down the updated code because I didn't want to bombard the whole site 
with 
it. Here is the snippit with the two corrections:

    $population=0;
    if($res_color==1)$res_color=2;else$res_color=1;
    $realm_type = $realm_type_def[$result['icon']];
    $realmnumber = $result['id']; //---- Create a RealmID Variable to test against.
    if(check_port_status($result['address'], $result['port'])===true)
    {
        $res_img = './templates/WotLK/images/uparrow2.gif';
        if($WSDB_EXTRA&&$CHDB_EXTRA) {
            $population = $CHDB_EXTRA->selectCell("SELECT count(*) FROM `characters` 
WHERE online=1");
            $uptime = time () - $DB->selectCell("select `starttime` FROM `uptime` 
WHERE `realmid`=$realmnumber ORDER BY `starttime` DESC LIMIT 1"); //-- Only 
pull 
from Uptime for the current realm. --//
        }
    }

Original comment by Stanbargers@gmail.com on 13 May 2010 at 3:48

GoogleCodeExporter commented 8 years ago
And yeah, for some reason, it did not upload the correct code in the file.

I will upload a pic of the working format. Take note that the servers are on 
different machines from each other all linking into a common REALMD database.

Original comment by Stanbargers@gmail.com on 14 May 2010 at 10:03

Attachments:

GoogleCodeExporter commented 8 years ago
You will notice in the image everything but TEST CENTER (RealmID 1) reverted to 
PVP 
(Icon 1) when I rebooted them. It should be Chaos and Order (RealmID 2&3) PVP, 
Purity (RID-4) Normal, Azeroth (RID-5) RP, and Tournament (RID-6) FFA_PvP.

Original comment by Stanbargers@gmail.com on 14 May 2010 at 10:08

GoogleCodeExporter commented 8 years ago
I have made a fix on this based on your code. Waiting for my internet to come 
back on and I will upload the fix :) ... May take a couple days though

Original comment by wilson.steven10@gmail.com on 15 Jul 2010 at 2:29

GoogleCodeExporter commented 8 years ago
fixed. Thank you for you code submission :)

Original comment by wilson.steven10@gmail.com on 24 Jul 2010 at 3:20