DragonPrime - LoGD Resource Community
Welcome Guest
  • Good evening, Guest.
    Please log in, or register.
  • February 17, 2019, 05:45:06 PM
Home Forums News Downloads Login Register Advanced Search
* * *
DragonPrime Menu
Login
 
 
Resource Pages
Search

Pages: [1] 2   Go Down
  Print  
Author Topic: Server Suspend for 0.97  (Read 10686 times)
0 Members and 1 Guest are viewing this topic.
Excalibur
Member
Mod God
*****
Offline Offline

Posts: 573


I'm a newbie, plz forgive me!


View Profile WWW
« on: December 01, 2004, 02:18:39 PM »

When I have to distribute prizes for the various tournaments I have installed onto my server, I need to do it when there's no player connected, otherwise the SQL queries will not be executed correctly, so I have decided to adapt LoGD to my need.
It's been quite easy and here are the instructions:
Quote
Open village.php
----------------
At the beginning of the file (right after the checkday) add:

Code:
if ($_GET['op']=="simanu") {
   savesetting("manutenzione",1);
   output("`b`^Server Suspend ON`b`0");
}
if ($_GET['op']=="nomanu") {
   savesetting("manutenzione",3);
   output("`b`^Server Suspend OFF`b`0");
}
Find the first addnav (it should be Blades Boulevard) and before it add:
Code:
if (getsetting("manutenzione",3) == 3 OR $session['user']['superuser'] > 2) {
Scroll down and right before:
addnav("X?`bSuperUser Grotto`b","superuser.php");

add:
Code:
addnav("Server Suspend ON","village.php?op=simanu");
addnav("Server Suspend OFF","village.php?op=nomanu");
After the last addnav (it should be NewDay link for admin) add:
Code:
} else {
    addnav("Q?`\$`bQuit`b`0 to field","login.php?op=logout",true);
    output("`c`n`n<big><big><big>`b`\$The server is currently suspended for maintenance</big></big></big>",true);
    output("`nBetter quit and come back in few minutes`nThanks for your cooperation`n");
output("LoGD's Admin`n`n`c`b");
}
Close and save.
Open index.php
--------------
Right before:
Code:
output("`c`n`2Write your `@USER NAME `2and your `@PASSWORD`2 to enter the realm.`n");
add:
Code:
if (getsetting("manutenzione", 3) == 3) {
and right before:
Code:
page_footer();
add:
Code:
}else{
output("`c`n`n<big><big><big>`b`\$The server is currently suspended for maintenance</big></big>",true);
output("`n`^Try again later.`n Admins are working for you ^_^`b`c</big>",true);
}
Be careful to don't log out before setting Server Suspend OFF, or you'll need to enter your MyAdmin to set it OFF.

Already tested and works fine for me. The only problem is when a player connected is dead, but it will be enough to add the same modification done for village.php to shades.php.

Have fun
Excalibur

P.S. I'm sure you're wondering why I have used 3[/b] and 1[/b] for settings instead of 0[/b] and 1[/b] ... the reason is because the savesetting command to set 0[/b] didn't work on my server  Shocked, while 3[/b] does the job.
Logged

Spock: Random chance seems to have operated in our favor.
McCoy: In plain, non-Vulcan English, we've been lucky.
Spock: I believe I said that, Doctor.
jerry cyr
Guest
« Reply #1 on: January 27, 2005, 04:36:39 PM »

i did it but when i looged out with it on i cant login as admin
Logged
Talisman
Administrator
Mod God
*****
Offline Offline

Posts: 5483



View Profile WWW
« Reply #2 on: January 27, 2005, 04:50:04 PM »

Maybe you need to spend more time reading posts and instructions.  He warns you about that very thing just a few inches above your post.
Logged

Play the latest beta version here on DragonPrime
jerry cyr
Guest
« Reply #3 on: January 27, 2005, 04:55:07 PM »

yeah i realized that after i posted that but he doesn't mention which table allows u to shut it off in the db
Logged
Talisman
Administrator
Mod God
*****
Offline Offline

Posts: 5483



View Profile WWW
« Reply #4 on: January 27, 2005, 05:09:29 PM »

It's all in the code he posted.
Logged

Play the latest beta version here on DragonPrime
jerry cyr
Guest
« Reply #5 on: January 27, 2005, 05:12:54 PM »

o'ok
Logged
jerry cyr
Guest
« Reply #6 on: January 27, 2005, 05:16:00 PM »

can u help me out i dont speak italion some of the code is italion
Logged
Talisman
Administrator
Mod God
*****
Offline Offline

Posts: 5483



View Profile WWW
« Reply #7 on: January 27, 2005, 05:27:48 PM »

You would be better served learning to read php, as that is all it is.
Logged

Play the latest beta version here on DragonPrime
jerry cyr
Guest
« Reply #8 on: January 27, 2005, 05:30:45 PM »

i'm trying to learn how to read the code and i dont see any sql quaries in the code
Logged
Arune
Member
Mod God
*****
Offline Offline

Posts: 718


Arune Vai - khatfield


View Profile WWW
« Reply #9 on: January 27, 2005, 08:31:52 PM »

....


Jerry the simplest thing for you to do is just change the 3's to 1's.
Code:
if (getsetting("manutenzione", 3) == 3) {

« Last Edit: January 27, 2005, 08:33:26 PM by Arune » Logged
jerry cyr
Guest
« Reply #10 on: January 27, 2005, 09:41:27 PM »

thanks, but i fixed the hard way
Logged
Excalibur
Member
Mod God
*****
Offline Offline

Posts: 573


I'm a newbie, plz forgive me!


View Profile WWW
« Reply #11 on: January 28, 2005, 01:29:42 AM »

Sorry for the delay but I've been quite busy these days.
I think that Arune and Talisman have already answered your question. If you find yourself blocked out of LoGD, you need to enter you PHPMyAdmin, table 'settings' and modify the 'manutenzione' field from 3 to 1, that's do the trick.

Excalibur
Logged

Spock: Random chance seems to have operated in our favor.
McCoy: In plain, non-Vulcan English, we've been lucky.
Spock: I believe I said that, Doctor.
jerry cyr
Guest
« Reply #12 on: January 28, 2005, 07:56:52 AM »

thanks
Logged
jerry cyr
Guest
« Reply #13 on: January 30, 2005, 12:32:48 AM »

do i need add a field to the settings for the server suspend cuz that field u were reffering too isn't there
Logged
Talisman
Administrator
Mod God
*****
Offline Offline

Posts: 5483



View Profile WWW
« Reply #14 on: January 30, 2005, 12:38:59 AM »

:shakes his head:

Why don't you just TRY IT and see what happens?  That's how you learn, instead of asking 'what if'...
Logged

Play the latest beta version here on DragonPrime
Pages: [1] 2   Go Up
  Print  
 
Jump to:  


*
DragonPrime Notices
Please take the time to read the FAQ and browse the DragonPedia

Support Us
No funds raised yet this year
Your help is greatly appreciated!
Recent Topics
DragonPrime LoGD
Who's Online
29 Guests, 0 Users
Home Forums News Downloads Login Register Advanced Search