Jump to content
  • 0

[HELP] Status Indicator Issue


Question

Posted

Alright, I have fiddled with this for two full days now, and I am now out of ideas. So here's the scoop:

 

I created a PHP status script to indicate whether or not the login/game server is on/offline. Script was working fine, then, out of the blue, completely stopped functioning. Here is what I've done so far, and the script I'm using:

 

<?php

 

$server = "X.X.X.X";

$portg = "7777";

$portl = "2106";

$timeout = "1";

 

$game = @fsockopen("$server", $portg, $errno, $errstr, $timeout);

$login = @fsockopen("$server", $portl, $errno, $errstr, $timeout);

echo $game ? "<img src=\"ico-on.png\">" : "<img src=\"ico-off.png\">";

echo "     ";

echo $login ? "<img src=\"ico-on.png\">" : "<img src=\"ico-off.png\">";

?>

 

(I've removed the $server IP)

 

Now, I know for a fact that this is a working script, because if I modify the server IP to my webserver, and change the ports to 80, it works without issue. HOWEVER, just to test this, I've copy + pasted several similar scripts I've found here and on Ragezone, same issue.

 

Then, I reset my router to the defaults, re-forwarded ports 2106, 7777, and 3306 to a new static IP on the network, and edited the L2J Configs to match the new internal IP. I've also quadruple checked all of the settings in the router, L2J configs, and the PHP script.

 

I then checked the open ports using a port scanner available online. The port scanner sees 7777 and 2106 as open, however 3306 (for SQL) is closed for some reason. The SQL port I'm not concerned as much about right now, but if the port scanner can see 7777 and 2106, shouldn't the PHP Script also?

 

Finally, I went so far as to change the ports from 2106 and 7777 on L2J to random port numbers that are not in use, and then match all of the settings on the script and router, however same issue.

 

I'm completely out of ideas, is there anything anyone can think of that I can further test?

11 answers to this question

Recommended Posts

  • 0
Posted

Dumb question, but have you tried with a total another PHP script (not L2J related), or is there any running script which currently work in the same time than your script ? Just to verify if PHP works correctly...

 

What's your error ? White blank screen ? Another type ?

 

You can test your PHP/mySQL link using another type of call, like an heroe/pvp/pk/another page, to see if php and mySQL can exchange data.

 

  • If you tested several scripts, that doesn't come (obviously) from script, assuming they all work :P.
  • If others PHP scripts work, that don't come from PHP.
  • If you can do a webpage calling heroes/etc, it doesn't come from php/mySQL link :P.
  • If all those things higher are true, than you 're in a big shit lol :). Nha, if all is true, it can only be a firewall problem, or your router. From my PoV anyway, and I'm not a guru in PsHitP...

 

Btw, you say in 2nd line it's not working now, and after your quote you're saying it works without issue... Have you changed something between the 2 states ?

 

If it's a developement platform, use an all-in-one solution like WAMP/LAMP. That avoids... Many problems.

 

Sry to don't give a real answer, but currently except if someone had exactly the same error in the past there is no real answer :D.

  • 0
Posted

I've tried using a non-L2J related script, still having the same issue. What is strange is if I change the IP to my webserver, rather than point it to the game server, and change the ports to 80 instead of 7777 and 2106, the script runs correctly. So I am guessing there is something being blocked somewhere, but I've disabled the firewall on the router + windows firewall.

 

Edit: there is no error message, the script runs, but it shows the servers are offline when they clearly are not. The port scanner I used online can see the open ports but the script doesn't see the servers.

  • 0
Posted

Another dumb check, you said you changed IP on L2J configs, but didn't say about L2J ports.

>> Are they matching ?

 

About that > I've tried using a non-L2J related script, still having the same issue.

>> if you got the same issue with a normal PHP script (try JUST an echo), it's PHP which is wrong :).

>> if you tried with another stylished ports script, try with an echo :P

 

Btw your LS/GS IP isn't the webserver one ? I have to understand you use 2 different computers if you hide your IP ? Because you just have to put 127.0.0.1 if it's the same computer.

 

If you haven't no more solution, try install/reinstall WAMP/LAMP, and test on it :P.

 

And try to remember what the heck you drink to fock your script yesterday, or at least what you did, haha :).

  • 0
