Jump to content

[share] L2 Server Status


Recommended Posts

Παρατήρησα οτι πολλα άτομα ψαχνουν και αναφερουν πως δεν βρισκουν κατι για να σηκώσουν την κατασταση του server στο web site τους.

Για τον λογο αυτο έγραψα μια σελίδα php της οποίας τον κώδικα μπορείτε να τον κανετε προσθήκη σε όποια σελίδα δική σας θέλετε.

Ειναι στην ποιο απλή μορφή και παιζει σε όλες τις εκδόσεις L2, καθως επίσης μπορείτε να την χρησιμοποήσετε σαν server status για οποιοδήποτε server, ακομα και για web server αρκει να δώσετε ip διεύθυνση και port.

Kαντε τον κωδικα copy - paste σε ενα εγγραφο κειμενου και αποθηκεύστε το με ενα ονομα σαν php (παράδειγμα  status.php)

Γραψτε τα δικά σας IP, Port για Login, Game και Community server.

Ρίξτε την στον server σας και απλα τρέξτε την.

 

 

 

 

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html><head>Hello from Tr@c3R, support to email: Astald.tor@gmail.com</head>

<br><br>

<body><?php

$LServerIP = "127.0.0.1";

$LServerPort = "2106";

$GServerIP = "127.0.0.1";

$GServerPort = "7777";

$CServerIP = "127.0.0.1";

$CServerPort = "9013";

$TimeCheck = "2";

if (! $CheckSocket = @fsockopen( $LServerIP, $LServerPort, $num, $error, $TimeCheck ))

echo '<b><font color = red >Login Server OFF</b></font><br>'; else{ echo '<b><font color = green >Login Server ON</b></font><br>';

fclose($CheckSocket); }

if (! $CheckSocket = @fsockopen( $GServerIP, $GServerPort, $num, $error, $TimeCheck ))

echo '<b><font color = red >Game Server OFF</b></font><br>'; else{ echo '<b><font color = green >Game Server ON</b></font><br>';

fclose($CheckSocket); }

if (! $CheckSocket = @fsockopen( $CServerIP, $CServerPort, $num, $error, $TimeCheck ))

echo '<b><font color = red >Community Server OFF</b></font><br>'; else{ echo '<b><font color = green >Community Server ON</b></font><br>';

fclose($CheckSocket); }

?>

</body></html>

 

 

 

 

το $TimeCheck καθοριζει τον χρονο ελεγχου οταν ο server ειναι OFF, δηλαδή ποσα sec θα περιμένετε να απαντησει (οταν ειναι ΟΝ γινεται άμεσα).

τo $LServerIP = Login Server, $GServerIP = Game Server, $CServerIP = Community Server (συνήθως ειναι στον ιδιο server οπότε ειναι ιδια).

στα $xServerPort  εβαλα τα default των pack.

 

Αν θελετε να προσθέσετε εικονίδια ή φωτάκια για την κατάσταση αντικαταστήστε τα κιτρινα με τα πρασινα γραμματα:

echo '<b><font color = red >Game Server OFF</b></font><br>'; else{ echo '<b><font color = green >Game Server ON</b></font><br>';

echo '<img src="/images/ServerOFF.jpg" /><br>'; else{ echo '<img src="/images/ServerON.jpg" /><br>';

 

Δημιουργήστε αν δεν υπάρχει ενα φακελο με ονομα images και τοποθετήστε μεσα τις δυο εικόνες, μια οταν ο server ειναι down και μια οταν ο server ειναι UP, σαν παράδειγμα έβαλα ServerON.jpg και ServerOFF.jpg (μπορει να ειναι jpg, gif ή png)

 

 

Link to comment
Share on other sites

Σωστό script αλλά δεν δουλεύει αν έχεις κλειστή την fsockopen από τις ρυθμίσεις της php σου. Πολλοί web-hosters όπως το papaki ας πούμε την έχουν κλειστή by default.

Link to comment
Share on other sites

Ναι ετσι ειναι αλλα συνήθως αυτο συμβαίνει σε virtual servers που χρησιμοποιούν control panel και δεν εχουν apache server.

Παραυτα μπορεις να μπεις στο panel και να ρυθμισεις το php.ini και να την ανοιξεις. Ο λογος που την κλεινουν μερικοί ειναι απλα τα ping ελέγχου κατάστασης. Οι περισσοτεροι ομως καλοι servers ειναι dedicated και τρεχουν php server.

 

Αν θελει κανεις να κανει ελεγχο αν ειναι ανοικτη η fsock μπορει να χρησιμοποιήσει τον εξής κωδικα:

 

<?php

If ( function_exists ("fsockopen"))

       { echo 'isOpen';}

else { echo 'isClose';}

?>

 

και αν ειναι ανοιχτή χρησιμοποιεί το share, διαφορετικα την ανοίγει και αν δεν θελει να την ανοίξει βρήσκει αλλο τρόπο.

Στον δικό μου server χρησιμοποιώ VB.net προγραμματακι που εγγραψα για να με ενημερωνει για το site και μου στελνει μυνημα σε mail και στο κινητό μαζι με τα στατιστικα του server ( οχι μονο βεβαια για το L2 αυτό, για ολα τα sites και forums).

Link to comment
Share on other sites

δουλεύει και htm/html αν προσθέσεις στο  htaccess αρχείο την σειρα εντολή:

AddHandler application/x-httpd-php52 .php .htm .html

 

αυτο για apache, για ιιs συνήθως ειναι ενεργό ή δεν θα παιζει php γενικώς οποτε εχεις αλλα προβλήματα.

Link to comment
Share on other sites

  • 3 weeks later...

Some packages manage different the CS. Try to remove the CS in the first phase. There is an explanation of the grill. It works just like the Post. Only checkout if fsock is open in htaccess.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Posts

    • I strongly concur with some opinions shared. As I've previously mentioned on different posts, it's shocking to see how seasonal servers gather this much population. However, being back in the game some months I did start understanding how the current community of L2 plays and thinks.   It's a huge problem, but in my opinion the guilt is shared between server owners and community. To keep a long term project running (more than a year on) you need to have the equivalent community that will support the project, which unfortunately is not that big. The current player community of L2 hops on new servers with such a haste to get full and "dominate" which does indeed give a lot of activity for some weeks but after that it's just downfall, population gets reduced drastically day by day. The reason is, while the community is busy "grinding" to win on their current server, a "new" server is being advertised which most likely is from the same owner. As I've mentioned, the guilt is shared since the server-owners focus on bringing up "new" servers for the cash grab but also since the community doesn't have the patience to support a long-term project. Besides, let's not forget about clans/CPs being invited directly to the server with some benefits. I'll give an example. An admin opens a server, invites 3 groups (either CPs or clans) by promising them some small benefits. Those three groups will invite more players and so on. It's like an investment, they spent 5$ to earn 20$. Therefore, most admins willing to play "fair" do not succeed, except for a few. Most of us "old-timers" play for nostalgia trips and are fine with low populated servers but lets take a step back and think about the owners that really want to provide a good server, no income will slowly dry out the server and eventually die.   Don't get me wrong, there are some great servers out there, but not everything is for everyone. I'll finish by quoting someone I saw few days ago on YouTube, he said something along the lines that we shouldn't expect fair play while we play an "illegal" version of the game.
    • You have to create the "voiced" handler in the core too, or at the very least make sure that the delimiter is underscore and not an empty space. Alternatively, you can try changing all references of the strings below to start with "voiced_", or remove the "voiced_" portion from the button bypass.   private static final String[] VOICED_COMMANDS = { "siege", "siege_gludio", "siege_dion", "siege_giran", "siege_oren", "siege_aden", "siege_innadril", "siege_goddard", "siege_rune", "siege_schuttgart" };
    • Hi maxcheaters, I recently added some code to my l2jacis revision and everything works fine with the .siege commands but when I click on the html options to open the registry I don't succeed!   registerHandler(new Castles());   package net.sf.l2j.gameserver.handler.voicedcommandhandlers;   import net.sf.l2j.Config; import net.sf.l2j.gameserver.handler.IVoicedCommandHandler; import net.sf.l2j.gameserver.data.manager.CastleManager; import net.sf.l2j.gameserver.model.actor.Player; import net.sf.l2j.gameserver.model.entity.Castle; import net.sf.l2j.gameserver.network.SystemMessageId; import net.sf.l2j.gameserver.network.serverpackets.NpcHtmlMessage; import net.sf.l2j.gameserver.network.serverpackets.SiegeInfo;   public class Castles implements IVoicedCommandHandler { private static final String[] VOICED_COMMANDS = { "siege", "siege_gludio", "siege_dion", "siege_giran", "siege_oren", "siege_aden", "siege_innadril", "siege_goddard", "siege_rune", "siege_schuttgart" };   @Override public boolean useVoicedCommand(String command, Player player, String target) { if (command.equals("siege") && Config.ENABLE_MENU) showHtm(player); else if (command.startsWith("siege_")) { if (player.getClan() != null && !player.isClanLeader()) { player.sendPacket(SystemMessageId.YOU_ARE_NOT_AUTHORIZED_TO_DO_THAT); return false; }   int castleId = 0; if (command.startsWith("siege_gludio") && Config.SIEGE_GLUDIO) castleId = 1; else if (command.startsWith("siege_dion") && Config.SIEGE_DION) castleId = 2; else if (command.startsWith("siege_giran") && Config.SIEGE_GIRAN) castleId = 3; else if (command.startsWith("siege_oren") && Config.SIEGE_OREN) castleId = 4; else if (command.startsWith("siege_aden") && Config.SIEGE_ADEN) castleId = 5; else if (command.startsWith("siege_innadril") && Config.SIEGE_INNADRIL) castleId = 6; else if (command.startsWith("siege_goddard") && Config.SIEGE_GODDARD) castleId = 7; else if (command.startsWith("siege_rune") && Config.SIEGE_RUNE) castleId = 8; else if (command.startsWith("siege_schuttgart") && Config.SIEGE_SCHUT) castleId = 9; else player.sendMessage("This Castle has been disabled");   Castle castle = CastleManager.getInstance().getCastleById(castleId); if ((castle != null) && (castleId != 0)) player.sendPacket(new SiegeInfo(castle)); } return true; }   private static void showHtm(Player player) { NpcHtmlMessage htm = new NpcHtmlMessage(0); htm.setFile(player.isLang() + "mods/menu/CastleManager.htm"); player.sendPacket(htm); }   @Override public String[] getVoicedCommandList() { return VOICED_COMMANDS; } }     <button value="Giran" action="bypass voiced_siege_giran" width=75 height=22 back="L2UI_ch3.Btn1_normalOn" fore="L2UI_ch3.Btn1_normal">
    • totally agree, the problem started with professionals who made easy to open a server, specially interlude has been abused unstoppably since you can open a server with few clicks now days making fewer players for many servers, while back in time when "compile" was a secret and opening a server was going max players but true things are changing and this has become a job but dont lie everyone knows what is going on, lying is showing desperation, better go and work. i've worked with lots of people with kids that invest huge amounts of money into this and fail while they needed the money its an addiction.
  • Topics

×
×
  • Create New...