Posted

Yes, the ports matched, I've checked my configs hundreds of times thinking I was just an idiot, but unfortunately it wasn't that easy.

 

LS/GS IP is not the same as the webserver. LS/GS is hosted locally, webserver is hosted by a host company (Fatcow) So the PHP script is pointing to my router's IP address which should then forward to my internal IP address since I've opened and tested the ports, and have had users connect to the LS/GS from outside of my network without issue.

 

I'm not sure what you mean with trying just an echo though.

 

And man, I wish I knew what I did to screw this up lol. It has been a nightmare for two days now.

  • 0
Posted

I just try to remove the followers from the "die" list :P.

- PHP

- mySQL

- ports

 

----

 

<?php echo 'Hello world !' ;
echo "Hello world !" ; ?>

 

Just to see if it's PHP or not. If it's already broken, the "fat|cow" will becomes a burger.

 

----

 

Have you tried to put off your server, to see what the result ?

 

----

 

I don't want to give you hope, but I think it could be the use of " instead of ' when you try to call (echo) images. I remember now something like that happened to me too... Some months ago.

 

To give a try, try my first echo situation and replace ' per ". I added the 2 versions in my code tag if you're lazy lol.

 

If you see only one *Hello world* instead of 2, you got your answer.

  • 0
Posted

Thanks for the advice, sadly, both of the Hello World showed on the page.

 

I shut down the server to see if I just reversed the echo, however it still says offline.

 

Edit: I do not currently have WAMP installed, as I run the site from the remote webhost. However could this be causing the problem with the script being able to connect to my local PC? I'm wondering if that is why I am having a similar issue connecting from the web server to my MySQL database, it can't seem to see the system.

  • 0
Posted

You tried to empty your browser cache...? Lol.

 

Be clear with your words, you're saying when the server is off, it says "offline", and when it is online, it says nothing. You're wrong or I'm wrong ? Because if it's true we got a track, if not that make a useless post on MxC lol.

 

Both off and on server should call nothing, if you got images when the server is offline, it's a draw problem. Lol.

 

Try replace your images with just a damn echo too.

 

<?php

 

$server = "X.X.X.X";

$portg = "7777";

$portl = "2106";

$timeout = "1";

 

$game = @fsockopen("$server", $portg, $errno, $errstr, $timeout);

$login = @fsockopen("$server", $portl, $errno, $errstr, $timeout);

echo $game ? 'on' : 'off';

echo ' ';

echo $login ? 'on' : 'off';

?>

 

I put the code in quote because it looks like christmas tree if you put in code tags.

 

If you got something it's related to your images.

 

About wamp, it was just if your current thing was a developement lab. You are supposed to be able to do the link between 2 hosts.

 

What have you tried with mySQL so far ?

 

Is your webhoster got security policies you didn't read ? :P

 

EDIT : TRY TO CHANGE THE HOSTNAME FOR A REAL ONE >> WWW.GOOGLE.COM

  • 0
Posted

My firefox is set to clear cache on exit. I've done that multiple times, as well as restarted the PC and used Internet Explorer to test a separate browser. Still same problem.

 

What I mean is this:

LS/GS on: PHP script says both are offline

LS/GS off: PHP script says both are offline

 

Either way, it always displays the "Server Offline" image.

 

I used the code you listed, and still displays as "offline"

 

I am beginning to wonder if there is a problem with my router, even though all of the settings are correctly set to forward to my internal IP.

 

Edit: I am really confused why the PHP script doesn't see the servers, I went to http://www.canyouseeme.org/ and listed the ports 2106 and 7777 at my IP, and it sees both as open.

  • 0
Posted
<?php

 

$server = "X.X.X.X";

$portg = "7777";

$portl = "2106";

$timeout = "1";

 

$game = fsockopen($server, $portg, $errno, $errstr, $timeout);

$login = fsockopen($server, $portl, $errno, $errstr, $timeout);

 

echo $game ? 'on' : 'off';

echo ' ';

echo $login ? 'on' : 'off';

?>

 

The $server variable was under ""... And what about the @ before fsockopen, I don't see the use.

 

If that still doesn't work, try with another existing hostname, instead of your IP put www.google.com

 

About the timeout, I have no idea how it is influenced by the ping. If it is, it could be one way. There is a default timeout set in your php.ini, so this optio is pretty useless anyway (from what I read).

 

See more about fsockopen here : http://www.php.net/manual/en/function.fsockopen.php

  • 0
Posted

Tried your code again, still didn't work. I replaced it with google as well as a couple other private server IP's and still showing as offline. Could this be caused by the webhost ?

 

Here is the error message I get using your code:

 

Warning: fsockopen() [function.fsockopen]: unable to connect to 91.206.227.139:7777 (Connection refused) in /hermes/web04/b1856/moo.l2con/index.htm on line 142

Warning: fsockopen() [function.fsockopen]: unable to connect to 91.206.227.139:2106 (Connection refused) in /hermes/web04/b1856/moo.l2con/index.htm on line 142

  • 0
Posted

You should contact your webhoster yup, I read some could firewalling ports to avoid spamming, which avoids to be blacklisted.

 

Did you tried with other websites, because google isn't the only one :). Try with 2-3 others, and if it's still no, just ask to your host.

 

You normally have an admin panel too in your webhoster, check about ports options if there is one.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Posts

    • L2jBayev Chronicle 3: Rise of Darkness – AiEngine Edition In short: this is a C3 build with a full-fledged AI engine, live mercenaries, a built-in quiz, a “personal account” in the Community Board, and server logic neatly distributed across thread pools. The project is about a living world without lags : bots farm, communicate, gather parties, teleport along routes, and the server remains cold and stable.   What's inside (the most delicious) 1) Full-fledged AI engine for characters Behavior types: farming ( FarmAI ), combat ( CombatAI ), party logic ( PartyAI ), trading/walking ( TraderAI / WalkerAI ), support roles (healer, etc.). Class profiles: for mages/archers/daggers, etc., “smart” skill rotations, distance control, sleep/save skills, healing, loot pickup, etc. are implemented (see examples of classes like SpellSingerAI , NecromancerAI , etc.). Self-healing and teleports: when dying, the bot goes through a sequence of steps without sleep()- via AITaskSequence + AITeleportToLocTask , searches for the nearest gatekeeper and teleports via TeleportationManager with routes depending on the level. Auto-support: auto-nipples, arrows/bones, smart auto-proceduring of buffs and auto-banks CP/HP/MP with thresholds - all sewn into the auxiliary EtcPlayersAi . Chat context: ChatManagerAi processes mentions, makes responses with delays (anti-flood), supports party chat and “human” reaction. Understanding: ChatManagerAi system  processes the dialogue, bots remember your aggression and insults, they start to respond less often to modern users, stop accepting or inviting to a group (party) and when it goes beyond the peak they will simply merge you, and every time they see you on the PC, there is an opportunity to measure more often, communicate respectfully and beautifully, in general, a “human” reaction. Why a player/admin needs this: bots actually “live”, farm and interact, and don’t just stand on macros. This is a great background for online and PvE action.   2) Mercenaries (Mercenary system) Full-fledged companion character : L2MercenaryInstance with its own MercenaryAI (movement, attack, support, consumables, shots). Behavior modes: DEFENDER / SUPPORT / PASSIVE - switchable to suit your playing style. Progress and trust: the mercenary's trust/exp/level grows , skills are learned according to the MercenarySkillTree (conditions are based on the trust or level of the owner). Templates and equipment: via MercenaryTemplateTable and spawner - model/weapon/type are selected. Social: MercenarySpeechManager - a set of speeches; the mercenary "comes to life" in the chat. Premium Link: Premium account owners give the mercenary additional trust (faster progress). Why: This is not a dummy pet, but a playful companion with modes, training and “character”.   3) Quiz (event viktorina ) Rounds according to schedule: pre-launch with announcements (minutes/seconds before start), registration .reg, auto-opening of the window. Multiple choice questions: question + set of answer buttons; fair processing, timings, question change. Tops and history: results table, statistics, neat UI via HTML assembly. Flexible control: you can start immediately or set a delayed start (notification package 5/2/1 min, etc.). Why: regular activity for players, “social entertainment” module right in the build.   4) Personal account in Community Board KB managers: buff cabinet, teleports, clans/forums/mail/friends, tops (PK/PvP/wealth/players), character repair, viewing skill trees , etc. Premium logic: some services/mail are limited by premium; premium also affects the visual (nickname color) and bonuses (see effect on mercenary). Single sign-on: all in one place, no team chaos. Why: conveniently manage your character and services without going into the console or installing third-party mods.   Why is the system technically valuable? Minimum load and stability Separated thread pools: AI logic, hunting, teleports, chat - on separate onesScheduledExecutorService ( AI_THREAD_POOL , MONSTER_HUNT_POOL , TELEPORT_POOL , CHAT_POOL ). No "freezing": task sequencers (teleport/recovery) work through the scheduler, not Thread.sleep(). Bot limitation: protection against overload via thresholds/counters - “extra” bots do not start. One bot - one sequence: AITaskManager ensures that the character does not have parallel conflicting tasks. Smoothing out peaks: starting tasks with offsets so that there are no simultaneous “ticks” of hundreds of bots. Monitoring/logs: own loggers (separate files for info/errors/processes/chats), CPU load monitoring. Bottom line: the build is designed for “thick online” and mass activities without TPS failures .   Additional Features Auto-alliances for farming: party logic invites suitable players (checking level/equipment/clan flags), there are “human” responses to requests. Sub/class management: out of the box helpers for changing class/subclass, auto-learning of necessary skills and selection of equipment by level. Security/protection: secondary PIN/picture password support (used in KB/voiced commands; optional). Premium accounts: privileges in KB/mail/visual and synergy with mercenary progress. Ready-made services: tops, auctions/mail, teleports from KB, buff rooms, repairs, viewing skill trees, etc.   Who is this build for? Freeshare/project admins who want a living world “from the pack”: bots and mercenaries provide a constant background of activity. Players who value convenience: personal account, premium services, events and a mercenary companion. Developers who want a clean, predictable backend with thread pools and a neat task model without “magic”.   How it differs from standard assemblies Not macros - AI profiles with “brains”: rotations, positioning, healing, decision making. Not a decoration pet - a mercenary with his own modes, progress, skill tree and lines. Not a faceless gamemod - an event quiz with UI, schedule, tops. No chaos in flows - strict pools, planning and task managers designed for online and growth. No separate scripts - a single personal account in KB for most activities.   TL;DR (one paragraph for the project card) AiEngine C3 is a build with live AI, smart bots, mercenaries (modes/progress/skills), built-in quiz, premium logic and a convenient personal account in KB. Under the hood are distributed thread pools and task managers without sleep(), so even with a dense online the server remains stable and responsive.   Additionally add - there is still a lot of interesting things command .assassin or shift+target (order murder), shift+target for admins on AI characters for control, admin panel is completely rewritten, many additional functions, mercenaries change their appearance depending on trust, deepseek and chatGPT system is connected for communication of characters like real players, GPT - for newer java, there is still a very large list of fixes after the last versions, a lot has been fixed, including height coordinates (Z) geo-Squares, pathfinding, visibility through obstacles, fix pet summons, trade packages, shop packages, many effects, quests (including the original ones like nipples, etc.), Ai behavior of NPC and RB monsters, absolutely all epics have been transferred to AiLoader no longer in python scripts. Attention! The server is suitable for both classic mode and PvP format, as well as with various mods. Absolutely everything is configured in the configurations to suit your taste and purposes of use. It is recommended to launch the server through L2ServerControl (simplifies management and control of processes). Download Servers: Chronicle 3 Server Chronicle 4 Test Upgraded Server Full Desc & screens: Post & Screens c3 Post & Desc c4    
    • 🎃 HALLOWEEN EVENT 🎃   ‼️ Information and details: https://forum.l2harbor.com/threads/halloween-event-fall-harvest-30-10-07-11.8265/post-168620
  • Topics

×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock