diff --git a/lgsl/admin.php b/lgsl/admin.php
new file mode 100644
index 0000000..0cc3b75
--- /dev/null
+++ b/lgsl/admin.php
@@ -0,0 +1,81 @@
+
+
+
+
+
+
+
+
+
+ USERNAME:
+ PASSWORD:
+
+
+
+
+
+
+
+ ";
+ }
+//------------------------------------------------------------------------------------------------------------+
+?>
+
+
+
+
+
diff --git a/lgsl/index.php b/lgsl/index.php
new file mode 100644
index 0000000..5b72266
--- /dev/null
+++ b/lgsl/index.php
@@ -0,0 +1,45 @@
+
+
+
+
+
+
+
+
+ Live Game Server List
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/lgsl/lgsl_files/icons/aarmy/aarmy.gif b/lgsl/lgsl_files/icons/aarmy/aarmy.gif
new file mode 100644
index 0000000..b07a9aa
Binary files /dev/null and b/lgsl/lgsl_files/icons/aarmy/aarmy.gif differ
diff --git a/lgsl/lgsl_files/icons/aarmy/armygame.gif b/lgsl/lgsl_files/icons/aarmy/armygame.gif
new file mode 100644
index 0000000..b07a9aa
Binary files /dev/null and b/lgsl/lgsl_files/icons/aarmy/armygame.gif differ
diff --git a/lgsl/lgsl_files/icons/aarmy3/aarmy3.gif b/lgsl/lgsl_files/icons/aarmy3/aarmy3.gif
new file mode 100644
index 0000000..f312fc9
Binary files /dev/null and b/lgsl/lgsl_files/icons/aarmy3/aarmy3.gif differ
diff --git a/lgsl/lgsl_files/icons/arcasimracing/arcasimracing.gif b/lgsl/lgsl_files/icons/arcasimracing/arcasimracing.gif
new file mode 100644
index 0000000..a89075f
Binary files /dev/null and b/lgsl/lgsl_files/icons/arcasimracing/arcasimracing.gif differ
diff --git a/lgsl/lgsl_files/icons/arma/arma.gif b/lgsl/lgsl_files/icons/arma/arma.gif
new file mode 100644
index 0000000..7bac33e
Binary files /dev/null and b/lgsl/lgsl_files/icons/arma/arma.gif differ
diff --git a/lgsl/lgsl_files/icons/arma2/arma2.gif b/lgsl/lgsl_files/icons/arma2/arma2.gif
new file mode 100644
index 0000000..1331d7c
Binary files /dev/null and b/lgsl/lgsl_files/icons/arma2/arma2.gif differ
diff --git a/lgsl/lgsl_files/icons/arma2/arma2pc.gif b/lgsl/lgsl_files/icons/arma2/arma2pc.gif
new file mode 100644
index 0000000..1331d7c
Binary files /dev/null and b/lgsl/lgsl_files/icons/arma2/arma2pc.gif differ
diff --git a/lgsl/lgsl_files/icons/avp2/avp2.gif b/lgsl/lgsl_files/icons/avp2/avp2.gif
new file mode 100644
index 0000000..c3ff1e3
Binary files /dev/null and b/lgsl/lgsl_files/icons/avp2/avp2.gif differ
diff --git a/lgsl/lgsl_files/icons/avp2010/avp2010.gif b/lgsl/lgsl_files/icons/avp2010/avp2010.gif
new file mode 100644
index 0000000..dd71426
Binary files /dev/null and b/lgsl/lgsl_files/icons/avp2010/avp2010.gif differ
diff --git a/lgsl/lgsl_files/icons/bf1942/bf1942.gif b/lgsl/lgsl_files/icons/bf1942/bf1942.gif
new file mode 100644
index 0000000..a7686f9
Binary files /dev/null and b/lgsl/lgsl_files/icons/bf1942/bf1942.gif differ
diff --git a/lgsl/lgsl_files/icons/bf1942/bfield1942.gif b/lgsl/lgsl_files/icons/bf1942/bfield1942.gif
new file mode 100644
index 0000000..a7686f9
Binary files /dev/null and b/lgsl/lgsl_files/icons/bf1942/bfield1942.gif differ
diff --git a/lgsl/lgsl_files/icons/bf1942/desertcombat.gif b/lgsl/lgsl_files/icons/bf1942/desertcombat.gif
new file mode 100644
index 0000000..5da31bc
Binary files /dev/null and b/lgsl/lgsl_files/icons/bf1942/desertcombat.gif differ
diff --git a/lgsl/lgsl_files/icons/bf1942/interstate.gif b/lgsl/lgsl_files/icons/bf1942/interstate.gif
new file mode 100644
index 0000000..b99ed7f
Binary files /dev/null and b/lgsl/lgsl_files/icons/bf1942/interstate.gif differ
diff --git a/lgsl/lgsl_files/icons/bf2/battlefield2.gif b/lgsl/lgsl_files/icons/bf2/battlefield2.gif
new file mode 100644
index 0000000..6f2695f
Binary files /dev/null and b/lgsl/lgsl_files/icons/bf2/battlefield2.gif differ
diff --git a/lgsl/lgsl_files/icons/bf2/bf2.gif b/lgsl/lgsl_files/icons/bf2/bf2.gif
new file mode 100644
index 0000000..6f2695f
Binary files /dev/null and b/lgsl/lgsl_files/icons/bf2/bf2.gif differ
diff --git a/lgsl/lgsl_files/icons/bf2142/bf2142.gif b/lgsl/lgsl_files/icons/bf2142/bf2142.gif
new file mode 100644
index 0000000..8cb53ef
Binary files /dev/null and b/lgsl/lgsl_files/icons/bf2142/bf2142.gif differ
diff --git a/lgsl/lgsl_files/icons/bf2142/stella.gif b/lgsl/lgsl_files/icons/bf2142/stella.gif
new file mode 100644
index 0000000..8cb53ef
Binary files /dev/null and b/lgsl/lgsl_files/icons/bf2142/stella.gif differ
diff --git a/lgsl/lgsl_files/icons/bfbc2/bfbc2.gif b/lgsl/lgsl_files/icons/bfbc2/bfbc2.gif
new file mode 100644
index 0000000..aaac9ce
Binary files /dev/null and b/lgsl/lgsl_files/icons/bfbc2/bfbc2.gif differ
diff --git a/lgsl/lgsl_files/icons/bfvietnam/bfvietnam.gif b/lgsl/lgsl_files/icons/bfvietnam/bfvietnam.gif
new file mode 100644
index 0000000..09947da
Binary files /dev/null and b/lgsl/lgsl_files/icons/bfvietnam/bfvietnam.gif differ
diff --git a/lgsl/lgsl_files/icons/callofduty/callofduty.gif b/lgsl/lgsl_files/icons/callofduty/callofduty.gif
new file mode 100644
index 0000000..4969062
Binary files /dev/null and b/lgsl/lgsl_files/icons/callofduty/callofduty.gif differ
diff --git a/lgsl/lgsl_files/icons/callofduty2/callofduty2.gif b/lgsl/lgsl_files/icons/callofduty2/callofduty2.gif
new file mode 100644
index 0000000..c5c1a91
Binary files /dev/null and b/lgsl/lgsl_files/icons/callofduty2/callofduty2.gif differ
diff --git a/lgsl/lgsl_files/icons/callofduty4/callofduty4.gif b/lgsl/lgsl_files/icons/callofduty4/callofduty4.gif
new file mode 100644
index 0000000..ac1a036
Binary files /dev/null and b/lgsl/lgsl_files/icons/callofduty4/callofduty4.gif differ
diff --git a/lgsl/lgsl_files/icons/callofdutyuo/callofdutyuo.gif b/lgsl/lgsl_files/icons/callofdutyuo/callofdutyuo.gif
new file mode 100644
index 0000000..435ba37
Binary files /dev/null and b/lgsl/lgsl_files/icons/callofdutyuo/callofdutyuo.gif differ
diff --git a/lgsl/lgsl_files/icons/callofdutywaw/callofdutywaw.gif b/lgsl/lgsl_files/icons/callofdutywaw/callofdutywaw.gif
new file mode 100644
index 0000000..30d6628
Binary files /dev/null and b/lgsl/lgsl_files/icons/callofdutywaw/callofdutywaw.gif differ
diff --git a/lgsl/lgsl_files/icons/cncrenegade/cncrenegade.gif b/lgsl/lgsl_files/icons/cncrenegade/cncrenegade.gif
new file mode 100644
index 0000000..9eb8cc7
Binary files /dev/null and b/lgsl/lgsl_files/icons/cncrenegade/cncrenegade.gif differ
diff --git a/lgsl/lgsl_files/icons/crysis/crysis.gif b/lgsl/lgsl_files/icons/crysis/crysis.gif
new file mode 100644
index 0000000..cc9acfc
Binary files /dev/null and b/lgsl/lgsl_files/icons/crysis/crysis.gif differ
diff --git a/lgsl/lgsl_files/icons/crysiswars/crysiswars.gif b/lgsl/lgsl_files/icons/crysiswars/crysiswars.gif
new file mode 100644
index 0000000..48dc922
Binary files /dev/null and b/lgsl/lgsl_files/icons/crysiswars/crysiswars.gif differ
diff --git a/lgsl/lgsl_files/icons/cs2d/cs2d.gif b/lgsl/lgsl_files/icons/cs2d/cs2d.gif
new file mode 100644
index 0000000..9f59dbe
Binary files /dev/null and b/lgsl/lgsl_files/icons/cs2d/cs2d.gif differ
diff --git a/lgsl/lgsl_files/icons/cube/assaultcube.gif b/lgsl/lgsl_files/icons/cube/assaultcube.gif
new file mode 100644
index 0000000..f32c0ef
Binary files /dev/null and b/lgsl/lgsl_files/icons/cube/assaultcube.gif differ
diff --git a/lgsl/lgsl_files/icons/cube/blood_frontier.gif b/lgsl/lgsl_files/icons/cube/blood_frontier.gif
new file mode 100644
index 0000000..160cf6a
Binary files /dev/null and b/lgsl/lgsl_files/icons/cube/blood_frontier.gif differ
diff --git a/lgsl/lgsl_files/icons/cube/cube.gif b/lgsl/lgsl_files/icons/cube/cube.gif
new file mode 100644
index 0000000..442cec0
Binary files /dev/null and b/lgsl/lgsl_files/icons/cube/cube.gif differ
diff --git a/lgsl/lgsl_files/icons/cube/cube1.gif b/lgsl/lgsl_files/icons/cube/cube1.gif
new file mode 100644
index 0000000..c5e8aea
Binary files /dev/null and b/lgsl/lgsl_files/icons/cube/cube1.gif differ
diff --git a/lgsl/lgsl_files/icons/cube/cube2.gif b/lgsl/lgsl_files/icons/cube/cube2.gif
new file mode 100644
index 0000000..3c4b52a
Binary files /dev/null and b/lgsl/lgsl_files/icons/cube/cube2.gif differ
diff --git a/lgsl/lgsl_files/icons/cube/sauerbraten.gif b/lgsl/lgsl_files/icons/cube/sauerbraten.gif
new file mode 100644
index 0000000..521b206
Binary files /dev/null and b/lgsl/lgsl_files/icons/cube/sauerbraten.gif differ
diff --git a/lgsl/lgsl_files/icons/dh2005/dh2005.gif b/lgsl/lgsl_files/icons/dh2005/dh2005.gif
new file mode 100644
index 0000000..e5dd11d
Binary files /dev/null and b/lgsl/lgsl_files/icons/dh2005/dh2005.gif differ
diff --git a/lgsl/lgsl_files/icons/doom3/basedoom-1.gif b/lgsl/lgsl_files/icons/doom3/basedoom-1.gif
new file mode 100644
index 0000000..68cce5b
Binary files /dev/null and b/lgsl/lgsl_files/icons/doom3/basedoom-1.gif differ
diff --git a/lgsl/lgsl_files/icons/doom3/doom3.gif b/lgsl/lgsl_files/icons/doom3/doom3.gif
new file mode 100644
index 0000000..68cce5b
Binary files /dev/null and b/lgsl/lgsl_files/icons/doom3/doom3.gif differ
diff --git a/lgsl/lgsl_files/icons/doomskulltag/doomskulltag.gif b/lgsl/lgsl_files/icons/doomskulltag/doomskulltag.gif
new file mode 100644
index 0000000..bb8bde0
Binary files /dev/null and b/lgsl/lgsl_files/icons/doomskulltag/doomskulltag.gif differ
diff --git a/lgsl/lgsl_files/icons/doomzdaemon/doomzdaemon.gif b/lgsl/lgsl_files/icons/doomzdaemon/doomzdaemon.gif
new file mode 100644
index 0000000..46379a3
Binary files /dev/null and b/lgsl/lgsl_files/icons/doomzdaemon/doomzdaemon.gif differ
diff --git a/lgsl/lgsl_files/icons/f1c9902/f1c9902.gif b/lgsl/lgsl_files/icons/f1c9902/f1c9902.gif
new file mode 100644
index 0000000..fe12447
Binary files /dev/null and b/lgsl/lgsl_files/icons/f1c9902/f1c9902.gif differ
diff --git a/lgsl/lgsl_files/icons/farcry/farcry.gif b/lgsl/lgsl_files/icons/farcry/farcry.gif
new file mode 100644
index 0000000..5986bc5
Binary files /dev/null and b/lgsl/lgsl_files/icons/farcry/farcry.gif differ
diff --git a/lgsl/lgsl_files/icons/farcry/obsidianedge.gif b/lgsl/lgsl_files/icons/farcry/obsidianedge.gif
new file mode 100644
index 0000000..5986bc5
Binary files /dev/null and b/lgsl/lgsl_files/icons/farcry/obsidianedge.gif differ
diff --git a/lgsl/lgsl_files/icons/fear/fear.gif b/lgsl/lgsl_files/icons/fear/fear.gif
new file mode 100644
index 0000000..b050493
Binary files /dev/null and b/lgsl/lgsl_files/icons/fear/fear.gif differ
diff --git a/lgsl/lgsl_files/icons/flashpoint/flashpoint.gif b/lgsl/lgsl_files/icons/flashpoint/flashpoint.gif
new file mode 100644
index 0000000..3b1d2e5
Binary files /dev/null and b/lgsl/lgsl_files/icons/flashpoint/flashpoint.gif differ
diff --git a/lgsl/lgsl_files/icons/flashpoint/opflashr.gif b/lgsl/lgsl_files/icons/flashpoint/opflashr.gif
new file mode 100644
index 0000000..3b1d2e5
Binary files /dev/null and b/lgsl/lgsl_files/icons/flashpoint/opflashr.gif differ
diff --git a/lgsl/lgsl_files/icons/freelancer/freelancer.gif b/lgsl/lgsl_files/icons/freelancer/freelancer.gif
new file mode 100644
index 0000000..c2636b0
Binary files /dev/null and b/lgsl/lgsl_files/icons/freelancer/freelancer.gif differ
diff --git a/lgsl/lgsl_files/icons/frontlines/frontlines.gif b/lgsl/lgsl_files/icons/frontlines/frontlines.gif
new file mode 100644
index 0000000..3ab2d98
Binary files /dev/null and b/lgsl/lgsl_files/icons/frontlines/frontlines.gif differ
diff --git a/lgsl/lgsl_files/icons/gamespy1/gamespy1.gif b/lgsl/lgsl_files/icons/gamespy1/gamespy1.gif
new file mode 100644
index 0000000..c78184d
Binary files /dev/null and b/lgsl/lgsl_files/icons/gamespy1/gamespy1.gif differ
diff --git a/lgsl/lgsl_files/icons/gamespy2/gamespy2.gif b/lgsl/lgsl_files/icons/gamespy2/gamespy2.gif
new file mode 100644
index 0000000..c78184d
Binary files /dev/null and b/lgsl/lgsl_files/icons/gamespy2/gamespy2.gif differ
diff --git a/lgsl/lgsl_files/icons/gamespy3/gamespy3.gif b/lgsl/lgsl_files/icons/gamespy3/gamespy3.gif
new file mode 100644
index 0000000..c78184d
Binary files /dev/null and b/lgsl/lgsl_files/icons/gamespy3/gamespy3.gif differ
diff --git a/lgsl/lgsl_files/icons/ghostrecon/ghostrecon.gif b/lgsl/lgsl_files/icons/ghostrecon/ghostrecon.gif
new file mode 100644
index 0000000..5cc429a
Binary files /dev/null and b/lgsl/lgsl_files/icons/ghostrecon/ghostrecon.gif differ
diff --git a/lgsl/lgsl_files/icons/graw/graw.gif b/lgsl/lgsl_files/icons/graw/graw.gif
new file mode 100644
index 0000000..0715ba9
Binary files /dev/null and b/lgsl/lgsl_files/icons/graw/graw.gif differ
diff --git a/lgsl/lgsl_files/icons/graw2/graw2.gif b/lgsl/lgsl_files/icons/graw2/graw2.gif
new file mode 100644
index 0000000..71899ac
Binary files /dev/null and b/lgsl/lgsl_files/icons/graw2/graw2.gif differ
diff --git a/lgsl/lgsl_files/icons/gtr2/gtr2.gif b/lgsl/lgsl_files/icons/gtr2/gtr2.gif
new file mode 100644
index 0000000..4b1184b
Binary files /dev/null and b/lgsl/lgsl_files/icons/gtr2/gtr2.gif differ
diff --git a/lgsl/lgsl_files/icons/had2/had2.gif b/lgsl/lgsl_files/icons/had2/had2.gif
new file mode 100644
index 0000000..7fc691b
Binary files /dev/null and b/lgsl/lgsl_files/icons/had2/had2.gif differ
diff --git a/lgsl/lgsl_files/icons/halflife/cstrike.gif b/lgsl/lgsl_files/icons/halflife/cstrike.gif
new file mode 100644
index 0000000..3032caa
Binary files /dev/null and b/lgsl/lgsl_files/icons/halflife/cstrike.gif differ
diff --git a/lgsl/lgsl_files/icons/halflife/czero.gif b/lgsl/lgsl_files/icons/halflife/czero.gif
new file mode 100644
index 0000000..8b3c74f
Binary files /dev/null and b/lgsl/lgsl_files/icons/halflife/czero.gif differ
diff --git a/lgsl/lgsl_files/icons/halflife/dod.gif b/lgsl/lgsl_files/icons/halflife/dod.gif
new file mode 100644
index 0000000..7b7edb9
Binary files /dev/null and b/lgsl/lgsl_files/icons/halflife/dod.gif differ
diff --git a/lgsl/lgsl_files/icons/halflife/frontline.gif b/lgsl/lgsl_files/icons/halflife/frontline.gif
new file mode 100644
index 0000000..8bd081d
Binary files /dev/null and b/lgsl/lgsl_files/icons/halflife/frontline.gif differ
diff --git a/lgsl/lgsl_files/icons/halflife/halflife.gif b/lgsl/lgsl_files/icons/halflife/halflife.gif
new file mode 100644
index 0000000..4d7aed8
Binary files /dev/null and b/lgsl/lgsl_files/icons/halflife/halflife.gif differ
diff --git a/lgsl/lgsl_files/icons/halflife/ns.gif b/lgsl/lgsl_files/icons/halflife/ns.gif
new file mode 100644
index 0000000..5a73faa
Binary files /dev/null and b/lgsl/lgsl_files/icons/halflife/ns.gif differ
diff --git a/lgsl/lgsl_files/icons/halflife/nsp.gif b/lgsl/lgsl_files/icons/halflife/nsp.gif
new file mode 100644
index 0000000..5a73faa
Binary files /dev/null and b/lgsl/lgsl_files/icons/halflife/nsp.gif differ
diff --git a/lgsl/lgsl_files/icons/halflife/ricochet.gif b/lgsl/lgsl_files/icons/halflife/ricochet.gif
new file mode 100644
index 0000000..729fd83
Binary files /dev/null and b/lgsl/lgsl_files/icons/halflife/ricochet.gif differ
diff --git a/lgsl/lgsl_files/icons/halflife/svencoop.gif b/lgsl/lgsl_files/icons/halflife/svencoop.gif
new file mode 100644
index 0000000..7d6b1ac
Binary files /dev/null and b/lgsl/lgsl_files/icons/halflife/svencoop.gif differ
diff --git a/lgsl/lgsl_files/icons/halflife/tfc.gif b/lgsl/lgsl_files/icons/halflife/tfc.gif
new file mode 100644
index 0000000..d509022
Binary files /dev/null and b/lgsl/lgsl_files/icons/halflife/tfc.gif differ
diff --git a/lgsl/lgsl_files/icons/halflife/ts.gif b/lgsl/lgsl_files/icons/halflife/ts.gif
new file mode 100644
index 0000000..f05432a
Binary files /dev/null and b/lgsl/lgsl_files/icons/halflife/ts.gif differ
diff --git a/lgsl/lgsl_files/icons/halflife/valve.gif b/lgsl/lgsl_files/icons/halflife/valve.gif
new file mode 100644
index 0000000..b6e9456
Binary files /dev/null and b/lgsl/lgsl_files/icons/halflife/valve.gif differ
diff --git a/lgsl/lgsl_files/icons/halflifewon/cstrike.gif b/lgsl/lgsl_files/icons/halflifewon/cstrike.gif
new file mode 100644
index 0000000..3032caa
Binary files /dev/null and b/lgsl/lgsl_files/icons/halflifewon/cstrike.gif differ
diff --git a/lgsl/lgsl_files/icons/halflifewon/halflifewon.gif b/lgsl/lgsl_files/icons/halflifewon/halflifewon.gif
new file mode 100644
index 0000000..4d7aed8
Binary files /dev/null and b/lgsl/lgsl_files/icons/halflifewon/halflifewon.gif differ
diff --git a/lgsl/lgsl_files/icons/halo/halo.gif b/lgsl/lgsl_files/icons/halo/halo.gif
new file mode 100644
index 0000000..af9d4bb
Binary files /dev/null and b/lgsl/lgsl_files/icons/halo/halo.gif differ
diff --git a/lgsl/lgsl_files/icons/il2/il2.gif b/lgsl/lgsl_files/icons/il2/il2.gif
new file mode 100644
index 0000000..5180825
Binary files /dev/null and b/lgsl/lgsl_files/icons/il2/il2.gif differ
diff --git a/lgsl/lgsl_files/icons/jediknight2/basejk.gif b/lgsl/lgsl_files/icons/jediknight2/basejk.gif
new file mode 100644
index 0000000..8d84e62
Binary files /dev/null and b/lgsl/lgsl_files/icons/jediknight2/basejk.gif differ
diff --git a/lgsl/lgsl_files/icons/jediknight2/jediknight2.gif b/lgsl/lgsl_files/icons/jediknight2/jediknight2.gif
new file mode 100644
index 0000000..8d84e62
Binary files /dev/null and b/lgsl/lgsl_files/icons/jediknight2/jediknight2.gif differ
diff --git a/lgsl/lgsl_files/icons/jediknightja/jediknightja.gif b/lgsl/lgsl_files/icons/jediknightja/jediknightja.gif
new file mode 100644
index 0000000..d3bb484
Binary files /dev/null and b/lgsl/lgsl_files/icons/jediknightja/jediknightja.gif differ
diff --git a/lgsl/lgsl_files/icons/killingfloor/killing_floor.gif b/lgsl/lgsl_files/icons/killingfloor/killing_floor.gif
new file mode 100644
index 0000000..fe7bf40
Binary files /dev/null and b/lgsl/lgsl_files/icons/killingfloor/killing_floor.gif differ
diff --git a/lgsl/lgsl_files/icons/killingfloor/killingfloor.gif b/lgsl/lgsl_files/icons/killingfloor/killingfloor.gif
new file mode 100644
index 0000000..fe7bf40
Binary files /dev/null and b/lgsl/lgsl_files/icons/killingfloor/killingfloor.gif differ
diff --git a/lgsl/lgsl_files/icons/kingpin/kingpin.gif b/lgsl/lgsl_files/icons/kingpin/kingpin.gif
new file mode 100644
index 0000000..1e5eb00
Binary files /dev/null and b/lgsl/lgsl_files/icons/kingpin/kingpin.gif differ
diff --git a/lgsl/lgsl_files/icons/mohaa/mohaa.gif b/lgsl/lgsl_files/icons/mohaa/mohaa.gif
new file mode 100644
index 0000000..7d0adfa
Binary files /dev/null and b/lgsl/lgsl_files/icons/mohaa/mohaa.gif differ
diff --git a/lgsl/lgsl_files/icons/mohaab/mohaab.gif b/lgsl/lgsl_files/icons/mohaab/mohaab.gif
new file mode 100644
index 0000000..c683644
Binary files /dev/null and b/lgsl/lgsl_files/icons/mohaab/mohaab.gif differ
diff --git a/lgsl/lgsl_files/icons/mohaas/mohaas.gif b/lgsl/lgsl_files/icons/mohaas/mohaas.gif
new file mode 100644
index 0000000..ddee824
Binary files /dev/null and b/lgsl/lgsl_files/icons/mohaas/mohaas.gif differ
diff --git a/lgsl/lgsl_files/icons/mohpa/mohpa.gif b/lgsl/lgsl_files/icons/mohpa/mohpa.gif
new file mode 100644
index 0000000..b90d89a
Binary files /dev/null and b/lgsl/lgsl_files/icons/mohpa/mohpa.gif differ
diff --git a/lgsl/lgsl_files/icons/mta/mta.gif b/lgsl/lgsl_files/icons/mta/mta.gif
new file mode 100644
index 0000000..249532c
Binary files /dev/null and b/lgsl/lgsl_files/icons/mta/mta.gif differ
diff --git a/lgsl/lgsl_files/icons/nascar2004/nascar2004.gif b/lgsl/lgsl_files/icons/nascar2004/nascar2004.gif
new file mode 100644
index 0000000..bf762cb
Binary files /dev/null and b/lgsl/lgsl_files/icons/nascar2004/nascar2004.gif differ
diff --git a/lgsl/lgsl_files/icons/neverwinter/neverwinter.gif b/lgsl/lgsl_files/icons/neverwinter/neverwinter.gif
new file mode 100644
index 0000000..e512333
Binary files /dev/null and b/lgsl/lgsl_files/icons/neverwinter/neverwinter.gif differ
diff --git a/lgsl/lgsl_files/icons/neverwinter2/neverwinter2.gif b/lgsl/lgsl_files/icons/neverwinter2/neverwinter2.gif
new file mode 100644
index 0000000..e512333
Binary files /dev/null and b/lgsl/lgsl_files/icons/neverwinter2/neverwinter2.gif differ
diff --git a/lgsl/lgsl_files/icons/nexuiz/nexuiz.gif b/lgsl/lgsl_files/icons/nexuiz/nexuiz.gif
new file mode 100644
index 0000000..4cb6a32
Binary files /dev/null and b/lgsl/lgsl_files/icons/nexuiz/nexuiz.gif differ
diff --git a/lgsl/lgsl_files/icons/openttd/openttd.gif b/lgsl/lgsl_files/icons/openttd/openttd.gif
new file mode 100644
index 0000000..e43e050
Binary files /dev/null and b/lgsl/lgsl_files/icons/openttd/openttd.gif differ
diff --git a/lgsl/lgsl_files/icons/painkiller/painkiller.gif b/lgsl/lgsl_files/icons/painkiller/painkiller.gif
new file mode 100644
index 0000000..d33f5f4
Binary files /dev/null and b/lgsl/lgsl_files/icons/painkiller/painkiller.gif differ
diff --git a/lgsl/lgsl_files/icons/plainsight/plainsight.gif b/lgsl/lgsl_files/icons/plainsight/plainsight.gif
new file mode 100644
index 0000000..7b43f36
Binary files /dev/null and b/lgsl/lgsl_files/icons/plainsight/plainsight.gif differ
diff --git a/lgsl/lgsl_files/icons/prey/prey.gif b/lgsl/lgsl_files/icons/prey/prey.gif
new file mode 100644
index 0000000..34d0ccd
Binary files /dev/null and b/lgsl/lgsl_files/icons/prey/prey.gif differ
diff --git a/lgsl/lgsl_files/icons/quake2/quake2.gif b/lgsl/lgsl_files/icons/quake2/quake2.gif
new file mode 100644
index 0000000..b4aebee
Binary files /dev/null and b/lgsl/lgsl_files/icons/quake2/quake2.gif differ
diff --git a/lgsl/lgsl_files/icons/quake3/quake3.gif b/lgsl/lgsl_files/icons/quake3/quake3.gif
new file mode 100644
index 0000000..675bc48
Binary files /dev/null and b/lgsl/lgsl_files/icons/quake3/quake3.gif differ
diff --git a/lgsl/lgsl_files/icons/quake4/basequake4-1.gif b/lgsl/lgsl_files/icons/quake4/basequake4-1.gif
new file mode 100644
index 0000000..711305b
Binary files /dev/null and b/lgsl/lgsl_files/icons/quake4/basequake4-1.gif differ
diff --git a/lgsl/lgsl_files/icons/quake4/quake4.gif b/lgsl/lgsl_files/icons/quake4/quake4.gif
new file mode 100644
index 0000000..711305b
Binary files /dev/null and b/lgsl/lgsl_files/icons/quake4/quake4.gif differ
diff --git a/lgsl/lgsl_files/icons/quakewars/quakewars.gif b/lgsl/lgsl_files/icons/quakewars/quakewars.gif
new file mode 100644
index 0000000..6d348e4
Binary files /dev/null and b/lgsl/lgsl_files/icons/quakewars/quakewars.gif differ
diff --git a/lgsl/lgsl_files/icons/quakeworld/fortress.gif b/lgsl/lgsl_files/icons/quakeworld/fortress.gif
new file mode 100644
index 0000000..c2c3f68
Binary files /dev/null and b/lgsl/lgsl_files/icons/quakeworld/fortress.gif differ
diff --git a/lgsl/lgsl_files/icons/quakeworld/quakeworld.gif b/lgsl/lgsl_files/icons/quakeworld/quakeworld.gif
new file mode 100644
index 0000000..c2c3f68
Binary files /dev/null and b/lgsl/lgsl_files/icons/quakeworld/quakeworld.gif differ
diff --git a/lgsl/lgsl_files/icons/quakeworld/qw.gif b/lgsl/lgsl_files/icons/quakeworld/qw.gif
new file mode 100644
index 0000000..c2c3f68
Binary files /dev/null and b/lgsl/lgsl_files/icons/quakeworld/qw.gif differ
diff --git a/lgsl/lgsl_files/icons/ravenshield/ravenshield.gif b/lgsl/lgsl_files/icons/ravenshield/ravenshield.gif
new file mode 100644
index 0000000..4800182
Binary files /dev/null and b/lgsl/lgsl_files/icons/ravenshield/ravenshield.gif differ
diff --git a/lgsl/lgsl_files/icons/redorchestra/red_orchestra.gif b/lgsl/lgsl_files/icons/redorchestra/red_orchestra.gif
new file mode 100644
index 0000000..949fa66
Binary files /dev/null and b/lgsl/lgsl_files/icons/redorchestra/red_orchestra.gif differ
diff --git a/lgsl/lgsl_files/icons/redorchestra/redorchestra.gif b/lgsl/lgsl_files/icons/redorchestra/redorchestra.gif
new file mode 100644
index 0000000..949fa66
Binary files /dev/null and b/lgsl/lgsl_files/icons/redorchestra/redorchestra.gif differ
diff --git a/lgsl/lgsl_files/icons/rfactor/rfactor.gif b/lgsl/lgsl_files/icons/rfactor/rfactor.gif
new file mode 100644
index 0000000..764f430
Binary files /dev/null and b/lgsl/lgsl_files/icons/rfactor/rfactor.gif differ
diff --git a/lgsl/lgsl_files/icons/samp/samp.gif b/lgsl/lgsl_files/icons/samp/samp.gif
new file mode 100644
index 0000000..6b6cf77
Binary files /dev/null and b/lgsl/lgsl_files/icons/samp/samp.gif differ
diff --git a/lgsl/lgsl_files/icons/savage/savage.gif b/lgsl/lgsl_files/icons/savage/savage.gif
new file mode 100644
index 0000000..629c202
Binary files /dev/null and b/lgsl/lgsl_files/icons/savage/savage.gif differ
diff --git a/lgsl/lgsl_files/icons/savage2/savage2.gif b/lgsl/lgsl_files/icons/savage2/savage2.gif
new file mode 100644
index 0000000..c4110cd
Binary files /dev/null and b/lgsl/lgsl_files/icons/savage2/savage2.gif differ
diff --git a/lgsl/lgsl_files/icons/serioussam/serioussam.gif b/lgsl/lgsl_files/icons/serioussam/serioussam.gif
new file mode 100644
index 0000000..b01c2d6
Binary files /dev/null and b/lgsl/lgsl_files/icons/serioussam/serioussam.gif differ
diff --git a/lgsl/lgsl_files/icons/serioussam2/serioussam2.gif b/lgsl/lgsl_files/icons/serioussam2/serioussam2.gif
new file mode 100644
index 0000000..702fcdd
Binary files /dev/null and b/lgsl/lgsl_files/icons/serioussam2/serioussam2.gif differ
diff --git a/lgsl/lgsl_files/icons/shatteredh/shatteredh.gif b/lgsl/lgsl_files/icons/shatteredh/shatteredh.gif
new file mode 100644
index 0000000..15ec54e
Binary files /dev/null and b/lgsl/lgsl_files/icons/shatteredh/shatteredh.gif differ
diff --git a/lgsl/lgsl_files/icons/sof2/sof2.gif b/lgsl/lgsl_files/icons/sof2/sof2.gif
new file mode 100644
index 0000000..ea25864
Binary files /dev/null and b/lgsl/lgsl_files/icons/sof2/sof2.gif differ
diff --git a/lgsl/lgsl_files/icons/sof2/sof2mp.gif b/lgsl/lgsl_files/icons/sof2/sof2mp.gif
new file mode 100644
index 0000000..ea25864
Binary files /dev/null and b/lgsl/lgsl_files/icons/sof2/sof2mp.gif differ
diff --git a/lgsl/lgsl_files/icons/soldat/soldat.gif b/lgsl/lgsl_files/icons/soldat/soldat.gif
new file mode 100644
index 0000000..067f56a
Binary files /dev/null and b/lgsl/lgsl_files/icons/soldat/soldat.gif differ
diff --git a/lgsl/lgsl_files/icons/source/ageofchivalry.gif b/lgsl/lgsl_files/icons/source/ageofchivalry.gif
new file mode 100644
index 0000000..0b907aa
Binary files /dev/null and b/lgsl/lgsl_files/icons/source/ageofchivalry.gif differ
diff --git a/lgsl/lgsl_files/icons/source/cstrike.gif b/lgsl/lgsl_files/icons/source/cstrike.gif
new file mode 100644
index 0000000..af3c565
Binary files /dev/null and b/lgsl/lgsl_files/icons/source/cstrike.gif differ
diff --git a/lgsl/lgsl_files/icons/source/decadence.gif b/lgsl/lgsl_files/icons/source/decadence.gif
new file mode 100644
index 0000000..449076d
Binary files /dev/null and b/lgsl/lgsl_files/icons/source/decadence.gif differ
diff --git a/lgsl/lgsl_files/icons/source/dod.gif b/lgsl/lgsl_files/icons/source/dod.gif
new file mode 100644
index 0000000..d77dbbc
Binary files /dev/null and b/lgsl/lgsl_files/icons/source/dod.gif differ
diff --git a/lgsl/lgsl_files/icons/source/dystopia.gif b/lgsl/lgsl_files/icons/source/dystopia.gif
new file mode 100644
index 0000000..7f2a7fb
Binary files /dev/null and b/lgsl/lgsl_files/icons/source/dystopia.gif differ
diff --git a/lgsl/lgsl_files/icons/source/empires.gif b/lgsl/lgsl_files/icons/source/empires.gif
new file mode 100644
index 0000000..4f8d142
Binary files /dev/null and b/lgsl/lgsl_files/icons/source/empires.gif differ
diff --git a/lgsl/lgsl_files/icons/source/esmod.gif b/lgsl/lgsl_files/icons/source/esmod.gif
new file mode 100644
index 0000000..198367a
Binary files /dev/null and b/lgsl/lgsl_files/icons/source/esmod.gif differ
diff --git a/lgsl/lgsl_files/icons/source/garrysmod.gif b/lgsl/lgsl_files/icons/source/garrysmod.gif
new file mode 100644
index 0000000..62e773a
Binary files /dev/null and b/lgsl/lgsl_files/icons/source/garrysmod.gif differ
diff --git a/lgsl/lgsl_files/icons/source/hidden.gif b/lgsl/lgsl_files/icons/source/hidden.gif
new file mode 100644
index 0000000..106b49c
Binary files /dev/null and b/lgsl/lgsl_files/icons/source/hidden.gif differ
diff --git a/lgsl/lgsl_files/icons/source/hl2mp.gif b/lgsl/lgsl_files/icons/source/hl2mp.gif
new file mode 100644
index 0000000..d2dc40c
Binary files /dev/null and b/lgsl/lgsl_files/icons/source/hl2mp.gif differ
diff --git a/lgsl/lgsl_files/icons/source/insurgency.gif b/lgsl/lgsl_files/icons/source/insurgency.gif
new file mode 100644
index 0000000..46ae4bd
Binary files /dev/null and b/lgsl/lgsl_files/icons/source/insurgency.gif differ
diff --git a/lgsl/lgsl_files/icons/source/left4dead.gif b/lgsl/lgsl_files/icons/source/left4dead.gif
new file mode 100644
index 0000000..abe944a
Binary files /dev/null and b/lgsl/lgsl_files/icons/source/left4dead.gif differ
diff --git a/lgsl/lgsl_files/icons/source/left4dead2.gif b/lgsl/lgsl_files/icons/source/left4dead2.gif
new file mode 100644
index 0000000..70c7f50
Binary files /dev/null and b/lgsl/lgsl_files/icons/source/left4dead2.gif differ
diff --git a/lgsl/lgsl_files/icons/source/neotokyosource.gif b/lgsl/lgsl_files/icons/source/neotokyosource.gif
new file mode 100644
index 0000000..b57b73d
Binary files /dev/null and b/lgsl/lgsl_files/icons/source/neotokyosource.gif differ
diff --git a/lgsl/lgsl_files/icons/source/obsidian.gif b/lgsl/lgsl_files/icons/source/obsidian.gif
new file mode 100644
index 0000000..5526eb8
Binary files /dev/null and b/lgsl/lgsl_files/icons/source/obsidian.gif differ
diff --git a/lgsl/lgsl_files/icons/source/source.gif b/lgsl/lgsl_files/icons/source/source.gif
new file mode 100644
index 0000000..d69e421
Binary files /dev/null and b/lgsl/lgsl_files/icons/source/source.gif differ
diff --git a/lgsl/lgsl_files/icons/source/svencoop.gif b/lgsl/lgsl_files/icons/source/svencoop.gif
new file mode 100644
index 0000000..77e4047
Binary files /dev/null and b/lgsl/lgsl_files/icons/source/svencoop.gif differ
diff --git a/lgsl/lgsl_files/icons/source/synergy.gif b/lgsl/lgsl_files/icons/source/synergy.gif
new file mode 100644
index 0000000..65f5ef4
Binary files /dev/null and b/lgsl/lgsl_files/icons/source/synergy.gif differ
diff --git a/lgsl/lgsl_files/icons/source/tf.gif b/lgsl/lgsl_files/icons/source/tf.gif
new file mode 100644
index 0000000..7a8735a
Binary files /dev/null and b/lgsl/lgsl_files/icons/source/tf.gif differ
diff --git a/lgsl/lgsl_files/icons/source/zombie_master.gif b/lgsl/lgsl_files/icons/source/zombie_master.gif
new file mode 100644
index 0000000..800400d
Binary files /dev/null and b/lgsl/lgsl_files/icons/source/zombie_master.gif differ
diff --git a/lgsl/lgsl_files/icons/source/zps.gif b/lgsl/lgsl_files/icons/source/zps.gif
new file mode 100644
index 0000000..fc4bc1d
Binary files /dev/null and b/lgsl/lgsl_files/icons/source/zps.gif differ
diff --git a/lgsl/lgsl_files/icons/stalker/stalker.gif b/lgsl/lgsl_files/icons/stalker/stalker.gif
new file mode 100644
index 0000000..7bbc745
Binary files /dev/null and b/lgsl/lgsl_files/icons/stalker/stalker.gif differ
diff --git a/lgsl/lgsl_files/icons/stalkercs/stalkercs.gif b/lgsl/lgsl_files/icons/stalkercs/stalkercs.gif
new file mode 100644
index 0000000..3b8dd5e
Binary files /dev/null and b/lgsl/lgsl_files/icons/stalkercs/stalkercs.gif differ
diff --git a/lgsl/lgsl_files/icons/startrekef/startrekef.gif b/lgsl/lgsl_files/icons/startrekef/startrekef.gif
new file mode 100644
index 0000000..10439dc
Binary files /dev/null and b/lgsl/lgsl_files/icons/startrekef/startrekef.gif differ
diff --git a/lgsl/lgsl_files/icons/starwarsbf/starwarsbf.gif b/lgsl/lgsl_files/icons/starwarsbf/starwarsbf.gif
new file mode 100644
index 0000000..a088149
Binary files /dev/null and b/lgsl/lgsl_files/icons/starwarsbf/starwarsbf.gif differ
diff --git a/lgsl/lgsl_files/icons/starwarsbf2/starwarsbf2.gif b/lgsl/lgsl_files/icons/starwarsbf2/starwarsbf2.gif
new file mode 100644
index 0000000..c0a0038
Binary files /dev/null and b/lgsl/lgsl_files/icons/starwarsbf2/starwarsbf2.gif differ
diff --git a/lgsl/lgsl_files/icons/starwarsrc/starwarsrc.gif b/lgsl/lgsl_files/icons/starwarsrc/starwarsrc.gif
new file mode 100644
index 0000000..b3ead25
Binary files /dev/null and b/lgsl/lgsl_files/icons/starwarsrc/starwarsrc.gif differ
diff --git a/lgsl/lgsl_files/icons/swat4/swat4.gif b/lgsl/lgsl_files/icons/swat4/swat4.gif
new file mode 100644
index 0000000..05308aa
Binary files /dev/null and b/lgsl/lgsl_files/icons/swat4/swat4.gif differ
diff --git a/lgsl/lgsl_files/icons/teeworlds/teeworlds.gif b/lgsl/lgsl_files/icons/teeworlds/teeworlds.gif
new file mode 100644
index 0000000..fe0c47e
Binary files /dev/null and b/lgsl/lgsl_files/icons/teeworlds/teeworlds.gif differ
diff --git a/lgsl/lgsl_files/icons/tribes/tribes.gif b/lgsl/lgsl_files/icons/tribes/tribes.gif
new file mode 100644
index 0000000..a38e342
Binary files /dev/null and b/lgsl/lgsl_files/icons/tribes/tribes.gif differ
diff --git a/lgsl/lgsl_files/icons/tribes2/tribes2.gif b/lgsl/lgsl_files/icons/tribes2/tribes2.gif
new file mode 100644
index 0000000..697563a
Binary files /dev/null and b/lgsl/lgsl_files/icons/tribes2/tribes2.gif differ
diff --git a/lgsl/lgsl_files/icons/tribesv/tribesv.gif b/lgsl/lgsl_files/icons/tribesv/tribesv.gif
new file mode 100644
index 0000000..36549f9
Binary files /dev/null and b/lgsl/lgsl_files/icons/tribesv/tribesv.gif differ
diff --git a/lgsl/lgsl_files/icons/urbanterror/urbanterror.gif b/lgsl/lgsl_files/icons/urbanterror/urbanterror.gif
new file mode 100644
index 0000000..6084d61
Binary files /dev/null and b/lgsl/lgsl_files/icons/urbanterror/urbanterror.gif differ
diff --git a/lgsl/lgsl_files/icons/ut/ut.gif b/lgsl/lgsl_files/icons/ut/ut.gif
new file mode 100644
index 0000000..cb94673
Binary files /dev/null and b/lgsl/lgsl_files/icons/ut/ut.gif differ
diff --git a/lgsl/lgsl_files/icons/ut2003/ut2003.gif b/lgsl/lgsl_files/icons/ut2003/ut2003.gif
new file mode 100644
index 0000000..d9d50d9
Binary files /dev/null and b/lgsl/lgsl_files/icons/ut2003/ut2003.gif differ
diff --git a/lgsl/lgsl_files/icons/ut2004/killing_floor.gif b/lgsl/lgsl_files/icons/ut2004/killing_floor.gif
new file mode 100644
index 0000000..fe7bf40
Binary files /dev/null and b/lgsl/lgsl_files/icons/ut2004/killing_floor.gif differ
diff --git a/lgsl/lgsl_files/icons/ut2004/red_orchestra.gif b/lgsl/lgsl_files/icons/ut2004/red_orchestra.gif
new file mode 100644
index 0000000..949fa66
Binary files /dev/null and b/lgsl/lgsl_files/icons/ut2004/red_orchestra.gif differ
diff --git a/lgsl/lgsl_files/icons/ut2004/ut2004.gif b/lgsl/lgsl_files/icons/ut2004/ut2004.gif
new file mode 100644
index 0000000..2ca0e26
Binary files /dev/null and b/lgsl/lgsl_files/icons/ut2004/ut2004.gif differ
diff --git a/lgsl/lgsl_files/icons/ut3/ut3.gif b/lgsl/lgsl_files/icons/ut3/ut3.gif
new file mode 100644
index 0000000..a48b33e
Binary files /dev/null and b/lgsl/lgsl_files/icons/ut3/ut3.gif differ
diff --git a/lgsl/lgsl_files/icons/vcmp/vcmp.gif b/lgsl/lgsl_files/icons/vcmp/vcmp.gif
new file mode 100644
index 0000000..6d49799
Binary files /dev/null and b/lgsl/lgsl_files/icons/vcmp/vcmp.gif differ
diff --git a/lgsl/lgsl_files/icons/vietcong/vietcong.gif b/lgsl/lgsl_files/icons/vietcong/vietcong.gif
new file mode 100644
index 0000000..4ed35c2
Binary files /dev/null and b/lgsl/lgsl_files/icons/vietcong/vietcong.gif differ
diff --git a/lgsl/lgsl_files/icons/vietcong2/vietcong2.gif b/lgsl/lgsl_files/icons/vietcong2/vietcong2.gif
new file mode 100644
index 0000000..56e4251
Binary files /dev/null and b/lgsl/lgsl_files/icons/vietcong2/vietcong2.gif differ
diff --git a/lgsl/lgsl_files/icons/warsow/warsow.gif b/lgsl/lgsl_files/icons/warsow/warsow.gif
new file mode 100644
index 0000000..6aba41b
Binary files /dev/null and b/lgsl/lgsl_files/icons/warsow/warsow.gif differ
diff --git a/lgsl/lgsl_files/icons/warsowold/warsowold.gif b/lgsl/lgsl_files/icons/warsowold/warsowold.gif
new file mode 100644
index 0000000..6aba41b
Binary files /dev/null and b/lgsl/lgsl_files/icons/warsowold/warsowold.gif differ
diff --git a/lgsl/lgsl_files/icons/wolf2009/wolf2009.gif b/lgsl/lgsl_files/icons/wolf2009/wolf2009.gif
new file mode 100644
index 0000000..eff889d
Binary files /dev/null and b/lgsl/lgsl_files/icons/wolf2009/wolf2009.gif differ
diff --git a/lgsl/lgsl_files/icons/wolfet/wolfet.gif b/lgsl/lgsl_files/icons/wolfet/wolfet.gif
new file mode 100644
index 0000000..1f96b01
Binary files /dev/null and b/lgsl/lgsl_files/icons/wolfet/wolfet.gif differ
diff --git a/lgsl/lgsl_files/icons/wolfrtcw/wolfrtcw.gif b/lgsl/lgsl_files/icons/wolfrtcw/wolfrtcw.gif
new file mode 100644
index 0000000..292ba25
Binary files /dev/null and b/lgsl/lgsl_files/icons/wolfrtcw/wolfrtcw.gif differ
diff --git a/lgsl/lgsl_files/lgsl_add.php b/lgsl/lgsl_files/lgsl_add.php
new file mode 100644
index 0000000..bb10dbe
--- /dev/null
+++ b/lgsl/lgsl_files/lgsl_add.php
@@ -0,0 +1,264 @@
+
+
+ {$lgsl_config['text']['asd']}
+
+
+ ";
+
+ return;
+ }
+
+//-----------------------------------------------------------------------------------------------------------+
+
+ $lgsl_type_list = lgsl_type_list();
+ unset($lgsl_type_list['test']);
+ asort($lgsl_type_list);
+
+ $type = empty($_POST['form_type']) ? "source" : trim($_POST['form_type']);
+ $ip = empty($_POST['form_ip']) ? "" : trim($_POST['form_ip']);
+ $c_port = empty($_POST['form_c_port']) ? 0 : intval(trim($_POST['form_c_port']));
+ $q_port = empty($_POST['form_q_port']) ? 0 : intval(trim($_POST['form_q_port']));
+ $s_port = 0;
+
+ if (preg_match("/(\[[0-9a-z\:]+\])/iU", $ip, $match)) { $ip = $match[1]; }
+ elseif (preg_match("/([0-9a-z\.\-]+)/i", $ip, $match)) { $ip = $match[1]; }
+ else { $ip = ""; }
+
+ if ($c_port > 99999 || $q_port < 1024) { $c_port = 0; }
+ if ($q_port > 99999 || $q_port < 1024) { $q_port = 0; }
+
+ list($c_port, $q_port, $s_port) = lgsl_port_conversion($type, $c_port, $q_port, $s_port);
+
+//-----------------------------------------------------------------------------------------------------------+
+
+ $output .= "
+ ";
+
+//-----------------------------------------------------------------------------------------------------------+
+
+ if (empty($_POST['lgsl_submit_test']) && empty($_POST['lgsl_submit_add'])) { return; }
+ if (!isset($lgsl_type_list[$type]) || !$ip || !$c_port || !$q_port) { return; }
+
+//-----------------------------------------------------------------------------------------------------------+
+
+ lgsl_database();
+
+ $ip = mysql_real_escape_string($ip);
+ $q_port = mysql_real_escape_string($q_port);
+ $c_port = mysql_real_escape_string($c_port);
+ $s_port = mysql_real_escape_string($s_port);
+ $type = mysql_real_escape_string($type);
+
+//-----------------------------------------------------------------------------------------------------------+
+
+ $ip_check = gethostbyname($ip);
+ $mysql_result = mysql_query("SELECT `ip`,`disabled` FROM `{$lgsl_config['db']['prefix']}{$lgsl_config['db']['table']}` WHERE `type`='{$type}' AND `q_port`='{$q_port}'");
+
+ while ($mysql_row = mysql_fetch_array($mysql_result, MYSQL_ASSOC))
+ {
+ if ($ip_check == gethostbyname($mysql_row['ip']))
+ {
+ $output .= "
+
+ ";
+
+ if ($mysql_row['disabled'])
+ {
+ $output .= $lgsl_config['text']['aaa'];
+ }
+ else
+ {
+ $output .= $lgsl_config['text']['aan'];
+ }
+
+ $output .="
+
+
+
+
+
+
+
";
+
+ return;
+ }
+ }
+
+//-----------------------------------------------------------------------------------------------------------+
+
+ $server = lgsl_query_live($type, $ip, $c_port, $q_port, $s_port, "s");
+ $server = lgsl_server_html($server);
+
+ if (!$server['b']['status'])
+ {
+ $output .= "
+
+
+ {$lgsl_config['text']['anr']}
+
+
+
+
+
+
+
";
+
+ return;
+ }
+
+//-----------------------------------------------------------------------------------------------------------+
+
+ if (!empty($_POST['lgsl_submit_add']))
+ {
+ $disabled = ($lgsl_config['public_add'] == "2") ? "0" : "1";
+
+ $mysql_query = "INSERT INTO `{$lgsl_config['db']['prefix']}{$lgsl_config['db']['table']}` (`type`,`ip`,`c_port`,`q_port`,`s_port`,`disabled`,`cache`,`cache_time`) VALUES ('{$type}','{$ip}','{$c_port}','{$q_port}','{$s_port}','{$disabled}','','')";
+ $mysql_result = mysql_query($mysql_query) or die(mysql_error());
+
+ $output .= "
+
+ ";
+
+ if ($disabled)
+ {
+ $output .= $lgsl_config['text']['ada'];
+ }
+ else
+ {
+ $output .= $lgsl_config['text']['adn'];
+ }
+
+ $output .="
+
+
+
+
+
+
+
";
+
+ return;
+ }
+
+//-----------------------------------------------------------------------------------------------------------+
+
+ $output .= "
+ ";
+
+//------------------------------------------------------------------------------------------------------------+
diff --git a/lgsl/lgsl_files/lgsl_admin.php b/lgsl/lgsl_files/lgsl_admin.php
new file mode 100644
index 0000000..13ae74e
--- /dev/null
+++ b/lgsl/lgsl_files/lgsl_admin.php
@@ -0,0 +1,406 @@
+FSOCKOPEN IS DISABLED - YOU MUST ENABLE THE FEED OPTION ".lgsl_help_info(); return;
+ }
+ else
+ {
+ $output = "FSOCKOPEN AND CURL ARE DISABLED - LGSL WILL NOT WORK ON THIS HOST
".lgsl_help_info(); return;
+ }
+ }
+
+//------------------------------------------------------------------------------------------------------------+
+
+ if ($_POST && get_magic_quotes_gpc()) { $_POST = lgsl_stripslashes_deep($_POST); }
+
+ if (function_exists("mysql_set_charset"))
+ {
+ @mysql_set_charset("utf8");
+ }
+ else
+ {
+ @mysql_query("SET NAMES 'utf8'");
+ }
+
+//------------------------------------------------------------------------------------------------------------+
+
+ if (!empty($_POST['lgsl_save_1']) || !empty($_POST['lgsl_save_2']))
+ {
+ if (!empty($_POST['lgsl_save_1']))
+ {
+ // LOAD SERVER CACHE INTO MEMORY
+ $db = array();
+ $mysql_result = mysql_query("SELECT * FROM `{$lgsl_config['db']['prefix']}{$lgsl_config['db']['table']}`");
+ while($mysql_row = mysql_fetch_array($mysql_result, MYSQL_ASSOC))
+ {
+ $db["{$mysql_row['type']}:{$mysql_row['ip']}:{$mysql_row['q_port']}"] = array($mysql_row['status'], $mysql_row['cache'], $mysql_row['cache_time']);
+ }
+ }
+
+ // EMPTY SQL TABLE
+ $mysql_result = mysql_query("TRUNCATE `{$lgsl_config['db']['prefix']}{$lgsl_config['db']['table']}`") or die(mysql_error());
+
+ // CONVERT ADVANCED TO NORMAL DATA FORMAT
+ if (!empty($_POST['lgsl_management']))
+ {
+ $form_lines = explode("\r\n", trim($_POST['form_list']));
+
+ foreach ($form_lines as $form_key => $form_line)
+ {
+ list($_POST['form_type'] [$form_key],
+ $_POST['form_ip'] [$form_key],
+ $_POST['form_c_port'] [$form_key],
+ $_POST['form_q_port'] [$form_key],
+ $_POST['form_s_port'] [$form_key],
+ $_POST['form_zone'] [$form_key],
+ $_POST['form_disabled'][$form_key],
+ $_POST['form_comment'] [$form_key]) = explode(":", "{$form_line}:::::::");
+ }
+ }
+
+ foreach ($_POST['form_type'] as $form_key => $not_used)
+ {
+ // COMMENTS LEFT IN THEIR NATIVE ENCODING WITH JUST HTML SPECIAL CHARACTERS CONVERTED
+ $_POST['form_comment'][$form_key] = lgsl_htmlspecialchars($_POST['form_comment'][$form_key]);
+
+ $type = mysql_real_escape_string( strtolower(trim($_POST['form_type'] [$form_key])));
+ $ip = mysql_real_escape_string( trim($_POST['form_ip'] [$form_key]));
+ $c_port = mysql_real_escape_string( intval(trim($_POST['form_c_port'] [$form_key])));
+ $q_port = mysql_real_escape_string( intval(trim($_POST['form_q_port'] [$form_key])));
+ $s_port = mysql_real_escape_string( intval(trim($_POST['form_s_port'] [$form_key])));
+ $zone = mysql_real_escape_string( trim($_POST['form_zone'] [$form_key]));
+ $disabled = isset($_POST['form_disabled'][$form_key]) ? intval(trim($_POST['form_disabled'][$form_key])) : "0";
+ $comment = mysql_real_escape_string( trim($_POST['form_comment'] [$form_key]));
+
+ // CACHE INDEXED BY TYPE:IP:Q_PORT SO IF THEY CHANGE THE CACHE IS IGNORED
+ list($status, $cache, $cache_time) = isset($db["{$type}:{$ip}:{$q_port}"]) ? $db["{$type}:{$ip}:{$q_port}"] : array("0", "", "");
+
+ $status = mysql_real_escape_string($status);
+ $cache = mysql_real_escape_string($cache);
+ $cache_time = mysql_real_escape_string($cache_time);
+
+ // THIS PREVENTS PORTS OR WHITESPACE BEING PUT IN THE IP WHILE ALLOWING IPv6
+ if (preg_match("/(\[[0-9a-z\:]+\])/iU", $ip, $match)) { $ip = $match[1]; }
+ elseif (preg_match("/([0-9a-z\.\-]+)/i", $ip, $match)) { $ip = $match[1]; }
+
+ list($c_port, $q_port, $s_port) = lgsl_port_conversion($type, $c_port, $q_port, $s_port);
+
+ // DISCARD SERVERS WITH AN EMPTY IP AND AUTO DISABLE SERVERS WITH SOMETHING WRONG
+ if (!$ip) { continue; }
+ elseif ($c_port < 1 || $c_port > 99999) { $disabled = 1; $c_port = 0; }
+ elseif ($q_port < 1 || $q_port > 99999) { $disabled = 1; $q_port = 0; }
+ elseif (!isset($lgsl_protocol_list[$type])) { $disabled = 1; }
+
+ $mysql_query = "INSERT INTO `{$lgsl_config['db']['prefix']}{$lgsl_config['db']['table']}` (`type`,`ip`,`c_port`,`q_port`,`s_port`,`zone`,`disabled`,`comment`,`status`,`cache`,`cache_time`) VALUES ('{$type}','{$ip}','{$c_port}','{$q_port}','{$s_port}','{$zone}','{$disabled}','{$comment}','{$status}','{$cache}','{$cache_time}')";
+ $mysql_result = mysql_query($mysql_query) or die(mysql_error());
+ }
+ }
+
+//------------------------------------------------------------------------------------------------------------+
+
+ if (!empty($_POST['lgsl_map_image_paths']))
+ {
+ $server_list = lgsl_query_cached_all("s");
+
+ foreach ($server_list as $server)
+ {
+ if (!$server['b']['status']) { continue; }
+
+ $image_map = lgsl_image_map($server['b']['status'], $server['b']['type'], $server['s']['game'], $server['s']['map'], FALSE);
+
+ $output .= "
+ ";
+ }
+
+ $output .= "
+ ";
+
+ return;
+ }
+
+//------------------------------------------------------------------------------------------------------------+
+
+ if ((!empty($_POST['lgsl_management']) && empty($_POST['lgsl_switch'])) || (empty($_POST['lgsl_management']) && !empty($_POST['lgsl_switch'])) || (!isset($_POST['lgsl_management']) && $lgsl_config['management']))
+ {
+ $output .= "
+ ";
+
+ $output .= lgsl_help_info();
+
+ return $output;
+ }
+
+//------------------------------------------------------------------------------------------------------------+
+
+ $output .= "
+
+
+ ";
+
+ $output .= lgsl_help_info();
+
+//------------------------------------------------------------------------------------------------------------+
+
+ function lgsl_help_info()
+ {
+ return "
+
+
+
[ LGSL ONLINE README ]
+ - To remove a server, delete the IP, then click Save.
+ - Leave the query port blank to have LGSL try to fill it in for you.
+ - Software port is only needed for a few games so it being set 0 is normal.
+ - Edit the lgsl_config.php to set the background colors and other options.
+
+
+ FSOCKOPEN
+ Enabled: ".(function_exists("fsockopen") ? "YES" : "NO")."
+ ( Required for direct querying of servers )
+
+
+ CURL
+ Enabled: ".((function_exists("curl_init") && function_exists("curl_setopt") && function_exists("curl_exec")) ? "YES" : "NO")."
+ ( Used for the feed when fsockopen is disabled )
+
+
+ MBSTRING
+ Enabled: ".(function_exists("mb_convert_encoding") ? "YES" : "NO")."
+ ( Used to show UTF-8 server and player names correctly )
+
+
+ BZIP2
+ Enabled: ".(function_exists("bzdecompress") ? "YES" : "NO")."
+ ( Used to show Source server settings over a certain size )
+
+
+ ZLIB
+ Enabled: ".(function_exists("gzuncompress") ? "YES" : "NO")."
+ ( Required for America's Army 3 )
+
+
+
+
+
";
+ }
+
+//------------------------------------------------------------------------------------------------------------+
+
+ function lgsl_stripslashes_deep($value)
+ {
+ $value = is_array($value) ? array_map('lgsl_stripslashes_deep', $value) : stripslashes($value);
+ return $value;
+ }
+
+//------------------------------------------------------------------------------------------------------------+
+
+ function lgsl_htmlspecialchars($string)
+ {
+ // PHP4 COMPATIBLE WAY OF CONVERTING SPECIAL CHARACTERS WITHOUT DOUBLE ENCODING EXISTING ENTITIES
+ $string = str_replace("\x05\x06", "", $string);
+ $string = preg_replace("/&([a-z\d]{2,7}|#\d{2,5});/i", "\x05\x06$1", $string);
+ $string = htmlspecialchars($string, ENT_QUOTES);
+ $string = str_replace("\x05\x06", "&", $string);
+
+ return $string;
+ }
+
+//------------------------------------------------------------------------------------------------------------+
diff --git a/lgsl/lgsl_files/lgsl_class.php b/lgsl/lgsl_files/lgsl_class.php
new file mode 100644
index 0000000..770900f
--- /dev/null
+++ b/lgsl/lgsl_files/lgsl_class.php
@@ -0,0 +1,1069 @@
+host;
+ $lgsl_config['db']['user'] = $joomla_config->user;
+ $lgsl_config['db']['pass'] = $joomla_config->password;
+ $lgsl_config['db']['db'] = $joomla_config->db;
+ $lgsl_config['db']['prefix'] = $joomla_config->dbprefix;
+ break;
+
+ case "drupal":
+ global $db_url, $db_prefix;
+ if (empty($db_url)) { @include "{$lgsl_file_path}../../../sites/default/settings.php"; }
+ $drupal_config = is_array($db_url) ? parse_url($db_url['default']) : parse_url($db_url);
+ $lgsl_config['db']['server'] = $drupal_config['host'];
+ $lgsl_config['db']['user'] = $drupal_config['user'];
+ $lgsl_config['db']['pass'] = isset($drupal_config['pass']) ? $drupal_config['pass'] : "";
+ $lgsl_config['db']['db'] = substr($drupal_config['path'], 1);
+ $lgsl_config['db']['prefix'] = isset($db_prefix['default']) ? $db_prefix['default'] : "";
+ break;
+
+ case "phpnuke":
+ @include "{$lgsl_file_path}../../../config.php";
+ @include "{$lgsl_file_path}../../../conf.inc.php";
+ @include "{$lgsl_file_path}../../../includes/config.php";
+ $lgsl_config['db']['server'] = $dbhost;
+ $lgsl_config['db']['user'] = $dbuname;
+ $lgsl_config['db']['pass'] = $dbpass;
+ $lgsl_config['db']['db'] = $dbname;
+ $lgsl_config['db']['prefix'] = $prefix."_";
+ break;
+ }
+ }
+
+ $lgsl_database = mysql_connect($lgsl_config['db']['server'], $lgsl_config['db']['user'], $lgsl_config['db']['pass']) or die(mysql_error());
+ $lgsl_select_db = mysql_select_db($lgsl_config['db']['db'], $lgsl_database) or die(mysql_error());
+ }
+
+//------------------------------------------------------------------------------------------------------------+
+
+ function lgsl_query_cached($type, $ip, $c_port, $q_port, $s_port, $request, $id = NULL)
+ {
+ global $lgsl_config;
+
+ lgsl_database();
+
+ // LOOKUP SERVER
+
+ if ($id != NULL)
+ {
+ $id = intval($id);
+ $mysql_query = "SELECT * FROM `{$lgsl_config['db']['prefix']}{$lgsl_config['db']['table']}` WHERE `id`='{$id}' LIMIT 1";
+ $mysql_result = mysql_query($mysql_query) or die(mysql_error());
+ $mysql_row = mysql_fetch_array($mysql_result, MYSQL_ASSOC);
+ if (!$mysql_row) { return FALSE; }
+ list($type, $ip, $c_port, $q_port, $s_port) = array($mysql_row['type'], $mysql_row['ip'], $mysql_row['c_port'], $mysql_row['q_port'], $mysql_row['s_port']);
+ }
+ else
+ {
+ list($type, $ip, $c_port, $q_port, $s_port) = array(mysql_real_escape_string($type), mysql_real_escape_string($ip), intval($c_port), intval($q_port), intval($s_port));
+
+ if (!$type || !$ip || !$c_port || !$q_port) { exit("LGSL PROBLEM: INVALID SERVER '{$type} : {$ip} : {$c_port} : {$q_port} : {$s_port}'"); }
+ $mysql_query = "SELECT * FROM `{$lgsl_config['db']['prefix']}{$lgsl_config['db']['table']}` WHERE `type`='{$type}' AND `ip`='{$ip}' AND `q_port`='{$q_port}' LIMIT 1";
+ $mysql_result = mysql_query($mysql_query) or die(mysql_error());
+ $mysql_row = mysql_fetch_array($mysql_result, MYSQL_ASSOC);
+
+ if (!$mysql_row)
+ {
+ if (strpos($request, "a") === FALSE) { exit("LGSL PROBLEM: SERVER NOT IN DATABASE '{$type} : {$ip} : {$c_port} : {$q_port} : {$s_port}'"); }
+ $mysql_query = "INSERT INTO `{$lgsl_config['db']['prefix']}{$lgsl_config['db']['table']}` (`type`,`ip`,`c_port`,`q_port`,`s_port`,`cache`,`cache_time`) VALUES ('{$type}','{$ip}','{$c_port}','{$q_port}','{$s_port}','','')";
+ $mysql_result = mysql_query($mysql_query) or die(mysql_error());
+ $mysql_row = array("id"=>mysql_insert_id(), "zone"=>"0", "comment"=>"");
+ }
+ }
+
+ // UNPACK CACHE AND CACHE TIMES
+
+ $cache = empty($mysql_row['cache']) ? array() : unserialize(base64_decode($mysql_row['cache']));
+ $cache_time = empty($mysql_row['cache_time']) ? array(0,0,0) : explode("_", $mysql_row['cache_time']);
+
+ // SET THE SERVER AS OFFLINE AND PENDING WHEN THERE IS NO CACHE
+
+ if (empty($cache['b']) || !is_array($cache))
+ {
+ $cache = array();
+ $cache['b'] = array();
+ $cache['b']['status'] = 0;
+ $cache['b']['pending'] = 1;
+ }
+
+ // CONVERT HOSTNAME TO IP WHEN NEEDED
+
+ if ($lgsl_config['host_to_ip'])
+ {
+ $ip = gethostbyname($ip);
+ }
+
+ // UPDATE CACHE WITH FIXED VALUES
+
+ $cache['b']['type'] = $type;
+ $cache['b']['ip'] = $ip;
+ $cache['b']['c_port'] = $c_port;
+ $cache['b']['q_port'] = $q_port;
+ $cache['b']['s_port'] = $s_port;
+ $cache['o']['request'] = $request;
+ $cache['o']['id'] = $mysql_row['id'];
+ $cache['o']['zone'] = $mysql_row['zone'];
+ $cache['o']['comment'] = $mysql_row['comment'];
+
+ // UPDATE CACHE WITH LOCATION
+
+ if (empty($cache['o']['location']))
+ {
+ $cache['o']['location'] = $lgsl_config['locations'] ? lgsl_query_location($ip) : "";
+ }
+
+ // UPDATE CACHE WITH DEFAULT OFFLINE VALUES
+
+ if (!isset($cache['s']))
+ {
+ $cache['s'] = array();
+ $cache['s']['game'] = $type;
+ $cache['s']['name'] = $lgsl_config['text']['nnm'];
+ $cache['s']['map'] = $lgsl_config['text']['nmp'];
+ $cache['s']['players'] = 0;
+ $cache['s']['playersmax'] = 0;
+ $cache['s']['password'] = 0;
+ }
+
+ if (!isset($cache['e'])) { $cache['e'] = array(); }
+ if (!isset($cache['p'])) { $cache['p'] = array(); }
+
+ // CHECK AND GET THE NEEDED DATA
+
+ $needed = "";
+
+ if (strpos($request, "c") === FALSE) // CACHE ONLY REQUEST
+ {
+ if (strpos($request, "s") !== FALSE && time() > ($cache_time[0]+$lgsl_config['cache_time'])) { $needed .= "s"; }
+ if (strpos($request, "e") !== FALSE && time() > ($cache_time[1]+$lgsl_config['cache_time'])) { $needed .= "e"; }
+ if (strpos($request, "p") !== FALSE && time() > ($cache_time[2]+$lgsl_config['cache_time'])) { $needed .= "p"; }
+ }
+
+ if ($needed)
+ {
+ // UPDATE CACHE TIMES BEFORE QUERY - PREVENTS OTHER INSTANCES FROM QUERY FLOODING THE SAME SERVER
+
+ $packed_times = time() + $lgsl_config['cache_time'] + 10;
+ $packed_times = "{$packed_times}_{$packed_times}_{$packed_times}";
+ $mysql_query = "UPDATE `{$lgsl_config['db']['prefix']}{$lgsl_config['db']['table']}` SET `cache_time`='{$packed_times}' WHERE `id`='{$mysql_row['id']}' LIMIT 1";
+ $mysql_result = mysql_query($mysql_query) or die(mysql_error());
+
+ // GET WHAT IS NEEDED
+
+ $live = lgsl_query_live($type, $ip, $c_port, $q_port, $s_port, $needed);
+
+ if (!$live['b']['status'] && $lgsl_config['retry_offline'] && !$lgsl_config['feed']['method'])
+ {
+ $live = lgsl_query_live($type, $ip, $c_port, $q_port, $s_port, $needed);
+ }
+
+ // CHECK AND CONVERT TO UTF-8 WHERE NEEDED
+
+ $live = lgsl_charset_convert($live, lgsl_charset_detect($live));
+
+ // IF SERVER IS OFFLINE PRESERVE SOME OF THE CACHE AND CLEAR THE REST
+
+ if (!$live['b']['status'])
+ {
+ $live['s']['game'] = $cache['s']['game'];
+ $live['s']['name'] = $cache['s']['name'];
+ $live['s']['map'] = $cache['s']['map'];
+ $live['s']['password'] = $cache['s']['password'];
+ $live['s']['players'] = 0;
+ $live['s']['playersmax'] = $cache['s']['playersmax'];
+ $live['e'] = array();
+ $live['p'] = array();
+ }
+
+ // MERGE LIVE INTO CACHE
+
+ if (isset($live['b'])) { $cache['b'] = $live['b']; $cache['b']['pending'] = 0; }
+ if (isset($live['s'])) { $cache['s'] = $live['s']; $cache_time[0] = time(); }
+ if (isset($live['e'])) { $cache['e'] = $live['e']; $cache_time[1] = time(); }
+ if (isset($live['p'])) { $cache['p'] = $live['p']; $cache_time[2] = time(); }
+
+ // UPDATE CACHE
+
+ $packed_cache = mysql_real_escape_string(base64_encode(serialize($cache)));
+ $packed_times = mysql_real_escape_string(implode("_", $cache_time));
+ $mysql_query = "UPDATE `{$lgsl_config['db']['prefix']}{$lgsl_config['db']['table']}` SET `status`='{$cache['b']['status']}',`cache`='{$packed_cache}',`cache_time`='{$packed_times}' WHERE `id`='{$mysql_row['id']}' LIMIT 1";
+ $mysql_result = mysql_query($mysql_query) or die(mysql_error());
+ }
+
+ // RETURN ONLY THE REQUESTED
+
+ if (strpos($request, "s") === FALSE) { unset($cache['s']); }
+ if (strpos($request, "e") === FALSE) { unset($cache['e']); }
+ if (strpos($request, "p") === FALSE) { unset($cache['p']); }
+
+ return $cache;
+ }
+
+//------------------------------------------------------------------------------------------------------------+
+//EXAMPLE USAGE: lgsl_query_group( array("request"=>"sep", "hide_offline"=>0, "random"=>0, "type"=>"source", "game"=>"cstrike") )
+
+ function lgsl_query_group($options = array())
+ {
+ if (!is_array($options)) { exit("LGSL PROBLEM: lgsl_query_group OPTIONS MUST BE ARRAY"); }
+
+ global $lgsl_config;
+
+ lgsl_database();
+
+ $request = isset($options['request']) ? $options['request'] : "s";
+ $zone = isset($options['zone']) ? intval($options['zone']) : 0;
+ $hide_offline = isset($options['hide_offline']) ? intval($options['hide_offline']) : intval($lgsl_config['hide_offline'][$zone]);
+ $random = isset($options['random']) ? intval($options['random']) : intval($lgsl_config['random'][$zone]);
+ $type = empty($options['type']) ? "" : preg_replace("/[^a-z0-9_]/", "_", strtolower($options['type']));
+ $game = empty($options['game']) ? "" : preg_replace("/[^a-z0-9_]/", "_", strtolower($options['game']));
+ $mysql_order = empty($random) ? "`cache_time` ASC" : "rand()";
+ $server_limit = empty($random) ? 0 : $random;
+
+ $mysql_where = array("`disabled`=0");
+ if ($zone != 0) { $mysql_where[] = "FIND_IN_SET('{$zone}',`zone`)"; }
+ if ($type != "") { $mysql_where[] = "`type`='{$type}'"; }
+
+ $mysql_query = "SELECT `id` FROM `{$lgsl_config['db']['prefix']}{$lgsl_config['db']['table']}` WHERE ".implode(" AND ", $mysql_where)." ORDER BY {$mysql_order}";
+ $mysql_result = mysql_query($mysql_query) or die(mysql_error());
+ $server_list = array();
+
+ while ($mysql_row = mysql_fetch_array($mysql_result, MYSQL_ASSOC))
+ {
+ if (strpos($request, "c") === FALSE && lgsl_timer("check")) { $request .= "c"; }
+
+ $server = lgsl_query_cached("", "", "", "", "", $request, $mysql_row['id']);
+
+ if ($hide_offline && empty($server['b']['status'])) { continue; }
+ if ($game && $game != preg_replace("/[^a-z0-9_]/", "_", strtolower($server['s']['game']))) { continue; }
+
+ $server_list[] = $server;
+
+ if ($server_limit && count($server_list) >= $server_limit) { break; }
+ }
+
+ return $server_list;
+ }
+
+//------------------------------------------------------------------------------------------------------------+
+
+ function lgsl_group_totals($server_list = FALSE)
+ {
+ if (!is_array($server_list)) { $server_list = lgsl_query_group( array( "request"=>"sc" ) ); }
+
+ $total = array("players"=>0, "playersmax"=>0, "servers"=>0, "servers_online"=>0, "servers_offline"=>0);
+
+ foreach ($server_list as $server)
+ {
+ $total['players'] += $server['s']['players'];
+ $total['playersmax'] += $server['s']['playersmax'];
+
+ $total['servers'] ++;
+ if ($server['b']['status']) { $total['servers_online'] ++; }
+ else { $total['servers_offline'] ++; }
+ }
+
+ return $total;
+ }
+
+//------------------------------------------------------------------------------------------------------------+
+
+ function lgsl_query_cached_all($request) // LEGACY - DO NOT USE
+ {
+ return lgsl_query_group( array( "request"=>$request ) );
+ }
+
+//------------------------------------------------------------------------------------------------------------+
+
+ function lgsl_query_cached_zone($request, $zone) // LEGACY - DO NOT USE
+ {
+ return lgsl_query_group( array( "request"=>$request, "zone"=>$zone ) );
+ }
+
+//------------------------------------------------------------------------------------------------------------+
+
+ function lgsl_cached_totals() // LEGACY - DO NOT USE
+ {
+ return lgsl_group_totals();
+ }
+
+//------------------------------------------------------------------------------------------------------------+
+
+ function lgsl_lookup_id($id) // LEGACY - DO NOT USE
+ {
+ global $lgsl_config;
+
+ lgsl_database();
+
+ $id = mysql_real_escape_string(intval($id));
+ $mysql_query = "SELECT `type`,`ip`,`c_port`,`q_port`,`s_port` FROM `{$lgsl_config['db']['prefix']}{$lgsl_config['db']['table']}` WHERE `id`='{$id}' LIMIT 1";
+ $mysql_result = mysql_query($mysql_query) or die(mysql_error());
+ $mysql_row = mysql_fetch_array($mysql_result, MYSQL_ASSOC);
+
+ return $mysql_row;
+ }
+
+//------------------------------------------------------------------------------------------------------------+
+
+ function lgsl_timer($action)
+ {
+ global $lgsl_config;
+ global $lgsl_timer;
+
+ if (!$lgsl_timer)
+ {
+ $microtime = microtime();
+ $microtime = explode(' ', $microtime);
+ $microtime = $microtime[1] + $microtime[0];
+ $lgsl_timer = $microtime - 0.01;
+ }
+
+ $time_limit = intval($lgsl_config['live_time']);
+ $time_php = ini_get("max_execution_time");
+
+ if ($time_limit > $time_php)
+ {
+ @set_time_limit($time_limit + 5);
+
+ $time_php = ini_get("max_execution_time");
+
+ if ($time_limit > $time_php)
+ {
+ $time_limit = $time_php - 5;
+ }
+ }
+
+ if ($action == "limit")
+ {
+ return $time_limit;
+ }
+
+ $microtime = microtime();
+ $microtime = explode(' ', $microtime);
+ $microtime = $microtime[1] + $microtime[0];
+ $time_taken = $microtime - $lgsl_timer;
+
+ if ($action == "check")
+ {
+ return ($time_taken > $time_limit) ? TRUE : FALSE;
+ }
+ else
+ {
+ return round($time_taken, 2);
+ }
+ }
+
+//------------------------------------------------------------------------------------------------------------+
+
+ function lgsl_server_misc($server)
+ {
+ global $lgsl_config, $lgsl_url_path;
+
+ $misc['icon_details'] = $lgsl_url_path."other/icon_details.gif";
+ $misc['icon_game'] = lgsl_icon_game($server['b']['type'], $server['s']['game']);
+ $misc['icon_status'] = lgsl_icon_status($server['b']['status'], $server['s']['password'], $server['b']['pending']);
+ $misc['icon_location'] = lgsl_icon_location($server['o']['location']);
+ $misc['image_map'] = lgsl_image_map($server['b']['status'], $server['b']['type'], $server['s']['game'], $server['s']['map'], TRUE, $server['o']['id']);
+ $misc['image_map_password'] = lgsl_image_map_password($server['b']['status'], $server['s']['password']);
+ $misc['text_status'] = lgsl_text_status($server['b']['status'], $server['s']['password'], $server['b']['pending']);
+ $misc['text_type_game'] = lgsl_text_type_game($server['b']['type'], $server['s']['game']);
+ $misc['text_location'] = lgsl_text_location($server['o']['location']);
+ $misc['name_filtered'] = lgsl_string_html($server['s']['name'], FALSE, 20); // LEGACY
+ $misc['software_link'] = lgsl_software_link($server['b']['type'], $server['b']['ip'], $server['b']['c_port'], $server['b']['q_port'], $server['b']['s_port']);
+ $misc['location_link'] = lgsl_location_link($server['o']['location']);
+
+ return $misc;
+ }
+
+//------------------------------------------------------------------------------------------------------------+
+
+ function lgsl_icon_game($type, $game)
+ {
+ global $lgsl_file_path, $lgsl_url_path;
+
+ $type = preg_replace("/[^a-z0-9_]/", "_", strtolower($type));
+ $game = preg_replace("/[^a-z0-9_]/", "_", strtolower($game));
+
+ $path_list = array(
+ "icons/{$type}/{$game}.gif",
+ "icons/{$type}/{$game}.png",
+ "icons/{$type}/{$type}.gif",
+ "icons/{$type}/{$type}.png");
+
+ foreach ($path_list as $path)
+ {
+ if (file_exists($lgsl_file_path.$path)) { return $lgsl_url_path.$path; }
+ }
+
+ return "{$lgsl_url_path}other/icon_unknown.gif";
+ }
+
+//------------------------------------------------------------------------------------------------------------+
+
+ function lgsl_icon_status($status, $password, $pending = 0)
+ {
+ global $lgsl_url_path;
+
+ if ($pending) { return "{$lgsl_url_path}other/icon_unknown.gif"; }
+ if (!$status) { return "{$lgsl_url_path}other/icon_no_response.gif"; }
+ if ($password) { return "{$lgsl_url_path}other/icon_online_password.gif"; }
+
+ return "{$lgsl_url_path}other/icon_online.gif";
+ }
+
+//------------------------------------------------------------------------------------------------------------+
+
+ function lgsl_icon_location($location)
+ {
+ global $lgsl_file_path, $lgsl_url_path;
+
+ if (!$location) { return "{$lgsl_url_path}locations/OFF.png"; }
+
+ if ($location)
+ {
+ $location = "locations/".preg_replace("/[^a-zA-Z0-9_]/", "_", $location).".png";
+
+ if (file_exists($lgsl_file_path.$location)) { return $lgsl_url_path.$location; }
+ }
+
+ return "{$lgsl_url_path}locations/XX.png";
+ }
+
+//------------------------------------------------------------------------------------------------------------+
+
+ function lgsl_image_map($status, $type, $game, $map, $check_exists = TRUE, $id = 0)
+ {
+ global $lgsl_file_path, $lgsl_url_path;
+
+ $type = preg_replace("/[^a-z0-9_]/", "_", strtolower($type));
+ $game = preg_replace("/[^a-z0-9_]/", "_", strtolower($game));
+ $map = preg_replace("/[^a-z0-9_]/", "_", strtolower($map));
+
+ if ($check_exists !== TRUE) { return "{$lgsl_url_path}maps/{$type}/{$game}/{$map}.jpg"; }
+
+ if ($status)
+ {
+ $path_list = array(
+ "maps/{$type}/{$game}/{$map}.jpg",
+ "maps/{$type}/{$game}/{$map}.gif",
+ "maps/{$type}/{$game}/{$map}.png",
+ "maps/{$type}/{$map}.jpg",
+ "maps/{$type}/{$map}.gif",
+ "maps/{$type}/{$map}.png",
+ "maps/{$type}/map_no_image.jpg",
+ "maps/{$type}/map_no_image.gif",
+ "maps/{$type}/map_no_image.png",
+ "other/map_no_image_{$id}.jpg",
+ "other/map_no_image_{$id}.gif",
+ "other/map_no_image_{$id}.png",
+ "other/map_no_image.jpg");
+ }
+ else
+ {
+ $path_list = array(
+ "maps/{$type}/map_no_response.jpg",
+ "maps/{$type}/map_no_response.gif",
+ "maps/{$type}/map_no_response.png",
+ "other/map_no_response_{$id}.jpg",
+ "other/map_no_response_{$id}.gif",
+ "other/map_no_response_{$id}.png",
+ "other/map_no_response.jpg");
+ }
+
+ foreach ($path_list as $path)
+ {
+ if (file_exists($lgsl_file_path.$path)) { return "{$lgsl_url_path}{$path}"; }
+ }
+
+ return "#LGSL_DEFAULT_IMAGES_MISSING#";
+ }
+
+//------------------------------------------------------------------------------------------------------------+
+
+ function lgsl_image_map_password($status, $password)
+ {
+ global $lgsl_url_path;
+
+ if (!$password || !$status) { return "{$lgsl_url_path}other/map_overlay.gif"; }
+
+ return "{$lgsl_url_path}other/map_overlay_password.gif";
+ }
+
+//------------------------------------------------------------------------------------------------------------+
+
+ function lgsl_text_status($status, $password, $pending = 0)
+ {
+ global $lgsl_config;
+
+ if ($pending) { return $lgsl_config['text']['pen']; }
+ if (!$status) { return $lgsl_config['text']['nrs']; }
+ if ($password) { return $lgsl_config['text']['onp']; }
+
+ return $lgsl_config['text']['onl'];
+ }
+
+//------------------------------------------------------------------------------------------------------------+
+
+ function lgsl_text_type_game($type, $game)
+ {
+ global $lgsl_config;
+
+ return "[ {$lgsl_config['text']['typ']} {$type} ] [ {$lgsl_config['text']['gme']} {$game} ]";
+ }
+
+//------------------------------------------------------------------------------------------------------------+
+
+ function lgsl_text_location($location)
+ {
+ global $lgsl_config;
+
+ return $location ? "{$lgsl_config['text']['loc']} {$location}" : "";
+ }
+
+//------------------------------------------------------------------------------------------------------------+
+
+ function lgsl_sort_servers($server_list)
+ {
+ global $lgsl_config;
+
+ if (!is_array($server_list)) { return $server_list; }
+
+ if ($lgsl_config['sort']['servers'] == "id") { usort($server_list, "lgsl_sort_servers_by_id"); }
+ elseif ($lgsl_config['sort']['servers'] == "zone") { usort($server_list, "lgsl_sort_servers_by_zone"); }
+ elseif ($lgsl_config['sort']['servers'] == "type") { usort($server_list, "lgsl_sort_servers_by_type"); }
+ elseif ($lgsl_config['sort']['servers'] == "status") { usort($server_list, "lgsl_sort_servers_by_status"); }
+ elseif ($lgsl_config['sort']['servers'] == "players") { usort($server_list, "lgsl_sort_servers_by_players"); }
+
+ return $server_list;
+ }
+
+//------------------------------------------------------------------------------------------------------------+
+
+ function lgsl_sort_fields($server, $fields_show, $fields_hide, $fields_other)
+ {
+ $fields_list = array();
+
+ if (!is_array($server['p'])) { return $fields_list; }
+
+ foreach ($server['p'] as $player)
+ {
+ foreach ($player as $field => $value)
+ {
+ if ($value === "") { continue; }
+ if (in_array($field, $fields_list)) { continue; }
+ if (in_array($field, $fields_hide)) { continue; }
+ $fields_list[] = $field;
+ }
+ }
+
+ $fields_show = array_intersect($fields_show, $fields_list);
+
+ if ($fields_other == FALSE) { return $fields_show; }
+
+ $fields_list = array_diff($fields_list, $fields_show);
+
+ return array_merge($fields_show, $fields_list);
+ }
+
+//------------------------------------------------------------------------------------------------------------+
+
+ function lgsl_sort_servers_by_id($server_a, $server_b)
+ {
+ if ($server_a['o']['id'] == $server_b['o']['id']) { return 0; }
+
+ return ($server_a['o']['id'] > $server_b['o']['id']) ? 1 : -1;
+ }
+
+//------------------------------------------------------------------------------------------------------------+
+
+ function lgsl_sort_servers_by_zone($server_a, $server_b)
+ {
+ if ($server_a['o']['zone'] == $server_b['o']['zone']) { return 0; }
+
+ return ($server_a['o']['zone'] > $server_b['o']['zone']) ? 1 : -1;
+ }
+
+//------------------------------------------------------------------------------------------------------------+
+
+ function lgsl_sort_servers_by_type($server_a, $server_b)
+ {
+ $result = strcasecmp($server_a['b']['type'], $server_b['b']['type']);
+
+ if ($result == 0)
+ {
+ $result = strcasecmp($server_a['s']['game'], $server_b['s']['game']);
+ }
+
+ return $result;
+ }
+
+//------------------------------------------------------------------------------------------------------------+
+
+ function lgsl_sort_servers_by_status($server_a, $server_b)
+ {
+ if ($server_a['b']['status'] == $server_b['b']['status']) { return 0; }
+
+ return ($server_a['b']['status'] < $server_b['b']['status']) ? 1 : -1;
+ }
+
+//------------------------------------------------------------------------------------------------------------+
+
+ function lgsl_sort_servers_by_players($server_a, $server_b)
+ {
+ if ($server_a['s']['players'] == $server_b['s']['players']) { return 0; }
+
+ return ($server_a['s']['players'] < $server_b['s']['players']) ? 1 : -1;
+ }
+
+//------------------------------------------------------------------------------------------------------------+
+
+ function lgsl_sort_extras($server)
+ {
+ if (!is_array($server['e'])) { return $server; }
+
+ ksort($server['e']);
+
+ return $server;
+ }
+
+//------------------------------------------------------------------------------------------------------------+
+
+ function lgsl_sort_players($server)
+ {
+ global $lgsl_config;
+
+ if (!is_array($server['p'])) { return $server; }
+
+ if ($lgsl_config['sort']['players'] == "name") { usort($server['p'], "lgsl_sort_players_by_name"); }
+ elseif ($lgsl_config['sort']['players'] == "score") { usort($server['p'], "lgsl_sort_players_by_score"); }
+
+ return $server;
+ }
+
+//------------------------------------------------------------------------------------------------------------+
+
+ function lgsl_sort_players_by_score($player_a, $player_b)
+ {
+ if ($player_a['score'] == $player_b['score']) { return 0; }
+
+ return ($player_a['score'] < $player_b['score']) ? 1 : -1;
+ }
+
+//------------------------------------------------------------------------------------------------------------+
+
+ function lgsl_sort_players_by_name($player_a, $player_b)
+ {
+ // REMOVE NON ALPHA NUMERIC ASCII WHILE LEAVING UPPER UTF-8 CHARACTERS
+ $name_a = preg_replace("/[\x{00}-\x{2F}\x{3A}-\x{40}\x{5B}-\x{60}\x{7B}-\x{7F}]/", "", $player_a['name']);
+ $name_b = preg_replace("/[\x{00}-\x{2F}\x{3A}-\x{40}\x{5B}-\x{60}\x{7B}-\x{7F}]/", "", $player_b['name']);
+
+ if (function_exists("mb_convert_case"))
+ {
+ $name_a = @mb_convert_case($name_a, MB_CASE_LOWER, "UTF-8");
+ $name_b = @mb_convert_case($name_b, MB_CASE_LOWER, "UTF-8");
+ return strcmp($name_a, $name_b);
+ }
+ else
+ {
+ return strcasecmp($name_a, $name_b);
+ }
+ }
+
+//------------------------------------------------------------------------------------------------------------+
+
+ function lgsl_charset_detect($server)
+ {
+ if (!function_exists("mb_detect_encoding")) { return "AUTO"; }
+
+ $test = "";
+
+ if (isset($server['s']['name'])) { $test .= " {$server['s']['name']} "; }
+
+ if (isset($server['p']) && $server['p'])
+ {
+ foreach ($server['p'] as $player)
+ {
+ if (isset($player['name'])) { $test .= " {$player['name']} "; }
+ }
+ }
+
+ $charset = @mb_detect_encoding($server['s']['name'], "UTF-8, Windows-1252, ISO-8859-1, ISO-8859-15");
+
+ return $charset ? $charset : "AUTO";
+ }
+
+//------------------------------------------------------------------------------------------------------------+
+
+ function lgsl_charset_convert($server, $charset)
+ {
+ if (!function_exists("mb_convert_encoding")) { return $server; }
+
+ if (is_array($server))
+ {
+ foreach ($server as $key => $value)
+ {
+ $server[$key] = lgsl_charset_convert($value, $charset);
+ }
+ }
+ else
+ {
+ $server = @mb_convert_encoding($server, "UTF-8", $charset);
+ }
+
+ return $server;
+ }
+
+//------------------------------------------------------------------------------------------------------------+
+
+ function lgsl_server_html($server, $word_wrap = 20)
+ {
+ foreach ($server as $key => $value)
+ {
+ $server[$key] = is_array($value) ? lgsl_server_html($value, $word_wrap) : lgsl_string_html($value, FALSE, $word_wrap);
+ }
+
+ return $server;
+ }
+
+//------------------------------------------------------------------------------------------------------------+
+
+ function lgsl_string_html($string, $xml_feed = FALSE, $word_wrap = 0)
+ {
+ if ($word_wrap) { $string = lgsl_word_wrap($string, $word_wrap); }
+
+ if ($xml_feed != FALSE)
+ {
+ $string = htmlspecialchars($string, ENT_QUOTES);
+ }
+ elseif (function_exists("mb_convert_encoding"))
+ {
+ $string = htmlspecialchars($string, ENT_QUOTES);
+ $string = @mb_convert_encoding($string, "HTML-ENTITIES", "UTF-8");
+ }
+ else
+ {
+ $string = htmlentities($string, ENT_QUOTES, "UTF-8");
+ }
+
+ if ($word_wrap) { $string = lgsl_word_wrap($string); }
+
+ return $string;
+ }
+
+//------------------------------------------------------------------------------------------------------------+
+
+ function lgsl_word_wrap($string, $length_limit = 0)
+ {
+ if (!$length_limit)
+ {
+// http://www.quirksmode.org/oddsandends/wbr.html
+// return str_replace("\x05\x06", " ", $string); // VISIBLE
+// return str_replace("\x05\x06", "", $string); // FF2 VISIBLE AND DIV NEEDED
+ return str_replace("\x05\x06", "", $string); // IE6 VISIBLE
+ }
+
+ $word_list = explode(" ", $string);
+
+ foreach ($word_list as $key => $word)
+ {
+ $word_length = function_exists("mb_strlen") ? mb_strlen($word, "UTF-8") : strlen($word);
+
+ if ($word_length < $length_limit) { continue; }
+
+ $word_new = "";
+
+ for ($i=0; $i<$word_length; $i+=$length_limit)
+ {
+ $word_new .= function_exists("mb_substr") ? mb_substr($word, $i, $length_limit, "UTF-8") : substr($word, $i, $length_limit);
+ $word_new .= "\x05\x06";
+ }
+
+ $word_list[$key] = $word_new;
+ }
+
+ return implode(" ", $word_list);
+ }
+
+//------------------------------------------------------------------------------------------------------------+
+
+ function lgsl_location_link($location)
+ {
+ if (!$location) { return "#"; }
+
+ if (strlen($location) == 2) { return "http://www.wipmania.com/map/{$location}"; }
+
+ return "http://www.google.com/search?q=".urlencode($location);
+ }
+
+//------------------------------------------------------------------------------------------------------------+
+
+ function lgsl_query_location($ip)
+ {
+ global $lgsl_config;
+
+ if ($lgsl_config['locations'] !== 1) { return $lgsl_config['locations']; }
+
+ $ip = gethostbyname($ip);
+
+ if (long2ip(ip2long($ip)) == "255.255.255.255") { return "XX"; }
+
+ $url = "http://api.wipmania.com/".urlencode($ip)."?".urlencode($_SERVER['HTTP_HOST']);
+
+ if (function_exists('curl_init') && function_exists('curl_setopt') && function_exists('curl_exec'))
+ {
+ $lgsl_curl = curl_init();
+
+ curl_setopt($lgsl_curl, CURLOPT_HEADER, 0);
+ curl_setopt($lgsl_curl, CURLOPT_TIMEOUT, 2);
+ curl_setopt($lgsl_curl, CURLOPT_RETURNTRANSFER, 1);
+ curl_setopt($lgsl_curl, CURLOPT_CONNECTTIMEOUT, 2);
+ curl_setopt($lgsl_curl, CURLOPT_URL, $url);
+
+ $location = curl_exec($lgsl_curl);
+
+ if (curl_error($lgsl_curl)) { $location = "XX"; }
+
+ curl_close($lgsl_curl);
+ }
+ else
+ {
+ $location = @file_get_contents($url);
+ }
+
+ if (strlen($location) != 2) { $location = "XX"; }
+
+ return $location;
+ }
+
+//------------------------------------------------------------------------------------------------------------+
+
+ function lgsl_realpath($path)
+ {
+ // WRAPPER SO IT CAN BE DISABLED
+
+ global $lgsl_config;
+
+ return $lgsl_config['no_realpath'] ? $path : realpath($path);
+ }
+
+//------------------------------------------------------------------------------------------------------------+
+
+ function lgsl_file_path()
+ {
+ // GET THE LGSL_CLASS.PHP PATH
+
+ $lgsl_path = __FILE__;
+
+ // SHORTEN TO JUST THE FOLDERS AND ADD TRAILING SLASH
+
+ $lgsl_path = dirname($lgsl_path)."/";
+
+ // CONVERT WINDOWS BACKSLASHES TO FORWARDSLASHES
+
+ $lgsl_path = str_replace("\\", "/", $lgsl_path);
+
+ return $lgsl_path;
+ }
+
+//------------------------------------------------------------------------------------------------------------+
+
+ function lgsl_url_path()
+ {
+ // CHECK IF PATH HAS BEEN SET IN CONFIG
+
+ global $lgsl_config;
+
+ if ($lgsl_config['url_path'])
+ {
+ return $lgsl_config['url_path'];
+ }
+
+ // USE FULL DOMAIN PATH TO AVOID ALIAS PROBLEMS
+
+ $host_path = (!isset($_SERVER['HTTPS']) || strtolower($_SERVER['HTTPS']) != "on") ? "http://" : "https://";
+ $host_path .= $_SERVER['HTTP_HOST'];
+
+ // GET FULL PATHS ( EXTRA CODE FOR WINDOWS AND IIS - NO DOCUMENT_ROOT - BACKSLASHES - DOUBLESLASHES - ETC )
+
+ if ($_SERVER['DOCUMENT_ROOT'])
+ {
+ $base_path = lgsl_realpath($_SERVER['DOCUMENT_ROOT']);
+ $base_path = str_replace("\\", "/", $base_path);
+ $base_path = str_replace("//", "/", $base_path);
+ }
+ else
+ {
+ $file_path = $_SERVER['SCRIPT_NAME'];
+ $file_path = str_replace("\\", "/", $file_path);
+ $file_path = str_replace("//", "/", $file_path);
+
+ $base_path = $_SERVER['PATH_TRANSLATED'];
+ $base_path = str_replace("\\", "/", $base_path);
+ $base_path = str_replace("//", "/", $base_path);
+ $base_path = substr($base_path, 0, -strlen($file_path));
+ }
+
+ $lgsl_path = dirname(lgsl_realpath(__FILE__));
+ $lgsl_path = str_replace("\\", "/", $lgsl_path);
+
+ // REMOVE ANY TRAILING SLASHES
+
+ if (substr($base_path, -1) == "/") { $base_path = substr($base_path, 0, -1); }
+ if (substr($lgsl_path, -1) == "/") { $lgsl_path = substr($lgsl_path, 0, -1); }
+
+ // USE THE DIFFERENCE BETWEEN PATHS
+
+ if (substr($lgsl_path, 0, strlen($base_path)) == $base_path)
+ {
+ $url_path = substr($lgsl_path, strlen($base_path));
+
+ return $host_path.$url_path."/";
+ }
+
+ return "/#LGSL_PATH_PROBLEM#{$base_path}#{$lgsl_path}#/";
+ }
+
+//------------------------------------------------------------------------------------------------------------+
+//------------------------------------------------------------------------------------------------------------+
+
+ } // END OF DOUBLE LOAD PROTECTION
+
+//------------------------------------------------------------------------------------------------------------+
+//------------------------------------------------------------------------------------------------------------+
+
+ global $lgsl_file_path, $lgsl_url_path;
+
+ $lgsl_file_path = lgsl_file_path();
+
+ if (isset($_GET['lgsl_debug']))
+ {
+ echo "".print_r($_SERVER, TRUE)."
+ #d0# ".__FILE__."
+ #d1# ".@realpath(__FILE__)."
+ #d2# ".dirname(__FILE__)."
+ #d3# {$lgsl_file_path}
+ #d4# {$_SERVER['DOCUMENT_ROOT']}
+ #d5# ".@realpath($_SERVER['DOCUMENT_ROOT']);
+ }
+
+ require $lgsl_file_path."lgsl_config.php";
+ require $lgsl_file_path."lgsl_protocol.php";
+
+ $lgsl_url_path = lgsl_url_path();
+
+ if (isset($_GET['lgsl_debug']))
+ {
+ echo " #d6# {$lgsl_url_path}
+ #c0# {$lgsl_config['url_path']}
+ #c1# {$lgsl_config['no_realpath']}
+ #c2# {$lgsl_config['feed']['method']}
+ #c3# {$lgsl_config['feed']['url']}
+ #c4# {$lgsl_config['cache_time']}
+ #c5# {$lgsl_config['live_time']}
+ #c6# {$lgsl_config['timeout']}
+ #c7# {$lgsl_config['cms']}
+ ";
+ }
+
+ if (!isset($lgsl_config['locations']))
+ {
+ exit("LGSL PROBLEM: lgsl_config.php FAILED TO LOAD OR MISSING ENTRIES");
+ }
+
+//------------------------------------------------------------------------------------------------------------+
diff --git a/lgsl/lgsl_files/lgsl_config.php b/lgsl/lgsl_files/lgsl_config.php
new file mode 100644
index 0000000..04ee447
--- /dev/null
+++ b/lgsl/lgsl_files/lgsl_config.php
@@ -0,0 +1,181 @@
+STARTING [ TIME LIMIT: ".ini_get("max_execution_time")." ] [ CACHE TIME: {$lgsl_config['cache_time']} ]\r\n\r\n";
+
+//------------------------------------------------------------------------------------------------------------+
+
+ $mysql_query = "SELECT `type`,`ip`,`c_port`,`q_port`,`s_port` FROM `{$lgsl_config['db']['prefix']}{$lgsl_config['db']['table']}` WHERE `disabled`=0 ORDER BY `cache_time` ASC";
+ $mysql_result = mysql_query($mysql_query) or die(mysql_error());
+
+ while($mysql_row = mysql_fetch_array($mysql_result, MYSQL_ASSOC))
+ {
+ echo str_pad(lgsl_timer("taken"), 8, " ").":".
+ str_pad($mysql_row['type'], 15, " ").":".
+ str_pad($mysql_row['ip'], 30, " ").":".
+ str_pad($mysql_row['c_port'], 6, " ").":".
+ str_pad($mysql_row['q_port'], 6, " ").":".
+ str_pad($mysql_row['s_port'], 12, " ")."\r\n";
+
+ lgsl_query_cached($mysql_row['type'], $mysql_row['ip'], $mysql_row['c_port'], $mysql_row['q_port'], $mysql_row['s_port'], $request);
+
+ flush();
+ ob_flush();
+ }
+
+//------------------------------------------------------------------------------------------------------------+
+
+ echo "\r\nFINISHED";
+
+//------------------------------------------------------------------------------------------------------------+
diff --git a/lgsl/lgsl_files/lgsl_details.php b/lgsl/lgsl_files/lgsl_details.php
new file mode 100644
index 0000000..655bc05
--- /dev/null
+++ b/lgsl/lgsl_files/lgsl_details.php
@@ -0,0 +1,208 @@
+ {$lgsl_config['text']['mid']} "; return; }
+
+ $fields = lgsl_sort_fields($server, $fields_show, $fields_hide, $fields_other);
+ $server = lgsl_sort_players($server);
+ $server = lgsl_sort_extras($server);
+ $misc = lgsl_server_misc($server);
+ $server = lgsl_server_html($server);
+
+//------------------------------------------------------------------------------------------------------------+
+
+ $output .= "
+ ";
+
+ $output .="
+
+
";
+
+//------------------------------------------------------------------------------------------------------------+
+// SHOW THE STANDARD INFO
+
+ $output .= "
+
+
+
+ {$server['s']['name']}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {$lgsl_config['text']['sts']} {$misc['text_status']}
+ {$lgsl_config['text']['adr']} {$server['b']['ip']}
+ {$lgsl_config['text']['cpt']} {$server['b']['c_port']}
+ {$lgsl_config['text']['qpt']} {$server['b']['q_port']}
+
+
+
+
+ {$lgsl_config['text']['typ']} {$server['b']['type']}
+ {$lgsl_config['text']['gme']} {$server['s']['game']}
+ {$lgsl_config['text']['map']} {$server['s']['map']}
+ {$lgsl_config['text']['plr']} {$server['s']['players']} / {$server['s']['playersmax']}
+
+
+
+
";
+
+//------------------------------------------------------------------------------------------------------------+
+
+ $output .= "
+
+
+
";
+
+//------------------------------------------------------------------------------------------------------------+
+// SHOW THE PLAYERS
+
+ $output .= "
+
";
+
+ if (empty($server['p']) || !is_array($server['p']))
+ {
+ $output .= "
+
+
+ {$lgsl_config['text']['npi']}
+
+
";
+ }
+ else
+ {
+ $output .= "
+
+ ";
+
+ foreach ($fields as $field)
+ {
+ $field = ucfirst($field);
+ $output .= "
+ {$field} ";
+ }
+
+ $output .= "
+ ";
+
+ foreach ($server['p'] as $player_key => $player)
+ {
+ $output .= "
+ ";
+
+ foreach ($fields as $field)
+ {
+ $output .= " {$player[$field]} ";
+ }
+
+ $output .= "
+ ";
+ }
+
+ $output .= "
+
";
+ }
+
+ $output .= "
+
";
+
+//------------------------------------------------------------------------------------------------------------+
+
+ $output .= "
+
+
+
";
+
+//------------------------------------------------------------------------------------------------------------+
+// SHOW THE SETTINGS
+
+ if (empty($server['e']) || !is_array($server['e']))
+ {
+ $output .= "
+
+
+ {$lgsl_config['text']['nei']}
+
+
";
+ }
+ else
+ {
+ $output .= "
+
+
+ {$lgsl_config['text']['ehs']}
+ {$lgsl_config['text']['ehv']}
+ ";
+
+ foreach ($server['e'] as $field => $value)
+ {
+ $color = lgsl_bg();
+
+ $output .= "
+
+ {$field}
+ {$value}
+ ";
+ }
+
+ $output .= "
+
";
+ }
+
+//------------------------------------------------------------------------------------------------------------+
+
+ $output .= "
+
+
+
";
+
+ $output .= "
+
";
+
+//--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
+//------ PLEASE MAKE A DONATION OR SIGN THE GUESTBOOK AT GREYCUBE.COM IF YOU REMOVE THIS CREDIT ----------------------------------------------------------------------------------------------------+
+ $output .= "";
+//--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
diff --git a/lgsl/lgsl_files/lgsl_export.php b/lgsl/lgsl_files/lgsl_export.php
new file mode 100644
index 0000000..2e584e3
--- /dev/null
+++ b/lgsl/lgsl_files/lgsl_export.php
@@ -0,0 +1,102 @@
+
+ {$mysql_row['type']}
+ {$mysql_row['ip']}
+ {$mysql_row['c_port']}
+ {$mysql_row['q_port']}
+ {$mysql_row['s_port']}
+ {$mysql_row['zone']}
+ {$mysql_row['disabled']}
+ ";
+ }
+ else
+ {
+ $output .= "{$mysql_row['type']} : {$mysql_row['ip']} : {$mysql_row['c_port']} : {$mysql_row['q_port']} : {$mysql_row['s_port']} : {$mysql_row['zone']} : {$mysql_row['disabled']} \r\n";
+ }
+ }
+
+//------------------------------------------------------------------------------------------------------------+
+
+ if ($download)
+ {
+ header("Content-type: application/octet-stream");
+ header("Content-Disposition: attachment; filename=\"servers.txt\"");
+ echo $output;
+ exit;
+ }
+
+ if ($xml)
+ {
+ header("content-type: text/xml");
+ echo "
+ {$output} ";
+ exit;
+ }
+
+//------------------------------------------------------------------------------------------------------------+
+?>
+
+
+
+
+
+
+ Live Game Server List
+
+
+
+
+
+
+
+
+
diff --git a/lgsl/lgsl_files/lgsl_feed.php b/lgsl/lgsl_files/lgsl_feed.php
new file mode 100644
index 0000000..17ccd12
--- /dev/null
+++ b/lgsl/lgsl_files/lgsl_feed.php
@@ -0,0 +1,162 @@
+ 99999 || $q_port < 1024)
+ {
+ exit("LGSL FEED PROBLEM: INVALID QUERY PORT: '{$q_port}'");
+ }
+
+ if (preg_match("/[^0-9a-z\.\-\[\]\:]/i", $ip))
+ {
+ exit("LGSL FEED PROBLEM: INVALID IP OR HOSTNAME: '{$ip}'");
+ }
+
+ if (preg_match("/[^a-z]/", $request))
+ {
+ exit("LGSL FEED PROBLEM: INVALID REQUEST: '{$request}'");
+ }
+
+ if ($type == "test")
+ {
+ exit("LGSL FEED PROBLEM: TYPE 'test' IS NOT ALLOWED");
+ }
+
+ $lgsl_protocol_list = lgsl_protocol_list();
+
+ if (!isset($lgsl_protocol_list[$type]))
+ {
+ exit("LGSL FEED PROBLEM: ".($type ? "UNKNOWN TYPE '{$type}'" : "MISSING TYPE")." FOR {$ip} : {$c_port} : {$q_port} : {$s_port}");
+ }
+
+//------------------------------------------------------------------------------------------------------------+
+// FILTER HOSTNAME AND IP FORMATS THAT PHP ACCEPTS BUT ARE NOT WANTED
+
+ if (preg_match("/(\[[0-9a-z\:]+\])/iU", $ip, $match)) { $ip = $match[1]; }
+ elseif (preg_match("/([0-9a-z\.\-]+)/i", $ip, $match)) { $ip = $match[1]; }
+
+//------------------------------------------------------------------------------------------------------------+
+// CHECK PUBLIC FEED SETTING AND EITHER ADD [a] REQUEST OR ENSURE [a] IS REMOVED
+
+ $request = $lgsl_config['public_feed'] ? $request."a" : str_replace("a", "", $request);
+
+//------------------------------------------------------------------------------------------------------------+
+// QUERY SERVER
+
+ $server = lgsl_query_cached($type, $ip, $c_port, $q_port, $s_port, $request);
+
+//------------------------------------------------------------------------------------------------------------+
+// ADD THE FEED PROVIDER
+
+ if ($server['e']) { $server['e']['_feed_'] = "http://{$_SERVER['HTTP_HOST']}"; }
+
+//------------------------------------------------------------------------------------------------------------+
+// FEED USAGE LOGGING - 'logs' FOLDER MUST BE MANUALLY CREATED AND SET AS WRITABLE
+
+ if (is_dir("logs") && is_writable("logs"))
+ {
+// $file_path = "logs/log_feed.html";
+ $file_path = "logs/log_feed_{$_SERVER['REMOTE_ADDR']}.html";
+
+ if (filesize($file_path) > 1234567) { unlink($file_path); }
+
+ $file_handle = fopen($file_path, "a");
+
+ $file_string = "
+ [ ".date("Y/m/d H:i:s")." ] {$type}:{$ip}:{$c_port}:{$q_port}:{$s_port}:{$request}
+ [ ".lgsl_string_html($_SERVER['REMOTE_ADDR']) ." ]
+ [ ".lgsl_string_html($_SERVER['HTTP_REFERER'])." ]
+ ".($version ? " [ {$version} ] " : "")."
+ ".($xml ? " [ XML ] " : "")."
+ ";
+
+ fwrite($file_handle, $file_string);
+
+ fclose($file_handle);
+ }
+
+//------------------------------------------------------------------------------------------------------------+
+// SERIALIZED OUTPUT
+
+ if (!$xml)
+ {
+ if ($format == 0) { exit("_SLGSLF_".serialize($server)."_SLGSLF_"); } // LEGACY SYSTEM ( 5.6 AND OLDER )
+
+ if (($format == 3 || $format == 4) && function_exists("json_encode"))
+ {
+ if ($format == 4 && function_exists("gzcompress")) { exit("_F4_".base64_encode(gzcompress(json_encode($server)))."_F4_"); }
+ else { exit("_F3_".base64_encode( json_encode($server)). "_F3_"); }
+ }
+ else
+ {
+ if ($format == 2 && function_exists("gzcompress")) { exit("_F2_".base64_encode(gzcompress(serialize($server)))."_F2_"); }
+ else { exit("_F1_".base64_encode( serialize($server)). "_F1_"); }
+ }
+ }
+
+//------------------------------------------------------------------------------------------------------------+
+// XML OUTPUT
+
+ header("content-type: text/xml");
+
+ echo "\r\n\r\n";
+
+ foreach ($server as $a => $b)
+ {
+ echo "<".lgsl_string_html($a, TRUE).">";
+
+ foreach ($b as $c => $d)
+ {
+ if (is_array($d))
+ {
+ echo "\r\n";
+
+ foreach ($d as $e => $f)
+ {
+ echo "<".lgsl_string_html($e, TRUE).">".lgsl_string_html($f, TRUE)."".lgsl_string_html($e, TRUE).">\r\n";
+ }
+
+ echo " \r\n";
+ }
+ else
+ {
+ echo "<".lgsl_string_html($c, TRUE).">".lgsl_string_html($d, TRUE)."".lgsl_string_html($c, TRUE).">\r\n";
+ }
+ }
+
+ echo "".lgsl_string_html($a, TRUE).">\r\n";
+ }
+
+ echo " \r\n";
+
+//------------------------------------------------------------------------------------------------------------+
diff --git a/lgsl/lgsl_files/lgsl_list.php b/lgsl/lgsl_files/lgsl_list.php
new file mode 100644
index 0000000..3b597be
--- /dev/null
+++ b/lgsl/lgsl_files/lgsl_list.php
@@ -0,0 +1,104 @@
+
+
+ ";
+
+//------------------------------------------------------------------------------------------------------------+
+
+ if ($lgsl_config['list']['totals'])
+ {
+ $total = lgsl_group_totals($server_list);
+
+ $output .= "
+
+
+
+
+
+
+ {$lgsl_config['text']['tns']} {$total['servers']}
+ {$lgsl_config['text']['tnp']} {$total['players']}
+ {$lgsl_config['text']['tmp']} {$total['playersmax']}
+
+
+
";
+ }
+
+//--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
+//------ PLEASE MAKE A DONATION OR SIGN THE GUESTBOOK AT GREYCUBE.COM IF YOU REMOVE THIS CREDIT ----------------------------------------------------------------------------------------------------+
+ $output .= "";
+//--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
diff --git a/lgsl/lgsl_files/lgsl_protocol.php b/lgsl/lgsl_files/lgsl_protocol.php
new file mode 100644
index 0000000..ad2c6b0
--- /dev/null
+++ b/lgsl/lgsl_files/lgsl_protocol.php
@@ -0,0 +1,4052 @@
+ "Americas Army",
+ "aarmy3" => "Americas Army 3",
+ "arcasimracing" => "Arca Sim Racing",
+ "arma" => "ArmA: Armed Assault",
+ "arma2" => "ArmA 2",
+ "avp2" => "Aliens VS. Predator 2",
+ "avp2010" => "Aliens VS. Predator ( 2010 By Rebellion )",
+ "bfbc2" => "Battlefield Bad Company 2",
+ "bfvietnam" => "Battlefield Vietnam",
+ "bf1942" => "Battlefield 1942",
+ "bf2" => "Battlefield 2",
+ "bf2142" => "Battlefield 2142",
+ "callofduty" => "Call Of Duty",
+ "callofdutyuo" => "Call Of Duty: United Offensive",
+ "callofdutywaw" => "Call Of Duty: World at War",
+ "callofduty2" => "Call Of Duty 2",
+ "callofduty4" => "Call Of Duty 4",
+ "cncrenegade" => "Command and Conquer: Renegade",
+ "crysis" => "Crysis",
+ "crysiswars" => "Crysis Wars",
+ "cs2d" => "Counter-Strike 2D",
+ "cube" => "Cube Engine",
+ "doomskulltag" => "Doom - Skulltag",
+ "doomzdaemon" => "Doom - ZDaemon",
+ "doom3" => "Doom 3",
+ "dh2005" => "Deer Hunter 2005",
+ "farcry" => "Far Cry",
+ "fear" => "F.E.A.R.",
+ "flashpoint" => "Operation Flashpoint",
+ "freelancer" => "Freelancer",
+ "frontlines" => "Frontlines: Fuel Of War",
+ "f1c9902" => "F1 Challenge 99-02",
+ "gamespy1" => "Generic GameSpy 1",
+ "gamespy2" => "Generic GameSpy 2",
+ "gamespy3" => "Generic GameSpy 3",
+ "ghostrecon" => "Ghost Recon",
+ "graw" => "Ghost Recon: Advanced Warfighter",
+ "graw2" => "Ghost Recon: Advanced Warfighter 2",
+ "gtr2" => "GTR 2",
+ "had2" => "Hidden and Dangerous 2",
+ "halflife" => "Half-Life - Steam",
+ "halflifewon" => "Half-Life - WON",
+ "halo" => "Halo",
+ "il2" => "IL-2 Sturmovik",
+ "jediknight2" => "JediKnight 2: Jedi Outcast",
+ "jediknightja" => "JediKnight: Jedi Academy",
+ "killingfloor" => "Killing Floor",
+ "kingpin" => "Kingpin: Life of Crime",
+ "mohaa" => "Medal of Honor: Allied Assault",
+ "mohaab" => "Medal of Honor: Allied Assault Breakthrough",
+ "mohaas" => "Medal of Honor: Allied Assault Spearhead",
+ "mohpa" => "Medal of Honor: Pacific Assault",
+ "mta" => "Multi Theft Auto",
+ "nascar2004" => "Nascar Thunder 2004",
+ "neverwinter" => "NeverWinter Nights",
+ "neverwinter2" => "NeverWinter Nights 2",
+ "nexuiz" => "Nexuiz",
+ "openttd" => "Open Transport Tycoon Deluxe",
+ "painkiller" => "PainKiller",
+ "plainsight" => "Plain Sight",
+ "prey" => "Prey",
+ "quakeworld" => "Quake World",
+ "quakewars" => "Enemy Territory: Quake Wars",
+ "quake2" => "Quake 2",
+ "quake3" => "Quake 3",
+ "quake4" => "Quake 4",
+ "ravenshield" => "Raven Shield",
+ "redorchestra" => "Red Orchestra",
+ "rfactor" => "RFactor",
+ "samp" => "San Andreas Multiplayer",
+ "savage" => "Savage",
+ "savage2" => "Savage 2",
+ "serioussam" => "Serious Sam",
+ "serioussam2" => "Serious Sam 2",
+ "shatteredh" => "Shattered Horizon",
+ "sof2" => "Soldier of Fortune 2",
+ "soldat" => "Soldat",
+ "source" => "Source ( Half-Life 2 )",
+ "stalker" => "S.T.A.L.K.E.R.",
+ "stalkercs" => "S.T.A.L.K.E.R. Clear Sky",
+ "startrekef" => "StarTrek Elite-Force",
+ "starwarsbf" => "Star Wars: Battlefront",
+ "starwarsbf2" => "Star Wars: Battlefront 2",
+ "starwarsrc" => "Star Wars: Republic Commando",
+ "swat4" => "SWAT 4",
+ "test" => "Test ( For PHP Developers )",
+ "teeworlds" => "Teeworlds",
+ "tribes" => "Tribes ( Starsiege )",
+ "tribes2" => "Tribes 2",
+ "tribesv" => "Tribes Vengeance",
+ "urbanterror" => "UrbanTerror",
+ "ut" => "Unreal Tournament",
+ "ut2003" => "Unreal Tournament 2003",
+ "ut2004" => "Unreal Tournament 2004",
+ "ut3" => "Unreal Tournament 3",
+ "vcmp" => "Vice City Multiplayer",
+ "vietcong" => "Vietcong",
+ "vietcong2" => "Vietcong 2",
+ "warsow" => "Warsow",
+ "warsowold" => "Warsow ( 0.4.2 and older )",
+ "wolfet" => "Wolfenstein: Enemy Territory",
+ "wolfrtcw" => "Wolfenstein: Return To Castle Wolfenstein",
+ "wolf2009" => "Wolfenstein ( 2009 By Raven )");
+ }
+
+//------------------------------------------------------------------------------------------------------------+
+//------------------------------------------------------------------------------------------------------------+
+
+ function lgsl_protocol_list()
+ {
+ return array(
+ "aarmy" => "09",
+ "aarmy_" => "03",
+ "aarmy3" => "26",
+ "arcasimracing" => "16",
+ "arma" => "09",
+ "arma2" => "09",
+ "avp2" => "03",
+ "avp2010" => "31",
+ "bfbc2" => "30",
+ "bfvietnam" => "09",
+ "bf1942" => "03",
+ "bf2" => "06",
+ "bf2142" => "06",
+ "callofduty" => "02",
+ "callofdutyuo" => "02",
+ "callofdutywaw" => "02",
+ "callofduty2" => "02",
+ "callofduty4" => "02",
+ "cncrenegade" => "03",
+ "crysis" => "06",
+ "crysiswars" => "06",
+ "cs2d" => "29",
+ "cube" => "24",
+ "doomskulltag" => "27",
+ "doomzdaemon" => "28",
+ "doom3" => "10",
+ "dh2005" => "09",
+ "had2" => "03",
+ "halflife" => "05",
+ "halflifewon" => "05",
+ "halo" => "03",
+ "il2" => "03",
+ "farcry" => "08",
+ "fear" => "09",
+ "flashpoint" => "03",
+ "freelancer" => "14",
+ "frontlines" => "20",
+ "f1c9902" => "03",
+ "gamespy1" => "03",
+ "gamespy2" => "09",
+ "gamespy3" => "06",
+ "ghostrecon" => "19",
+ "graw" => "06",
+ "graw2" => "09",
+ "gtr2" => "15",
+ "jediknight2" => "02",
+ "jediknightja" => "02",
+ "killingfloor" => "13",
+ "kingpin" => "03",
+ "mohaa" => "03",
+ "mohaab" => "03",
+ "mohaas" => "03",
+ "mohpa" => "03",
+ "mohaa_" => "02",
+ "mohaab_" => "02",
+ "mohaas_" => "02",
+ "mohpa_" => "02",
+ "mta" => "08",
+ "nascar2004" => "09",
+ "neverwinter" => "09",
+ "neverwinter2" => "09",
+ "nexuiz" => "02",
+ "openttd" => "22",
+ "painkiller" => "08",
+ "painkiller_" => "09",
+ "plainsight" => "32",
+ "prey" => "10",
+ "quakeworld" => "07",
+ "quakewars" => "10",
+ "quake2" => "02",
+ "quake3" => "02",
+ "quake4" => "10",
+ "ravenshield" => "04",
+ "redorchestra" => "13",
+ "rfactor" => "16",
+ "samp" => "12",
+ "savage" => "17",
+ "savage2" => "18",
+ "serioussam" => "03",
+ "serioussam2" => "09",
+ "shatteredh" => "05",
+ "sof2" => "02",
+ "soldat" => "08",
+ "source" => "05",
+ "stalker" => "06",
+ "stalkercs" => "09",
+ "startrekef" => "02",
+ "starwarsbf" => "09",
+ "starwarsbf2" => "09",
+ "starwarsrc" => "09",
+ "swat4" => "03",
+ "test" => "01",
+ "teeworlds" => "21",
+ "tribes" => "23",
+ "tribes2" => "25",
+ "tribesv" => "09",
+ "warsow" => "02",
+ "warsowold" => "02",
+ "urbanterror" => "02",
+ "ut" => "03",
+ "ut2003" => "13",
+ "ut2003_" => "03",
+ "ut2004" => "13",
+ "ut2004_" => "03",
+ "ut3" => "11",
+ "vcmp" => "12",
+ "vietcong" => "03",
+ "vietcong2" => "09",
+ "wolfet" => "02",
+ "wolfrtcw" => "02",
+ "wolf2009" => "10");
+
+ return $lgsl_protocol_list;
+ }
+
+//------------------------------------------------------------------------------------------------------------+
+//------------------------------------------------------------------------------------------------------------+
+
+ function lgsl_software_link($type, $ip, $c_port, $q_port, $s_port)
+ {
+ $lgsl_software_link = array(
+ "aarmy" => "qtracker://{IP}:{S_PORT}?game=ArmyOperations&action=show",
+ "aarmy3" => "qtracker://{IP}:{S_PORT}?game=AmericasArmy3&action=show",
+ "arcasimracing" => "http://en.wikipedia.org/wiki/ARCA_Sim_Racing",
+ "arma" => "qtracker://{IP}:{S_PORT}?game=ArmedAssault&action=show",
+ "arma2" => "http://en.wikipedia.org/wiki/ARMA_2",
+ "avp2" => "qtracker://{IP}:{S_PORT}?game=AliensversusPredator2&action=show",
+ "avp2010" => "http://en.wikipedia.org/wiki/Aliens_vs._Predator_%28video_game%29",
+ "bfbc2" => "http://en.wikipedia.org/wiki/Battlefield_bad_company_2",
+ "bfvietnam" => "qtracker://{IP}:{S_PORT}?game=BattlefieldVietnam&action=show",
+ "bf1942" => "qtracker://{IP}:{S_PORT}?game=Battlefield1942&action=show",
+ "bf2" => "qtracker://{IP}:{S_PORT}?game=Battlefield2&action=show",
+ "bf2142" => "qtracker://{IP}:{S_PORT}?game=Battlefield2142&action=show",
+ "callofduty" => "qtracker://{IP}:{S_PORT}?game=CallOfDuty&action=show",
+ "callofdutyuo" => "qtracker://{IP}:{S_PORT}?game=CallOfDutyUnitedOffensive&action=show",
+ "callofdutywaw" => "qtracker://{IP}:{S_PORT}?game=CallOfDutyWorldAtWar&action=show",
+ "callofduty2" => "qtracker://{IP}:{S_PORT}?game=CallOfDuty2&action=show",
+ "callofduty4" => "qtracker://{IP}:{S_PORT}?game=CallOfDuty4&action=show",
+ "cncrenegade" => "qtracker://{IP}:{S_PORT}?game=CommandConquerRenegade&action=show",
+ "crysis" => "qtracker://{IP}:{S_PORT}?game=Crysis&action=show",
+ "crysiswars" => "qtracker://{IP}:{S_PORT}?game=CrysisWars&action=show",
+ "cs2d" => "http://www.cs2d.com",
+ "cube" => "http://cubeengine.com",
+ "doomskulltag" => "http://skulltag.com",
+ "doomzdaemon" => "http://www.zdaemon.org",
+ "doom3" => "qtracker://{IP}:{S_PORT}?game=Doom3&action=show",
+ "dh2005" => "http://en.wikipedia.org/wiki/Deer_Hunter_(computer_game)",
+ "farcry" => "qtracker://{IP}:{S_PORT}?game=FarCry&action=show",
+ "fear" => "qtracker://{IP}:{S_PORT}?game=FEAR&action=show",
+ "flashpoint" => "qtracker://{IP}:{S_PORT}?game=OperationFlashpoint&action=show",
+ "freelancer" => "http://en.wikipedia.org/wiki/Freelancer_(computer_game)",
+ "frontlines" => "http://en.wikipedia.org/wiki/Frontlines:_Fuel_of_War",
+ "f1c9902" => "http://en.wikipedia.org/wiki/EA_Sports_F1_Series",
+ "gamespy1" => "http://www.greycube.com",
+ "gamespy2" => "http://www.greycube.com",
+ "gamespy3" => "http://www.greycube.com",
+ "ghostrecon" => "http://en.wikipedia.org/wiki/Tom_Clancy's_Ghost_Recon",
+ "graw" => "qtracker://{IP}:{S_PORT}?game=GhostRecon&action=show",
+ "graw2" => "http://en.wikipedia.org/wiki/Tom_Clancy's_Ghost_Recon_Advanced_Warfighter_2",
+ "gtr2" => "http://en.wikipedia.org/wiki/GTR2",
+ "had2" => "http://en.wikipedia.org/wiki/Hidden_&_Dangerous_2",
+ "halflife" => "qtracker://{IP}:{S_PORT}?game=HalfLife&action=show",
+ "halflifewon" => "qtracker://{IP}:{S_PORT}?game=HalfLife_WON2&action=show",
+ "halo" => "qtracker://{IP}:{S_PORT}?game=Halo&action=show",
+ "il2" => "http://en.wikipedia.org/wiki/IL-2_Sturmovik_(game)",
+ "jediknight2" => "qtracker://{IP}:{S_PORT}?game=JediKnight2&action=show",
+ "jediknightja" => "qtracker://{IP}:{S_PORT}?game=JediKnightJediAcademy&action=show",
+ "killingfloor" => "qtracker://{IP}:{S_PORT}?game=KillingFloor&action=show",
+ "kingpin" => "qtracker://{IP}:{S_PORT}?game=Kingpin&action=show",
+ "mohaa" => "qtracker://{IP}:{S_PORT}?game=MedalofHonorAlliedAssault&action=show",
+ "mohaab" => "qtracker://{IP}:{S_PORT}?game=MedalofHonorAlliedAssaultBreakthrough&action=show",
+ "mohaas" => "qtracker://{IP}:{S_PORT}?game=MedalofHonorAlliedAssaultSpearhead&action=show",
+ "mohpa" => "qtracker://{IP}:{S_PORT}?game=MedalofHonorPacificAssault&action=show",
+ "mta" => "http://en.wikipedia.org/wiki/Multi_Theft_Auto",
+ "nascar2004" => "http://en.wikipedia.org/wiki/NASCAR_Thunder_2004",
+ "neverwinter" => "qtracker://{IP}:{S_PORT}?game=NeverwinterNights&action=show",
+ "neverwinter2" => "qtracker://{IP}:{S_PORT}?game=NeverwinterNights&action=show",
+ "nexuiz" => "qtracker://{IP}:{S_PORT}?game=Nexuiz&action=show",
+ "openttd" => "http://wwww.openttd.org",
+ "painkiller" => "qtracker://{IP}:{S_PORT}?game=Painkiller&action=show",
+ "plainsight" => "http://www.plainsightgame.com",
+ "prey" => "qtracker://{IP}:{S_PORT}?game=Prey&action=show",
+ "quakeworld" => "qtracker://{IP}:{S_PORT}?game=QuakeWorld&action=show",
+ "quakewars" => "qtracker://{IP}:{S_PORT}?game=EnemyTerritoryQuakeWars&action=show",
+ "quake2" => "qtracker://{IP}:{S_PORT}?game=Quake2&action=show",
+ "quake3" => "qtracker://{IP}:{S_PORT}?game=Quake3&action=show",
+ "quake4" => "qtracker://{IP}:{S_PORT}?game=Quake4&action=show",
+ "ravenshield" => "http://en.wikipedia.org/wiki/Tom_Clancy's_Rainbow_Six_3",
+ "redorchestra" => "qtracker://{IP}:{S_PORT}?game=RedOrchestra&action=show",
+ "rfactor" => "rfactor://{IP}:{S_PORT}",
+ "samp" => "http://www.sa-mp.com",
+ "savage" => "http://en.wikipedia.org/wiki/Savage:_The_Battle_for_Newerth",
+ "savage2" => "http://en.wikipedia.org/wiki/Savage_2:_A_Tortured_Soul",
+ "serioussam" => "qtracker://{IP}:{S_PORT}?game=SeriousSam&action=show",
+ "serioussam2" => "qtracker://{IP}:{S_PORT}?game=Serious_Sam2&action=show",
+ "shatteredh" => "http://en.wikipedia.org/wiki/Shattered_Horizon",
+ "sof2" => "qtracker://{IP}:{S_PORT}?game=SoldierOfFortune2&action=show",
+ "soldat" => "http://www.soldat.pl",
+ "source" => "qtracker://{IP}:{S_PORT}?game=HalfLife2&action=show",
+ "stalker" => "qtracker://{IP}:{S_PORT}?game=STALKER_ShadowChernobyl&action=show",
+ "stalkercs" => "qtracker://{IP}:{S_PORT}?game=STALKER_ClearSky&action=show",
+ "startrekef" => "http://en.wikipedia.org/wiki/Star_Trek:_Voyager:_Elite_Force",
+ "starwarsbf" => "qtracker://{IP}:{S_PORT}?game=StarWarsBattlefront&action=show",
+ "starwarsbf2" => "qtracker://{IP}:{S_PORT}?game=StarWarsBattlefront2&action=show",
+ "starwarsrc" => "qtracker://{IP}:{S_PORT}?game=StarWarsRepublicCommando&action=show",
+ "swat4" => "qtracker://{IP}:{S_PORT}?game=SWAT4&action=show",
+ "test" => "http://www.greycube.com",
+ "teeworlds" => "http://www.teeworlds.com",
+ "tribes" => "qtracker://{IP}:{S_PORT}?game=Tribes&action=show",
+ "tribes2" => "qtracker://{IP}:{S_PORT}?game=Tribes2&action=show",
+ "tribesv" => "qtracker://{IP}:{S_PORT}?game=TribesVengeance&action=show",
+ "urbanterror" => "qtracker://{IP}:{S_PORT}?game=UrbanTerror&action=show",
+ "ut" => "qtracker://{IP}:{S_PORT}?game=UnrealTournament&action=show",
+ "ut2003" => "qtracker://{IP}:{S_PORT}?game=UnrealTournament2003&action=show",
+ "ut2004" => "qtracker://{IP}:{S_PORT}?game=UnrealTournament2004&action=show",
+ "ut3" => "qtracker://{IP}:{S_PORT}?game=UnrealTournament3&action=show",
+ "vcmp" => "http://vicecitymultiplayer.com",
+ "vietcong" => "qtracker://{IP}:{S_PORT}?game=Vietcong&action=show",
+ "vietcong2" => "qtracker://{IP}:{S_PORT}?game=Vietcong2&action=show",
+ "warsow" => "qtracker://{IP}:{S_PORT}?game=Warsow&action=show",
+ "warsowold" => "qtracker://{IP}:{S_PORT}?game=Warsow&action=show",
+ "wolfet" => "qtracker://{IP}:{S_PORT}?game=WolfensteinEnemyTerritory&action=show",
+ "wolfrtcw" => "qtracker://{IP}:{S_PORT}?game=ReturntoCastleWolfenstein&action=show",
+ "wolf2009" => "http://en.wikipedia.org/wiki/Wolfenstein_(2009_video_game)");
+
+ // SOFTWARE PORT IS THE QUERY PORT UNLESS SET
+ if (!$s_port) { $s_port = $q_port; }
+
+ // TRY USING THE STANDARD LAUNCH LINK FOR ALTERNATE PROTOCOLS IF ONE IS NOT SET
+ if (!isset($lgsl_software_link[$type])) { $type = str_replace("_", "", $type); }
+
+ // INSERT DATA INTO STATIC LINK - CONVERT SPECIAL CHARACTERS - RETURN
+ return htmlentities(str_replace(array("{IP}", "{C_PORT}", "{Q_PORT}", "{S_PORT}"), array($ip, $c_port, $q_port, $s_port), $lgsl_software_link[$type]), ENT_QUOTES);
+ }
+
+//------------------------------------------------------------------------------------------------------------+
+//------------------------------------------------------------------------------------------------------------+
+
+ function lgsl_port_conversion($type, $c_port, $q_port, $s_port)
+ {
+ switch ($type) // GAMES WHERE Q_PORT IS NOT EQUAL TO C_PORT
+ {
+ case "aarmy" : $c_to_q = 1; $c_def = 1716; $q_def = 1717; $c_to_s = 0; break;
+ case "aarmy3" : $c_to_q = 0; $c_def = 8777; $q_def = 39300; $c_to_s = 0; break;
+ case "arcasimracing" : $c_to_q = -100; $c_def = 34397; $q_def = 34297; $c_to_s = 0; break;
+ case "bfbc2" : $c_to_q = 0; $c_def = 19567; $q_def = 48888; $c_to_s = 0; break;
+ case "bfvietnam" : $c_to_q = 0; $c_def = 15567; $q_def = 23000; $c_to_s = 0; break;
+ case "bf1942" : $c_to_q = 0; $c_def = 14567; $q_def = 23000; $c_to_s = 0; break;
+ case "bf2" : $c_to_q = 0; $c_def = 16567; $q_def = 29900; $c_to_s = 0; break;
+ case "bf2142" : $c_to_q = 0; $c_def = 17567; $q_def = 29900; $c_to_s = 0; break;
+ case "cube" : $c_to_q = 1; $c_def = 28785; $q_def = 28786; $c_to_s = 0; break;
+ case "dh2005" : $c_to_q = 0; $c_def = 23459; $q_def = 34567; $c_to_s = 0; break;
+ case "farcry" : $c_to_q = 123; $c_def = 49001; $q_def = 49124; $c_to_s = 0; break;
+ case "flashpoint" : $c_to_q = 1; $c_def = 2302; $q_def = 2303; $c_to_s = 0; break;
+ case "frontlines" : $c_to_q = 2; $c_def = 5476; $q_def = 5478; $c_to_s = 0; break;
+ case "ghostrecon" : $c_to_q = 2; $c_def = 2346; $q_def = 2348; $c_to_s = 0; break;
+ case "gtr2" : $c_to_q = 1; $c_def = 34297; $q_def = 34298; $c_to_s = 0; break;
+ case "had2" : $c_to_q = 3; $c_def = 11001; $q_def = 11004; $c_to_s = 0; break;
+ case "kingpin" : $c_to_q = -10; $c_def = 31510; $q_def = 31500; $c_to_s = 0; break;
+ case "killingfloor" : $c_to_q = 1; $c_def = 7708; $q_def = 7709; $c_to_s = 0; break;
+ case "mohaa" : $c_to_q = 97; $c_def = 12203; $q_def = 12300; $c_to_s = 0; break;
+ case "mohaab" : $c_to_q = 97; $c_def = 12203; $q_def = 12300; $c_to_s = 0; break;
+ case "mohaas" : $c_to_q = 97; $c_def = 12203; $q_def = 12300; $c_to_s = 0; break;
+ case "mohpa" : $c_to_q = 97; $c_def = 13203; $q_def = 13300; $c_to_s = 0; break;
+ case "mta" : $c_to_q = 123; $c_def = 22003; $q_def = 22126; $c_to_s = 0; break;
+ case "painkiller" : $c_to_q = 123; $c_def = 3455; $q_def = 3578; $c_to_s = 0; break;
+ case "ravenshield" : $c_to_q = 1000; $c_def = 7777; $q_def = 8777; $c_to_s = 0; break;
+ case "redorchestra" : $c_to_q = 1; $c_def = 7758; $q_def = 7759; $c_to_s = 0; break;
+ case "rfactor" : $c_to_q = -100; $c_def = 34397; $q_def = 34297; $c_to_s = 0; break;
+ case "serioussam" : $c_to_q = 1; $c_def = 25600; $q_def = 25601; $c_to_s = 0; break;
+ case "soldat" : $c_to_q = 123; $c_def = 23073; $q_def = 23196; $c_to_s = 0; break;
+ case "stalker" : $c_to_q = 2; $c_def = 5447; $q_def = 5445; $c_to_s = 0; break;
+ case "stalkercs" : $c_to_q = 2; $c_def = 5447; $q_def = 5445; $c_to_s = 0; break;
+ case "starwarsrc" : $c_to_q = 0; $c_def = 7777; $q_def = 11138; $c_to_s = 0; break;
+ case "swat4" : $c_to_q = 1; $c_def = 10780; $q_def = 10781; $c_to_s = 0; break;
+ case "tribesv" : $c_to_q = 1; $c_def = 7777; $q_def = 7778; $c_to_s = 0; break;
+ case "ut" : $c_to_q = 1; $c_def = 7777; $q_def = 7778; $c_to_s = 0; break;
+ case "ut2003" : $c_to_q = 1; $c_def = 7757; $q_def = 7758; $c_to_s = 10; break;
+ case "ut2003_" : $c_to_q = 10; $c_def = 7757; $q_def = 7767; $c_to_s = 0; break;
+ case "ut2004" : $c_to_q = 1; $c_def = 7777; $q_def = 7778; $c_to_s = 10; break;
+ case "ut2004_" : $c_to_q = 10; $c_def = 7777; $q_def = 7787; $c_to_s = 0; break;
+ case "ut3" : $c_to_q = 0; $c_def = 7777; $q_def = 6500; $c_to_s = 0; break;
+ case "vietcong" : $c_to_q = 10000; $c_def = 5425; $q_def = 15425; $c_to_s = 0; break;
+ case "vietcong2" : $c_to_q = 0; $c_def = 5001; $q_def = 19967; $c_to_s = 0; break;
+ default : $c_to_q = 0; $c_def = 0; $q_def = 0; $c_to_s = 0; break;
+ }
+
+ if (!$c_port && !$q_port && $c_def) { $c_port = $c_def; $q_port = $q_def; }
+ if (!$c_port && $q_port && $c_to_q) { $c_port = $q_port - $c_to_q; }
+ elseif (!$c_port && $q_port && $c_def) { $c_port = $c_def; }
+ elseif (!$c_port && $q_port) { $c_port = $q_port; }
+ if (!$q_port && $c_port && $c_to_q) { $q_port = $c_port + $c_to_q; }
+ elseif (!$q_port && $c_port && $q_def) { $q_port = $q_def; }
+ elseif (!$q_port && $c_port) { $q_port = $c_port; }
+ if (!$s_port && $c_to_s) { $s_port = $c_port + $c_to_s; }
+
+ return array(intval($c_port), intval($q_port), intval($s_port));
+ }
+
+//------------------------------------------------------------------------------------------------------------+
+//------------------------------------------------------------------------------------------------------------+
+
+ function lgsl_query_live($type, $ip, $c_port, $q_port, $s_port, $request)
+ {
+//---------------------------------------------------------+
+
+ if (preg_match("/[^0-9a-z\.\-\[\]\:]/i", $ip))
+ {
+ exit("LGSL PROBLEM: INVALID IP OR HOSTNAME");
+ }
+
+ $lgsl_protocol_list = lgsl_protocol_list();
+
+ if (!isset($lgsl_protocol_list[$type]))
+ {
+ exit("LGSL PROBLEM: ".($type ? "INVALID TYPE '{$type}'" : "MISSING TYPE")." FOR {$ip}, {$c_port}, {$q_port}, {$s_port}");
+ }
+
+ $lgsl_function = "lgsl_query_{$lgsl_protocol_list[$type]}";
+
+ if (!function_exists($lgsl_function))
+ {
+ exit("LGSL PROBLEM: FUNCTION DOES NOT EXIST FOR: {$type}");
+ }
+
+ if (!intval($q_port))
+ {
+ exit("LGSL PROBLEM: INVALID QUERY PORT");
+ }
+
+//---------------------------------------------------------+
+// ARRAYS ARE SETUP IN ADVANCE
+
+ $server = array(
+ "b" => array("type" => $type, "ip" => $ip, "c_port" => $c_port, "q_port" => $q_port, "s_port" => $s_port, "status" => 1),
+ "s" => array("game" => "", "name" => "", "map" => "", "players" => 0, "playersmax" => 0, "password" => ""),
+ "e" => array(),
+ "p" => array(),
+ "t" => array());
+
+//---------------------------------------------------------+
+// GET DATA
+
+ if ($lgsl_function == "lgsl_query_01") // TEST RETURNS DIRECT
+ {
+ $lgsl_need = ""; $lgsl_fp = "";
+ $response = call_user_func_array($lgsl_function, array(&$server, &$lgsl_need, &$lgsl_fp));
+ return $server;
+ }
+
+ global $lgsl_config; // FEED ENABLED BY EXTERNAL CONFIG SETTING
+
+ if (!empty($lgsl_config['feed']['method']) && !empty($lgsl_config['feed']['url']))
+ {
+ $response = lgsl_query_feed($server, $request, $lgsl_config['feed']['method'], $lgsl_config['feed']['url']);
+ }
+ elseif ($lgsl_function == "lgsl_query_30")
+ {
+ $response = lgsl_query_direct($server, $request, $lgsl_function, "tcp");
+ }
+ else
+ {
+ $response = lgsl_query_direct($server, $request, $lgsl_function, "udp");
+ }
+
+//---------------------------------------------------------+
+// FORMAT RESPONSE
+
+ if (!$response) // SERVER OFFLINE
+ {
+ $server['b']['status'] = 0;
+ }
+ else
+ {
+ // FILL IN EMPTY VALUES
+ if (empty($server['s']['game'])) { $server['s']['game'] = $type; }
+ if (empty($server['s']['map'])) { $server['s']['map'] = "-"; }
+
+ // REMOVE FOLDERS FROM MAP NAMES
+ if (($pos = strrpos($server['s']['map'], "/")) !== FALSE) { $server['s']['map'] = substr($server['s']['map'], $pos + 1); }
+ if (($pos = strrpos($server['s']['map'], "\\")) !== FALSE) { $server['s']['map'] = substr($server['s']['map'], $pos + 1); }
+
+ // PLAYER COUNT AND PASSWORD STATUS SHOULD BE NUMERIC
+ $server['s']['players'] = intval($server['s']['players']);
+ $server['s']['playersmax'] = intval($server['s']['playersmax']);
+
+ if (isset($server['s']['password'][0])) { $server['s']['password'] = (strtolower($server['s']['password'][0]) == "t") ? 1 : 0; }
+ else { $server['s']['password'] = intval($server['s']['password']); }
+
+ // REMOVE EMPTY AND UN-REQUESTED ARRAYS
+
+ if (strpos($request, "p") === FALSE && empty($server['p']) && $server['s']['players'] != 0) { unset($server['p']); }
+ if (strpos($request, "p") === FALSE && empty($server['t'])) { unset($server['t']); }
+ if (strpos($request, "e") === FALSE && empty($server['e'])) { unset($server['e']); }
+ if (strpos($request, "s") === FALSE && empty($server['s']['name'])) { unset($server['s']); }
+ }
+
+//---------------------------------------------------------+
+
+ return $server;
+ }
+
+//------------------------------------------------------------------------------------------------------------+
+//------------------------------------------------------------------------------------------------------------+
+
+ function lgsl_query_direct(&$server, $request, $lgsl_function, $scheme)
+ {
+//---------------------------------------------------------+
+
+ $lgsl_fp = @fsockopen("{$scheme}://{$server['b']['ip']}", $server['b']['q_port'], $errno, $errstr, 1);
+
+ if (!$lgsl_fp) { return FALSE; }
+
+//---------------------------------------------------------+
+
+ global $lgsl_config;
+
+ $lgsl_config['timeout'] = intval($lgsl_config['timeout']);
+
+ stream_set_timeout($lgsl_fp, $lgsl_config['timeout'], $lgsl_config['timeout'] ? 0 : 500000);
+ stream_set_blocking($lgsl_fp, TRUE);
+
+//---------------------------------------------------------+
+// CHECK WHAT IS NEEDED
+
+ $lgsl_need = array();
+ $lgsl_need['s'] = strpos($request, "s") !== FALSE ? TRUE : FALSE;
+ $lgsl_need['e'] = strpos($request, "e") !== FALSE ? TRUE : FALSE;
+ $lgsl_need['p'] = strpos($request, "p") !== FALSE ? TRUE : FALSE;
+
+ // ChANGE [e] TO [s][e] AS BASIC QUERIES OFTEN RETURN EXTRA INFO
+ if ($lgsl_need['e'] && !$lgsl_need['s']) { $lgsl_need['s'] = TRUE; }
+
+//---------------------------------------------------------+
+// QUERY FUNCTION IS REPEATED TO REDUCE DUPLICATE CODE
+
+ do
+ {
+ $lgsl_need_check = $lgsl_need;
+
+ // CALL FUNCTION REQUIRES '&$variable' TO PASS 'BY REFERENCE'
+ $response = call_user_func_array($lgsl_function, array(&$server, &$lgsl_need, &$lgsl_fp));
+
+ // CHECK IF SERVER IS OFFLINE
+ if (!$response) { break; }
+
+ // CHECK IF NEED HAS NOT CHANGED - THIS SERVES TWO PURPOSES - TO PREVENT INFINITE LOOPS - AND TO
+ // AVOID WRITING $lgsl_need = FALSE FALSE FALSE FOR GAMES THAT RETURN ALL DATA IN ONE RESPONSE
+ if ($lgsl_need_check == $lgsl_need) { break; }
+
+ // OPTIMIZATION THAT SKIPS REQUEST FOR PLAYER DETAILS WHEN THE SERVER IS KNOWN TO BE EMPTY
+ if ($lgsl_need['p'] && $server['s']['players'] == "0") { $lgsl_need['p'] = FALSE; }
+ }
+ while ($lgsl_need['s'] == TRUE || $lgsl_need['e'] == TRUE || $lgsl_need['p'] == TRUE);
+
+//---------------------------------------------------------+
+
+ @fclose($lgsl_fp);
+
+ return $response;
+ }
+
+//------------------------------------------------------------------------------------------------------------+
+//------------------------------------------------------------------------------------------------------------+
+
+ function lgsl_query_01(&$server, &$lgsl_need, &$lgsl_fp)
+ {
+//---------------------------------------------------------+
+// PROTOCOL FOR DEVELOPING WITHOUT USING LIVE SERVERS TO HELP ENSURE RETURNED
+// DATA IS SANITIZED AND THAT LONG SERVER AND PLAYER NAMES ARE HANDLED PROPERLY
+
+ $server['s'] = array(
+ "game" => "test_game",
+ "name" => "test_ServerNameThatsOften'Really'LongAndCanHaveSymbols ThatWill\"Screw\"UpHtmlUnlessEntitied",
+ "map" => "test_map",
+ "players" => rand(0, 16),
+ "playersmax" => rand(16, 32),
+ "password" => rand(0, 1));
+
+//---------------------------------------------------------+
+
+ $server['e'] = array(
+ "testextra1" => "normal",
+ "testextra2" => 123,
+ "testextra3" => time(),
+ "testextra4" => "",
+ "testextra5" => "Setting WithHtml ",
+ "testextra6" => "ReallyLongSettingLikeSomeMapCyclesThatHaveNoSpacesAndCauseThePageToGoReallyWideIfNotBrokenUp");
+
+//---------------------------------------------------------+
+
+ $server['p']['0']['name'] = "Normal";
+ $server['p']['0']['score'] = "12";
+ $server['p']['0']['ping'] = "34";
+
+ $server['p']['1']['name'] = "\xc3\xa9\x63\x68\x6f\x20\xd0\xb8-d0\xb3\xd1\x80\xd0\xbe\xd0\xba"; // UTF PLAYER NAME
+ $server['p']['1']['score'] = "56";
+ $server['p']['1']['ping'] = "78";
+
+ $server['p']['2']['name'] = "One&&Three&\"Four\"&'Five'";
+ $server['p']['2']['score'] = "90";
+ $server['p']['2']['ping'] = "12";
+
+ $server['p']['3']['name'] = "ReallyLongPlayerNameBecauseTheyAreUberCoolAndAreInFiveClans";
+ $server['p']['3']['score'] = "90";
+ $server['p']['3']['ping'] = "12";
+
+//---------------------------------------------------------+
+
+ if (rand(0, 10) == 5) { $server['p'] = array(); } // RANDOM NO PLAYERS
+ if (rand(0, 10) == 5) { return FALSE; } // RANDOM GOING OFFLINE
+
+//---------------------------------------------------------+
+
+ return TRUE;
+ }
+
+//------------------------------------------------------------------------------------------------------------+
+//------------------------------------------------------------------------------------------------------------+
+
+ function lgsl_query_02(&$server, &$lgsl_need, &$lgsl_fp)
+ {
+//---------------------------------------------------------+
+
+ if ($server['b']['type'] == "quake2") { fwrite($lgsl_fp, "\xFF\xFF\xFF\xFFstatus"); }
+ elseif ($server['b']['type'] == "warsowold") { fwrite($lgsl_fp, "\xFF\xFF\xFF\xFFgetinfo"); }
+ elseif (strpos($server['b']['type'], "moh") !== FALSE) { fwrite($lgsl_fp, "\xFF\xFF\xFF\xFF\x02getstatus"); } // mohaa_ mohaab_ mohaas_ mohpa_
+ else { fwrite($lgsl_fp, "\xFF\xFF\xFF\xFFgetstatus"); }
+
+ $buffer = fread($lgsl_fp, 4096);
+
+ if (!$buffer) { return FALSE; }
+
+//---------------------------------------------------------+
+
+ $part = explode("\n", $buffer); // SPLIT INTO PARTS: HEADER/SETTINGS/PLAYERS/FOOTER
+ array_pop($part); // REMOVE FOOTER WHICH IS EITHER NULL OR "\challenge\"
+ $item = explode("\\", $part[1]); // SPLIT PART INTO ITEMS
+
+ foreach ($item as $item_key => $data_key)
+ {
+ if (!($item_key % 2)) { continue; } // SKIP EVEN KEYS
+
+ $data_key = strtolower(lgsl_parse_color($data_key, "1"));
+ $server['e'][$data_key] = lgsl_parse_color($item[$item_key+1], "1");
+ }
+
+//---------------------------------------------------------+
+
+ if (!empty($server['e']['hostname'])) { $server['s']['name'] = $server['e']['hostname']; }
+ if (!empty($server['e']['sv_hostname'])) { $server['s']['name'] = $server['e']['sv_hostname']; }
+
+ if (isset($server['e']['gamename'])) { $server['s']['game'] = $server['e']['gamename']; }
+ if (isset($server['e']['mapname'])) { $server['s']['map'] = $server['e']['mapname']; }
+
+ $server['s']['players'] = empty($part['2']) ? 0 : count($part) - 2;
+
+ if (isset($server['e']['maxclients'])) { $server['s']['playersmax'] = $server['e']['maxclients']; } // QUAKE 2
+ if (isset($server['e']['sv_maxclients'])) { $server['s']['playersmax'] = $server['e']['sv_maxclients']; }
+
+ if (isset($server['e']['pswrd'])) { $server['s']['password'] = $server['e']['pswrd']; } // CALL OF DUTY
+ if (isset($server['e']['needpass'])) { $server['s']['password'] = $server['e']['needpass']; } // QUAKE 2
+ if (isset($server['e']['g_needpass'])) { $server['s']['password'] = $server['e']['g_needpass']; }
+
+ array_shift($part); // REMOVE HEADER
+ array_shift($part); // REMOVE SETTING
+
+//---------------------------------------------------------+
+
+ if ($server['b']['type'] == "nexuiz") // (SCORE) (PING) (TEAM IF TEAM GAME) "(NAME)"
+ {
+ $pattern = "/(.*) (.*) (.*)\"(.*)\"/U"; $fields = array(1=>"score", 2=>"ping", 3=>"team", 4=>"name");
+ }
+ elseif ($server['b']['type'] == "warsow") // (SCORE) (PING) "(NAME)" (TEAM)
+ {
+ $pattern = "/(.*) (.*) \"(.*)\" (.*)/"; $fields = array(1=>"score", 2=>"ping", 3=>"name", 4=>"team");
+ }
+ elseif ($server['b']['type'] == "sof2") // (SCORE) (PING) (DEATHS) "(NAME)"
+ {
+ $pattern = "/(.*) (.*) (.*) \"(.*)\"/"; $fields = array(1=>"score", 2=>"ping", 3=>"deaths", 4=>"name");
+ }
+ elseif (strpos($server['b']['type'], "mohpa") !== FALSE) // (?) (SCORE) (?) (TIME) (?) "(RANK?)" "(NAME)"
+ {
+ $pattern = "/(.*) (.*) (.*) (.*) (.*) \"(.*)\" \"(.*)\"/"; $fields = array(2=>"score", 3=>"deaths", 4=>"time", 6=>"rank", 7=>"name");
+ }
+ elseif (strpos($server['b']['type'], "moh") !== FALSE) // (PING) "(NAME)"
+ {
+ $pattern = "/(.*) \"(.*)\"/"; $fields = array(1=>"ping", 2=>"name");
+ }
+ else // (SCORE) (PING) "(NAME)"
+ {
+ $pattern = "/(.*) (.*) \"(.*)\"/"; $fields = array(1=>"score", 2=>"ping", 3=>"name");
+ }
+
+//---------------------------------------------------------+
+
+ foreach ($part as $player_key => $data)
+ {
+ if (!$data) { continue; }
+
+ preg_match($pattern, $data, $match);
+
+ foreach ($fields as $match_key => $field_name)
+ {
+ if (isset($match[$match_key])) { $server['p'][$player_key][$field_name] = trim($match[$match_key]); }
+ }
+
+ $server['p'][$player_key]['name'] = lgsl_parse_color($server['p'][$player_key]['name'], "1");
+
+ if (isset($server['p'][$player_key]['time']))
+ {
+ $server['p'][$player_key]['time'] = lgsl_time($server['p'][$player_key]['time']);
+ }
+ }
+
+//---------------------------------------------------------+
+
+ return TRUE;
+ }
+
+//------------------------------------------------------------------------------------------------------------+
+//------------------------------------------------------------------------------------------------------------+
+
+ function lgsl_query_03(&$server, &$lgsl_need, &$lgsl_fp)
+ {
+//---------------------------------------------------------+
+
+ // BF1942 BUG: RETURNS 'GHOST' NAMES - TO SKIP THESE WE NEED AN [s] REQUEST FOR AN ACCURATE PLAYER COUNT
+ if ($server['b']['type'] == "bf1942" && $lgsl_need['p'] && !$lgsl_need['s'] && !isset($lgsl_need['sp'])) { $lgsl_need['s'] = TRUE; $lgsl_need['sp'] = TRUE; }
+
+ if ($server['b']['type'] == "cncrenegade") { fwrite($lgsl_fp, "\\status\\"); }
+ elseif ($lgsl_need['s'] || $lgsl_need['e']) { fwrite($lgsl_fp, "\\basic\\\\info\\\\rules\\"); $lgsl_need['s'] = FALSE; $lgsl_need['e'] = FALSE; }
+ elseif ($lgsl_need['p']) { fwrite($lgsl_fp, "\\players\\"); $lgsl_need['p'] = FALSE; }
+
+//---------------------------------------------------------+
+
+ $buffer = "";
+ $packet_count = 0;
+ $packet_total = 20;
+
+ do
+ {
+ $packet = fread($lgsl_fp, 4096);
+
+ // QUERY PORT CHECK AS THE CONNECTION PORT WILL ALSO RESPOND
+ if (strpos($packet, "\\") === FALSE) { return FALSE; }
+
+ // REMOVE SLASH PREFIX
+ if ($packet[0] == "\\") { $packet = substr($packet, 1); }
+
+ while ($packet)
+ {
+ $key = strtolower(lgsl_cut_string($packet, 0, "\\"));
+ $value = trim(lgsl_cut_string($packet, 0, "\\"));
+
+ // CHECK IF KEY IS PLAYER DATA
+ if (preg_match("/(.*)_([0-9]+)$/", $key, $match))
+ {
+ // SEPERATE TEAM NAMES
+ if ($match[1] == "teamname") { $server['t'][$match[2]]['name'] = $value; continue; }
+
+ // CONVERT TO LGSL STANDARD
+ if ($match[1] == "player") { $match[1] = "name"; }
+ elseif ($match[1] == "playername") { $match[1] = "name"; }
+ elseif ($match[1] == "frags") { $match[1] = "score"; }
+ elseif ($match[1] == "ngsecret") { $match[1] = "stats"; }
+
+ $server['p'][$match[2]][$match[1]] = $value; continue;
+ }
+
+ // SEPERATE QUERYID
+ if ($key == "queryid") { $queryid = $value; continue; }
+
+ // SERVER SETTING
+ $server['e'][$key] = $value;
+ }
+
+ // FINAL PACKET NUMBER IS THE TOTAL
+ if (isset($server['e']['final']))
+ {
+ preg_match("/([0-9]+)\.([0-9]+)/", $queryid, $match);
+ $packet_total = intval($match[2]);
+ unset($server['e']['final']);
+ }
+
+ $packet_count ++;
+ }
+ while ($packet_count < $packet_total);
+
+//---------------------------------------------------------+
+
+ if (isset($server['e']['mapname']))
+ {
+ $server['s']['map'] = $server['e']['mapname'];
+
+ if (!empty($server['e']['hostname'])) { $server['s']['name'] = $server['e']['hostname']; }
+ if (!empty($server['e']['sv_hostname'])) { $server['s']['name'] = $server['e']['sv_hostname']; }
+
+ if (isset($server['e']['password'])) { $server['s']['password'] = $server['e']['password']; }
+ if (isset($server['e']['numplayers'])) { $server['s']['players'] = $server['e']['numplayers']; }
+ if (isset($server['e']['maxplayers'])) { $server['s']['playersmax'] = $server['e']['maxplayers']; }
+
+ if (!empty($server['e']['gamename'])) { $server['s']['game'] = $server['e']['gamename']; }
+ if (!empty($server['e']['gameid']) && empty($server['e']['gamename'])) { $server['s']['game'] = $server['e']['gameid']; }
+ if (!empty($server['e']['gameid']) && $server['b']['type'] == "bf1942") { $server['s']['game'] = $server['e']['gameid']; }
+ }
+
+//---------------------------------------------------------+
+
+ if ($server['p'])
+ {
+ // BF1942 BUG - REMOVE 'GHOST' PLAYERS
+ if ($server['b']['type'] == "bf1942" && $server['s']['players'])
+ {
+ $server['p'] = array_slice($server['p'], 0, $server['s']['players']);
+ }
+
+ // OPERATION FLASHPOINT BUG: 'GHOST' PLAYERS IN UN-USED 'TEAM' FIELD
+ if ($server['b']['type'] == "flashpoint")
+ {
+ foreach ($server['p'] as $key => $value)
+ {
+ unset($server['p'][$key]['team']);
+ }
+ }
+
+ // AVP2 BUG: PLAYER NUMBER PREFIXED TO NAMES
+ if ($server['b']['type'] == "avp2")
+ {
+ foreach ($server['p'] as $key => $value)
+ {
+ $server['p'][$key]['name'] = preg_replace("/[0-9]+~/", "", $server['p'][$key]['name']);
+ }
+ }
+
+ // IF TEAM NAMES AVAILABLE USED INSTEAD OF TEAM NUMBERS
+ if (isset($server['t'][0]['name']))
+ {
+ foreach ($server['p'] as $key => $value)
+ {
+ $team_key = $server['p'][$key]['team'] - 1;
+ $server['p'][$key]['team'] = $server['t'][$team_key]['name'];
+ }
+ }
+
+ // RE-INDEX PLAYER KEYS TO REMOVE ANY GAPS
+ $server['p'] = array_values($server['p']);
+ }
+
+ return TRUE;
+ }
+
+//------------------------------------------------------------------------------------------------------------+
+//------------------------------------------------------------------------------------------------------------+
+
+ function lgsl_query_04(&$server, &$lgsl_need, &$lgsl_fp)
+ {
+//---------------------------------------------------------+
+
+ fwrite($lgsl_fp, "REPORT");
+
+ $buffer = fread($lgsl_fp, 4096);
+
+ if (!$buffer) { return FALSE; }
+
+//---------------------------------------------------------+
+
+ $lgsl_ravenshield_key = array(
+ "A1" => "playersmax",
+ "A2" => "tkpenalty",
+ "B1" => "players",
+ "B2" => "allowradar",
+ "D2" => "version",
+ "E1" => "mapname",
+ "E2" => "lid",
+ "F1" => "maptype",
+ "F2" => "gid",
+ "G1" => "password",
+ "G2" => "hostport",
+ "H1" => "dedicated",
+ "H2" => "terroristcount",
+ "I1" => "hostname",
+ "I2" => "aibackup",
+ "J1" => "mapcycletypes",
+ "J2" => "rotatemaponsuccess",
+ "K1" => "mapcycle",
+ "K2" => "forcefirstpersonweapons",
+ "L1" => "players_name",
+ "L2" => "gamename",
+ "L3" => "punkbuster",
+ "M1" => "players_time",
+ "N1" => "players_ping",
+ "O1" => "players_score",
+ "P1" => "queryport",
+ "Q1" => "rounds",
+ "R1" => "roundtime",
+ "S1" => "bombtimer",
+ "T1" => "bomb",
+ "W1" => "allowteammatenames",
+ "X1" => "iserver",
+ "Y1" => "friendlyfire",
+ "Z1" => "autobalance");
+
+//---------------------------------------------------------+
+
+ $item = explode("\xB6", $buffer);
+
+ foreach ($item as $data_value)
+ {
+ $tmp = explode(" ", $data_value, 2);
+ $data_key = isset($lgsl_ravenshield_key[$tmp[0]]) ? $lgsl_ravenshield_key[$tmp[0]] : $tmp[0]; // CONVERT TO DESCRIPTIVE KEYS
+ $server['e'][$data_key] = trim($tmp[1]); // ALL VALUES NEED TRIMMING
+ }
+
+ $server['e']['mapcycle'] = str_replace("/"," ", $server['e']['mapcycle']); // CONVERT SLASH TO SPACE
+ $server['e']['mapcycletypes'] = str_replace("/"," ", $server['e']['mapcycletypes']); // SO LONG LISTS WRAP
+
+//---------------------------------------------------------+
+
+ $server['s']['game'] = $server['e']['gamename'];
+ $server['s']['name'] = $server['e']['hostname'];
+ $server['s']['map'] = $server['e']['mapname'];
+ $server['s']['players'] = $server['e']['players'];
+ $server['s']['playersmax'] = $server['e']['playersmax'];
+ $server['s']['password'] = $server['e']['password'];
+
+//---------------------------------------------------------+
+
+ $player_name = isset($server['e']['players_name']) ? explode("/", substr($server['e']['players_name'], 1)) : array(); unset($server['e']['players_name']);
+ $player_time = isset($server['e']['players_time']) ? explode("/", substr($server['e']['players_time'], 1)) : array(); unset($server['e']['players_time']);
+ $player_ping = isset($server['e']['players_ping']) ? explode("/", substr($server['e']['players_ping'], 1)) : array(); unset($server['e']['players_ping']);
+ $player_score = isset($server['e']['players_score']) ? explode("/", substr($server['e']['players_score'], 1)) : array(); unset($server['e']['players_score']);
+
+ foreach ($player_name as $key => $name)
+ {
+ $server['p'][$key]['name'] = $player_name[$key];
+ $server['p'][$key]['time'] = $player_time[$key];
+ $server['p'][$key]['ping'] = $player_ping[$key];
+ $server['p'][$key]['score'] = $player_score[$key];
+ }
+
+//---------------------------------------------------------+
+
+ return TRUE;
+ }
+
+//------------------------------------------------------------------------------------------------------------+
+//------------------------------------------------------------------------------------------------------------+
+
+ function lgsl_query_05(&$server, &$lgsl_need, &$lgsl_fp)
+ {
+//---------------------------------------------------------+
+// REFERENCE: http://developer.valvesoftware.com/wiki/Server_Queries
+
+ if ($server['b']['type'] == "halflifewon")
+ {
+ if ($lgsl_need['s']) { fwrite($lgsl_fp, "\xFF\xFF\xFF\xFFdetails\x00"); }
+ elseif ($lgsl_need['p']) { fwrite($lgsl_fp, "\xFF\xFF\xFF\xFFplayers\x00"); }
+ elseif ($lgsl_need['e']) { fwrite($lgsl_fp, "\xFF\xFF\xFF\xFFrules\x00"); }
+ }
+ else
+ {
+ $challenge_code = isset($lgsl_need['challenge']) ? $lgsl_need['challenge'] : "\x00\x00\x00\x00";
+
+ if ($lgsl_need['s']) { fwrite($lgsl_fp, "\xFF\xFF\xFF\xFF\x54Source Engine Query\x00"); }
+ elseif ($lgsl_need['p']) { fwrite($lgsl_fp, "\xFF\xFF\xFF\xFF\x55{$challenge_code}"); }
+ elseif ($lgsl_need['e']) { fwrite($lgsl_fp, "\xFF\xFF\xFF\xFF\x56{$challenge_code}"); }
+ }
+
+//---------------------------------------------------------+
+// THE STANDARD HEADER POSITION REVEALS THE TYPE BUT IT MAY NOT ARRIVE FIRST
+// ONCE WE KNOW THE TYPE WE CAN FIND THE TOTAL NUMBER OF PACKETS EXPECTED
+
+ $packet_temp = array();
+ $packet_type = 0;
+ $packet_count = 0;
+ $packet_total = 4;
+
+ do
+ {
+ $packet = fread($lgsl_fp, 4096); if (!$packet) { return FALSE; }
+
+ //---------------------------------------------------------------------------------------------------------------------------------+
+ // NEWER HL1 SERVERS REPLY TO A2S_INFO WITH 3 PACKETS ( HL1 FORMAT INFO, SOURCE FORMAT INFO, PLAYERS )
+ // THIS DISCARDS UN-EXPECTED PACKET FORMATS ON THE GO ( AS READING IN ADVANCE CAUSES TIMEOUT DELAYS FOR OTHER SERVER VERSIONS )
+ // ITS NOT PERFECT AS [s] CAN FLIP BETWEEN HL1 AND SOURCE FORMATS DEPENDING ON ARRIVAL ORDER ( MAYBE FIX WITH RETURN ON HL1 APPID )
+ if ($lgsl_need['s']) { if ($packet[4] == "D") { continue; } }
+ elseif ($lgsl_need['p']) { if ($packet[4] == "m" || $packet[4] == "I") { continue; } }
+ elseif ($lgsl_need['e']) { if ($packet[4] == "m" || $packet[4] == "I" || $packet[4] == "D") { continue; } }
+ //---------------------------------------------------------------------------------------------------------------------------------+
+
+ if (substr($packet, 0, 5) == "\xFF\xFF\xFF\xFF\x41") { $lgsl_need['challenge'] = substr($packet, 5, 4); return TRUE; } // REPEAT WITH GIVEN CHALLENGE CODE
+ elseif (substr($packet, 0, 4) == "\xFF\xFF\xFF\xFF") { $packet_total = 1; $packet_type = 1; } // SINGLE PACKET - HL1 OR HL2
+ elseif (substr($packet, 9, 4) == "\xFF\xFF\xFF\xFF") { $packet_total = ord($packet[8]) & 0xF; $packet_type = 2; } // MULTI PACKET - HL1 ( TOTAL IS LOWER NIBBLE OF BYTE )
+ elseif (substr($packet, 12, 4) == "\xFF\xFF\xFF\xFF") { $packet_total = ord($packet[8]); $packet_type = 3; } // MULTI PACKET - HL2
+ elseif (substr($packet, 18, 2) == "BZ") { $packet_total = ord($packet[8]); $packet_type = 4; } // BZIP PACKET - HL2
+
+ $packet_count ++;
+ $packet_temp[] = $packet;
+ }
+ while ($packet && $packet_count < $packet_total);
+
+ if ($packet_type == 0) { return $server['s'] ? TRUE : FALSE; } // UNKNOWN RESPONSE ( SOME SERVERS ONLY SEND [s] )
+
+//---------------------------------------------------------+
+// WITH THE TYPE WE CAN NOW SORT AND JOIN THE PACKETS IN THE CORRECT ORDER
+// REMOVING ANY EXTRA HEADERS IN THE PROCESS
+
+ $buffer = array();
+
+ foreach ($packet_temp as $packet)
+ {
+ if ($packet_type == 1) { $packet_order = 0; }
+ elseif ($packet_type == 2) { $packet_order = ord($packet[8]) >> 4; $packet = substr($packet, 9); } // ( INDEX IS UPPER NIBBLE OF BYTE )
+ elseif ($packet_type == 3) { $packet_order = ord($packet[9]); $packet = substr($packet, 12); }
+ elseif ($packet_type == 4) { $packet_order = ord($packet[9]); $packet = substr($packet, 18); }
+
+ $buffer[$packet_order] = $packet;
+ }
+
+ ksort($buffer);
+
+ $buffer = implode("", $buffer);
+
+//---------------------------------------------------------+
+// WITH THE PACKETS JOINED WE CAN NOW DECOMPRESS BZIP PACKETS
+// THEN REMOVE THE STANDARD HEADER AND CHECK ITS CORRECT
+
+ if ($packet_type == 4)
+ {
+ if (!function_exists("bzdecompress")) // REQUIRES http://php.net/bzip2
+ {
+ $server['e']['bzip2'] = "unavailable"; $lgsl_need['e'] = FALSE;
+ return TRUE;
+ }
+
+ $buffer = bzdecompress($buffer);
+ }
+
+ $header = lgsl_cut_byte($buffer, 4);
+
+ if ($header != "\xFF\xFF\xFF\xFF") { return FALSE; } // SOMETHING WENT WRONG
+
+//---------------------------------------------------------+
+
+ $response_type = lgsl_cut_byte($buffer, 1);
+
+ if ($response_type == "I") // SOURCE INFO ( HALF-LIFE 2 )
+ {
+ $server['e']['netcode'] = ord(lgsl_cut_byte($buffer, 1));
+ $server['s']['name'] = lgsl_cut_string($buffer);
+ $server['s']['map'] = lgsl_cut_string($buffer);
+ $server['s']['game'] = lgsl_cut_string($buffer);
+ $server['e']['description'] = lgsl_cut_string($buffer);
+ $server['e']['appid'] = lgsl_unpack(lgsl_cut_byte($buffer, 2), "S");
+ $server['s']['players'] = ord(lgsl_cut_byte($buffer, 1));
+ $server['s']['playersmax'] = ord(lgsl_cut_byte($buffer, 1));
+ $server['e']['bots'] = ord(lgsl_cut_byte($buffer, 1));
+ $server['e']['dedicated'] = lgsl_cut_byte($buffer, 1);
+ $server['e']['os'] = lgsl_cut_byte($buffer, 1);
+ $server['s']['password'] = ord(lgsl_cut_byte($buffer, 1));
+ $server['e']['anticheat'] = ord(lgsl_cut_byte($buffer, 1));
+ $server['e']['version'] = lgsl_cut_string($buffer);
+ }
+
+ elseif ($response_type == "m") // HALF-LIFE 1 INFO
+ {
+ $server_ip = lgsl_cut_string($buffer);
+ $server['s']['name'] = lgsl_cut_string($buffer);
+ $server['s']['map'] = lgsl_cut_string($buffer);
+ $server['s']['game'] = lgsl_cut_string($buffer);
+ $server['e']['description'] = lgsl_cut_string($buffer);
+ $server['s']['players'] = ord(lgsl_cut_byte($buffer, 1));
+ $server['s']['playersmax'] = ord(lgsl_cut_byte($buffer, 1));
+ $server['e']['netcode'] = ord(lgsl_cut_byte($buffer, 1));
+ $server['e']['dedicated'] = lgsl_cut_byte($buffer, 1);
+ $server['e']['os'] = lgsl_cut_byte($buffer, 1);
+ $server['s']['password'] = ord(lgsl_cut_byte($buffer, 1));
+
+ if (ord(lgsl_cut_byte($buffer, 1))) // MOD FIELDS ( OFF FOR SOME HALFLIFEWON-VALVE SERVERS )
+ {
+ $server['e']['mod_url_info'] = lgsl_cut_string($buffer);
+ $server['e']['mod_url_download'] = lgsl_cut_string($buffer);
+ $buffer = substr($buffer, 1);
+ $server['e']['mod_version'] = lgsl_unpack(lgsl_cut_byte($buffer, 4), "l");
+ $server['e']['mod_size'] = lgsl_unpack(lgsl_cut_byte($buffer, 4), "l");
+ $server['e']['mod_server_side'] = ord(lgsl_cut_byte($buffer, 1));
+ $server['e']['mod_custom_dll'] = ord(lgsl_cut_byte($buffer, 1));
+ }
+
+ $server['e']['anticheat'] = ord(lgsl_cut_byte($buffer, 1));
+ $server['e']['bots'] = ord(lgsl_cut_byte($buffer, 1));
+ }
+
+ elseif ($response_type == "D") // SOURCE AND HALF-LIFE 1 PLAYERS
+ {
+ $returned = ord(lgsl_cut_byte($buffer, 1));
+
+ $player_key = 0;
+
+ while ($buffer)
+ {
+ $server['p'][$player_key]['pid'] = ord(lgsl_cut_byte($buffer, 1));
+ $server['p'][$player_key]['name'] = lgsl_cut_string($buffer);
+ $server['p'][$player_key]['score'] = lgsl_unpack(lgsl_cut_byte($buffer, 4), "l");
+ $server['p'][$player_key]['time'] = lgsl_time(lgsl_unpack(lgsl_cut_byte($buffer, 4), "f"));
+
+ $player_key ++;
+ }
+ }
+
+ elseif ($response_type == "E") // SOURCE AND HALF-LIFE 1 RULES
+ {
+ $returned = lgsl_unpack(lgsl_cut_byte($buffer, 2), "S");
+
+ while ($buffer)
+ {
+ $item_key = strtolower(lgsl_cut_string($buffer));
+ $item_value = lgsl_cut_string($buffer);
+
+ $server['e'][$item_key] = $item_value;
+ }
+ }
+
+//---------------------------------------------------------+
+
+ // IF ONLY [s] WAS REQUESTED THEN REMOVE INCOMPLETE [e]
+ if ($lgsl_need['s'] && !$lgsl_need['e']) { $server['e'] = array(); }
+
+ if ($lgsl_need['s']) { $lgsl_need['s'] = FALSE; }
+ elseif ($lgsl_need['p']) { $lgsl_need['p'] = FALSE; }
+ elseif ($lgsl_need['e']) { $lgsl_need['e'] = FALSE; }
+
+//---------------------------------------------------------+
+
+ return TRUE;
+ }
+
+//------------------------------------------------------------------------------------------------------------+
+//------------------------------------------------------------------------------------------------------------+
+
+ function lgsl_query_06(&$server, &$lgsl_need, &$lgsl_fp)
+ {
+//---------------------------------------------------------+
+// GET A CHALLENGE CODE IF NEEDED
+
+ $challenge_code = "";
+
+ if ($server['b']['type'] != "bf2" && $server['b']['type'] != "graw")
+ {
+ fwrite($lgsl_fp, "\xFE\xFD\x09\x21\x21\x21\x21\xFF\xFF\xFF\x01");
+
+ $challenge_packet = fread($lgsl_fp, 4096);
+
+ if (!$challenge_packet) { return FALSE; }
+
+ $challenge_code = substr($challenge_packet, 5, -1); // REMOVE HEADER AND TRAILING NULL
+
+ // IF CODE IS RETURNED ( SOME STALKER SERVERS RETURN BLANK WHERE THE CODE IS NOT NEEDED )
+ // CONVERT DECIMAL |TO| HEX AS 8 CHARACTER STRING |TO| 4 PAIRS OF HEX |TO| 4 PAIRS OF DECIMAL |TO| 4 PAIRS OF ASCII
+
+ $challenge_code = $challenge_code ? chr($challenge_code >> 24).chr($challenge_code >> 16).chr($challenge_code >> 8).chr($challenge_code >> 0) : "";
+ }
+
+ fwrite($lgsl_fp, "\xFE\xFD\x00\x21\x21\x21\x21{$challenge_code}\xFF\xFF\xFF\x01");
+
+//---------------------------------------------------------+
+// GET RAW PACKET DATA
+
+ $buffer = array();
+ $packet_count = 0;
+ $packet_total = 4;
+
+ do
+ {
+ $packet_count ++;
+ $packet = fread($lgsl_fp, 4096);
+
+ if (!$packet) { return FALSE; }
+
+ $packet = substr($packet, 14); // REMOVE SPLITNUM HEADER
+ $packet_order = ord(lgsl_cut_byte($packet, 1));
+
+ if ($packet_order >= 128) // LAST PACKET - SO ITS ORDER NUMBER IS ALSO THE TOTAL
+ {
+ $packet_order -= 128;
+ $packet_total = $packet_order + 1;
+ }
+
+ $buffer[$packet_order] = $packet;
+ }
+ while ($packet_count < $packet_total);
+
+//---------------------------------------------------------+
+// PROCESS AND SORT PACKETS
+
+ foreach ($buffer as $key => $packet)
+ {
+ $packet = substr($packet, 0, -1); // REMOVE END NULL FOR JOINING
+
+ if (substr($packet, -1) != "\x00") // LAST VALUE HAS BEEN SPLIT
+ {
+ $part = explode("\x00", $packet); // REMOVE SPLIT VALUE AS COMPLETE VALUE IS IN NEXT PACKET
+ array_pop($part);
+ $packet = implode("\x00", $part)."\x00";
+ }
+
+ if ($packet[0] != "\x00") // PLAYER OR TEAM DATA THAT MAY BE A CONTINUATION
+ {
+ $pos = strpos($packet, "\x00") + 1; // WHEN DATA IS SPLIT THE NEXT PACKET STARTS WITH A REPEAT OF THE FIELD NAME
+
+ if (isset($packet[$pos]) && $packet[$pos] != "\x00") // REPEATED FIELD NAMES END WITH \x00\x?? INSTEAD OF \x00\x00
+ {
+ $packet = substr($packet, $pos + 1); // REMOVE REPEATED FIELD NAME
+ }
+ else
+ {
+ $packet = "\x00".$packet; // RE-ADD NULL AS PACKET STARTS WITH A NEW FIELD
+ }
+ }
+
+ $buffer[$key] = $packet;
+ }
+
+ ksort($buffer);
+
+ $buffer = implode("", $buffer);
+
+//---------------------------------------------------------+
+// SERVER SETTINGS
+
+ $buffer = substr($buffer, 1); // REMOVE HEADER \x00
+
+ while ($key = strtolower(lgsl_cut_string($buffer)))
+ {
+ $server['e'][$key] = lgsl_cut_string($buffer);
+ }
+
+ $lgsl_conversion = array("name"=>"hostname", "game"=>"gamename", "map"=>"mapname", "players"=>"numplayers", "playersmax"=>"maxplayers", "password"=>"password");
+ foreach ($lgsl_conversion as $s => $e) { if (isset($server['e'][$e])) { $server['s'][$s] = $server['e'][$e]; unset($server['e'][$e]); } } // LGSL STANDARD
+
+ if ($server['b']['type'] == "bf2" || $server['b']['type'] == "bf2142") { $server['s']['map'] = ucwords(str_replace("_", " ", $server['s']['map'])); } // MAP NAME CONSISTENCY
+
+ if ($server['s']['players'] == "0") { return TRUE; } // IF SERVER IS EMPTY SKIP THE PLAYER CODE
+
+//---------------------------------------------------------+
+// PLAYER DETAILS
+
+ $buffer = substr($buffer, 1); // REMOVE HEADER \x01
+
+ while ($buffer)
+ {
+ if ($buffer[0] == "\x02") { break; }
+ if ($buffer[0] == "\x00") { $buffer = substr($buffer, 1); break; }
+
+ $field = lgsl_cut_string($buffer, 0, "\x00\x00");
+ $field = strtolower(substr($field, 0, -1));
+
+ if ($field == "player") { $field = "name"; }
+ elseif ($field == "aibot") { $field = "bot"; }
+
+ if ($buffer[0] == "\x00") { $buffer = substr($buffer, 1); continue; }
+
+ $value_list = lgsl_cut_string($buffer, 0, "\x00\x00");
+ $value_list = explode("\x00", $value_list);
+
+ foreach ($value_list as $key => $value)
+ {
+ $server['p'][$key][$field] = $value;
+ }
+ }
+
+//---------------------------------------------------------+
+// TEAM DATA
+
+ $buffer = substr($buffer, 1); // REMOVE HEADER \x02
+
+ while ($buffer)
+ {
+ if ($buffer[0] == "\x00") { break; }
+
+ $field = lgsl_cut_string($buffer, 0, "\x00\x00");
+ $field = strtolower($field);
+
+ if ($field == "team_t") { $field = "name"; }
+ elseif ($field == "score_t") { $field = "score"; }
+
+ $value_list = lgsl_cut_string($buffer, 0, "\x00\x00");
+ $value_list = explode("\x00", $value_list);
+
+ foreach ($value_list as $key => $value)
+ {
+ $server['t'][$key][$field] = $value;
+ }
+ }
+
+//---------------------------------------------------------+
+// TEAM NAME CONVERSION
+
+ if ($server['p'] && isset($server['t'][0]['name']) && $server['t'][0]['name'] != "Team")
+ {
+ foreach ($server['p'] as $key => $value)
+ {
+ if (empty($server['p'][$key]['team'])) { continue; }
+
+ $team_key = $server['p'][$key]['team'] - 1;
+
+ if (!isset($server['t'][$team_key]['name'])) { continue; }
+
+ $server['p'][$key]['team'] = $server['t'][$team_key]['name'];
+ }
+ }
+
+//---------------------------------------------------------+
+
+ return TRUE;
+ }
+
+//------------------------------------------------------------------------------------------------------------+
+//------------------------------------------------------------------------------------------------------------+
+
+ function lgsl_query_07(&$server, &$lgsl_need, &$lgsl_fp)
+ {
+//---------------------------------------------------------+
+
+ fwrite($lgsl_fp, "\xFF\xFF\xFF\xFFstatus\x00");
+
+ $buffer = fread($lgsl_fp, 4096);
+
+ if (!$buffer) { return FALSE; }
+
+//---------------------------------------------------------+
+
+ $buffer = substr($buffer, 6, -2); // REMOVE HEADER AND FOOTER
+ $part = explode("\n", $buffer); // SPLIT INTO SETTINGS/PLAYER/PLAYER/PLAYER
+
+//---------------------------------------------------------+
+
+ $item = explode("\\", $part[0]);
+
+ foreach ($item as $item_key => $data_key)
+ {
+ if ($item_key % 2) { continue; } // SKIP ODD KEYS
+
+ $data_key = strtolower($data_key);
+ $server['e'][$data_key] = $item[$item_key+1];
+ }
+
+//---------------------------------------------------------+
+
+ array_shift($part); // REMOVE SETTINGS
+
+ foreach ($part as $key => $data)
+ {
+ preg_match("/(.*) (.*) (.*) (.*) \"(.*)\" \"(.*)\" (.*) (.*)/s", $data, $match); // GREEDY MATCH FOR SKINS
+
+ $server['p'][$key]['pid'] = $match[1];
+ $server['p'][$key]['score'] = $match[2];
+ $server['p'][$key]['time'] = $match[3];
+ $server['p'][$key]['ping'] = $match[4];
+ $server['p'][$key]['name'] = lgsl_parse_color($match[5], $server['b']['type']);
+ $server['p'][$key]['skin'] = $match[6];
+ $server['p'][$key]['skin_top'] = $match[7];
+ $server['p'][$key]['skin_bottom'] = $match[8];
+ }
+
+//---------------------------------------------------------+
+
+ $server['s']['game'] = $server['e']['*gamedir'];
+ $server['s']['name'] = $server['e']['hostname'];
+ $server['s']['map'] = $server['e']['map'];
+ $server['s']['players'] = $server['p'] ? count($server['p']) : 0;
+ $server['s']['playersmax'] = $server['e']['maxclients'];
+ $server['s']['password'] = isset($server['e']['needpass']) && $server['e']['needpass'] > 0 && $server['e']['needpass'] < 4 ? 1 : 0;
+
+//---------------------------------------------------------+
+
+ return TRUE;
+ }
+
+//------------------------------------------------------------------------------------------------------------+
+//------------------------------------------------------------------------------------------------------------+
+
+ function lgsl_query_08(&$server, &$lgsl_need, &$lgsl_fp)
+ {
+//---------------------------------------------------------+
+
+ fwrite($lgsl_fp, "s"); // ASE ( ALL SEEING EYE ) PROTOCOL
+
+ $buffer = fread($lgsl_fp, 4096);
+
+ if (!$buffer) { return FALSE; }
+
+//---------------------------------------------------------+
+
+ $buffer = substr($buffer, 4); // REMOVE HEADER
+
+ $server['e']['gamename'] = lgsl_cut_pascal($buffer, 1, -1);
+ $server['e']['hostport'] = lgsl_cut_pascal($buffer, 1, -1);
+ $server['s']['name'] = lgsl_parse_color(lgsl_cut_pascal($buffer, 1, -1), $server['b']['type']);
+ $server['e']['gamemode'] = lgsl_cut_pascal($buffer, 1, -1);
+ $server['s']['map'] = lgsl_cut_pascal($buffer, 1, -1);
+ $server['e']['version'] = lgsl_cut_pascal($buffer, 1, -1);
+ $server['s']['password'] = lgsl_cut_pascal($buffer, 1, -1);
+ $server['s']['players'] = lgsl_cut_pascal($buffer, 1, -1);
+ $server['s']['playersmax'] = lgsl_cut_pascal($buffer, 1, -1);
+
+ while ($buffer && $buffer[0] != "\x01")
+ {
+ $item_key = strtolower(lgsl_cut_pascal($buffer, 1, -1));
+ $item_value = lgsl_cut_pascal($buffer, 1, -1);
+
+ $server['e'][$item_key] = $item_value;
+ }
+
+ $buffer = substr($buffer, 1); // REMOVE END MARKER
+
+//---------------------------------------------------------+
+
+ $player_key = 0;
+
+ while ($buffer)
+ {
+ $bit_flags = lgsl_cut_byte($buffer, 1); // FIELDS HARD CODED BELOW BECAUSE GAMES DO NOT USE THEM PROPERLY
+
+ if ($bit_flags == "\x3D") { $field_list = array("name", "score", "", "time"); } // FARCRY PLAYERS CONNECTING
+ elseif ($server['b']['type'] == "farcry") { $field_list = array("name", "team", "", "score", "ping", "time"); } // FARCRY PLAYERS JOINED
+ elseif ($server['b']['type'] == "mta") { $field_list = array("name", "", "", "score", "ping", "" ); }
+ elseif ($server['b']['type'] == "painkiller") { $field_list = array("name", "", "skin", "score", "ping", "" ); }
+ elseif ($server['b']['type'] == "soldat") { $field_list = array("name", "team", "", "score", "ping", "time"); }
+
+ foreach ($field_list as $item_key)
+ {
+ $item_value = lgsl_cut_pascal($buffer, 1, -1);
+
+ if (!$item_key) { continue; }
+
+ if ($item_key == "name") { lgsl_parse_color($item_value, $server['b']['type']); }
+
+ $server['p'][$player_key][$item_key] = $item_value;
+ }
+
+ $player_key ++;
+ }
+
+//---------------------------------------------------------+
+
+ return TRUE;
+ }
+
+//------------------------------------------------------------------------------------------------------------+
+//------------------------------------------------------------------------------------------------------------+
+
+ function lgsl_query_09(&$server, &$lgsl_need, &$lgsl_fp)
+ {
+//---------------------------------------------------------+
+
+ // SERIOUS SAM 2 RETURNS ALL PLAYER NAMES AS "Unknown Player" SO SKIP OR CONVERT ANY PLAYER REQUESTS
+ if ($server['b']['type'] == "serioussam2") { $lgsl_need['p'] = FALSE; if (!$lgsl_need['s'] && !$lgsl_need['e']) { $lgsl_need['s'] = TRUE; } }
+
+//---------------------------------------------------------+
+
+ if ($lgsl_need['s'] || $lgsl_need['e'])
+ {
+ $lgsl_need['s'] = FALSE; $lgsl_need['e'] = FALSE;
+
+ fwrite($lgsl_fp, "\xFE\xFD\x00\x21\x21\x21\x21\xFF\x00\x00\x00");
+
+ $buffer = fread($lgsl_fp, 4096);
+
+ $buffer = substr($buffer, 5, -2); // REMOVE HEADER AND FOOTER
+
+ if (!$buffer) { return FALSE; }
+
+ $item = explode("\x00", $buffer);
+
+ foreach ($item as $item_key => $data_key)
+ {
+ if ($item_key % 2) { continue; } // SKIP EVEN KEYS
+
+ $data_key = strtolower($data_key);
+ $server['e'][$data_key] = $item[$item_key+1];
+ }
+
+ if (isset($server['e']['hostname'])) { $server['s']['name'] = $server['e']['hostname']; }
+ if (isset($server['e']['mapname'])) { $server['s']['map'] = $server['e']['mapname']; }
+ if (isset($server['e']['numplayers'])) { $server['s']['players'] = $server['e']['numplayers']; }
+ if (isset($server['e']['maxplayers'])) { $server['s']['playersmax'] = $server['e']['maxplayers']; }
+ if (isset($server['e']['password'])) { $server['s']['password'] = $server['e']['password']; }
+
+ if (!empty($server['e']['gamename'])) { $server['s']['game'] = $server['e']['gamename']; } // AARMY
+ if (!empty($server['e']['gsgamename'])) { $server['s']['game'] = $server['e']['gsgamename']; } // FEAR
+ if (!empty($server['e']['game_id'])) { $server['s']['game'] = $server['e']['game_id']; } // BFVIETNAM
+
+ if ($server['b']['type'] == "arma" || $server['b']['type'] == "arma2")
+ {
+ $server['s']['map'] = $server['e']['mission'];
+ }
+ elseif ($server['b']['type'] == "vietcong2")
+ {
+ $server['e']['extinfo_autobalance'] = ord($server['e']['extinfo'][18]) == 2 ? "off" : "on";
+ // [ 13 = Vietnam and RPG Mode 19 1b 99 9b ] [ 22 23 = Mounted MG Limit ]
+ // [ 27 = Idle Limit ] [ 18 = Auto Balance ] [ 55 = Chat and Blind Spectator 5a 5c da dc ]
+ }
+ }
+
+//---------------------------------------------------------+
+
+ elseif ($lgsl_need['p'])
+ {
+ $lgsl_need['p'] = FALSE;
+
+ fwrite($lgsl_fp, "\xFE\xFD\x00\x21\x21\x21\x21\x00\xFF\x00\x00");
+
+ $buffer = fread($lgsl_fp, 4096);
+
+ $buffer = substr($buffer, 7, -1); // REMOVE HEADER / PLAYER TOTAL / FOOTER
+
+ if (!$buffer) { return FALSE; }
+
+ if (strpos($buffer, "\x00\x00") === FALSE) { return TRUE; } // NO PLAYERS
+
+ $buffer = explode("\x00\x00",$buffer, 2); // SPLIT FIELDS FROM ITEMS
+ $buffer[0] = str_replace("_", "", $buffer[0]); // REMOVE UNDERSCORES FROM FIELDS
+ $buffer[0] = str_replace("player", "name", $buffer[0]); // LGSL STANDARD
+ $field_list = explode("\x00",$buffer[0]); // SPLIT UP FIELDS
+ $item = explode("\x00",$buffer[1]); // SPLIT UP ITEMS
+
+ $item_position = 0;
+ $item_total = count($item);
+ $player_key = 0;
+
+ do
+ {
+ foreach ($field_list as $field)
+ {
+ $server['p'][$player_key][$field] = $item[$item_position];
+
+ $item_position ++;
+ }
+
+ $player_key ++;
+ }
+ while ($item_position < $item_total);
+ }
+
+//---------------------------------------------------------+
+
+ return TRUE;
+ }
+
+//------------------------------------------------------------------------------------------------------------+
+//------------------------------------------------------------------------------------------------------------+
+
+ function lgsl_query_10(&$server, &$lgsl_need, &$lgsl_fp)
+ {
+//---------------------------------------------------------+
+
+ if ($server['b']['type'] == "quakewars") { fwrite($lgsl_fp, "\xFF\xFFgetInfoEX\xFF"); }
+ else { fwrite($lgsl_fp, "\xFF\xFFgetInfo\xFF"); }
+
+ $buffer = fread($lgsl_fp, 4096);
+
+ if (!$buffer) { return FALSE; }
+
+//---------------------------------------------------------+
+
+ if ($server['b']['type'] == "wolf2009") { $buffer = substr($buffer, 31); } // REMOVE HEADERS
+ elseif ($server['b']['type'] == "quakewars") { $buffer = substr($buffer, 33); }
+ else { $buffer = substr($buffer, 23); }
+
+ $buffer = lgsl_parse_color($buffer, "2");
+
+//---------------------------------------------------------+
+
+ while ($buffer && $buffer[0] != "\x00")
+ {
+ $item_key = strtolower(lgsl_cut_string($buffer));
+ $item_value = lgsl_cut_string($buffer);
+
+ $server['e'][$item_key] = $item_value;
+ }
+
+//---------------------------------------------------------+
+
+ $buffer = substr($buffer, 2);
+
+ $player_key = 0;
+
+//---------------------------------------------------------+
+
+ if ($server['b']['type'] == "wolf2009") // WOLFENSTEIN: (PID)(PING)(NAME)(TAGPOSITION)(TAG)(BOT)
+ {
+ while ($buffer && $buffer[0] != "\x10") // STOPS AT PID 16
+ {
+ $server['p'][$player_key]['pid'] = ord(lgsl_cut_byte($buffer, 1));
+ $server['p'][$player_key]['ping'] = lgsl_unpack(lgsl_cut_byte($buffer, 2), "S");
+ $server['p'][$player_key]['rate'] = lgsl_unpack(lgsl_cut_byte($buffer, 2), "S");
+ $server['p'][$player_key]['unknown'] = lgsl_unpack(lgsl_cut_byte($buffer, 2), "S");
+ $player_name = lgsl_cut_string($buffer);
+ $player_tag_position = ord(lgsl_cut_byte($buffer, 1));
+ $player_tag = lgsl_cut_string($buffer);
+ $server['p'][$player_key]['bot'] = ord(lgsl_cut_byte($buffer, 1));
+
+ if ($player_tag == "") { $server['p'][$player_key]['name'] = $player_name; }
+ elseif ($player_tag_position == "0") { $server['p'][$player_key]['name'] = $player_tag." ".$player_name; }
+ else { $server['p'][$player_key]['name'] = $player_name." ".$player_tag; }
+
+ $player_key ++;
+ }
+ }
+
+//---------------------------------------------------------+
+
+ elseif ($server['b']['type'] == "quakewars") // QUAKEWARS: (PID)(PING)(NAME)(TAGPOSITION)(TAG)(BOT)
+ {
+ while ($buffer && $buffer[0] != "\x20") // STOPS AT PID 32
+ {
+ $server['p'][$player_key]['pid'] = ord(lgsl_cut_byte($buffer, 1));
+ $server['p'][$player_key]['ping'] = lgsl_unpack(lgsl_cut_byte($buffer, 2), "S");
+ $player_name = lgsl_cut_string($buffer);
+ $player_tag_position = ord(lgsl_cut_byte($buffer, 1));
+ $player_tag = lgsl_cut_string($buffer);
+ $server['p'][$player_key]['bot'] = ord(lgsl_cut_byte($buffer, 1));
+
+ if ($player_tag_position == "") { $server['p'][$player_key]['name'] = $player_name; }
+ elseif ($player_tag_position == "1") { $server['p'][$player_key]['name'] = $player_name." ".$player_tag; }
+ else { $server['p'][$player_key]['name'] = $player_tag." ".$player_name; }
+
+ $player_key ++;
+ }
+
+ $buffer = substr($buffer, 1);
+ $server['e']['si_osmask'] = lgsl_unpack(lgsl_cut_byte($buffer, 4), "I");
+ $server['e']['si_ranked'] = ord(lgsl_cut_byte($buffer, 1));
+ $server['e']['si_timeleft'] = lgsl_time(lgsl_unpack(lgsl_cut_byte($buffer, 4), "I") / 1000);
+ $server['e']['si_gamestate'] = ord(lgsl_cut_byte($buffer, 1));
+ $buffer = substr($buffer, 2);
+
+ $player_key = 0;
+
+ while ($buffer && $buffer[0] != "\x20") // QUAKEWARS EXTENDED: (PID)(XP)(TEAM)(KILLS)(DEATHS)
+ {
+ $server['p'][$player_key]['pid'] = ord(lgsl_cut_byte($buffer, 1));
+ $server['p'][$player_key]['xp'] = intval(lgsl_unpack(lgsl_cut_byte($buffer, 4), "f"));
+ $server['p'][$player_key]['team'] = lgsl_cut_string($buffer);
+ $server['p'][$player_key]['score'] = lgsl_unpack(lgsl_cut_byte($buffer, 4), "i");
+ $server['p'][$player_key]['deaths'] = lgsl_unpack(lgsl_cut_byte($buffer, 4), "i");
+ $player_key ++;
+ }
+ }
+
+//---------------------------------------------------------+
+
+ elseif ($server['b']['type'] == "quake4") // QUAKE4: (PID)(PING)(RATE)(NULLNULL)(NAME)(TAG)
+ {
+ while ($buffer && $buffer[0] != "\x20") // STOPS AT PID 32
+ {
+ $server['p'][$player_key]['pid'] = ord(lgsl_cut_byte($buffer, 1));
+ $server['p'][$player_key]['ping'] = lgsl_unpack(lgsl_cut_byte($buffer, 2), "S");
+ $server['p'][$player_key]['rate'] = lgsl_unpack(lgsl_cut_byte($buffer, 2), "S");
+ $buffer = substr($buffer, 2);
+ $player_name = lgsl_cut_string($buffer);
+ $player_tag = lgsl_cut_string($buffer);
+ $server['p'][$player_key]['name'] = $player_tag ? $player_tag." ".$player_name : $player_name;
+
+ $player_key ++;
+ }
+ }
+
+//---------------------------------------------------------+
+
+ else // DOOM3 AND PREY: (PID)(PING)(RATE)(NULLNULL)(NAME)
+ {
+ while ($buffer && $buffer[0] != "\x20") // STOPS AT PID 32
+ {
+ $server['p'][$player_key]['pid'] = ord(lgsl_cut_byte($buffer, 1));
+ $server['p'][$player_key]['ping'] = lgsl_unpack(lgsl_cut_byte($buffer, 2), "S");
+ $server['p'][$player_key]['rate'] = lgsl_unpack(lgsl_cut_byte($buffer, 2), "S");
+ $buffer = substr($buffer, 2);
+ $server['p'][$player_key]['name'] = lgsl_cut_string($buffer);
+
+ $player_key ++;
+ }
+ }
+
+//---------------------------------------------------------+
+
+ $server['s']['game'] = $server['e']['gamename'];
+ $server['s']['name'] = $server['e']['si_name'];
+ $server['s']['map'] = $server['e']['si_map'];
+ $server['s']['players'] = $server['p'] ? count($server['p']) : 0;
+ $server['s']['playersmax'] = $server['e']['si_maxplayers'];
+
+ if ($server['b']['type'] == "wolf2009" || $server['b']['type'] == "quakewars")
+ {
+ $server['s']['map'] = str_replace(".entities", "", $server['s']['map']);
+ $server['s']['password'] = $server['e']['si_needpass'];
+ }
+ else
+ {
+ $server['s']['password'] = $server['e']['si_usepass'];
+ }
+
+//---------------------------------------------------------+
+
+ return TRUE;
+ }
+
+//------------------------------------------------------------------------------------------------------------+
+//------------------------------------------------------------------------------------------------------------+
+
+ function lgsl_query_11(&$server, &$lgsl_need, &$lgsl_fp)
+ {
+//---------------------------------------------------------+
+// REFERENCE: http://wiki.unrealadmin.org/UT3_query_protocol
+// UT3 RESPONSE IS REALLY MESSY SO THIS CLEANS IT UP
+
+ $status = lgsl_query_06($server, $lgsl_need, $lgsl_fp);
+
+ if (!$status) { return FALSE; }
+
+//---------------------------------------------------------+
+
+ $server['s']['map'] = $server['e']['p1073741825'];
+ unset($server['e']['p1073741825']);
+
+//---------------------------------------------------------+
+
+ $lgsl_ut3_key = array(
+ "s0" => "bots_skill",
+ "s6" => "pure",
+ "s7" => "password",
+ "s8" => "bots_vs",
+ "s10" => "forcerespawn",
+ "p268435703" => "bots",
+ "p268435704" => "goalscore",
+ "p268435705" => "timelimit",
+ "p268435717" => "mutators_default",
+ "p1073741826" => "gamemode",
+ "p1073741827" => "description",
+ "p1073741828" => "mutators_custom");
+
+ foreach ($lgsl_ut3_key as $old => $new)
+ {
+ if (!isset($server['e'][$old])) { continue; }
+ $server['e'][$new] = $server['e'][$old];
+ unset($server['e'][$old]);
+ }
+
+//---------------------------------------------------------+
+
+ $part = explode(".", $server['e']['gamemode']);
+
+ if ($part[0] && (stristr($part[0], "UT") === FALSE))
+ {
+ $server['s']['game'] = $part[0];
+ }
+
+//---------------------------------------------------------+
+
+ $tmp = $server['e']['mutators_default'];
+ $server['e']['mutators_default'] = "";
+
+ if ($tmp & 1) { $server['e']['mutators_default'] .= " BigHead"; }
+ if ($tmp & 2) { $server['e']['mutators_default'] .= " FriendlyFire"; }
+ if ($tmp & 4) { $server['e']['mutators_default'] .= " Handicap"; }
+ if ($tmp & 8) { $server['e']['mutators_default'] .= " Instagib"; }
+ if ($tmp & 16) { $server['e']['mutators_default'] .= " LowGrav"; }
+ if ($tmp & 64) { $server['e']['mutators_default'] .= " NoPowerups"; }
+ if ($tmp & 128) { $server['e']['mutators_default'] .= " NoTranslocator"; }
+ if ($tmp & 256) { $server['e']['mutators_default'] .= " Slomo"; }
+ if ($tmp & 1024) { $server['e']['mutators_default'] .= " SpeedFreak"; }
+ if ($tmp & 2048) { $server['e']['mutators_default'] .= " SuperBerserk"; }
+ if ($tmp & 8192) { $server['e']['mutators_default'] .= " WeaponReplacement"; }
+ if ($tmp & 16384) { $server['e']['mutators_default'] .= " WeaponsRespawn"; }
+
+ $server['e']['mutators_default'] = str_replace(" ", " / ", trim($server['e']['mutators_default']));
+ $server['e']['mutators_custom'] = str_replace("\x1c", " / ", $server['e']['mutators_custom']);
+
+//---------------------------------------------------------+
+
+ return TRUE;
+ }
+
+//------------------------------------------------------------------------------------------------------------+
+//------------------------------------------------------------------------------------------------------------+
+
+ function lgsl_query_12(&$server, &$lgsl_need, &$lgsl_fp)
+ {
+//---------------------------------------------------------+
+// REFERENCE:
+// VICE CITY CURRENTLY ONLY SUPPORTS THE 'i' CHALLENGE
+
+ if ($server['b']['type'] == "samp") { $challenge_packet = "SAMP\x21\x21\x21\x21\x00\x00"; }
+ elseif ($server['b']['type'] == "vcmp") { $challenge_packet = "VCMP\x21\x21\x21\x21\x00\x00"; $lgsl_need['e'] = FALSE; $lgsl_need['p'] = FALSE; }
+
+ if ($lgsl_need['s']) { $challenge_packet .= "i"; }
+ elseif ($lgsl_need['e']) { $challenge_packet .= "r"; }
+ elseif ($lgsl_need['p']) { $challenge_packet .= "d"; }
+
+ fwrite($lgsl_fp, $challenge_packet);
+
+ $buffer = fread($lgsl_fp, 4096);
+
+ if (!$buffer) { return FALSE; }
+
+//---------------------------------------------------------+
+
+ $buffer = substr($buffer, 10); // REMOVE HEADER
+
+ $response_type = lgsl_cut_byte($buffer, 1);
+
+//---------------------------------------------------------+
+
+ if ($response_type == "i")
+ {
+ $lgsl_need['s'] = FALSE;
+
+ $server['s']['password'] = ord(lgsl_cut_byte($buffer, 1));
+ $server['s']['players'] = lgsl_unpack(lgsl_cut_byte($buffer, 2), "S");
+ $server['s']['playersmax'] = lgsl_unpack(lgsl_cut_byte($buffer, 2), "S");
+ $server['s']['name'] = lgsl_cut_pascal($buffer, 4);
+ $server['e']['gamemode'] = lgsl_cut_pascal($buffer, 4);
+ $server['s']['map'] = lgsl_cut_pascal($buffer, 4);
+ }
+
+//---------------------------------------------------------+
+
+ elseif ($response_type == "r")
+ {
+ $lgsl_need['e'] = FALSE;
+
+ $item_total = lgsl_unpack(lgsl_cut_byte($buffer, 2), "S");
+
+ for ($i=0; $i<$item_total; $i++)
+ {
+ if (!$buffer) { return FALSE; }
+
+ $data_key = strtolower(lgsl_cut_pascal($buffer));
+ $data_value = lgsl_cut_pascal($buffer);
+
+ $server['e'][$data_key] = $data_value;
+ }
+ }
+
+//---------------------------------------------------------+
+
+ elseif ($response_type == "d")
+ {
+ $lgsl_need['p'] = FALSE;
+
+ $player_total = lgsl_unpack(lgsl_cut_byte($buffer, 2), "S");
+
+ for ($i=0; $i<$player_total; $i++)
+ {
+ if (!$buffer) { return FALSE; }
+
+ $server['p'][$i]['pid'] = ord(lgsl_cut_byte($buffer, 1));
+ $server['p'][$i]['name'] = lgsl_cut_pascal($buffer);
+ $server['p'][$i]['score'] = lgsl_unpack(lgsl_cut_byte($buffer, 4), "S");
+ $server['p'][$i]['ping'] = lgsl_unpack(lgsl_cut_byte($buffer, 4), "S");
+ }
+ }
+
+//---------------------------------------------------------+
+
+ return TRUE;
+ }
+
+//------------------------------------------------------------------------------------------------------------+
+//------------------------------------------------------------------------------------------------------------+
+
+ function lgsl_query_13(&$server, &$lgsl_need, &$lgsl_fp)
+ {
+//---------------------------------------------------------+
+
+ $buffer_s = ""; fwrite($lgsl_fp, "\x21\x21\x21\x21\x00"); // REQUEST [s]
+ $buffer_e = ""; fwrite($lgsl_fp, "\x21\x21\x21\x21\x01"); // REQUEST [e]
+ $buffer_p = ""; fwrite($lgsl_fp, "\x21\x21\x21\x21\x02"); // REQUEST [p]
+
+//---------------------------------------------------------+
+
+ while ($packet = fread($lgsl_fp, 4096))
+ {
+ if ($packet[4] == "\x00") { $buffer_s .= substr($packet, 5); }
+ elseif ($packet[4] == "\x01") { $buffer_e .= substr($packet, 5); }
+ elseif ($packet[4] == "\x02") { $buffer_p .= substr($packet, 5); }
+ }
+
+ if (!$buffer_s) { return FALSE; }
+
+//---------------------------------------------------------+
+// SOME VALUES START WITH A PASCAL LENGTH AND END WITH A NULL BUT THERE IS AN ISSUE WHERE
+// CERTAIN CHARACTERS CAUSE A WRONG PASCAL LENGTH AND NULLS TO APPEAR WITHIN NAMES
+
+ $buffer_s = str_replace("\xa0", "\x20", $buffer_s); // REPLACE SPECIAL SPACE WITH NORMAL SPACE
+ $buffer_s = substr($buffer_s, 5);
+ $server['e']['hostport'] = lgsl_unpack(lgsl_cut_byte($buffer_s, 4), "S");
+ $buffer_s = substr($buffer_s, 4);
+ $server['s']['name'] = lgsl_cut_string($buffer_s, 1);
+ $server['s']['map'] = lgsl_cut_string($buffer_s, 1);
+ $server['e']['gamemode'] = lgsl_cut_string($buffer_s, 1);
+ $server['s']['players'] = lgsl_unpack(lgsl_cut_byte($buffer_s, 4), "S");
+ $server['s']['playersmax'] = lgsl_unpack(lgsl_cut_byte($buffer_s, 4), "S");
+
+//---------------------------------------------------------+
+
+ while ($buffer_e && $buffer_e[0] != "\x00")
+ {
+ $item_key = strtolower(lgsl_cut_string($buffer_e, 1));
+ $item_value = lgsl_cut_string($buffer_e, 1);
+
+ $item_key = str_replace("\x1B\xFF\xFF\x01", "", $item_key); // REMOVE MOD
+ $item_value = str_replace("\x1B\xFF\xFF\x01", "", $item_value); // GARBAGE
+
+ $server['e'][$item_key] = $item_value;
+ }
+
+//---------------------------------------------------------+
+// THIS PROTOCOL RETURNS MORE INFO THAN THE ALTERNATIVE BUT IT DOES NOT
+// RETURN THE GAME NAME ! SO WE HAVE MANUALLY DETECT IT USING THE GAME TYPE
+
+ $tmp = strtolower(substr($server['e']['gamemode'], 0, 2));
+
+ if ($tmp == "ro") { $server['s']['game'] = "Red Orchestra"; }
+ elseif ($tmp == "kf") { $server['s']['game'] = "Killing Floor"; }
+
+ $server['s']['password'] = empty($server['e']['password']) && empty($server['e']['gamepassword']) ? "0" : "1";
+
+//---------------------------------------------------------+
+
+ $player_key = 0;
+
+ while ($buffer_p && $buffer_p[0] != "\x00")
+ {
+ $server['p'][$player_key]['pid'] = lgsl_unpack(lgsl_cut_byte($buffer_p, 4), "S");
+
+ $end_marker = ord($buffer_p[0]) > 64 ? "\x00\x00" : "\x00"; // DIRTY WORK-AROUND FOR NAMES WITH PROBLEM CHARACTERS
+
+ $server['p'][$player_key]['name'] = lgsl_cut_string($buffer_p, 1, $end_marker);
+ $server['p'][$player_key]['ping'] = lgsl_unpack(lgsl_cut_byte($buffer_p, 4), "S");
+ $server['p'][$player_key]['score'] = lgsl_unpack(lgsl_cut_byte($buffer_p, 4), "s");
+ $tmp = lgsl_cut_byte($buffer_p, 4);
+
+ if ($tmp[3] == "\x20") { $server['p'][$player_key]['team'] = 1; }
+ elseif ($tmp[3] == "\x40") { $server['p'][$player_key]['team'] = 2; }
+
+ $player_key ++;
+ }
+
+//---------------------------------------------------------+
+
+ return TRUE;
+ }
+
+//------------------------------------------------------------------------------------------------------------+
+//------------------------------------------------------------------------------------------------------------+
+
+ function lgsl_query_14(&$server, &$lgsl_need, &$lgsl_fp)
+ {
+//---------------------------------------------------------+
+// REFERENCE: http://flstat.cryosphere.co.uk/global-list.php
+
+ fwrite($lgsl_fp, "\x00\x02\xf1\x26\x01\x26\xf0\x90\xa6\xf0\x26\x57\x4e\xac\xa0\xec\xf8\x68\xe4\x8d\x21");
+
+ $buffer = fread($lgsl_fp, 4096);
+
+ if (!$buffer) { return FALSE; }
+
+//---------------------------------------------------------+
+
+ $buffer = substr($buffer, 4); // HEADER ( 00 03 F1 26 )
+ $buffer = substr($buffer, 4); // NOT USED ( 87 + NAME LENGTH )
+ $buffer = substr($buffer, 4); // NOT USED ( NAME END TO BUFFER END LENGTH )
+ $buffer = substr($buffer, 4); // UNKNOWN ( 80 )
+
+ $server['s']['map'] = "freelancer";
+ $server['s']['password'] = lgsl_unpack(lgsl_cut_byte($buffer, 4), "l") - 1 ? 1 : 0;
+ $server['s']['playersmax'] = lgsl_unpack(lgsl_cut_byte($buffer, 4), "l") - 1;
+ $server['s']['players'] = lgsl_unpack(lgsl_cut_byte($buffer, 4), "l") - 1;
+ $buffer = substr($buffer, 4); // UNKNOWN ( 88 )
+ $name_length = lgsl_unpack(lgsl_cut_byte($buffer, 4), "l");
+ $buffer = substr($buffer, 56); // UNKNOWN
+ $server['s']['name'] = lgsl_cut_byte($buffer, $name_length);
+
+ lgsl_cut_string($buffer, 0, ":");
+ lgsl_cut_string($buffer, 0, ":");
+ lgsl_cut_string($buffer, 0, ":");
+ lgsl_cut_string($buffer, 0, ":");
+ lgsl_cut_string($buffer, 0, ":");
+
+ // WHATS LEFT IS THE MOTD
+ $server['e']['motd'] = substr($buffer, 0, -1);
+
+ // REMOVE UTF-8 ENCODING NULLS
+ $server['s']['name'] = str_replace("\x00", "", $server['s']['name']);
+ $server['e']['motd'] = str_replace("\x00", "", $server['e']['motd']);
+
+ // DOES NOT RETURN PLAYER INFORMATION
+
+//---------------------------------------------------------+
+
+ return TRUE;
+ }
+
+//------------------------------------------------------------------------------------------------------------+
+//------------------------------------------------------------------------------------------------------------+
+
+ function lgsl_query_15(&$server, &$lgsl_need, &$lgsl_fp)
+ {
+//---------------------------------------------------------+
+
+ fwrite($lgsl_fp, "GTR2_Direct_IP_Search\x00");
+
+ $buffer = fread($lgsl_fp, 4096);
+
+ if (!$buffer) { return FALSE; }
+
+//---------------------------------------------------------+
+
+ $buffer = str_replace("\xFE", "\xFF", $buffer);
+ $buffer = explode("\xFF", $buffer);
+
+ $server['s']['name'] = $buffer[3];
+ $server['s']['game'] = $buffer[7];
+ $server['e']['version'] = $buffer[11];
+ $server['e']['hostport'] = $buffer[15];
+ $server['s']['map'] = $buffer[19];
+ $server['s']['players'] = $buffer[25];
+ $server['s']['playersmax'] = $buffer[27];
+ $server['e']['gamemode'] = $buffer[31];
+
+ // DOES NOT RETURN PLAYER INFORMATION
+
+//---------------------------------------------------------+
+
+ return TRUE;
+ }
+
+//------------------------------------------------------------------------------------------------------------+
+//------------------------------------------------------------------------------------------------------------+
+
+ function lgsl_query_16(&$server, &$lgsl_need, &$lgsl_fp)
+ {
+//---------------------------------------------------------+
+// REFERENCE:
+// http://www.planetpointy.co.uk/software/rfactorsspy.shtml
+// http://users.pandora.be/viperius/mUtil/
+// USES FIXED DATA POSITIONS WITH RANDOM CHARACTERS FILLING THE GAPS
+
+ fwrite($lgsl_fp, "rF_S");
+
+ $buffer = fread($lgsl_fp, 4096);
+
+ if (!$buffer) { return FALSE; }
+
+//---------------------------------------------------------+
+
+// $server['e']['gamename'] = lgsl_get_string($buffer);
+ $buffer = substr($buffer, 8);
+// $server['e']['fullupdate'] = lgsl_unpack($buffer[0], "C");
+ $server['e']['region'] = lgsl_unpack($buffer[1] .$buffer[2], "S");
+// $server['e']['ip'] = ($buffer[3] .$buffer[4].$buffer[5].$buffer[6]); // UNSIGNED LONG
+// $server['e']['size'] = lgsl_unpack($buffer[7] .$buffer[8], "S");
+ $server['e']['version'] = lgsl_unpack($buffer[9] .$buffer[10], "S");
+// $server['e']['version_racecast'] = lgsl_unpack($buffer[11].$buffer[12], "S");
+ $server['e']['hostport'] = lgsl_unpack($buffer[13].$buffer[14], "S");
+// $server['e']['queryport'] = lgsl_unpack($buffer[15].$buffer[16], "S");
+ $buffer = substr($buffer, 17);
+ $server['s']['game'] = lgsl_get_string($buffer);
+ $buffer = substr($buffer, 20);
+ $server['s']['name'] = lgsl_get_string($buffer);
+ $buffer = substr($buffer, 28);
+ $server['s']['map'] = lgsl_get_string($buffer);
+ $buffer = substr($buffer, 32);
+ $server['e']['motd'] = lgsl_get_string($buffer);
+ $buffer = substr($buffer, 96);
+ $server['e']['packed_aids'] = lgsl_unpack($buffer[0].$buffer[1], "S");
+// $server['e']['ping'] = lgsl_unpack($buffer[2].$buffer[3], "S");
+ $server['e']['packed_flags'] = lgsl_unpack($buffer[4], "C");
+ $server['e']['rate'] = lgsl_unpack($buffer[5], "C");
+ $server['s']['players'] = lgsl_unpack($buffer[6], "C");
+ $server['s']['playersmax'] = lgsl_unpack($buffer[7], "C");
+ $server['e']['bots'] = lgsl_unpack($buffer[8], "C");
+ $server['e']['packed_special'] = lgsl_unpack($buffer[9], "C");
+ $server['e']['damage'] = lgsl_unpack($buffer[10], "C");
+ $server['e']['packed_rules'] = lgsl_unpack($buffer[11].$buffer[12], "S");
+ $server['e']['credits1'] = lgsl_unpack($buffer[13], "C");
+ $server['e']['credits2'] = lgsl_unpack($buffer[14].$buffer[15], "S");
+ $server['e']['time'] = lgsl_time(lgsl_unpack($buffer[16].$buffer[17], "S"));
+ $server['e']['laps'] = lgsl_unpack($buffer[18].$buffer[19], "s") / 16;
+ $buffer = substr($buffer, 23);
+ $server['e']['vehicles'] = lgsl_get_string($buffer);
+
+ // DOES NOT RETURN PLAYER INFORMATION
+
+//---------------------------------------------------------+
+
+ $server['s']['password'] = ($server['e']['packed_special'] & 2) ? 1 : 0;
+ $server['e']['racecast'] = ($server['e']['packed_special'] & 4) ? 1 : 0;
+ $server['e']['fixedsetups'] = ($server['e']['packed_special'] & 16) ? 1 : 0;
+
+ $server['e']['aids'] = "";
+ if ($server['e']['packed_aids'] & 1) { $server['e']['aids'] .= " TractionControl"; }
+ if ($server['e']['packed_aids'] & 2) { $server['e']['aids'] .= " AntiLockBraking"; }
+ if ($server['e']['packed_aids'] & 4) { $server['e']['aids'] .= " StabilityControl"; }
+ if ($server['e']['packed_aids'] & 8) { $server['e']['aids'] .= " AutoShifting"; }
+ if ($server['e']['packed_aids'] & 16) { $server['e']['aids'] .= " AutoClutch"; }
+ if ($server['e']['packed_aids'] & 32) { $server['e']['aids'] .= " Invulnerability"; }
+ if ($server['e']['packed_aids'] & 64) { $server['e']['aids'] .= " OppositeLock"; }
+ if ($server['e']['packed_aids'] & 128) { $server['e']['aids'] .= " SteeringHelp"; }
+ if ($server['e']['packed_aids'] & 256) { $server['e']['aids'] .= " BrakingHelp"; }
+ if ($server['e']['packed_aids'] & 512) { $server['e']['aids'] .= " SpinRecovery"; }
+ if ($server['e']['packed_aids'] & 1024) { $server['e']['aids'] .= " AutoPitstop"; }
+
+ $server['e']['aids'] = str_replace(" ", " / ", trim($server['e']['aids']));
+ $server['e']['vehicles'] = str_replace("|", " / ", trim($server['e']['vehicles']));
+
+ unset($server['e']['packed_aids']);
+ unset($server['e']['packed_flags']);
+ unset($server['e']['packed_special']);
+ unset($server['e']['packed_rules']);
+
+//---------------------------------------------------------+
+
+ return TRUE;
+ }
+
+//------------------------------------------------------------------------------------------------------------+
+//------------------------------------------------------------------------------------------------------------+
+
+ function lgsl_query_17(&$server, &$lgsl_need, &$lgsl_fp)
+ {
+//---------------------------------------------------------+
+// REFERENCE: http://masterserver.savage.s2games.com
+
+ fwrite($lgsl_fp, "\x9e\x4c\x23\x00\x00\xce\x21\x21\x21\x21");
+
+ $buffer = fread($lgsl_fp, 4096);
+
+ if (!$buffer) { return FALSE; }
+
+//---------------------------------------------------------+
+
+ $buffer = substr($buffer, 12); // REMOVE HEADER
+
+ while ($key = strtolower(lgsl_cut_string($buffer, 0, "\xFE")))
+ {
+ if ($key == "players") { break; }
+
+ $value = lgsl_cut_string($buffer, 0, "\xFF");
+ $value = str_replace("\x00", "", $value);
+ $value = lgsl_parse_color($value, $server['b']['type']);
+
+ $server['e'][$key] = $value;
+ }
+
+ $server['s']['name'] = $server['e']['name']; unset($server['e']['name']);
+ $server['s']['map'] = $server['e']['world']; unset($server['e']['world']);
+ $server['s']['players'] = $server['e']['cnum']; unset($server['e']['cnum']);
+ $server['s']['playersmax'] = $server['e']['cmax']; unset($server['e']['cnum']);
+ $server['s']['password'] = $server['e']['pass']; unset($server['e']['cnum']);
+
+//---------------------------------------------------------+
+
+ $server['t'][0]['name'] = $server['e']['race1'];
+ $server['t'][1]['name'] = $server['e']['race2'];
+ $server['t'][2]['name'] = "spectator";
+
+ $team_key = -1;
+ $player_key = 0;
+
+ while ($value = lgsl_cut_string($buffer, 0, "\x0a"))
+ {
+ if ($value[0] == "\x00") { break; }
+ if ($value[0] != "\x20") { $team_key++; continue; }
+
+ $server['p'][$player_key]['name'] = lgsl_parse_color(substr($value, 1), $server['b']['type']);
+ $server['p'][$player_key]['team'] = $server['t'][$team_key]['name'];
+
+ $player_key++;
+ }
+
+//---------------------------------------------------------+
+
+ return TRUE;
+ }
+
+//------------------------------------------------------------------------------------------------------------+
+//------------------------------------------------------------------------------------------------------------+
+
+ function lgsl_query_18(&$server, &$lgsl_need, &$lgsl_fp)
+ {
+//---------------------------------------------------------+
+// REFERENCE: http://masterserver.savage2.s2games.com
+
+ fwrite($lgsl_fp, "\x01");
+
+ $buffer = fread($lgsl_fp, 4096);
+
+ if (!$buffer) { return FALSE; }
+
+//---------------------------------------------------------+
+
+ $buffer = substr($buffer, 12); // REMOVE HEADER
+
+ $server['s']['name'] = lgsl_cut_string($buffer);
+ $server['s']['players'] = ord(lgsl_cut_byte($buffer, 1));
+ $server['s']['playersmax'] = ord(lgsl_cut_byte($buffer, 1));
+ $server['e']['time'] = lgsl_cut_string($buffer);
+ $server['s']['map'] = lgsl_cut_string($buffer);
+ $server['e']['nextmap'] = lgsl_cut_string($buffer);
+ $server['e']['location'] = lgsl_cut_string($buffer);
+ $server['e']['minimum_players'] = ord(lgsl_cut_string($buffer));
+ $server['e']['gamemode'] = lgsl_cut_string($buffer);
+ $server['e']['version'] = lgsl_cut_string($buffer);
+ $server['e']['minimum_level'] = ord(lgsl_cut_byte($buffer, 1));
+
+ // DOES NOT RETURN PLAYER INFORMATION
+
+//---------------------------------------------------------+
+
+ return TRUE;
+ }
+
+//------------------------------------------------------------------------------------------------------------+
+//------------------------------------------------------------------------------------------------------------+
+
+ function lgsl_query_19(&$server, &$lgsl_need, &$lgsl_fp)
+ {
+//---------------------------------------------------------+
+
+ fwrite($lgsl_fp, "\xC0\xDE\xF1\x11\x42\x06\x00\xF5\x03\x21\x21\x21\x21");
+
+ $buffer = fread($lgsl_fp, 4096);
+
+ if (!$buffer) { return FALSE; }
+
+//---------------------------------------------------------+
+
+ $buffer = substr($buffer, 25); // REMOVE HEADER
+
+ $server['s']['name'] = lgsl_get_string(lgsl_cut_pascal($buffer, 4, 3, -3));
+ $server['s']['map'] = lgsl_get_string(lgsl_cut_pascal($buffer, 4, 3, -3));
+ $server['e']['nextmap'] = lgsl_get_string(lgsl_cut_pascal($buffer, 4, 3, -3));
+ $server['e']['gametype'] = lgsl_get_string(lgsl_cut_pascal($buffer, 4, 3, -3));
+
+ $buffer = substr($buffer, 1);
+
+ $server['s']['password'] = ord(lgsl_cut_byte($buffer, 1));
+ $server['s']['playersmax'] = ord(lgsl_cut_byte($buffer, 4));
+ $server['s']['players'] = ord(lgsl_cut_byte($buffer, 4));
+
+//---------------------------------------------------------+
+
+ for ($player_key=0; $player_key<$server['s']['players']; $player_key++)
+ {
+ $server['p'][$player_key]['name'] = lgsl_get_string(lgsl_cut_pascal($buffer, 4, 3, -3));
+ }
+
+//---------------------------------------------------------+
+
+ $buffer = substr($buffer, 17);
+
+ $server['e']['version'] = lgsl_get_string(lgsl_cut_pascal($buffer, 4, 3, -3));
+ $server['e']['mods'] = lgsl_get_string(lgsl_cut_pascal($buffer, 4, 3, -3));
+ $server['e']['dedicated'] = ord(lgsl_cut_byte($buffer, 1));
+ $server['e']['time'] = lgsl_time(lgsl_unpack(lgsl_cut_byte($buffer, 4), "f"));
+ $server['e']['status'] = ord(lgsl_cut_byte($buffer, 4));
+ $server['e']['gamemode'] = ord(lgsl_cut_byte($buffer, 4));
+ $server['e']['motd'] = lgsl_get_string(lgsl_cut_pascal($buffer, 4, 3, -3));
+ $server['e']['respawns'] = ord(lgsl_cut_byte($buffer, 4));
+ $server['e']['time_limit'] = lgsl_time(lgsl_unpack(lgsl_cut_byte($buffer, 4), "f"));
+ $server['e']['voting'] = ord(lgsl_cut_byte($buffer, 4));
+
+ $buffer = substr($buffer, 2);
+
+//---------------------------------------------------------+
+
+ for ($player_key=0; $player_key<$server['s']['players']; $player_key++)
+ {
+ $server['p'][$player_key]['team'] = ord(lgsl_cut_byte($buffer, 4));
+
+ $unknown = ord(lgsl_cut_byte($buffer, 1));
+ }
+
+//---------------------------------------------------------+
+
+ $buffer = substr($buffer, 7);
+
+ $server['e']['platoon_1_color'] = ord(lgsl_cut_byte($buffer, 8));
+ $server['e']['platoon_2_color'] = ord(lgsl_cut_byte($buffer, 8));
+ $server['e']['platoon_3_color'] = ord(lgsl_cut_byte($buffer, 8));
+ $server['e']['platoon_4_color'] = ord(lgsl_cut_byte($buffer, 8));
+ $server['e']['timer_on'] = ord(lgsl_cut_byte($buffer, 1));
+ $server['e']['timer_time'] = lgsl_time(lgsl_unpack(lgsl_cut_byte($buffer, 4), "f"));
+ $server['e']['time_debriefing'] = lgsl_time(lgsl_unpack(lgsl_cut_byte($buffer, 4), "f"));
+ $server['e']['time_respawn_min'] = lgsl_time(lgsl_unpack(lgsl_cut_byte($buffer, 4), "f"));
+ $server['e']['time_respawn_max'] = lgsl_time(lgsl_unpack(lgsl_cut_byte($buffer, 4), "f"));
+ $server['e']['time_respawn_safe'] = lgsl_time(lgsl_unpack(lgsl_cut_byte($buffer, 4), "f"));
+ $server['e']['difficulty'] = ord(lgsl_cut_byte($buffer, 4));
+ $server['e']['respawn_total'] = ord(lgsl_cut_byte($buffer, 4));
+ $server['e']['random_insertions'] = ord(lgsl_cut_byte($buffer, 1));
+ $server['e']['spectators'] = ord(lgsl_cut_byte($buffer, 1));
+ $server['e']['arcademode'] = ord(lgsl_cut_byte($buffer, 1));
+ $server['e']['ai_backup'] = ord(lgsl_cut_byte($buffer, 1));
+ $server['e']['random_teams'] = ord(lgsl_cut_byte($buffer, 1));
+ $server['e']['time_starting'] = lgsl_time(lgsl_unpack(lgsl_cut_byte($buffer, 4), "f"));
+ $server['e']['identify_friends'] = ord(lgsl_cut_byte($buffer, 1));
+ $server['e']['identify_threats'] = ord(lgsl_cut_byte($buffer, 1));
+
+ $buffer = substr($buffer, 5);
+
+ $server['e']['restrictions'] = lgsl_get_string(lgsl_cut_pascal($buffer, 4, 3, -3));
+
+//---------------------------------------------------------+
+
+ switch ($server['e']['status'])
+ {
+ case 3: $server['e']['status'] = "Joining"; break;
+ case 4: $server['e']['status'] = "Joining"; break;
+ case 5: $server['e']['status'] = "Joining"; break;
+ }
+
+ switch ($server['e']['gamemode'])
+ {
+ case 2: $server['e']['gamemode'] = "Co-Op"; break;
+ case 3: $server['e']['gamemode'] = "Solo"; break;
+ case 4: $server['e']['gamemode'] = "Team"; break;
+ }
+
+ switch ($server['e']['respawns'])
+ {
+ case 0: $server['e']['respawns'] = "None"; break;
+ case 1: $server['e']['respawns'] = "Individual"; break;
+ case 2: $server['e']['respawns'] = "Team"; break;
+ case 3: $server['e']['respawns'] = "Infinite"; break;
+ }
+
+ switch ($server['e']['difficulty'])
+ {
+ case 0: $server['e']['difficulty'] = "Recruit"; break;
+ case 1: $server['e']['difficulty'] = "Veteran"; break;
+ case 2: $server['e']['difficulty'] = "Elite"; break;
+ }
+
+//---------------------------------------------------------+
+
+ return TRUE;
+ }
+
+//------------------------------------------------------------------------------------------------------------+
+//------------------------------------------------------------------------------------------------------------+
+
+ function lgsl_query_20(&$server, &$lgsl_need, &$lgsl_fp)
+ {
+//---------------------------------------------------------+
+
+ if ($lgsl_need['s'])
+ {
+ fwrite($lgsl_fp, "\xFF\xFF\xFF\xFFFLSQ");
+ }
+ else
+ {
+ fwrite($lgsl_fp, "\xFF\xFF\xFF\xFF\x57");
+
+ $challenge_packet = fread($lgsl_fp, 4096);
+
+ if (!$challenge_packet) { return FALSE; }
+
+ $challenge_code = substr($challenge_packet, 5, 4);
+
+ if ($lgsl_need['e']) { fwrite($lgsl_fp, "\xFF\xFF\xFF\xFF\x56{$challenge_code}"); }
+ elseif ($lgsl_need['p']) { fwrite($lgsl_fp, "\xFF\xFF\xFF\xFF\x55{$challenge_code}"); }
+ }
+
+ $buffer = fread($lgsl_fp, 4096);
+ $buffer = substr($buffer, 4); // REMOVE HEADER
+
+ if (!$buffer) { return FALSE; }
+
+//---------------------------------------------------------+
+
+ $response_type = lgsl_cut_byte($buffer, 1);
+
+ if ($response_type == "I")
+ {
+ $server['e']['netcode'] = ord(lgsl_cut_byte($buffer, 1));
+ $server['s']['name'] = lgsl_cut_string($buffer);
+ $server['s']['map'] = lgsl_cut_string($buffer);
+ $server['s']['game'] = lgsl_cut_string($buffer);
+ $server['e']['gamemode'] = lgsl_cut_string($buffer);
+ $server['e']['description'] = lgsl_cut_string($buffer);
+ $server['e']['version'] = lgsl_cut_string($buffer);
+ $server['e']['hostport'] = lgsl_unpack(lgsl_cut_byte($buffer, 2), "n");
+ $server['s']['players'] = lgsl_unpack(lgsl_cut_byte($buffer, 1), "C");
+ $server['s']['playersmax'] = lgsl_unpack(lgsl_cut_byte($buffer, 1), "C");
+ $server['e']['dedicated'] = lgsl_cut_byte($buffer, 1);
+ $server['e']['os'] = lgsl_cut_byte($buffer, 1);
+ $server['s']['password'] = lgsl_unpack(lgsl_cut_byte($buffer, 1), "C");
+ $server['e']['anticheat'] = lgsl_unpack(lgsl_cut_byte($buffer, 1), "C");
+ $server['e']['cpu_load'] = round(3.03 * lgsl_unpack(lgsl_cut_byte($buffer, 1), "C"))."%";
+ $server['e']['round'] = lgsl_unpack(lgsl_cut_byte($buffer, 1), "C");
+ $server['e']['roundsmax'] = lgsl_unpack(lgsl_cut_byte($buffer, 1), "C");
+ $server['e']['timeleft'] = lgsl_time(lgsl_unpack(lgsl_cut_byte($buffer, 2), "S") / 250);
+ }
+
+ elseif ($response_type == "E")
+ {
+ $returned = lgsl_unpack(lgsl_cut_byte($buffer, 2), "S");
+
+ while ($buffer)
+ {
+ $item_key = strtolower(lgsl_cut_string($buffer));
+ $item_value = lgsl_cut_string($buffer);
+
+ $server['e'][$item_key] = $item_value;
+ }
+ }
+
+ elseif ($response_type == "D")
+ {
+ $returned = ord(lgsl_cut_byte($buffer, 1));
+
+ $player_key = 0;
+
+ while ($buffer)
+ {
+ $server['p'][$player_key]['pid'] = ord(lgsl_cut_byte($buffer, 1));
+ $server['p'][$player_key]['name'] = lgsl_cut_string($buffer);
+ $server['p'][$player_key]['score'] = lgsl_unpack(lgsl_cut_byte($buffer, 4), "N");
+ $server['p'][$player_key]['time'] = lgsl_time(lgsl_unpack(strrev(lgsl_cut_byte($buffer, 4)), "f"));
+ $server['p'][$player_key]['ping'] = lgsl_unpack(lgsl_cut_byte($buffer, 2), "n");
+ $server['p'][$player_key]['uid'] = lgsl_unpack(lgsl_cut_byte($buffer, 4), "N");
+ $server['p'][$player_key]['team'] = ord(lgsl_cut_byte($buffer, 1));
+
+ $player_key ++;
+ }
+ }
+
+//---------------------------------------------------------+
+
+ if ($lgsl_need['s']) { $lgsl_need['s'] = FALSE; }
+ elseif ($lgsl_need['e']) { $lgsl_need['e'] = FALSE; }
+ elseif ($lgsl_need['p']) { $lgsl_need['p'] = FALSE; }
+
+//---------------------------------------------------------+
+
+ return TRUE;
+ }
+
+//------------------------------------------------------------------------------------------------------------+
+//------------------------------------------------------------------------------------------------------------+
+
+ function lgsl_query_21(&$server, &$lgsl_need, &$lgsl_fp)
+ {
+//---------------------------------------------------------+
+
+ fwrite($lgsl_fp,"\xff\xff\xff\xff\xff\xff\xff\xff\xff\xffgief");
+
+ $buffer = fread($lgsl_fp, 4096);
+ $buffer = substr($buffer, 20); // REMOVE HEADER
+
+ if (!$buffer) { return FALSE; }
+
+//---------------------------------------------------------+
+
+ $server['s']['name'] = lgsl_cut_string($buffer);
+ $server['s']['map'] = lgsl_cut_string($buffer);
+ $server['e']['gamemode'] = lgsl_cut_string($buffer);
+ $server['s']['password'] = lgsl_cut_string($buffer);
+ $server['e']['progress'] = lgsl_cut_string($buffer)."%";
+ $server['s']['players'] = lgsl_cut_string($buffer);
+ $server['s']['playersmax'] = lgsl_cut_string($buffer);
+
+ switch ($server['e']['gamemode'])
+ {
+ case 0: $server['e']['gamemode'] = "Deathmatch"; break;
+ case 1: $server['e']['gamemode'] = "Team Deathmatch"; break;
+ case 2: $server['e']['gamemode'] = "Capture The Flag"; break;
+ }
+
+//---------------------------------------------------------+
+
+ $player_key = 0;
+
+ while ($buffer)
+ {
+ $server['p'][$player_key]['name'] = lgsl_cut_string($buffer);
+ $server['p'][$player_key]['score'] = lgsl_cut_string($buffer);
+
+ $player_key ++;
+ }
+
+//---------------------------------------------------------+
+
+ return TRUE;
+ }
+
+//------------------------------------------------------------------------------------------------------------+
+//------------------------------------------------------------------------------------------------------------+
+
+ function lgsl_query_22(&$server, &$lgsl_need, &$lgsl_fp)
+ {
+//---------------------------------------------------------+
+
+ fwrite($lgsl_fp,"\x03\x00\x00");
+
+ $buffer = fread($lgsl_fp, 4096);
+ $buffer = substr($buffer, 3); // REMOVE HEADER
+
+ if (!$buffer) { return FALSE; }
+
+ $response_type = ord(lgsl_cut_byte($buffer, 1)); // TYPE SHOULD BE 4
+
+//---------------------------------------------------------+
+
+ $grf_count = ord(lgsl_cut_byte($buffer, 1));
+
+ for ($a=0; $a<$grf_count; $a++)
+ {
+ $server['e']['grf_'.$a.'_id'] = strtoupper(dechex(lgsl_unpack(lgsl_cut_byte($buffer, 4), "N")));
+
+ for ($b=0; $b<16; $b++)
+ {
+ $server['e']['grf_'.$a.'_md5'] .= strtoupper(dechex(ord(lgsl_cut_byte($buffer, 1))));
+ }
+ }
+
+//---------------------------------------------------------+
+
+ $server['e']['date_current'] = lgsl_unpack(lgsl_cut_byte($buffer, 4), "L");
+ $server['e']['date_start'] = lgsl_unpack(lgsl_cut_byte($buffer, 4), "L");
+ $server['e']['companies_max'] = ord(lgsl_cut_byte($buffer, 1));
+ $server['e']['companies'] = ord(lgsl_cut_byte($buffer, 1));
+ $server['e']['spectators_max'] = ord(lgsl_cut_byte($buffer, 1));
+ $server['s']['name'] = lgsl_cut_string($buffer);
+ $server['e']['version'] = lgsl_cut_string($buffer);
+ $server['e']['language'] = ord(lgsl_cut_byte($buffer, 1));
+ $server['s']['password'] = ord(lgsl_cut_byte($buffer, 1));
+ $server['s']['playersmax'] = ord(lgsl_cut_byte($buffer, 1));
+ $server['s']['players'] = ord(lgsl_cut_byte($buffer, 1));
+ $server['e']['spectators'] = ord(lgsl_cut_byte($buffer, 1));
+ $server['s']['map'] = lgsl_cut_string($buffer);
+ $server['e']['map_width'] = lgsl_unpack(lgsl_cut_byte($buffer, 2), "S");
+ $server['e']['map_height'] = lgsl_unpack(lgsl_cut_byte($buffer, 2), "S");
+ $server['e']['map_set'] = ord(lgsl_cut_byte($buffer, 1));
+ $server['e']['dedicated'] = ord(lgsl_cut_byte($buffer, 1));
+
+ // DOES NOT RETURN PLAYER INFORMATION
+
+//---------------------------------------------------------+
+
+ return TRUE;
+ }
+
+//------------------------------------------------------------------------------------------------------------+
+//------------------------------------------------------------------------------------------------------------+
+
+ function lgsl_query_23(&$server, &$lgsl_need, &$lgsl_fp)
+ {
+//---------------------------------------------------------+
+// REFERENCE:
+// http://siteinthe.us
+// http://www.tribesmasterserver.com
+
+ fwrite($lgsl_fp, "b++");
+
+ $buffer = fread($lgsl_fp, 4096);
+
+ if (!$buffer) { return FALSE; }
+
+ $buffer = substr($buffer, 4); // REMOVE HEADER
+
+//---------------------------------------------------------+
+
+ $server['s']['game'] = lgsl_cut_pascal($buffer);
+ $server['e']['version'] = lgsl_cut_pascal($buffer);
+ $server['s']['name'] = lgsl_cut_pascal($buffer);
+ $server['e']['dedicated'] = ord(lgsl_cut_byte($buffer, 1));
+ $server['s']['password'] = ord(lgsl_cut_byte($buffer, 1));
+ $server['s']['players'] = ord(lgsl_cut_byte($buffer, 1));
+ $server['s']['playersmax'] = ord(lgsl_cut_byte($buffer, 1));
+ $server['e']['cpu'] = lgsl_unpack(lgsl_cut_byte($buffer, 2), "S");
+ $server['e']['mod'] = lgsl_cut_pascal($buffer);
+ $server['e']['type'] = lgsl_cut_pascal($buffer);
+ $server['s']['map'] = lgsl_cut_pascal($buffer);
+ $server['e']['motd'] = lgsl_cut_pascal($buffer);
+ $server['e']['teams'] = ord(lgsl_cut_byte($buffer, 1));
+
+//---------------------------------------------------------+
+
+ $team_field = "?".lgsl_cut_pascal($buffer);
+ $team_field = split("\t", $team_field);
+
+ foreach ($team_field as $key => $value)
+ {
+ $value = substr($value, 1);
+ $value = strtolower($value);
+ $team_field[$key] = $value;
+ }
+
+//---------------------------------------------------------+
+
+ $player_field = "?".lgsl_cut_pascal($buffer);
+ $player_field = split("\t", $player_field);
+
+ foreach ($player_field as $key => $value)
+ {
+ $value = substr($value, 1);
+ $value = strtolower($value);
+
+ if ($value == "player name") { $value = "name"; }
+
+ $player_field[$key] = $value;
+ }
+
+ $player_field[] = "unknown_1";
+ $player_field[] = "unknown_2";
+
+//---------------------------------------------------------+
+
+ for ($i=0; $i<$server['e']['teams']; $i++)
+ {
+ $team_name = lgsl_cut_pascal($buffer);
+ $team_info = lgsl_cut_pascal($buffer);
+
+ if (!$team_info) { continue; }
+
+ $team_info = str_replace("%t", $team_name, $team_info);
+ $team_info = split("\t", $team_info);
+
+ foreach ($team_info as $key => $value)
+ {
+ $field = $team_field[$key];
+ $value = trim($value);
+
+ if ($field == "team name") { $field = "name"; }
+
+ $server['t'][$i][$field] = $value;
+ }
+ }
+
+//---------------------------------------------------------+
+
+ for ($i=0; $i<$server['s']['players']; $i++)
+ {
+ $player_bits = array();
+ $player_bits[] = ord(lgsl_cut_byte($buffer, 1)) * 4; // %p = PING
+ $player_bits[] = ord(lgsl_cut_byte($buffer, 1)); // %l = PACKET LOSS
+ $player_bits[] = ord(lgsl_cut_byte($buffer, 1)); // %t = TEAM
+ $player_bits[] = lgsl_cut_pascal($buffer); // %n = PLAYER NAME
+ $player_info = lgsl_cut_pascal($buffer);
+
+ if (!$player_info) { continue; }
+
+ $player_info = str_replace(array("%p","%l","%t","%n"), $player_bits, $player_info);
+ $player_info = split("\t", $player_info);
+
+ foreach ($player_info as $key => $value)
+ {
+ $field = $player_field[$key];
+ $value = trim($value);
+
+ if ($field == "team") { $value = $server['t'][$value]['name']; }
+
+ $server['p'][$i][$field] = $value;
+ }
+ }
+
+//---------------------------------------------------------+
+
+ return TRUE;
+ }
+
+//------------------------------------------------------------------------------------------------------------+
+//------------------------------------------------------------------------------------------------------------+
+
+ function lgsl_query_24(&$server, &$lgsl_need, &$lgsl_fp)
+ {
+//---------------------------------------------------------+
+// REFERENCE: http://cubelister.sourceforge.net
+
+ fwrite($lgsl_fp, "\x21\x21");
+
+ $buffer = fread($lgsl_fp, 4096);
+
+ if (!$buffer) { return FALSE; }
+
+ $buffer = substr($buffer, 2); // REMOVE HEADER
+
+//---------------------------------------------------------+
+
+ if ($buffer[0] == "\x1b") // CUBE 1
+ {
+ // RESPONSE IS XOR ENCODED FOR SOME STRANGE REASON
+ for ($i=0; $i $field)
+ {
+ $field = strtolower($field);
+
+ preg_match("/^player(.*)(\d+)$/U", $field, $match);
+
+ if (isset($match[1]))
+ {
+ // IGNORE POINTLESS PLAYER FIELDS
+ if ($match[1] == "mapname") { continue; }
+ if ($match[1] == "version") { continue; }
+ if ($match[1] == "servermapname") { continue; }
+ if ($match[1] == "serveripaddress") { continue; }
+
+ // LGSL STANDARD ( SWAP NAME AS ITS ACTUALLY THE ACCOUNT NAME )
+ if ($match[1] == "name") { $match[1] = "username"; }
+ if ($match[1] == "soldiername") { $match[1] = "name"; }
+
+ $server['p'][$match[2]][$match[1]] = $raw['attributeValues'][$key];
+ }
+ else
+ {
+ if (substr($field, 0, 6) == "server") { $field = substr($field, 6); }
+ $server['e'][$field] = $raw['attributeValues'][$key];
+ }
+ }
+
+ $lgsl_conversion = array("gamename"=>"name","mapname"=>"map","playercount"=>"players","maxplayers"=>"playersmax","flagpassword"=>"password");
+ foreach ($lgsl_conversion as $e => $s) { $server['s'][$s] = $server['e'][$e]; unset($server['ea'][$e]); } // LGSL STANDARD
+ $server['s']['playersmax'] += intval($server['e']['maxspectators']); // ADD SPECTATOR SLOTS TO MAX PLAYERS
+
+//---------------------------------------------------------+
+
+ return TRUE;
+ }
+
+//------------------------------------------------------------------------------------------------------------+
+//------------------------------------------------------------------------------------------------------------+
+
+ function lgsl_query_27(&$server, &$lgsl_need, &$lgsl_fp)
+ {
+//---------------------------------------------------------+
+// REFERENCE:
+// http://skulltag.com/wiki/Launcher_protocol
+// http://en.wikipedia.org/wiki/Huffman_coding
+// http://www.greycube.com/help/lgsl_other/skulltag_huffman.txt
+
+ $huffman_table = array(
+ "010","110111","101110010","00100","10011011","00101","100110101","100001100","100101100","001110100","011001001","11001000","101100001","100100111","001111111","101110000","101110001","001111011",
+ "11011011","101111100","100001110","110011111","101100000","001111100","0011000","001111000","10001100","100101011","100010000","101111011","100100110","100110010","0111","1111000","00010001",
+ "00011010","00011000","00010101","00010000","00110111","00110110","00011100","01100101","1101001","00110100","10110011","10110100","1111011","10111100","10111010","11001001","11010101","11111110",
+ "11111100","10001110","11110011","001101011","10000000","000101101","11010000","001110111","100000010","11100111","001100101","11100110","00111001","10001010","00010011","001110110","10001111",
+ "000111110","11000111","11010111","11100011","000101000","001100111","11010100","000111010","10010111","100000111","000100100","001110001","11111010","100100011","11110100","000110111","001111010",
+ "100010011","100110001","11101","110001011","101110110","101111110","100100010","100101001","01101","100100100","101100101","110100011","100111100","110110001","100010010","101101101","011001110",
+ "011001101","11111101","100010001","100110000","110001000","110110000","0001001010","110001010","101101010","000110110","10110001","110001101","110101101","110001100","000111111","110010101",
+ "111000100","11011001","110010110","110011110","000101100","001110101","101111101","1001110","0000","1000010","0001110111","0001100101","1010","11001110","0110011000","0110011001","1000011011",
+ "1001100110","0011110011","0011001100","11111001","0110010001","0001010011","1000011010","0001001011","1001101001","101110111","1000001101","1000011111","1100000101","0110000000","1011011101",
+ "11110101","0001111011","1101000101","1101000100","1001000010","0110000001","1011001000","100101010","1100110","111100101","1100101111","0001100111","1110000","0011111100","11111011","1100101110",
+ "101110011","1001100111","1001111111","1011011100","111110001","101111010","1011010110","1001010000","1001000011","1001111110","0011111011","1000011110","1000101100","01100001","00010111",
+ "1000000110","110000101","0001111010","0011001101","0110011110","110010100","111000101","0011001001","0011110010","110000001","101101111","0011111101","110110100","11100100","1011001001",
+ "0011001000","0001110110","111111111","110101100","111111110","1000001011","1001011010","110000000","000111100","111110000","011000001","1001111010","111001011","011000111","1001000001",
+ "1001111100","1000110111","1001101000","0110001100","1001111011","0011010101","1000101101","0011111010","0001100100","01100010","110000100","101101100","0110011111","1001011011","1000101110",
+ "111100100","1000110110","0110001101","1001000000","110110101","1000001000","1000001001","1100000100","110001001","1000000111","1001111101","111001010","0011010100","1000101111","101111111",
+ "0001010010","0011100000","0001100110","1000001010","0011100001","11000011","1011010111","1000001100","100011010","0110010000","100100101","1001010001","110000011");
+
+//---------------------------------------------------------+
+
+ fwrite($lgsl_fp, "\x02\xB8\x49\x1A\x9C\x8B\xB5\x3F\x1E\x8F\x07");
+
+ $packet = fread($lgsl_fp, 4096);
+
+ if (!$packet) { return FALSE; }
+
+ $packet = substr($packet, 1); // REMOVE HEADER
+
+//---------------------------------------------------------+
+
+ $packet_binary = "";
+
+ for ($i=0; $i $huffman_binary)
+ {
+ $huffman_length = strlen($huffman_binary);
+
+ if (substr($packet_binary, 0, $huffman_length) === $huffman_binary)
+ {
+ $packet_binary = substr($packet_binary, $huffman_length);
+ $buffer .= chr($ascii);
+ continue 2;
+ }
+ }
+ break;
+ }
+
+//---------------------------------------------------------+
+
+ $response_status = lgsl_unpack(lgsl_cut_byte($buffer, 4), "l"); if ($response_status != "5660023") { return FALSE; }
+ $response_time = lgsl_unpack(lgsl_cut_byte($buffer, 4), "l");
+ $server['e']['version'] = lgsl_cut_string($buffer);
+ $response_flag = lgsl_unpack(lgsl_cut_byte($buffer, 4), "l");
+
+//---------------------------------------------------------+
+
+ if ($response_flag & 0x00000001) { $server['s']['name'] = lgsl_cut_string($buffer); }
+ if ($response_flag & 0x00000002) { $server['e']['wadurl'] = lgsl_cut_string($buffer); }
+ if ($response_flag & 0x00000004) { $server['e']['email'] = lgsl_cut_string($buffer); }
+ if ($response_flag & 0x00000008) { $server['s']['map'] = lgsl_cut_string($buffer); }
+ if ($response_flag & 0x00000010) { $server['s']['playersmax'] = ord(lgsl_cut_byte($buffer, 1)); }
+ if ($response_flag & 0x00000020) { $server['e']['playersmax'] = ord(lgsl_cut_byte($buffer, 1)); }
+ if ($response_flag & 0x00000040)
+ {
+ $pwad_total = ord(lgsl_cut_byte($buffer, 1));
+
+ $server['e']['pwads'] = "";
+
+ for ($i=0; $i<$pwad_total; $i++)
+ {
+ $server['e']['pwads'] .= lgsl_cut_string($buffer)." ";
+ }
+ }
+ if ($response_flag & 0x00000080)
+ {
+ $server['e']['gametype'] = ord(lgsl_cut_byte($buffer, 1));
+ $server['e']['instagib'] = ord(lgsl_cut_byte($buffer, 1));
+ $server['e']['buckshot'] = ord(lgsl_cut_byte($buffer, 1));
+ }
+ if ($response_flag & 0x00000100) { $server['s']['game'] = lgsl_cut_string($buffer); }
+ if ($response_flag & 0x00000200) { $server['e']['iwad'] = lgsl_cut_string($buffer); }
+ if ($response_flag & 0x00000400) { $server['s']['password'] = ord(lgsl_cut_byte($buffer, 1)); }
+ if ($response_flag & 0x00000800) { $server['e']['playpassword'] = ord(lgsl_cut_byte($buffer, 1)); }
+ if ($response_flag & 0x00001000) { $server['e']['skill'] = ord(lgsl_cut_byte($buffer, 1)) + 1; }
+ if ($response_flag & 0x00002000) { $server['e']['botskill'] = ord(lgsl_cut_byte($buffer, 1)) + 1; }
+ if ($response_flag & 0x00004000)
+ {
+ $server['e']['dmflags'] = lgsl_unpack(lgsl_cut_byte($buffer, 4), "l");
+ $server['e']['dmflags2'] = lgsl_unpack(lgsl_cut_byte($buffer, 4), "l");
+ $server['e']['compatflags'] = lgsl_unpack(lgsl_cut_byte($buffer, 4), "l");
+ }
+ if ($response_flag & 0x00010000)
+ {
+ $server['e']['fraglimit'] = lgsl_unpack(lgsl_cut_byte($buffer, 2), "s");
+ $timelimit = lgsl_unpack(lgsl_cut_byte($buffer, 2), "S");
+
+ if ($timelimit) // FUTURE VERSION MAY ALWAYS RETURN THIS
+ {
+ $server['e']['timeleft'] = lgsl_time(lgsl_unpack(lgsl_cut_byte($buffer, 2), "S") * 60);
+ }
+
+ $server['e']['timelimit'] = lgsl_time($timelimit * 60);
+ $server['e']['duellimit'] = lgsl_unpack(lgsl_cut_byte($buffer, 2), "s");
+ $server['e']['pointlimit'] = lgsl_unpack(lgsl_cut_byte($buffer, 2), "s");
+ $server['e']['winlimit'] = lgsl_unpack(lgsl_cut_byte($buffer, 2), "s");
+ }
+ if ($response_flag & 0x00020000) { $server['e']['teamdamage'] = lgsl_unpack(lgsl_cut_byte($buffer, 4), "f"); }
+ if ($response_flag & 0x00040000) // DEPRECIATED
+ {
+ $server['t'][0]['score'] = lgsl_unpack(lgsl_cut_byte($buffer, 2), "s");
+ $server['t'][1]['score'] = lgsl_unpack(lgsl_cut_byte($buffer, 2), "s");
+ }
+ if ($response_flag & 0x00080000) { $server['s']['players'] = ord(lgsl_cut_byte($buffer, 1)); }
+ if ($response_flag & 0x00100000)
+ {
+ for ($i=0; $i<$server['s']['players']; $i++)
+ {
+ $server['p'][$i]['name'] = lgsl_parse_color(lgsl_cut_string($buffer), $server['b']['type']);
+ $server['p'][$i]['score'] = lgsl_unpack(lgsl_cut_byte($buffer, 2), "s");
+ $server['p'][$i]['ping'] = lgsl_unpack(lgsl_cut_byte($buffer, 2), "S");
+ $server['p'][$i]['spectator'] = ord(lgsl_cut_byte($buffer, 1));
+ $server['p'][$i]['bot'] = ord(lgsl_cut_byte($buffer, 1));
+
+ if (($response_flag & 0x00200000) && ($response_flag & 0x00400000))
+ {
+ $server['p'][$i]['team'] = ord(lgsl_cut_byte($buffer, 1));
+ }
+
+ $server['p'][$i]['time'] = lgsl_time(ord(lgsl_cut_byte($buffer, 1)) * 60);
+ }
+ }
+ if ($response_flag & 0x00200000)
+ {
+ $team_total = ord(lgsl_cut_byte($buffer, 1));
+
+ if ($response_flag & 0x00400000)
+ {
+ for ($i=0; $i<$team_total; $i++) { $server['t'][$i]['name'] = lgsl_cut_string($buffer); }
+ }
+ if ($response_flag & 0x00800000)
+ {
+ for ($i=0; $i<$team_total; $i++) { $server['t'][$i]['color'] = lgsl_unpack(lgsl_cut_byte($buffer, 4), "l"); }
+ }
+ if ($response_flag & 0x01000000)
+ {
+ for ($i=0; $i<$team_total; $i++) { $server['t'][$i]['score'] = lgsl_unpack(lgsl_cut_byte($buffer, 2), "s"); }
+ }
+
+ for ($i=0; $i<$server['s']['players']; $i++)
+ {
+ if ($server['t'][$i]['name']) { $server['p'][$i]['team'] = $server['t'][$i]['name']; }
+ }
+ }
+
+//---------------------------------------------------------+
+
+ return TRUE;
+ }
+
+//------------------------------------------------------------------------------------------------------------+
+//------------------------------------------------------------------------------------------------------------+
+
+ function lgsl_query_28(&$server, &$lgsl_need, &$lgsl_fp)
+ {
+//---------------------------------------------------------+
+// REFERENCE: http://doomutils.ucoz.com
+
+ fwrite($lgsl_fp, "\xA3\xDB\x0B\x00"."\xFC\xFD\xFE\xFF"."\x01\x00\x00\x00"."\x21\x21\x21\x21");
+
+ $buffer = fread($lgsl_fp, 4096);
+
+ if (!$buffer) { return FALSE; }
+
+//---------------------------------------------------------+
+
+ $response_status = lgsl_unpack(lgsl_cut_byte($buffer, 4), "l"); if ($response_status != "5560022") { return FALSE; }
+ $response_version = lgsl_unpack(lgsl_cut_byte($buffer, 4), "l");
+ $response_time = lgsl_unpack(lgsl_cut_byte($buffer, 4), "l");
+
+ $server['e']['invited'] = ord(lgsl_cut_byte($buffer, 1));
+ $server['e']['version'] = lgsl_unpack(lgsl_cut_byte($buffer, 2), "S");
+ $server['s']['name'] = lgsl_cut_string($buffer);
+ $server['s']['players'] = ord(lgsl_cut_byte($buffer, 1));
+ $server['s']['playersmax'] = ord(lgsl_cut_byte($buffer, 1));
+ $server['s']['map'] = lgsl_cut_string($buffer);
+
+ $pwad_total = ord(lgsl_cut_byte($buffer, 1));
+
+ for ($i=0; $i<$pwad_total; $i++)
+ {
+ $server['e']['pwads'] .= lgsl_cut_string($buffer)." ";
+ $pwad_optional = ord(lgsl_cut_byte($buffer, 1));
+ $pwad_alternative = lgsl_cut_string($buffer);
+ }
+
+ $server['e']['gametype'] = ord(lgsl_cut_byte($buffer, 1));
+ $server['s']['game'] = lgsl_cut_string($buffer);
+ $server['e']['iwad'] = lgsl_cut_string($buffer);
+ $iwad_altenative = lgsl_cut_string($buffer);
+ $server['e']['skill'] = ord(lgsl_cut_byte($buffer, 1)) + 1;
+ $server['e']['wadurl'] = lgsl_cut_string($buffer);
+ $server['e']['email'] = lgsl_cut_string($buffer);
+ $server['e']['dmflags'] = lgsl_unpack(lgsl_cut_byte($buffer, 4), "l");
+ $server['e']['dmflags2'] = lgsl_unpack(lgsl_cut_byte($buffer, 4), "l");
+ $server['s']['password'] = ord(lgsl_cut_byte($buffer, 1));
+ $server['e']['inviteonly'] = ord(lgsl_cut_byte($buffer, 1));
+ $server['e']['players'] = ord(lgsl_cut_byte($buffer, 1));
+ $server['e']['playersmax'] = ord(lgsl_cut_byte($buffer, 1));
+ $server['e']['timelimit'] = lgsl_time(lgsl_unpack(lgsl_cut_byte($buffer, 2), "S") * 60);
+ $server['e']['timeleft'] = lgsl_time(lgsl_unpack(lgsl_cut_byte($buffer, 2), "S") * 60);
+ $server['e']['fraglimit'] = lgsl_unpack(lgsl_cut_byte($buffer, 2), "s");
+ $server['e']['gravity'] = lgsl_unpack(lgsl_cut_byte($buffer, 4), "f");
+ $server['e']['aircontrol'] = lgsl_unpack(lgsl_cut_byte($buffer, 4), "f");
+ $server['e']['playersmin'] = ord(lgsl_cut_byte($buffer, 1));
+ $server['e']['removebots'] = ord(lgsl_cut_byte($buffer, 1));
+ $server['e']['voting'] = ord(lgsl_cut_byte($buffer, 1));
+ $server['e']['serverinfo'] = lgsl_cut_string($buffer);
+ $server['e']['startup'] = lgsl_unpack(lgsl_cut_byte($buffer, 4), "l");
+
+ for ($i=0; $i<$server['s']['players']; $i++)
+ {
+ $server['p'][$i]['name'] = lgsl_cut_string($buffer);
+ $server['p'][$i]['score'] = lgsl_unpack(lgsl_cut_byte($buffer, 2), "s");
+ $server['p'][$i]['death'] = lgsl_unpack(lgsl_cut_byte($buffer, 2), "s");
+ $server['p'][$i]['ping'] = lgsl_unpack(lgsl_cut_byte($buffer, 2), "S");
+ $server['p'][$i]['time'] = lgsl_time(lgsl_unpack(lgsl_cut_byte($buffer, 2), "S") * 60);
+ $server['p'][$i]['bot'] = ord(lgsl_cut_byte($buffer, 1));
+ $server['p'][$i]['spectator'] = ord(lgsl_cut_byte($buffer, 1));
+ $server['p'][$i]['team'] = ord(lgsl_cut_byte($buffer, 1));
+ $server['p'][$i]['country'] = lgsl_cut_byte($buffer, 2);
+ }
+
+ $team_total = ord(lgsl_cut_byte($buffer, 1));
+ $server['e']['pointlimit'] = lgsl_unpack(lgsl_cut_byte($buffer, 2), "s");
+ $server['e']['teamdamage'] = lgsl_unpack(lgsl_cut_byte($buffer, 4), "f");
+
+ for ($i=0; $i<$team_total; $i++) // RETURNS 4 TEAMS BUT IGNORE THOSE NOT IN USE
+ {
+ $server['t']['team'][$i]['name'] = lgsl_cut_string($buffer);
+ $server['t']['team'][$i]['color'] = lgsl_unpack(lgsl_cut_byte($buffer, 4), "l");
+ $server['t']['team'][$i]['score'] = lgsl_unpack(lgsl_cut_byte($buffer, 2), "s");
+ }
+
+ for ($i=0; $i<$server['s']['players']; $i++)
+ {
+ if ($server['t'][$i]['name']) { $server['p'][$i]['team'] = $server['t'][$i]['name']; }
+ }
+
+//---------------------------------------------------------+
+
+ return TRUE;
+ }
+
+//------------------------------------------------------------------------------------------------------------+
+//------------------------------------------------------------------------------------------------------------+
+
+ function lgsl_query_29(&$server, &$lgsl_need, &$lgsl_fp)
+ {
+//---------------------------------------------------------+
+// REFERENCE: http://www.cs2d.com/servers.php
+
+ if ($lgsl_need['s'] || $lgsl_need['e'])
+ {
+ $lgsl_need['s'] = FALSE;
+ $lgsl_need['e'] = FALSE;
+
+ fwrite($lgsl_fp, "\x01\x00\x03\x10\x21\xFB\x01\x75\x00");
+
+ $buffer = fread($lgsl_fp, 4096);
+
+ if (!$buffer) { return FALSE; }
+
+ $buffer = substr($buffer, 4); // REMOVE HEADER
+
+ $server['e']['bit_flags'] = ord(lgsl_cut_byte($buffer, 1)) - 48;
+ $server['s']['name'] = lgsl_cut_pascal($buffer);
+ $server['s']['map'] = lgsl_cut_pascal($buffer);
+ $server['s']['players'] = ord(lgsl_cut_byte($buffer, 1));
+ $server['s']['playersmax'] = ord(lgsl_cut_byte($buffer, 1));
+ $server['e']['gamemode'] = ord(lgsl_cut_byte($buffer, 1));
+ $server['e']['bots'] = ord(lgsl_cut_byte($buffer, 1));
+
+ $server['s']['password'] = ($server['e']['bit_flags'] & 1) ? "1" : "0";
+ $server['e']['registered_only'] = ($server['e']['bit_flags'] & 2) ? "1" : "0";
+ $server['e']['fog_of_war'] = ($server['e']['bit_flags'] & 4) ? "1" : "0";
+ $server['e']['friendlyfire'] = ($server['e']['bit_flags'] & 8) ? "1" : "0";
+ }
+
+ if ($lgsl_need['p'])
+ {
+ $lgsl_need['p'] = FALSE;
+
+ fwrite($lgsl_fp, "\x01\x00\xFB\x05");
+
+ $buffer = fread($lgsl_fp, 4096);
+
+ if (!$buffer) { return FALSE; }
+
+ $buffer = substr($buffer, 4); // REMOVE HEADER
+
+ $player_total = ord(lgsl_cut_byte($buffer, 1));
+
+ for ($i=0; $i<$player_total; $i++)
+ {
+ $server['p'][$i]['pid'] = ord(lgsl_cut_byte($buffer, 1));
+ $server['p'][$i]['name'] = lgsl_cut_pascal($buffer);
+ $server['p'][$i]['team'] = ord(lgsl_cut_byte($buffer, 1));
+ $server['p'][$i]['score'] = lgsl_unpack(lgsl_cut_byte($buffer, 4), "l");
+ $server['p'][$i]['deaths'] = lgsl_unpack(lgsl_cut_byte($buffer, 4), "l");
+ }
+ }
+
+//---------------------------------------------------------+
+
+ return TRUE;
+ }
+
+//------------------------------------------------------------------------------------------------------------+
+//------------------------------------------------------------------------------------------------------------+
+
+ function lgsl_query_30(&$server, &$lgsl_need, &$lgsl_fp)
+ {
+//---------------------------------------------------------+
+// REFERENCE: http://blogs.battlefield.ea.com/battlefield_bad_company/archive/2010/02/05/remote-administration-interface-for-bfbc2-pc.aspx
+// THIS USES TCP COMMUNICATION
+
+ if ($lgsl_need['s'] || $lgsl_need['e'])
+ {
+ fwrite($lgsl_fp, "\x00\x00\x00\x00\x1B\x00\x00\x00\x01\x00\x00\x00\x0A\x00\x00\x00serverInfo\x00");
+ }
+ elseif ($lgsl_need['p'])
+ {
+ fwrite($lgsl_fp, "\x00\x00\x00\x00\x24\x00\x00\x00\x02\x00\x00\x00\x0B\x00\x00\x00listPlayers\x00\x03\x00\x00\x00all\x00");
+ }
+
+//---------------------------------------------------------+
+
+ $buffer = fread($lgsl_fp, 4096);
+
+ if (!$buffer) { return FALSE; }
+
+ $length = lgsl_unpack(substr($buffer, 4, 4), "L");
+
+ while (strlen($buffer) < $length)
+ {
+ $packet = fread($lgsl_fp, 4096);
+
+ if ($packet) { $buffer .= $packet; } else { break; }
+ }
+
+//---------------------------------------------------------+
+
+ $buffer = substr($buffer, 12); // REMOVE HEADER
+
+ $response_type = lgsl_cut_pascal($buffer, 4, 0, 1);
+
+ if ($response_type != "OK") { return FALSE; }
+
+//---------------------------------------------------------+
+
+ if ($lgsl_need['s'] || $lgsl_need['e'])
+ {
+ $lgsl_need['s'] = FALSE;
+ $lgsl_need['e'] = FALSE;
+
+ $server['s']['name'] = lgsl_cut_pascal($buffer, 4, 0, 1);
+ $server['s']['players'] = lgsl_cut_pascal($buffer, 4, 0, 1);
+ $server['s']['playersmax'] = lgsl_cut_pascal($buffer, 4, 0, 1);
+ $server['e']['gamemode'] = lgsl_cut_pascal($buffer, 4, 0, 1);
+ $server['s']['map'] = lgsl_cut_pascal($buffer, 4, 0, 1);
+ $server['e']['score_attackers'] = lgsl_cut_pascal($buffer, 4, 0, 1);
+ $server['e']['score_defenders'] = lgsl_cut_pascal($buffer, 4, 0, 1);
+
+ // CONVERT MAP NUMBER TO DESCRIPTIVE NAME
+
+ $server['e']['level'] = $server['s']['map'];
+ $map_check = strtolower($server['s']['map']);
+
+ if (strpos($map_check, "mp_001") !== FALSE) { $server['s']['map'] = "Panama Canal"; }
+ elseif (strpos($map_check, "mp_002") !== FALSE) { $server['s']['map'] = "Valparaiso"; }
+ elseif (strpos($map_check, "mp_003") !== FALSE) { $server['s']['map'] = "Laguna Alta"; }
+ elseif (strpos($map_check, "mp_004") !== FALSE) { $server['s']['map'] = "Isla Inocentes"; }
+ elseif (strpos($map_check, "mp_005") !== FALSE) { $server['s']['map'] = "Atacama Desert"; }
+ elseif (strpos($map_check, "mp_006") !== FALSE) { $server['s']['map'] = "Arica Harbor"; }
+ elseif (strpos($map_check, "mp_007") !== FALSE) { $server['s']['map'] = "White Pass"; }
+ elseif (strpos($map_check, "mp_008") !== FALSE) { $server['s']['map'] = "Nelson Bay"; }
+ elseif (strpos($map_check, "mp_009") !== FALSE) { $server['s']['map'] = "Laguna Presa"; }
+ elseif (strpos($map_check, "mp_012") !== FALSE) { $server['s']['map'] = "Port Valdez"; }
+ }
+
+//---------------------------------------------------------+
+
+ elseif ($lgsl_need['p'])
+ {
+ $lgsl_need['p'] = FALSE;
+
+ $field_total = lgsl_cut_pascal($buffer, 4, 0, 1);
+ $field_list = array();
+
+ for ($i=0; $i<$field_total; $i++)
+ {
+ $field_list[] = strtolower(lgsl_cut_pascal($buffer, 4, 0, 1));
+ }
+
+ $player_squad = array("","Alpha","Bravo","Charlie","Delta","Echo","Foxtrot","Golf","Hotel");
+ $player_team = array("","Attackers","Defenders");
+ $player_total = lgsl_cut_pascal($buffer, 4, 0, 1);
+
+ for ($i=0; $i<$player_total; $i++)
+ {
+ foreach ($field_list as $field)
+ {
+ $value = lgsl_cut_pascal($buffer, 4, 0, 1);
+
+ switch ($field)
+ {
+ case "clantag": $server['p'][$i]['name'] = $value; break;
+ case "name": $server['p'][$i]['name'] = empty($server['p'][$i]['name']) ? $value : "[{$server['p'][$i]['name']}] {$value}"; break;
+ case "teamid": $server['p'][$i]['team'] = isset($player_team[$value]) ? $player_team[$value] : $value; break;
+ case "squadid": $server['p'][$i]['squad'] = isset($player_squad[$value]) ? $player_squad[$value] : $value; break;
+ default: $server['p'][$i][$field] = $value; break;
+ }
+ }
+ }
+ }
+
+//---------------------------------------------------------+
+
+ return TRUE;
+ }
+
+//------------------------------------------------------------------------------------------------------------+
+//------------------------------------------------------------------------------------------------------------+
+
+ function lgsl_query_31(&$server, &$lgsl_need, &$lgsl_fp)
+ {
+//---------------------------------------------------------+
+// AVP 2010 ONLY ROUGHLY FOLLOWS THE SOURCE QUERY FORMAT
+// SERVER RULES ARE ON THE END OF THE INFO RESPONSE
+
+ fwrite($lgsl_fp, "\xFF\xFF\xFF\xFF\x54Source Engine Query\x00");
+
+ $buffer = fread($lgsl_fp, 4096);
+
+ if (!$buffer) { return FALSE; }
+
+ $buffer = substr($buffer, 5); // REMOVE HEADER
+
+ $server['e']['netcode'] = ord(lgsl_cut_byte($buffer, 1));
+ $server['s']['name'] = lgsl_cut_string($buffer);
+ $server['s']['map'] = lgsl_cut_string($buffer);
+ $server['s']['game'] = lgsl_cut_string($buffer);
+ $server['e']['description'] = lgsl_cut_string($buffer);
+ $server['e']['appid'] = lgsl_unpack(lgsl_cut_byte($buffer, 2), "S");
+ $server['s']['players'] = ord(lgsl_cut_byte($buffer, 1));
+ $server['s']['playersmax'] = ord(lgsl_cut_byte($buffer, 1));
+ $server['e']['bots'] = ord(lgsl_cut_byte($buffer, 1));
+ $server['e']['dedicated'] = lgsl_cut_byte($buffer, 1);
+ $server['e']['os'] = lgsl_cut_byte($buffer, 1);
+ $server['s']['password'] = ord(lgsl_cut_byte($buffer, 1));
+ $server['e']['anticheat'] = ord(lgsl_cut_byte($buffer, 1));
+ $server['e']['version'] = lgsl_cut_string($buffer);
+
+ $buffer = substr($buffer, 1);
+ $server['e']['hostport'] = lgsl_unpack(lgsl_cut_byte($buffer, 2), "S");
+ $server['e']['friendlyfire'] = $buffer[124];
+
+ // DOES NOT RETURN PLAYER INFORMATION
+
+//---------------------------------------------------------+
+
+ return TRUE;
+ }
+
+//------------------------------------------------------------------------------------------------------------+
+//------------------------------------------------------------------------------------------------------------+
+
+ function lgsl_query_32(&$server, &$lgsl_need, &$lgsl_fp)
+ {
+//---------------------------------------------------------+
+
+ fwrite($lgsl_fp, "\x05\x00\x00\x01\x0A");
+
+ $buffer = fread($lgsl_fp, 4096);
+
+ if (!$buffer) { return FALSE; }
+
+ $buffer = substr($buffer, 5); // REMOVE HEADER
+
+ $server['s']['name'] = lgsl_cut_pascal($buffer);
+ $server['s']['map'] = lgsl_cut_pascal($buffer);
+ $server['s']['players'] = ord(lgsl_cut_byte($buffer, 1));
+ $server['s']['playersmax'] = 0; // HELD ON MASTER
+
+ // DOES NOT RETURN PLAYER INFORMATION
+
+//---------------------------------------------------------+
+
+ return TRUE;
+ }
+
+//------------------------------------------------------------------------------------------------------------+
+//------------------------------------------------------------------------------------------------------------+
+
+ function lgsl_query_feed(&$server, $request, $lgsl_feed_method, $lgsl_feed_url)
+ {
+//---------------------------------------------------------+
+
+ $lgsl_feed_error = 0;
+
+ $host = parse_url($lgsl_feed_url);
+
+ if (empty($host['host']) || empty($host['path'])) { exit("LGSL FEED PROBLEM: INVALID URL"); }
+
+ $host_query = "?type={$server['b']['type']}&ip={$server['b']['ip']}&c_port={$server['b']['c_port']}&q_port={$server['b']['q_port']}&s_port={$server['b']['s_port']}&request={$request}&version=5.8";
+
+ if (function_exists("json_decode")) { $host_query .= function_exists("gzuncompress") ? "&format=4" : "&format=3"; }
+ else { $host_query .= function_exists("gzuncompress") ? "&format=2" : "&format=1"; }
+
+ $referrer = preg_replace("/(.*):\/\//i", "", $_SERVER['HTTP_HOST'])."/{$_SERVER['SCRIPT_NAME']}";
+ $referrer = "http://".str_replace("//", "/", $referrer);
+ $referrer = empty($_SERVER['QUERY_STRING']) ? $referrer : "{$referrer}?{$_SERVER['QUERY_STRING']}";
+
+//---------------------------------------------------------+
+
+ if (function_exists('curl_init') && function_exists('curl_setopt') && function_exists('curl_exec') && $lgsl_feed_method == 1)
+ {
+ $lgsl_curl = curl_init();
+
+ curl_setopt($lgsl_curl, CURLOPT_HEADER, 0);
+ curl_setopt($lgsl_curl, CURLOPT_HTTPGET, 1);
+ curl_setopt($lgsl_curl, CURLOPT_TIMEOUT, 6);
+ curl_setopt($lgsl_curl, CURLOPT_ENCODING, "");
+ curl_setopt($lgsl_curl, CURLOPT_FORBID_REUSE, 1);
+ curl_setopt($lgsl_curl, CURLOPT_FRESH_CONNECT, 1);
+ curl_setopt($lgsl_curl, CURLOPT_RETURNTRANSFER, 1);
+ curl_setopt($lgsl_curl, CURLOPT_CONNECTTIMEOUT, 6);
+ curl_setopt($lgsl_curl, CURLOPT_REFERER, $referrer);
+ curl_setopt($lgsl_curl, CURLOPT_URL, "http://{$host['host']}{$host['path']}{$host_query}");
+
+ $http_reply = curl_exec($lgsl_curl);
+
+ if (curl_error($lgsl_curl))
+ {
+ $lgsl_feed_error = 1;
+ }
+
+ curl_close($lgsl_curl);
+ }
+
+//---------------------------------------------------------+
+
+ elseif (function_exists('fsockopen'))
+ {
+ $lgsl_fp = @fsockopen($host['host'], "80", $errno, $errstr, 6);
+
+ if (!$lgsl_fp)
+ {
+ $lgsl_feed_error = 1;
+ }
+ else
+ {
+ stream_set_timeout($lgsl_fp, 6, 0);
+ stream_set_blocking($lgsl_fp, TRUE);
+
+ $http_send = "GET {$host['path']}{$host_query} HTTP/1.0\r\n";
+ $http_send .= "Host: {$host['host']}\r\n";
+ $http_send .= "Referer: {$referrer}\r\n";
+ $http_send .= "Pragma: no-cache\r\n";
+ $http_send .= "Cache-Control: max-age=0\r\n";
+ $http_send .= "Accept-Encoding: \r\n";
+ $http_send .= "Accept-Language: en-us,en;q=0.5\r\n";
+ $http_send .= "Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7\r\n";
+ $http_send .= "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\r\n";
+ $http_send .= "User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-GB; rv:1.9.1.4) Gecko/20091028\r\n";
+ $http_send .= "Connection: Close\r\n\r\n";
+
+ fwrite($lgsl_fp, $http_send);
+
+ $http_reply = "";
+
+ while (!feof($lgsl_fp))
+ {
+ $http_chunk = fread($lgsl_fp, 4096);
+ if ($http_chunk === "") { break; }
+ $http_reply .= $http_chunk;
+ }
+
+ @fclose($lgsl_fp);
+ }
+ }
+
+//---------------------------------------------------------+
+
+ else
+ {
+ exit("LGSL FEED PROBLEM: NO CURL OR FSOCKOPEN SUPPORT");
+ }
+
+//---------------------------------------------------------+
+
+ if (!$lgsl_feed_error)
+ {
+ if (preg_match("/_F([1-4])_(.*)_F([1-4])_/U", $http_reply, $match))
+ {
+ if ($match[1] == 4 && $match[3] == 4) { $server = json_decode(gzuncompress(base64_decode($match[2])), TRUE); }
+ elseif ($match[1] == 3 && $match[3] == 3) { $server = json_decode( (base64_decode($match[2])), TRUE); }
+ elseif ($match[1] == 2 && $match[3] == 2) { $server = unserialize(gzuncompress(base64_decode($match[2]))); }
+ elseif ($match[1] == 1 && $match[3] == 1) { $server = unserialize( (base64_decode($match[2]))); }
+ }
+ elseif (preg_match("/_SLGSLF_(.*)_SLGSLF_/U", $http_reply, $match))
+ {
+ $server = unserialize($match[1]);
+ }
+ else
+ {
+ $lgsl_feed_error = 2;
+ }
+
+ if (!$lgsl_feed_error && empty($server))
+ {
+ $lgsl_feed_error = 3;
+ }
+ }
+
+//---------------------------------------------------------+
+
+ switch($lgsl_feed_error)
+ {
+ case 1: // CONNECTION PROBLEM - FEED MAYBE TEMPORARLY OFFLINE
+ $server['s']['name'] = "---";
+ $server['s']['map'] = "---";
+ $server['e'] = array("feed" => "Failed To Connect");
+ $server['p'] = array();
+ break;
+
+ case 2: // NO FEED DATA - MAYBE WRONG FEED URL
+ exit("FEED MISSING FROM: {$host['host']}{$host['path']} RETURNED: ".htmlspecialchars($http_reply, ENT_QUOTES)." :END
");
+ break;
+
+ case 3: // UNABLE TO UNPACK FEED DATA - MAYBE ERRORS ON FEED
+ exit("FEED CORRUPTION FROM: {$host['host']}{$host['path']} RETURNED: ".htmlspecialchars($http_reply, ENT_QUOTES)." :END
");
+ break;
+ }
+
+//---------------------------------------------------------+
+
+ // FALSE IS SO LOCAL OFFLINE CODE TAKES OVER
+ return $server['b']['status'] ? TRUE : FALSE;
+ }
+
+//------------------------------------------------------------------------------------------------------------+
+//------------------------------------------------------------------------------------------------------------+
+
+ function lgsl_parse_color($string, $type)
+ {
+ switch($type)
+ {
+ case "1":
+ $string = preg_replace("/\^x.../", "", $string);
+ $string = preg_replace("/\^./", "", $string);
+
+ $string_length = strlen($string);
+ for ($i=0; $i<$string_length; $i++)
+ {
+ $char = ord($string[$i]);
+ if ($char > 160) { $char = $char - 128; }
+ if ($char > 126) { $char = 46; }
+ if ($char == 16) { $char = 91; }
+ if ($char == 17) { $char = 93; }
+ if ($char < 32) { $char = 46; }
+ $string[$i] = chr($char);
+ }
+ break;
+
+ case "2":
+ $string = preg_replace("/\^[\x20-\x7E]/", "", $string);
+ break;
+
+ case "doomskulltag":
+ $string = preg_replace("/\\x1c./", "", $string);
+ break;
+
+ case "farcry":
+ $string = preg_replace("/\\$\d/", "", $string);
+ break;
+
+ case "painkiller":
+ $string = preg_replace("/#./", "", $string);
+ break;
+
+ case "quakeworld":
+ $string_length = strlen($string);
+ for ($i=0; $i<$string_length; $i++)
+ {
+ $char = ord($string[$i]);
+ if ($char > 141) { $char = $char - 128; }
+ if ($char < 32) { $char = $char + 30; }
+ $string[$i] = chr($char);
+ }
+ break;
+
+ case "savage":
+ $string = preg_replace("/\^[a-z]/", "", $string);
+ $string = preg_replace("/\^[0-9]+/", "", $string);
+ $string = preg_replace("/lan .*\^/U", "", $string);
+ $string = preg_replace("/con .*\^/U", "", $string);
+ break;
+
+ case "swat4":
+ $string = preg_replace("/\[c=......\]/Usi", "", $string);
+ break;
+ }
+ return $string;
+ }
+
+//---------------------------------------------------------+
+
+ function lgsl_time($seconds)
+ {
+ if ($seconds === "") { return ""; }
+
+ $n = $seconds < 0 ? "-" : "";
+
+ $seconds = abs($seconds);
+
+ $h = intval($seconds / 3600);
+ $m = intval($seconds / 60 ) % 60;
+ $s = intval($seconds ) % 60;
+
+ $h = str_pad($h, "2", "0", STR_PAD_LEFT);
+ $m = str_pad($m, "2", "0", STR_PAD_LEFT);
+ $s = str_pad($s, "2", "0", STR_PAD_LEFT);
+
+ return "{$n}{$h}:{$m}:{$s}";
+ }
+
+//---------------------------------------------------------+
+
+ function lgsl_unpack($string, $format)
+ {
+ list(,$string) = @unpack($format, $string);
+
+ return $string;
+ }
+
+//---------------------------------------------------------+
+
+ function lgsl_cut_byte(&$buffer, $length)
+ {
+ $string = substr($buffer, 0, $length);
+ $buffer = substr($buffer, $length);
+
+ return $string;
+ }
+
+//---------------------------------------------------------+
+
+ function lgsl_cut_string(&$buffer, $start_byte = 0, $end_marker = "\x00")
+ {
+ $buffer = substr($buffer, $start_byte);
+ $length = strpos($buffer, $end_marker);
+
+ if ($length === FALSE) { $length = strlen($buffer); }
+
+ $string = substr($buffer, 0, $length);
+ $buffer = substr($buffer, $length + strlen($end_marker));
+
+ return $string;
+ }
+
+//---------------------------------------------------------+
+
+ function lgsl_cut_pascal(&$buffer, $start_byte = 1, $length_adjust = 0, $end_byte = 0)
+ {
+ $length = ord(substr($buffer, 0, $start_byte)) + $length_adjust;
+ $string = substr($buffer, $start_byte, $length);
+ $buffer = substr($buffer, $start_byte + $length + $end_byte);
+
+ return $string;
+ }
+
+//---------------------------------------------------------+
+
+ function lgsl_get_string($buffer, $start_byte = 0, $end_marker = "\x00")
+ {
+ $buffer = substr($buffer, $start_byte);
+ $length = strpos($buffer, $end_marker);
+
+ if ($length === FALSE) { $length = strlen($buffer); }
+
+ $string = substr($buffer, 0, $length);
+
+ return $string;
+ }
+
+//---------------------------------------------------------+
+
+ function lgsl_gs_crypt($type, &$buffer, $encrypt = FALSE)
+ {
+ $master_key = pack("H*",
+ "f5c5914b27235dc0dc274200ddd187c32fe02aed5fc5c079518f49208e4c5548aaef313c5d2e7c91dc580d3cd9e1aec577595325d3c5c84b44a020802becb17e".
+ "7d6b6b87e8a4ebc8e4cafbaf5720f9600818b334ad2695ba0f19e1fbd48d0139f05e9059e98a15c79ebabb4f3aa8039d8720aef2bf1b4693a67a20a114b8505b".
+ "693cf5b24a236503582ecdb8109a7d89a8d90d660b96435b4656ecec3fff2086e94c54988843d2aa55adefb2d47fc804c0024a7897e993b2326e8990e425f7c8".
+ "38aef55f2002f22d84479f43849de260a8a2de6a7de09225c275a172729e65be687182bde68cb17b3fd77bf513c8045f0b6696d3a501b255db0632e36c0e7806".
+ "c5c193b5b9a9c621f0ac9a0ee72196edbb336e7431b75eba95d02191048ab7c3874578218d79a2623e308184fdac98a1568c09b8907d8411e29c53823a3a68bc".
+ "c785547ebb29401822da7fa59c6fc412cf2a9201f31336bcdffe78501058b1d7814e920ceee7aca8fa798f10f0a8ba19a1deae864e1c77f974880e5571a4380b".
+ "52d3357ec8cbf8ff6ff7e8f3fa6223f923e4a7bb1918054bcd2a115e466307f39d964c051983f8b2e5db0b39332ec08c94d9b36a4594ab5e868bc888e4586687".
+ "b6e62b2bb06ad0903544e379d744896f95346a0238b2b72c6d38ed1bf011185bad1910812cfe2c5b38db10433088f2e5a3746e7302467d35e8f07722fad1f7d4".
+ "283fbea23fa6f50f710491b1f0a8dd3a187939e7f344de57c256ffb063791fc556d3791570a873537c3f05f8ca08aa1eb2e3f641e0fb46fde7394f8fb4c216d7".
+ "55c020b405a21b8e4340136fc9583800afd87a677d3d9b6b95585ba502d6db2dec504f25b612340e29be64700682f4f012908e2672916ba83d35deb58d826d83".
+ "d75a61f726876747d78df10a31f6acb36cb64dec47b7da11c7e7177dcc097965a50065e8e5f91732e20647604c00c0fa451f7ee140d93515b7b5e6f9e0c92ad0".
+ "29648ab1e0ea363c5a19d12832c54c0ae67baa7e029217ede5f97cd07ebf3aaf14c020f4646e3792e2472409299868b9ee1ce7a69a30203218289523d848a2ee".
+ "42b96edf05f24182491dfb048c17f815aa8983d9ab72723defbe9750cd694bc1318c92862ed7b7ab1e37472b986a7f4745224fd723e4e6ef53ff6d5f51f1b8cd".
+ "34b32b9ac92968e5ec8b631aa750e7cec51e7fddca5da1cdc836c0243ab2a2f86d072479c117738fafba4d72db6fee13274d652a7c76ff962c1389b32f95f3c0".
+ "04d178b71646fe084507e7dd4b4db98405cb72399f78f989c188fb2ed6e18e5aa417adae504d33ad8414f9e3a6e466837062e8ea91664f63134539679b119d6b".
+ "3918f833ceddc249933b0ae83e0965b38fb86d3da02622d02f57c7282e5f0cdb18f71e7450c538ddca55588575f80754dd0c89840bcf7e246e8f041309069f15".
+ "a49c27fa0a5913c72be881ae27ff6b0332701d96dc295576d2a9bc0fd266f5604da647f78d1c2ced95c4cf8a929c55bf524198898b444c67040d7c7debcc3cc9".
+ "7cab1a8fe190f4db097beaccea9a34e38380b43bd2b2bf98f471c02894aaaf3944680988497aa74d293238d503a4df19d90af204fdcbb1875170a96b7f3e288c".
+ "0f24e1c8b9ce4f77f2b03944c2abbacba69331a244923c38f731f368d10eca82dd503bdece016064c68cb38a4e3408712959cb5216dc42bf5365eb789c484bcc".
+ "5813a1f1680fc5606e8da06bd5a68a73bd593fcd4aeb9aca06bb258f84a38dd0d4c6c0c355c4d5e0e1a97abaa11869f26285a99db4dfb8eab0b0f53e80d2486b".
+ "9a6cc63affac0b830b12434ddbc1c4ef3ee46af67fcc711b88a352d2b324c0acfb35bfbe74865afd7f3293a944cd9f69230a206c5112ed9858497ddc118c0338".
+ "63f1a974b033a225c74e83c9d1bec1a3e6a7b2b7ddab58aec40fe4bed9e2fd1beaded608c695dafaf4d683fdf3b9175d1283d7d99b47c40209a555c317e29bad".
+ "574ac49e78ae91896b527d27f04d89b10d5f754b953d1218bf01fc06086c031ff334eab692e9c6fb221ac0f3027283ac5350d860f2d6125d31edf4b7ac806f21".
+ "abeb04f84230e8c17455e54a27d6862cfb3279370eae1cdb1f84c10209e89241182c307b45a6b97520a62bc263c66f78d27b52ad9728f5d78c1626297b1d1cdd".
+ "e47fd67d9f1f4846a3643810359f2cc6b22a662683836eb48f6e1605be3a830fe29f0c54412e7d82aefff9748a2fddb368dd0103161e2a17da69216e22adf6b5".
+ "7ce255e400279188655820eedd5a1935aa3d8cf621fa312bab89cbb3071bfbe7e0635126de8217bd5c342f35824511769ac6b72de09b87012cd85f2cbef53e11".
+ "9aba484771b15bddda183501230ae6a16fcde55a161df16f178e04478a3711437dc91eeabe92e14b44d2f49036532be42c425346df9d91288aa409a63272e061".
+ "baaaca491cc04c44b2ac739290baa76d9fdc7b66733548af6411a6ba790c4962ddf033e63fab462bc0ccbfa45d45ce377d32f4c7e905cab5fbbb524f8c2907d0".
+ "41b304d1f38f348efd34a7d51c118445d05353b5f0449f368450782df457ca55169bdfa817a94e1082faf4115cf3d6d890481affb2feb95145691f152485465d".
+ "0f8dba4cde2079784574fadbe805222e3a132934f1a419cda032b310fd7dfa2830d3f3385d646ba0c373cba4d624a6267300014cdd2dd5e87999aa5b0e5df0a8".
+ "de50f3473918474ccf82f9c8ab9f31379a9d8d00bead3bc8b9d00f4ebba9c7b0ea882454e3a785e096d7887b3a507f089dba88925df12c633241ed2f9f68905b".
+ "66775d1d0ca3cc312f7be8641856be8de24248e55dd737df8410e23e9457024f534261f09ab278821b1c89da824f7f546a4163f4d53ccf07ee9bd59adb673822".
+ "87092b94a7847141a796a6abf90f7bfa5d8967bfba2275283863bfc3f8283f0e5b223748a55dff04f3c6bf228bb1e0bfd2c80289abf5819e165268b4e687bcf4".
+ "a33f1c42c47a6236ca14c26778ad2cbe013c20807e45276d49a4e0df7df7c42d2c73f298f61fc8e778ba953a71c6b7d1779624552df0f3896a790671a3a981fa".
+ "17914d856321d0997ff4b2d05944335ceac60b63b1d827eab5ef7483990e9bd1b5453a473e1efd476ba1e093466cb21dc72e35dc12bb8c8d3bb29db420251590".
+ "32441b8a7e9458cad9cdc1551ce52312bb27d858a8ae319e525b38f20242a60933b2a21bd858e147cc6ee702983c84bf535d1575a54dc46c03cdb42a39d1a64e".
+ "433d9bea41f9915f7d9d462d4308baccb19bb1adc3e0125715950f7c7f8b54312826204fd512386da587bad7bf81069dc554fd8fd77153832225e56a7fa4046b".
+ "d588ed258dc7e54ccf1c021f9800376376bdcfc62116555ab0e06b3161b3b7a6a7a87de2371215207c43fce54c82feddc5d444b08f6a30c0095007d526da1b02".
+ "41563a9360f86ef3b824294bd174679f4dee74912acdeb00ac96a713ad86dc212a544b7420fa6c83d5dec48400e1f11f8163e20c932bc893820a8261939e0f85".
+ "fdb416c6a0a18cc0182d675702a8362694f23ce686962150f862357fe84a0b572068c7e0578909d7f82c87cd17e7ef50e5566eab694ac76edb4b6d8a85cd2910".
+ "0b93272b0a524a24db8db7d4622fae63d982e4090fb519e30736d5b5152d58a234919d216d0294628841cba91ed72d985ba92f7cc548378e7ddf812816ad99dd".
+ "27adffdf5b6d762a79a942d8af9a8f0ac81afc98869dcdcc06835478947ced5ccbb22d02624e207c774042fa8c133221c362bef69582c52ca9c014db1ec2d351".
+ "a1d72bb01c06e32ca0a4ecfe923737f0f7145b27c943a9be1f174dd46d3af58e7a2f612177affd11ae7e1b9231aadb46bcb732ee79de7e62f467721f06d8e9e5".
+ "59b526bb702ddbc0f0b46a2162458c15c0154cbb1b1edad3fa198a0781279ecc5e5391269c335bc94b2f21da781cf943cd0e700206128fe1f1e3af4e70bfbaec".
+ "1c7ae4884c7e7544050036b001f87fc2f10762888701c160010e7691ea2b53b646d22178ebf1a56eb9cba86ffa2b570d846e231037d403298103c61732b04113".
+ "ff7ec74e0a671332f7df9da231f995c1fb53523c17c23105312b7d8ab63e5f6a0e7b9d106f3ce575d14befb3a5803aabcc9edb5f1ddf9dcabff4efbd785b169d".
+ "f7fb1b991faf63f064b5fc8f2c7fcac4b35a61f19c92dec36a6aadf02dc3942dde51d7225aefeaf6b7527183c2adc832c6bc8735bc7be2c18ad3d70653f91581".
+ "ce42a275ef6715932ae7513d0ecb726be54c167cc89445a08cb8e12fc583aee815b3947bd1ac781fcbfbdda25fe3e931a21c47058197ceffbe9bd2ac6394b2d5".
+ "95c3e10076c3aceba33b1556029edfbc04849e0d66713f7beeb1517dcd43279a5073ec9fa221bfaceef0f639e771a44156778cbb696af28e2437eea3fc025d27".
+ "70b1409d978e4ec808c58288d525ac977db0ace80d9554925bf8767b8e91a9bf1ed25deabdbb93315ca08f711ae3f768a911eeacd93bfa6db3957da83c0fd945".
+ "a7e596b66530aa7347e04590fd31db6b49485a9ea8208c0aab4068f482b185aaed6ee69e32f9ff7b882763da34f6e3bce94c79353ef6849d47e6345d8727e076".
+ "f1aa0133c2399e4d777525fe9aa29e75d23df6e829f9058580413d5c24f85568beb1343430f393adee28ab54e220b4c884fa6ebc2825705f863ba7d82977f653".
+ "edb2088abd84ad52a1810a52abc6e7c3b5687f3bf4744941ce48c876205f2497b641e6e4bb565ab816425c348e1f034104efda9a21723b00cdadc6ed2af6b225".
+ "524ae512afba6bc19c471e14bbba042dba641424005a816f25aee44ee84cf2f729b79b1b9d58218f0274d92168c9bb1cd1c141b5f8341a3a4dc78c0ddf08dfd4".
+ "110b4eb0b71b265fe70aa5a4b2186cafad5ff94dafd5b4b4560bac45cb47c4c863274ac2d84af46b75bfde496d39984ff0af8ab7d98bc12c02ce782b23268d03".
+ "864826b0201d8d1e0c09c9ab229a2f7fe1504795bafa8b8ae13fb046a2f35233a49b772b57862ada835951742439693ed9f3a080aea7a1309de4ae04b1ce3d78".
+ "72cdd85a3544906afaf55aff8255bdb2367c7ecf184c91c8f4c60a1301b80f8bb9f0ff6d80ac6e1c9d6c9fafbc65199790e0a9c323e68b105f5c56eed2f60294".
+ "5ab59d79698829ba092cc97f37dd023595d3fa014e718cda23d6bdbbfd70c2c6cc1b9121d22eae0bde7b94277dc8e5e096d60351f2740ddb986c7e10e0af8a40".
+ "e9bd526f863cde028dd253e18013d3c76c2006a9ab9ec3e7b6b1aca865b2ace8c8debb50ae1efbc0e49dd69f128c28bd02d79f22717e2679d5142540733cb278".
+ "0969944106122d5f2baf97f7e09ef67b894cd191411126ad962e4b9c5a0bbe83215563662ce5f063ce2a76c2e09613539fbb094d389e739ca0a3fc34bd1692ba".
+ "f0601e2122a70fdf68ede6c431090896622362c59801000727718f4b551f32340fc5f740e15fc0a023791aa57a6cc97af3077f5d71d33cbc864049b30cb11ea5".
+ "23c15141ea5ac620aec5f81e6661bf8f01a3c817ac1ab592570b63764402e4934d776df03cadae448c5d9082c30c00737e4bbe5c184a1167507d9b99bdd05592".
+ "456ac25dadb5beafe282028611db969c44db7bfb2cad349c0ecbebc281a00ad4f70cfd889b3533833ab845f86403e6a1970da6b5c8b8e82e9f42a82c7c14e535".
+ "16b3d9efbaae6ca6b9c93977f17f58ec29a1a8bb188fb15f377bf50d37e84781ca1716052f657a361cbe44eb227002a57390873e54b8695f76fe0f84f873e021".
+ "c92945f3d7b54861be3c237701c140c3a4e1b84fa4bab910cd265393e0172293d6fc40fa1872e175d7d3f06153a9eca3f8db85c2166f68415eda3bf4aee35adc".
+ "0231cd6cfe5d3a23b51fb0105176b9cdadc28304d27fef698cf4155235d07ecfaf5a2c5f8610a63ee809b0e0260251c33873dceebdda1ec3725d1376031e45cc".
+ "731a870b39edc97b549b96624c891984acf7a422584bc56f2104256f15da552d0a8376a546b6966153728ca1f38514df0d458375e99bc01fa498b07abb33803f".
+ "da07c4149e6e5773f9ec65ac3c87ca7c515f263de3cda2d53edbc20c47486ee33f9810c8226bbc9c52fcadb1f01fe28bf099b8afb9f1798e0b9815210c559187".
+ "c562b5e45350a5d0708c2fb96bad405ef4b8b535066ed02da198e4a3a4eaf075450c87f6d9840c8e00b8e316bcc7a5c6113fefbd72b0c7f6860fcecc8a3f33fb".
+ "a2999e4f3f3e3da5d7bfcf5d22a93f4d16ae6dd053685dfc7223628f92086735d09551bd29e8d0f537d06f33536fce8360d7443f583e9079685efce0347c1ffa".
+ "fedd0b7d1125f0dfc9bb21460079f286abbbeb549bb744aeea0b7a6bc66a272c8af945621b57b8380d40fa067c3060b9d44b79bd4333ec96d47632124a9aad0a".
+ "2df287eda9312f70f12f544fd7bdef9e6cc5e110effb8dbdebb821571f0fa95301db9da0bb60b77af6d5b7de00ca26039f1dda92f7a777c75d02fc340f1b81b5".
+ "e7c5efc6aaa6ffe3b77db348b7a5973a9465cb1e01841fa10f398318bfb73a4f8f53a4bded656f35db0ef00685826d8eac3aa0941623b3401ffdaba927bc91f4".
+ "808818548a60f653e9f340f79e40d666525923c4847ac3c0a9b36f3069620b0aea677ee7afa2c333987d9a5afade1b0e1e22ef7470228b07c9f482a6c343a37c".
+ "462a749c02d4cc86447cc16c3c68955afa80e63a3a41aaa1375c7ca0cffa0335e96e599e1b6841ae5693b5fa6ff437c3c1dca20075b7a58aafa81845af0aa8f6".
+ "30520d89a362d667447045c2b39f88f573f6b76b95ea4a98950ad797570b841975e9841306223dbefd21a4f092d69452c4539c664e27e110622ae7a7db5073d6".
+ "17eb023b36f28a13eeeebdbd964df63dcb18762950b6bd3eeead2a25b9bba48060ac8b82af3f41ecafbb7134140ca8cc687b92eded8bdabd9567e50950ed617a".
+ "a114d3db8648f9ab48a622456aec56fe79cfa6225fc7fd3fb0607f9dbc1bd861b316600fc10163fe8098ea685bc3fe06435f51cb1ce7ffebae67b3114fadf8c8".
+ "808a4044bb06638d05bc9a73c44c5b1eb7c83cdb4bde51ffa85413a97fbd534ddb17dc899fc4e2ced6ed81eeb117b4c77f9ecd03251367649a5649ec58567907".
+ "4fc8c2702dc42a58308f4023fb2cd30c79ecb9a952cde77dfcf92d8ef234811c327112abd568c49d4bf693f611d07e433fcd0a396530c6a279eb3ba567d780b7".
+ "271b6bfc7f1683a6b9159e143788662e8c5f73dd25ab623633efe781edd647b32003c9f3eaf236d968244e4561bc855848b839bfb93af2ea3e230a30089230c4".
+ "2e593ed3b9be53d677a7c9da744ee1961aaccac237f9e0bc1f886a92d5f335c6c0b0250ea76fbdcd85ae9cf6afe7ab25fd6b4753be6505b986757b003b94a089".
+ "d6a42b1fb24d2249ec917bb0ad50c8bd31265f82071a0816c3f8985edf0311205f83eaf8ff5587a3c7c24938a3f0cf9ff438b567d71407a51292e6d7e3f939e6".
+ "cdbecd49e913793f73cb964406934907ca4d48f44bec301bdf0110986757fcac6c2cca84eb7c5fad1662d1a833d24fa356771d6b772759a4837d9872d23ff1ab".
+ "219597aadc062f317d6cbc044bf65dc5ddda95ddc34d68584b7db991c8441a43e0511f71b88dda141f36b7cb326650c3244b989f1b992d2baa318e2a76dd1c34".
+ "a946c843255f65c6896eac3a6774ceff50b6f66b752672f5ce8dc84149ba6b227da844254d01bf470f6c987e8b5df2168414bcee11ad8c131d16e43addbdd493".
+ "595117f4f211c5d6460ee1be41e72b42c21252ce6dcd9838e53b0e1fd8d1864c2d3d219b82d42d0446865848431658732a78f0d9348f8044fa7f576d11562d25".
+ "d7b681f714c4b43532543d27069a21d1d152e646c56d75229bb198f87676108306e68fa49751f3b1d678bbf1ea38b2e0712d896882b5ea1494136f23a7e1d528".
+ "ca456c6c2a2cfc8cb6b6e7e6526aaa1da082653492b624936213569892706d8f9c6496b1193ec5a4294e3c1da14b25c24337cf9bb3490ea3f8a54e0a5b9f77af".
+ "fc70fe8dcb7687a9f45c7ae3ee8f2a94fa58e6c920cce1f447fd60526fa71b6f1048a3dcc7680e3b20ac66d78290bfc3878e72d4876e014036b0b80b6be4bf2e".
+ "a358125bea811b51af76a0077b3a615750a9ca3368d1d17e060a0d37bfd3b13c91412ca83298b06aea3048607f718c04667dcfc7faa4ac5a594be1c1551140ba".
+ "9c1ea7cebc074b1fbd338eef831fa3eb1f39088bcf1cf13bf706b1d287e12b165f4fb3e6c4586067c5e2f461c4cc86400b456428e8767c1b57a7bc3e64a8abe6".
+ "d253646f8796763b2a33de35c6f1667d06f30bb12c0fd0e28e4859ebdc2f96236af4a895d9a7d6fb90cbb60084db28a0c628faf7653c316ec69b5c5103aea495".
+ "792efd58ec42bc950f8608d5fa6834aab7bd2aaece33b3e16756f518a5410e8957dd534437e8c152451d86beb20124e8fb9e672d13fb7e98e153c124fdb2eaf7".
+ "f94a23efffeea25ec31f821e492d9de00a6d056c67e565f734f864d425035bb13620b7a1f44ec02ab7a6b1c4a38511b6902cfcf199d3918eb07da11d634add44".
+ "0860d123fa2b8003f87270777c6415e32f1b34dd6e1e22df3a78684e1169fce84b61cf461544f4e891fcd9d1f5a1e5fef148aeddbfcc922f5d7bfd3bd2480e8a".
+ "3318c75ce0afc24ca179fc0e832ab64368c174407bf2cd45a72cd5c9e7dd0b9def7500cec54d4d692938a1bb18289189d4b2445640d8abc9a0b70c3ffc8ba3c8".
+ "d483119a4f63851a57cf30f48c88616785a5ee00cb9221db45dd8dff118ca33bb4ae254937891f2c971edc8614fa3fc43e56f297a44a234fb1737f23d44a15f0".
+ "6a9e364fe1daa8e28bf72927526296202713f76dc8342e3843483b479ff793697b11a934bdc206905dd020e2f321cf8d65c245a8e7c4275f87301211800f0751".
+ "4e9cb59b88540f5441e6b09b4b73112d855ba0dffd4affd670c4f76ec11ac07a6cc2201ac65c83b3b3e4dc10d991ef4424cd001d34f0393dc262957df641469a".
+ "e00f74c527f8c99f50432c5ff4c4260ec6998b7ef2a0223290762126542d8aa89bfd241ac59e3a9a6c6f13afc9d69a771d124d16359525e4b374605b699e32bd".
+ "fb393d9397767bce32ab2d5557d05c33fa54183b0d5facc73a097441aa34abf7d6ac36fb35d6be7f19d0c26c7ad564c06f8a4f616ff4819c53e8b29e782b8791".
+ "c4039e5d049bd36819ae6d01a113eae6260e25150b935ee364011558dea97e1ee0e7f2938b7368ad9a5a86bae4f89a9ffbd06638566a785cb6ad3982b133ce6a".
+ "3edb13aa2c4ad4db7052ac646fcf336b375efb6a360d448862f2b711db3d8e657a706c14013664beae06b1a067fd078b0a8800c01dd610d583bee4fa4634e4f3".
+ "5251372b8144a7194ed60dc2539283ce909e7d65338a9050b09b66b647f30b6d595d7e03d9a77029afce140df7717f64949ae1362f94602dc2e70840e3117ab1".
+ "a26cc8e8ffd068ec225f0b75b2de63e3511f4485c87fb0087e4421675f3754bc4bc9c0a38db6392661e8a59802d83f887cf81aa99ed13a10b4b8a176144f76ce".
+ "3a192cc77b09e3f8a087db488f3d304d048623f46a031ba9251896cd08ff601dd0b933f5110b4cc9d943b5705b2435fa1c0adaad6c3aed88022f57cc3d71048f".
+ "9d5f420cfaf737b8a9f2434601b296b14384618fa9b76e6acbf1b55ad7130f582f36920a5aff71e15d120b11d6e0dd374554803538f3b12305512cf24322ed52".
+ "cd7ce5f409efd2f2752684bc326bf4548fa17169028c819ba342ee672682860a6de09752f509caad897484160895dc712b70bd05d588fe218fd85718b9b833ff".
+ "2c18e2566416ce1e52c3d7dc696cca1ad02b9b99e2953f92d8fe7ac0e4d75bd2ae2834b9ad8e87f179cdaf5e75609abdf1236787fe366347c32991f20c7faf41".
+ "b65da4ed5edc3cab1134a4ee0a3b565cab7c6dcd6f93feb528ddf0a1e992f6ad4814e51d338433dc5b52fddd8e780a312d12c80c4dbdaf8818b1c84883d8be41".
+ "186de5fdeeb9c7b7542a8429e53645a313cd8c9a53c3790b9fcf0143421da3bb586762790c91b0110f68b5fd111338560437d7d77457fb5587efb40a90ed1c02".
+ "838ba4e83b0c6adb175d94b6e14767a4f4a127e80f79be7741f4dc446c520176fd5b0412cc4d7a8f3d293e438d50e4e79e52bbc2c3bc6707d97b6289f1b39733".
+ "48c9351b66be55b2152bee9b76c42dc057d12134180488f45aee9491fe72f8634e3beeda8006869a829d2d58614150ab489dca7af268c09dde668cc20428ff88".
+ "366a3c0119446bdba29c39b0723fcd639393d397d138ab241c187beac647d8f73e5e42b3468e3958e0e73908c081ce0b6c894f0409f3bd321807a1633860a8e7".
+ "49cb4a10875a65b3f0a073f48f141747c88afe9039ef0795752dbd07ef51a2dadb40bb09bb9d4fcb328f68af28f8d76085fccaef4afe848a93c4cac43f55863a".
+ "21b540e6d408eb55fdfbd2a0c13fbae6fdf68e51423737f6966105d1ed57570bb521adb9576b06988d7d5a6445fe77d177076d47ca45b437a9780b376d49689e".
+ "6b0be983d90f46dbf935e14b53f3bf7ac7aec7fc1b92c14f161e59ae2620f7552206f22a365c91476943b8b51e920661efc19d040070407ba1cf011d3a0e072e".
+ "68d10e064619aa2184d7e848729b254af6b83db15fca2134d0d54efc761fff25c1169d608ed2434de8ae3cafb8c3af0b5b23a16183b5ead5dc5d175c955f4db5".
+ "454623d611244c462776118992ba03e8e20e6e1d9d6101d2286d7e040d5a56f22d6e3ae86bd6a0605c8b34d7a385fee5f3c9b6d0cf550f7aa67f338d8a014dfd".
+ "639cade855e8d25df73ea01bc5635bb5e032269b2a10f6b2baea7c4a88ede42caf91d7c9d3b2802608fdc361e23ee8cdcc1c954da86f929e9721130ef6d74e99".
+ "180f8c8c2263b41f538e105bc5f411f8dd1c2d3e0dc4540ff9cbdb9a6c44524ebcdfe37d9427a43dc24fd28c2fc25baef96490ae847b435ef4eea87db030829d".
+ "06b4c5d9271c8ffda114c336f5d82f9e6ca0d140112f364b1613cfe84c6e924629cba51a7d21f92ce26802bda0651340a8aad0c1ef439acc5552634304321cf6".
+ "02851751630d671a8cce7028f1cc6fdbce64f762c8ed522c2a81c2886986999a85d41a87d2ba5281dcbc2dbd728559470017e12fd70a97a771de499d2953c49b".
+ "0e60abac5ced203dd26bb75df922938723b1341bb07b0250d7af1bf91788994f8ed193221dd829e6665b114763e490fd8482955b097ac3b5b124bf92ae8ce902".
+ "1897b67db820cbfd646fe2c61e63baa972651a47bb1aae56f5e623a1167beff84166ea78cc9854b21a9478ebf3a1429226213c20a7a9ce8031eced508b937263".
+ "1357591069d5c482c0f6f99e4a6084f34fdab7b26399b4efcb0e5217e4e9115d0f6011bcfe55e0f05d3d8850febab0a6100bab8142a3913662a568f9d32367bf".
+ "5db46b6572cb76bd6a49d84bd567e1f834bbd705dd395c1609e9eba7fe8b9c59f1c4cb2561461204805c25a384140314e515f84050949529050279393884f8d0");
+
+ if ($type == "aarmy3") { $game_key = "c6mw4it2kg7sz5o0813d9qyufenhj\x00"; } else { exit("UNKNOWN GAME CRYPT KEY"); }
+
+ $buffer_length = strlen($buffer);
+ $game_key_length = strlen($game_key);
+
+ if ($encrypt == TRUE)
+ {
+ for ($i=1; $i<$buffer_length; $i++) { $buffer[$i] = chr(ord($buffer[$i]) ^ ord($buffer[$i-1])); }
+ for ($i=0; $i<$buffer_length; $i++) { $buffer[$i] = chr(ord($buffer[$i]) ^ ord($game_key[($i%128) % $game_key_length]) ^ ord($master_key[$i%128]) ^ ord($master_key[$i])); }
+ }
+ else
+ {
+ for ($i=0; $i<$buffer_length; $i++) { $buffer[$i] = chr(ord($buffer[$i]) ^ ord($master_key[$i]) ^ ord($master_key[$i%128]) ^ ord($game_key[($i%128) % $game_key_length])); }
+ for ($i=$buffer_length; $i>0; $i--) { $buffer[$i] = chr(ord($buffer[$i]) ^ ord($buffer[$i-1])); }
+ }
+ }
+
+//------------------------------------------------------------------------------------------------------------+
+//--------- PLEASE MAKE A DONATION OR SIGN THE GUESTBOOK AT GREYCUBE.COM IF YOU REMOVE THIS CREDIT -----------+
+
+ function lgsl_version()
+ {
+ return "LGSL 5.8 By Richard Perry";
+ }
+
+//------------------------------------------------------------------------------------------------------------+
+//------------------------------------------------------------------------------------------------------------+
+
+ } // END OF DOUBLE LOAD PROTECTION
+
+//------------------------------------------------------------------------------------------------------------+
+//------------------------------------------------------------------------------------------------------------+
diff --git a/lgsl/lgsl_files/lgsl_zone.php b/lgsl/lgsl_files/lgsl_zone.php
new file mode 100644
index 0000000..b02024d
--- /dev/null
+++ b/lgsl/lgsl_files/lgsl_zone.php
@@ -0,0 +1,148 @@
+$request, "zone"=>$lgsl_zone_number ) );
+ $server_list = lgsl_sort_servers($server_list);
+
+//------------------------------------------------------------------------------------------------------------+
+
+ if (!$server_list)
+ {
+ $output .= "NO SERVERS IN ZONE {$lgsl_zone_number}
"; return;
+ }
+
+//------------------------------------------------------------------------------------------------------------+
+
+ $output .= "
+
+ ";
+
+ foreach ($server_list as $key => $server)
+ {
+ $server = lgsl_sort_players($server);
+ $misc = lgsl_server_misc($server);
+ $server = lgsl_server_html($server);
+
+//------------------------------------------------------------------------------------------------------------+
+ if ($zone_count != 0 && !($zone_count % $zone_grid))
+ {
+ $output .= "
+
+ ";
+ }
+
+ $zone_count ++;
+//------------------------------------------------------------------------------------------------------------+
+
+ $output .= "
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {$misc['name_filtered']}
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {$server['s']['map']}
+
+
+ ";
+
+ if ($server['p'] && $lgsl_config['players'][$lgsl_zone_number])
+ {
+ $zone_height = $lgsl_config['zone']['line_size'] * (count($server['p']) + 2);
+ $zone_height = $zone_height > $lgsl_config['zone']['height'] ? "{$lgsl_config['zone']['height']}px" : "{$zone_height}px";
+
+ $output .= "
+
+
+
+
{$lgsl_config['text']['zpl']}
+
{$server['s']['players']} / {$server['s']['playersmax']}
+
+
";
+
+ foreach ($server['p'] as $player)
+ {
+ $output .= "
+
{$player['name']}
";
+ }
+
+ $output .= "
+
+
+ ";
+ }
+ else
+ {
+ $output .= "
+
+
+ {$lgsl_config['text']['zpl']}
+ {$server['s']['players']} / {$server['s']['playersmax']}
+
+ ";
+ }
+
+ $output .= "
+
+ ";
+ }
+
+ $output .= "
+
+
";
+
+//------------------------------------------------------------------------------------------------------------+
diff --git a/lgsl/lgsl_files/locations/AD.png b/lgsl/lgsl_files/locations/AD.png
new file mode 100644
index 0000000..625ca84
Binary files /dev/null and b/lgsl/lgsl_files/locations/AD.png differ
diff --git a/lgsl/lgsl_files/locations/AE.png b/lgsl/lgsl_files/locations/AE.png
new file mode 100644
index 0000000..ef3a1ec
Binary files /dev/null and b/lgsl/lgsl_files/locations/AE.png differ
diff --git a/lgsl/lgsl_files/locations/AF.png b/lgsl/lgsl_files/locations/AF.png
new file mode 100644
index 0000000..a4742e2
Binary files /dev/null and b/lgsl/lgsl_files/locations/AF.png differ
diff --git a/lgsl/lgsl_files/locations/AG.png b/lgsl/lgsl_files/locations/AG.png
new file mode 100644
index 0000000..556d550
Binary files /dev/null and b/lgsl/lgsl_files/locations/AG.png differ
diff --git a/lgsl/lgsl_files/locations/AI.png b/lgsl/lgsl_files/locations/AI.png
new file mode 100644
index 0000000..74ed29d
Binary files /dev/null and b/lgsl/lgsl_files/locations/AI.png differ
diff --git a/lgsl/lgsl_files/locations/AL.png b/lgsl/lgsl_files/locations/AL.png
new file mode 100644
index 0000000..92354cb
Binary files /dev/null and b/lgsl/lgsl_files/locations/AL.png differ
diff --git a/lgsl/lgsl_files/locations/AM.png b/lgsl/lgsl_files/locations/AM.png
new file mode 100644
index 0000000..344a2a8
Binary files /dev/null and b/lgsl/lgsl_files/locations/AM.png differ
diff --git a/lgsl/lgsl_files/locations/AN.png b/lgsl/lgsl_files/locations/AN.png
new file mode 100644
index 0000000..633e4b8
Binary files /dev/null and b/lgsl/lgsl_files/locations/AN.png differ
diff --git a/lgsl/lgsl_files/locations/AO.png b/lgsl/lgsl_files/locations/AO.png
new file mode 100644
index 0000000..bcbd1d6
Binary files /dev/null and b/lgsl/lgsl_files/locations/AO.png differ
diff --git a/lgsl/lgsl_files/locations/AR.png b/lgsl/lgsl_files/locations/AR.png
new file mode 100644
index 0000000..e5ef8f1
Binary files /dev/null and b/lgsl/lgsl_files/locations/AR.png differ
diff --git a/lgsl/lgsl_files/locations/AS.png b/lgsl/lgsl_files/locations/AS.png
new file mode 100644
index 0000000..32f30e4
Binary files /dev/null and b/lgsl/lgsl_files/locations/AS.png differ
diff --git a/lgsl/lgsl_files/locations/AT.png b/lgsl/lgsl_files/locations/AT.png
new file mode 100644
index 0000000..0f15f34
Binary files /dev/null and b/lgsl/lgsl_files/locations/AT.png differ
diff --git a/lgsl/lgsl_files/locations/AU.png b/lgsl/lgsl_files/locations/AU.png
new file mode 100644
index 0000000..a01389a
Binary files /dev/null and b/lgsl/lgsl_files/locations/AU.png differ
diff --git a/lgsl/lgsl_files/locations/AW.png b/lgsl/lgsl_files/locations/AW.png
new file mode 100644
index 0000000..a3579c2
Binary files /dev/null and b/lgsl/lgsl_files/locations/AW.png differ
diff --git a/lgsl/lgsl_files/locations/AX.png b/lgsl/lgsl_files/locations/AX.png
new file mode 100644
index 0000000..1eea80a
Binary files /dev/null and b/lgsl/lgsl_files/locations/AX.png differ
diff --git a/lgsl/lgsl_files/locations/AZ.png b/lgsl/lgsl_files/locations/AZ.png
new file mode 100644
index 0000000..4ee9fe5
Binary files /dev/null and b/lgsl/lgsl_files/locations/AZ.png differ
diff --git a/lgsl/lgsl_files/locations/BA.png b/lgsl/lgsl_files/locations/BA.png
new file mode 100644
index 0000000..c774992
Binary files /dev/null and b/lgsl/lgsl_files/locations/BA.png differ
diff --git a/lgsl/lgsl_files/locations/BB.png b/lgsl/lgsl_files/locations/BB.png
new file mode 100644
index 0000000..0df19c7
Binary files /dev/null and b/lgsl/lgsl_files/locations/BB.png differ
diff --git a/lgsl/lgsl_files/locations/BD.png b/lgsl/lgsl_files/locations/BD.png
new file mode 100644
index 0000000..076a8bf
Binary files /dev/null and b/lgsl/lgsl_files/locations/BD.png differ
diff --git a/lgsl/lgsl_files/locations/BE.png b/lgsl/lgsl_files/locations/BE.png
new file mode 100644
index 0000000..d86ebc8
Binary files /dev/null and b/lgsl/lgsl_files/locations/BE.png differ
diff --git a/lgsl/lgsl_files/locations/BF.png b/lgsl/lgsl_files/locations/BF.png
new file mode 100644
index 0000000..ab5ce8f
Binary files /dev/null and b/lgsl/lgsl_files/locations/BF.png differ
diff --git a/lgsl/lgsl_files/locations/BG.png b/lgsl/lgsl_files/locations/BG.png
new file mode 100644
index 0000000..0469f06
Binary files /dev/null and b/lgsl/lgsl_files/locations/BG.png differ
diff --git a/lgsl/lgsl_files/locations/BH.png b/lgsl/lgsl_files/locations/BH.png
new file mode 100644
index 0000000..ea8ce68
Binary files /dev/null and b/lgsl/lgsl_files/locations/BH.png differ
diff --git a/lgsl/lgsl_files/locations/BI.png b/lgsl/lgsl_files/locations/BI.png
new file mode 100644
index 0000000..5cc2e30
Binary files /dev/null and b/lgsl/lgsl_files/locations/BI.png differ
diff --git a/lgsl/lgsl_files/locations/BJ.png b/lgsl/lgsl_files/locations/BJ.png
new file mode 100644
index 0000000..1cc8b45
Binary files /dev/null and b/lgsl/lgsl_files/locations/BJ.png differ
diff --git a/lgsl/lgsl_files/locations/BM.png b/lgsl/lgsl_files/locations/BM.png
new file mode 100644
index 0000000..c0c7aea
Binary files /dev/null and b/lgsl/lgsl_files/locations/BM.png differ
diff --git a/lgsl/lgsl_files/locations/BN.png b/lgsl/lgsl_files/locations/BN.png
new file mode 100644
index 0000000..8fb0984
Binary files /dev/null and b/lgsl/lgsl_files/locations/BN.png differ
diff --git a/lgsl/lgsl_files/locations/BO.png b/lgsl/lgsl_files/locations/BO.png
new file mode 100644
index 0000000..ce7ba52
Binary files /dev/null and b/lgsl/lgsl_files/locations/BO.png differ
diff --git a/lgsl/lgsl_files/locations/BR.png b/lgsl/lgsl_files/locations/BR.png
new file mode 100644
index 0000000..9b1a553
Binary files /dev/null and b/lgsl/lgsl_files/locations/BR.png differ
diff --git a/lgsl/lgsl_files/locations/BS.png b/lgsl/lgsl_files/locations/BS.png
new file mode 100644
index 0000000..639fa6c
Binary files /dev/null and b/lgsl/lgsl_files/locations/BS.png differ
diff --git a/lgsl/lgsl_files/locations/BT.png b/lgsl/lgsl_files/locations/BT.png
new file mode 100644
index 0000000..1d512df
Binary files /dev/null and b/lgsl/lgsl_files/locations/BT.png differ
diff --git a/lgsl/lgsl_files/locations/BV.png b/lgsl/lgsl_files/locations/BV.png
new file mode 100644
index 0000000..160b6b5
Binary files /dev/null and b/lgsl/lgsl_files/locations/BV.png differ
diff --git a/lgsl/lgsl_files/locations/BW.png b/lgsl/lgsl_files/locations/BW.png
new file mode 100644
index 0000000..fcb1039
Binary files /dev/null and b/lgsl/lgsl_files/locations/BW.png differ
diff --git a/lgsl/lgsl_files/locations/BY.png b/lgsl/lgsl_files/locations/BY.png
new file mode 100644
index 0000000..504774e
Binary files /dev/null and b/lgsl/lgsl_files/locations/BY.png differ
diff --git a/lgsl/lgsl_files/locations/BZ.png b/lgsl/lgsl_files/locations/BZ.png
new file mode 100644
index 0000000..be63ee1
Binary files /dev/null and b/lgsl/lgsl_files/locations/BZ.png differ
diff --git a/lgsl/lgsl_files/locations/CA.png b/lgsl/lgsl_files/locations/CA.png
new file mode 100644
index 0000000..1f20419
Binary files /dev/null and b/lgsl/lgsl_files/locations/CA.png differ
diff --git a/lgsl/lgsl_files/locations/CC.png b/lgsl/lgsl_files/locations/CC.png
new file mode 100644
index 0000000..aed3d3b
Binary files /dev/null and b/lgsl/lgsl_files/locations/CC.png differ
diff --git a/lgsl/lgsl_files/locations/CD.png b/lgsl/lgsl_files/locations/CD.png
new file mode 100644
index 0000000..5e48942
Binary files /dev/null and b/lgsl/lgsl_files/locations/CD.png differ
diff --git a/lgsl/lgsl_files/locations/CF.png b/lgsl/lgsl_files/locations/CF.png
new file mode 100644
index 0000000..da687bd
Binary files /dev/null and b/lgsl/lgsl_files/locations/CF.png differ
diff --git a/lgsl/lgsl_files/locations/CG.png b/lgsl/lgsl_files/locations/CG.png
new file mode 100644
index 0000000..a859792
Binary files /dev/null and b/lgsl/lgsl_files/locations/CG.png differ
diff --git a/lgsl/lgsl_files/locations/CH.png b/lgsl/lgsl_files/locations/CH.png
new file mode 100644
index 0000000..d716e5a
Binary files /dev/null and b/lgsl/lgsl_files/locations/CH.png differ
diff --git a/lgsl/lgsl_files/locations/CI.png b/lgsl/lgsl_files/locations/CI.png
new file mode 100644
index 0000000..3f2c62e
Binary files /dev/null and b/lgsl/lgsl_files/locations/CI.png differ
diff --git a/lgsl/lgsl_files/locations/CK.png b/lgsl/lgsl_files/locations/CK.png
new file mode 100644
index 0000000..746d3d6
Binary files /dev/null and b/lgsl/lgsl_files/locations/CK.png differ
diff --git a/lgsl/lgsl_files/locations/CL.png b/lgsl/lgsl_files/locations/CL.png
new file mode 100644
index 0000000..29c6d61
Binary files /dev/null and b/lgsl/lgsl_files/locations/CL.png differ
diff --git a/lgsl/lgsl_files/locations/CM.png b/lgsl/lgsl_files/locations/CM.png
new file mode 100644
index 0000000..f65c5bd
Binary files /dev/null and b/lgsl/lgsl_files/locations/CM.png differ
diff --git a/lgsl/lgsl_files/locations/CN.png b/lgsl/lgsl_files/locations/CN.png
new file mode 100644
index 0000000..8914414
Binary files /dev/null and b/lgsl/lgsl_files/locations/CN.png differ
diff --git a/lgsl/lgsl_files/locations/CO.png b/lgsl/lgsl_files/locations/CO.png
new file mode 100644
index 0000000..a118ff4
Binary files /dev/null and b/lgsl/lgsl_files/locations/CO.png differ
diff --git a/lgsl/lgsl_files/locations/CR.png b/lgsl/lgsl_files/locations/CR.png
new file mode 100644
index 0000000..c7a3731
Binary files /dev/null and b/lgsl/lgsl_files/locations/CR.png differ
diff --git a/lgsl/lgsl_files/locations/CS.png b/lgsl/lgsl_files/locations/CS.png
new file mode 100644
index 0000000..8254790
Binary files /dev/null and b/lgsl/lgsl_files/locations/CS.png differ
diff --git a/lgsl/lgsl_files/locations/CU.png b/lgsl/lgsl_files/locations/CU.png
new file mode 100644
index 0000000..083f1d6
Binary files /dev/null and b/lgsl/lgsl_files/locations/CU.png differ
diff --git a/lgsl/lgsl_files/locations/CV.png b/lgsl/lgsl_files/locations/CV.png
new file mode 100644
index 0000000..a63f7ea
Binary files /dev/null and b/lgsl/lgsl_files/locations/CV.png differ
diff --git a/lgsl/lgsl_files/locations/CX.png b/lgsl/lgsl_files/locations/CX.png
new file mode 100644
index 0000000..48e31ad
Binary files /dev/null and b/lgsl/lgsl_files/locations/CX.png differ
diff --git a/lgsl/lgsl_files/locations/CY.png b/lgsl/lgsl_files/locations/CY.png
new file mode 100644
index 0000000..5b1ad6c
Binary files /dev/null and b/lgsl/lgsl_files/locations/CY.png differ
diff --git a/lgsl/lgsl_files/locations/CZ.png b/lgsl/lgsl_files/locations/CZ.png
new file mode 100644
index 0000000..c8403dd
Binary files /dev/null and b/lgsl/lgsl_files/locations/CZ.png differ
diff --git a/lgsl/lgsl_files/locations/DE.png b/lgsl/lgsl_files/locations/DE.png
new file mode 100644
index 0000000..ac4a977
Binary files /dev/null and b/lgsl/lgsl_files/locations/DE.png differ
diff --git a/lgsl/lgsl_files/locations/DJ.png b/lgsl/lgsl_files/locations/DJ.png
new file mode 100644
index 0000000..582af36
Binary files /dev/null and b/lgsl/lgsl_files/locations/DJ.png differ
diff --git a/lgsl/lgsl_files/locations/DK.png b/lgsl/lgsl_files/locations/DK.png
new file mode 100644
index 0000000..e2993d3
Binary files /dev/null and b/lgsl/lgsl_files/locations/DK.png differ
diff --git a/lgsl/lgsl_files/locations/DM.png b/lgsl/lgsl_files/locations/DM.png
new file mode 100644
index 0000000..5fbffcb
Binary files /dev/null and b/lgsl/lgsl_files/locations/DM.png differ
diff --git a/lgsl/lgsl_files/locations/DO.png b/lgsl/lgsl_files/locations/DO.png
new file mode 100644
index 0000000..5a04932
Binary files /dev/null and b/lgsl/lgsl_files/locations/DO.png differ
diff --git a/lgsl/lgsl_files/locations/DZ.png b/lgsl/lgsl_files/locations/DZ.png
new file mode 100644
index 0000000..335c239
Binary files /dev/null and b/lgsl/lgsl_files/locations/DZ.png differ
diff --git a/lgsl/lgsl_files/locations/EC.png b/lgsl/lgsl_files/locations/EC.png
new file mode 100644
index 0000000..0caa0b1
Binary files /dev/null and b/lgsl/lgsl_files/locations/EC.png differ
diff --git a/lgsl/lgsl_files/locations/EE.png b/lgsl/lgsl_files/locations/EE.png
new file mode 100644
index 0000000..0c82efb
Binary files /dev/null and b/lgsl/lgsl_files/locations/EE.png differ
diff --git a/lgsl/lgsl_files/locations/EG.png b/lgsl/lgsl_files/locations/EG.png
new file mode 100644
index 0000000..8a3f7a1
Binary files /dev/null and b/lgsl/lgsl_files/locations/EG.png differ
diff --git a/lgsl/lgsl_files/locations/EH.png b/lgsl/lgsl_files/locations/EH.png
new file mode 100644
index 0000000..90a1195
Binary files /dev/null and b/lgsl/lgsl_files/locations/EH.png differ
diff --git a/lgsl/lgsl_files/locations/ER.png b/lgsl/lgsl_files/locations/ER.png
new file mode 100644
index 0000000..13065ae
Binary files /dev/null and b/lgsl/lgsl_files/locations/ER.png differ
diff --git a/lgsl/lgsl_files/locations/ES.png b/lgsl/lgsl_files/locations/ES.png
new file mode 100644
index 0000000..c2de2d7
Binary files /dev/null and b/lgsl/lgsl_files/locations/ES.png differ
diff --git a/lgsl/lgsl_files/locations/ET.png b/lgsl/lgsl_files/locations/ET.png
new file mode 100644
index 0000000..2e893fa
Binary files /dev/null and b/lgsl/lgsl_files/locations/ET.png differ
diff --git a/lgsl/lgsl_files/locations/EU.png b/lgsl/lgsl_files/locations/EU.png
new file mode 100644
index 0000000..d6d8711
Binary files /dev/null and b/lgsl/lgsl_files/locations/EU.png differ
diff --git a/lgsl/lgsl_files/locations/FI.png b/lgsl/lgsl_files/locations/FI.png
new file mode 100644
index 0000000..14ec091
Binary files /dev/null and b/lgsl/lgsl_files/locations/FI.png differ
diff --git a/lgsl/lgsl_files/locations/FJ.png b/lgsl/lgsl_files/locations/FJ.png
new file mode 100644
index 0000000..cee9988
Binary files /dev/null and b/lgsl/lgsl_files/locations/FJ.png differ
diff --git a/lgsl/lgsl_files/locations/FK.png b/lgsl/lgsl_files/locations/FK.png
new file mode 100644
index 0000000..ceaeb27
Binary files /dev/null and b/lgsl/lgsl_files/locations/FK.png differ
diff --git a/lgsl/lgsl_files/locations/FM.png b/lgsl/lgsl_files/locations/FM.png
new file mode 100644
index 0000000..066bb24
Binary files /dev/null and b/lgsl/lgsl_files/locations/FM.png differ
diff --git a/lgsl/lgsl_files/locations/FO.png b/lgsl/lgsl_files/locations/FO.png
new file mode 100644
index 0000000..cbceb80
Binary files /dev/null and b/lgsl/lgsl_files/locations/FO.png differ
diff --git a/lgsl/lgsl_files/locations/FR.png b/lgsl/lgsl_files/locations/FR.png
new file mode 100644
index 0000000..8332c4e
Binary files /dev/null and b/lgsl/lgsl_files/locations/FR.png differ
diff --git a/lgsl/lgsl_files/locations/GA.png b/lgsl/lgsl_files/locations/GA.png
new file mode 100644
index 0000000..0e0d434
Binary files /dev/null and b/lgsl/lgsl_files/locations/GA.png differ
diff --git a/lgsl/lgsl_files/locations/GB.png b/lgsl/lgsl_files/locations/GB.png
new file mode 100644
index 0000000..ff701e1
Binary files /dev/null and b/lgsl/lgsl_files/locations/GB.png differ
diff --git a/lgsl/lgsl_files/locations/GD.png b/lgsl/lgsl_files/locations/GD.png
new file mode 100644
index 0000000..9ab57f5
Binary files /dev/null and b/lgsl/lgsl_files/locations/GD.png differ
diff --git a/lgsl/lgsl_files/locations/GE.png b/lgsl/lgsl_files/locations/GE.png
new file mode 100644
index 0000000..728d970
Binary files /dev/null and b/lgsl/lgsl_files/locations/GE.png differ
diff --git a/lgsl/lgsl_files/locations/GF.png b/lgsl/lgsl_files/locations/GF.png
new file mode 100644
index 0000000..8332c4e
Binary files /dev/null and b/lgsl/lgsl_files/locations/GF.png differ
diff --git a/lgsl/lgsl_files/locations/GH.png b/lgsl/lgsl_files/locations/GH.png
new file mode 100644
index 0000000..4e2f896
Binary files /dev/null and b/lgsl/lgsl_files/locations/GH.png differ
diff --git a/lgsl/lgsl_files/locations/GI.png b/lgsl/lgsl_files/locations/GI.png
new file mode 100644
index 0000000..e76797f
Binary files /dev/null and b/lgsl/lgsl_files/locations/GI.png differ
diff --git a/lgsl/lgsl_files/locations/GL.png b/lgsl/lgsl_files/locations/GL.png
new file mode 100644
index 0000000..ef12a73
Binary files /dev/null and b/lgsl/lgsl_files/locations/GL.png differ
diff --git a/lgsl/lgsl_files/locations/GM.png b/lgsl/lgsl_files/locations/GM.png
new file mode 100644
index 0000000..0720b66
Binary files /dev/null and b/lgsl/lgsl_files/locations/GM.png differ
diff --git a/lgsl/lgsl_files/locations/GN.png b/lgsl/lgsl_files/locations/GN.png
new file mode 100644
index 0000000..ea660b0
Binary files /dev/null and b/lgsl/lgsl_files/locations/GN.png differ
diff --git a/lgsl/lgsl_files/locations/GP.png b/lgsl/lgsl_files/locations/GP.png
new file mode 100644
index 0000000..dbb086d
Binary files /dev/null and b/lgsl/lgsl_files/locations/GP.png differ
diff --git a/lgsl/lgsl_files/locations/GQ.png b/lgsl/lgsl_files/locations/GQ.png
new file mode 100644
index 0000000..ebe20a2
Binary files /dev/null and b/lgsl/lgsl_files/locations/GQ.png differ
diff --git a/lgsl/lgsl_files/locations/GR.png b/lgsl/lgsl_files/locations/GR.png
new file mode 100644
index 0000000..8651ade
Binary files /dev/null and b/lgsl/lgsl_files/locations/GR.png differ
diff --git a/lgsl/lgsl_files/locations/GS.png b/lgsl/lgsl_files/locations/GS.png
new file mode 100644
index 0000000..7ef0bf5
Binary files /dev/null and b/lgsl/lgsl_files/locations/GS.png differ
diff --git a/lgsl/lgsl_files/locations/GT.png b/lgsl/lgsl_files/locations/GT.png
new file mode 100644
index 0000000..c43a70d
Binary files /dev/null and b/lgsl/lgsl_files/locations/GT.png differ
diff --git a/lgsl/lgsl_files/locations/GU.png b/lgsl/lgsl_files/locations/GU.png
new file mode 100644
index 0000000..92f37c0
Binary files /dev/null and b/lgsl/lgsl_files/locations/GU.png differ
diff --git a/lgsl/lgsl_files/locations/GW.png b/lgsl/lgsl_files/locations/GW.png
new file mode 100644
index 0000000..b37bcf0
Binary files /dev/null and b/lgsl/lgsl_files/locations/GW.png differ
diff --git a/lgsl/lgsl_files/locations/GY.png b/lgsl/lgsl_files/locations/GY.png
new file mode 100644
index 0000000..22cbe2f
Binary files /dev/null and b/lgsl/lgsl_files/locations/GY.png differ
diff --git a/lgsl/lgsl_files/locations/HK.png b/lgsl/lgsl_files/locations/HK.png
new file mode 100644
index 0000000..d5c380c
Binary files /dev/null and b/lgsl/lgsl_files/locations/HK.png differ
diff --git a/lgsl/lgsl_files/locations/HM.png b/lgsl/lgsl_files/locations/HM.png
new file mode 100644
index 0000000..a01389a
Binary files /dev/null and b/lgsl/lgsl_files/locations/HM.png differ
diff --git a/lgsl/lgsl_files/locations/HN.png b/lgsl/lgsl_files/locations/HN.png
new file mode 100644
index 0000000..96f8388
Binary files /dev/null and b/lgsl/lgsl_files/locations/HN.png differ
diff --git a/lgsl/lgsl_files/locations/HR.png b/lgsl/lgsl_files/locations/HR.png
new file mode 100644
index 0000000..696b515
Binary files /dev/null and b/lgsl/lgsl_files/locations/HR.png differ
diff --git a/lgsl/lgsl_files/locations/HT.png b/lgsl/lgsl_files/locations/HT.png
new file mode 100644
index 0000000..416052a
Binary files /dev/null and b/lgsl/lgsl_files/locations/HT.png differ
diff --git a/lgsl/lgsl_files/locations/HU.png b/lgsl/lgsl_files/locations/HU.png
new file mode 100644
index 0000000..7baafe4
Binary files /dev/null and b/lgsl/lgsl_files/locations/HU.png differ
diff --git a/lgsl/lgsl_files/locations/ID.png b/lgsl/lgsl_files/locations/ID.png
new file mode 100644
index 0000000..c6bc0fa
Binary files /dev/null and b/lgsl/lgsl_files/locations/ID.png differ
diff --git a/lgsl/lgsl_files/locations/IE.png b/lgsl/lgsl_files/locations/IE.png
new file mode 100644
index 0000000..26baa31
Binary files /dev/null and b/lgsl/lgsl_files/locations/IE.png differ
diff --git a/lgsl/lgsl_files/locations/IL.png b/lgsl/lgsl_files/locations/IL.png
new file mode 100644
index 0000000..2ca772d
Binary files /dev/null and b/lgsl/lgsl_files/locations/IL.png differ
diff --git a/lgsl/lgsl_files/locations/IN.png b/lgsl/lgsl_files/locations/IN.png
new file mode 100644
index 0000000..e4d7e81
Binary files /dev/null and b/lgsl/lgsl_files/locations/IN.png differ
diff --git a/lgsl/lgsl_files/locations/IO.png b/lgsl/lgsl_files/locations/IO.png
new file mode 100644
index 0000000..3e74b6a
Binary files /dev/null and b/lgsl/lgsl_files/locations/IO.png differ
diff --git a/lgsl/lgsl_files/locations/IQ.png b/lgsl/lgsl_files/locations/IQ.png
new file mode 100644
index 0000000..878a351
Binary files /dev/null and b/lgsl/lgsl_files/locations/IQ.png differ
diff --git a/lgsl/lgsl_files/locations/IR.png b/lgsl/lgsl_files/locations/IR.png
new file mode 100644
index 0000000..c5fd136
Binary files /dev/null and b/lgsl/lgsl_files/locations/IR.png differ
diff --git a/lgsl/lgsl_files/locations/IS.png b/lgsl/lgsl_files/locations/IS.png
new file mode 100644
index 0000000..b8f6d0f
Binary files /dev/null and b/lgsl/lgsl_files/locations/IS.png differ
diff --git a/lgsl/lgsl_files/locations/IT.png b/lgsl/lgsl_files/locations/IT.png
new file mode 100644
index 0000000..89692f7
Binary files /dev/null and b/lgsl/lgsl_files/locations/IT.png differ
diff --git a/lgsl/lgsl_files/locations/JM.png b/lgsl/lgsl_files/locations/JM.png
new file mode 100644
index 0000000..7be119e
Binary files /dev/null and b/lgsl/lgsl_files/locations/JM.png differ
diff --git a/lgsl/lgsl_files/locations/JO.png b/lgsl/lgsl_files/locations/JO.png
new file mode 100644
index 0000000..11bd497
Binary files /dev/null and b/lgsl/lgsl_files/locations/JO.png differ
diff --git a/lgsl/lgsl_files/locations/JP.png b/lgsl/lgsl_files/locations/JP.png
new file mode 100644
index 0000000..325fbad
Binary files /dev/null and b/lgsl/lgsl_files/locations/JP.png differ
diff --git a/lgsl/lgsl_files/locations/KE.png b/lgsl/lgsl_files/locations/KE.png
new file mode 100644
index 0000000..51879ad
Binary files /dev/null and b/lgsl/lgsl_files/locations/KE.png differ
diff --git a/lgsl/lgsl_files/locations/KG.png b/lgsl/lgsl_files/locations/KG.png
new file mode 100644
index 0000000..0a818f6
Binary files /dev/null and b/lgsl/lgsl_files/locations/KG.png differ
diff --git a/lgsl/lgsl_files/locations/KH.png b/lgsl/lgsl_files/locations/KH.png
new file mode 100644
index 0000000..30f6bb1
Binary files /dev/null and b/lgsl/lgsl_files/locations/KH.png differ
diff --git a/lgsl/lgsl_files/locations/KI.png b/lgsl/lgsl_files/locations/KI.png
new file mode 100644
index 0000000..2dcce4b
Binary files /dev/null and b/lgsl/lgsl_files/locations/KI.png differ
diff --git a/lgsl/lgsl_files/locations/KM.png b/lgsl/lgsl_files/locations/KM.png
new file mode 100644
index 0000000..812b2f5
Binary files /dev/null and b/lgsl/lgsl_files/locations/KM.png differ
diff --git a/lgsl/lgsl_files/locations/KN.png b/lgsl/lgsl_files/locations/KN.png
new file mode 100644
index 0000000..febd5b4
Binary files /dev/null and b/lgsl/lgsl_files/locations/KN.png differ
diff --git a/lgsl/lgsl_files/locations/KP.png b/lgsl/lgsl_files/locations/KP.png
new file mode 100644
index 0000000..d3d509a
Binary files /dev/null and b/lgsl/lgsl_files/locations/KP.png differ
diff --git a/lgsl/lgsl_files/locations/KR.png b/lgsl/lgsl_files/locations/KR.png
new file mode 100644
index 0000000..9c0a78e
Binary files /dev/null and b/lgsl/lgsl_files/locations/KR.png differ
diff --git a/lgsl/lgsl_files/locations/KW.png b/lgsl/lgsl_files/locations/KW.png
new file mode 100644
index 0000000..96546da
Binary files /dev/null and b/lgsl/lgsl_files/locations/KW.png differ
diff --git a/lgsl/lgsl_files/locations/KY.png b/lgsl/lgsl_files/locations/KY.png
new file mode 100644
index 0000000..15c5f8e
Binary files /dev/null and b/lgsl/lgsl_files/locations/KY.png differ
diff --git a/lgsl/lgsl_files/locations/KZ.png b/lgsl/lgsl_files/locations/KZ.png
new file mode 100644
index 0000000..45a8c88
Binary files /dev/null and b/lgsl/lgsl_files/locations/KZ.png differ
diff --git a/lgsl/lgsl_files/locations/LA.png b/lgsl/lgsl_files/locations/LA.png
new file mode 100644
index 0000000..e28acd0
Binary files /dev/null and b/lgsl/lgsl_files/locations/LA.png differ
diff --git a/lgsl/lgsl_files/locations/LB.png b/lgsl/lgsl_files/locations/LB.png
new file mode 100644
index 0000000..d0d452b
Binary files /dev/null and b/lgsl/lgsl_files/locations/LB.png differ
diff --git a/lgsl/lgsl_files/locations/LC.png b/lgsl/lgsl_files/locations/LC.png
new file mode 100644
index 0000000..a47d065
Binary files /dev/null and b/lgsl/lgsl_files/locations/LC.png differ
diff --git a/lgsl/lgsl_files/locations/LI.png b/lgsl/lgsl_files/locations/LI.png
new file mode 100644
index 0000000..6469909
Binary files /dev/null and b/lgsl/lgsl_files/locations/LI.png differ
diff --git a/lgsl/lgsl_files/locations/LK.png b/lgsl/lgsl_files/locations/LK.png
new file mode 100644
index 0000000..088aad6
Binary files /dev/null and b/lgsl/lgsl_files/locations/LK.png differ
diff --git a/lgsl/lgsl_files/locations/LR.png b/lgsl/lgsl_files/locations/LR.png
new file mode 100644
index 0000000..89a5bc7
Binary files /dev/null and b/lgsl/lgsl_files/locations/LR.png differ
diff --git a/lgsl/lgsl_files/locations/LS.png b/lgsl/lgsl_files/locations/LS.png
new file mode 100644
index 0000000..33fdef1
Binary files /dev/null and b/lgsl/lgsl_files/locations/LS.png differ
diff --git a/lgsl/lgsl_files/locations/LT.png b/lgsl/lgsl_files/locations/LT.png
new file mode 100644
index 0000000..c8ef0da
Binary files /dev/null and b/lgsl/lgsl_files/locations/LT.png differ
diff --git a/lgsl/lgsl_files/locations/LU.png b/lgsl/lgsl_files/locations/LU.png
new file mode 100644
index 0000000..4cabba9
Binary files /dev/null and b/lgsl/lgsl_files/locations/LU.png differ
diff --git a/lgsl/lgsl_files/locations/LV.png b/lgsl/lgsl_files/locations/LV.png
new file mode 100644
index 0000000..49b6998
Binary files /dev/null and b/lgsl/lgsl_files/locations/LV.png differ
diff --git a/lgsl/lgsl_files/locations/LY.png b/lgsl/lgsl_files/locations/LY.png
new file mode 100644
index 0000000..b163a9f
Binary files /dev/null and b/lgsl/lgsl_files/locations/LY.png differ
diff --git a/lgsl/lgsl_files/locations/MA.png b/lgsl/lgsl_files/locations/MA.png
new file mode 100644
index 0000000..f386770
Binary files /dev/null and b/lgsl/lgsl_files/locations/MA.png differ
diff --git a/lgsl/lgsl_files/locations/MC.png b/lgsl/lgsl_files/locations/MC.png
new file mode 100644
index 0000000..1aa830f
Binary files /dev/null and b/lgsl/lgsl_files/locations/MC.png differ
diff --git a/lgsl/lgsl_files/locations/MD.png b/lgsl/lgsl_files/locations/MD.png
new file mode 100644
index 0000000..4e92c18
Binary files /dev/null and b/lgsl/lgsl_files/locations/MD.png differ
diff --git a/lgsl/lgsl_files/locations/ME.png b/lgsl/lgsl_files/locations/ME.png
new file mode 100644
index 0000000..ac72535
Binary files /dev/null and b/lgsl/lgsl_files/locations/ME.png differ
diff --git a/lgsl/lgsl_files/locations/MG.png b/lgsl/lgsl_files/locations/MG.png
new file mode 100644
index 0000000..d2715b3
Binary files /dev/null and b/lgsl/lgsl_files/locations/MG.png differ
diff --git a/lgsl/lgsl_files/locations/MH.png b/lgsl/lgsl_files/locations/MH.png
new file mode 100644
index 0000000..fb523a8
Binary files /dev/null and b/lgsl/lgsl_files/locations/MH.png differ
diff --git a/lgsl/lgsl_files/locations/MK.png b/lgsl/lgsl_files/locations/MK.png
new file mode 100644
index 0000000..db173aa
Binary files /dev/null and b/lgsl/lgsl_files/locations/MK.png differ
diff --git a/lgsl/lgsl_files/locations/ML.png b/lgsl/lgsl_files/locations/ML.png
new file mode 100644
index 0000000..2cec8ba
Binary files /dev/null and b/lgsl/lgsl_files/locations/ML.png differ
diff --git a/lgsl/lgsl_files/locations/MM.png b/lgsl/lgsl_files/locations/MM.png
new file mode 100644
index 0000000..f464f67
Binary files /dev/null and b/lgsl/lgsl_files/locations/MM.png differ
diff --git a/lgsl/lgsl_files/locations/MN.png b/lgsl/lgsl_files/locations/MN.png
new file mode 100644
index 0000000..9396355
Binary files /dev/null and b/lgsl/lgsl_files/locations/MN.png differ
diff --git a/lgsl/lgsl_files/locations/MO.png b/lgsl/lgsl_files/locations/MO.png
new file mode 100644
index 0000000..deb801d
Binary files /dev/null and b/lgsl/lgsl_files/locations/MO.png differ
diff --git a/lgsl/lgsl_files/locations/MP.png b/lgsl/lgsl_files/locations/MP.png
new file mode 100644
index 0000000..298d588
Binary files /dev/null and b/lgsl/lgsl_files/locations/MP.png differ
diff --git a/lgsl/lgsl_files/locations/MQ.png b/lgsl/lgsl_files/locations/MQ.png
new file mode 100644
index 0000000..010143b
Binary files /dev/null and b/lgsl/lgsl_files/locations/MQ.png differ
diff --git a/lgsl/lgsl_files/locations/MR.png b/lgsl/lgsl_files/locations/MR.png
new file mode 100644
index 0000000..319546b
Binary files /dev/null and b/lgsl/lgsl_files/locations/MR.png differ
diff --git a/lgsl/lgsl_files/locations/MS.png b/lgsl/lgsl_files/locations/MS.png
new file mode 100644
index 0000000..d4cbb43
Binary files /dev/null and b/lgsl/lgsl_files/locations/MS.png differ
diff --git a/lgsl/lgsl_files/locations/MT.png b/lgsl/lgsl_files/locations/MT.png
new file mode 100644
index 0000000..00af948
Binary files /dev/null and b/lgsl/lgsl_files/locations/MT.png differ
diff --git a/lgsl/lgsl_files/locations/MU.png b/lgsl/lgsl_files/locations/MU.png
new file mode 100644
index 0000000..b7fdce1
Binary files /dev/null and b/lgsl/lgsl_files/locations/MU.png differ
diff --git a/lgsl/lgsl_files/locations/MV.png b/lgsl/lgsl_files/locations/MV.png
new file mode 100644
index 0000000..5073d9e
Binary files /dev/null and b/lgsl/lgsl_files/locations/MV.png differ
diff --git a/lgsl/lgsl_files/locations/MW.png b/lgsl/lgsl_files/locations/MW.png
new file mode 100644
index 0000000..13886e9
Binary files /dev/null and b/lgsl/lgsl_files/locations/MW.png differ
diff --git a/lgsl/lgsl_files/locations/MX.png b/lgsl/lgsl_files/locations/MX.png
new file mode 100644
index 0000000..5bc58ab
Binary files /dev/null and b/lgsl/lgsl_files/locations/MX.png differ
diff --git a/lgsl/lgsl_files/locations/MY.png b/lgsl/lgsl_files/locations/MY.png
new file mode 100644
index 0000000..9034cba
Binary files /dev/null and b/lgsl/lgsl_files/locations/MY.png differ
diff --git a/lgsl/lgsl_files/locations/MZ.png b/lgsl/lgsl_files/locations/MZ.png
new file mode 100644
index 0000000..76405e0
Binary files /dev/null and b/lgsl/lgsl_files/locations/MZ.png differ
diff --git a/lgsl/lgsl_files/locations/NA.png b/lgsl/lgsl_files/locations/NA.png
new file mode 100644
index 0000000..63358c6
Binary files /dev/null and b/lgsl/lgsl_files/locations/NA.png differ
diff --git a/lgsl/lgsl_files/locations/NC.png b/lgsl/lgsl_files/locations/NC.png
new file mode 100644
index 0000000..2cad283
Binary files /dev/null and b/lgsl/lgsl_files/locations/NC.png differ
diff --git a/lgsl/lgsl_files/locations/NE.png b/lgsl/lgsl_files/locations/NE.png
new file mode 100644
index 0000000..d85f424
Binary files /dev/null and b/lgsl/lgsl_files/locations/NE.png differ
diff --git a/lgsl/lgsl_files/locations/NF.png b/lgsl/lgsl_files/locations/NF.png
new file mode 100644
index 0000000..f9bcdda
Binary files /dev/null and b/lgsl/lgsl_files/locations/NF.png differ
diff --git a/lgsl/lgsl_files/locations/NG.png b/lgsl/lgsl_files/locations/NG.png
new file mode 100644
index 0000000..3eea2e0
Binary files /dev/null and b/lgsl/lgsl_files/locations/NG.png differ
diff --git a/lgsl/lgsl_files/locations/NI.png b/lgsl/lgsl_files/locations/NI.png
new file mode 100644
index 0000000..3969aaa
Binary files /dev/null and b/lgsl/lgsl_files/locations/NI.png differ
diff --git a/lgsl/lgsl_files/locations/NL.png b/lgsl/lgsl_files/locations/NL.png
new file mode 100644
index 0000000..fe44791
Binary files /dev/null and b/lgsl/lgsl_files/locations/NL.png differ
diff --git a/lgsl/lgsl_files/locations/NO.png b/lgsl/lgsl_files/locations/NO.png
new file mode 100644
index 0000000..160b6b5
Binary files /dev/null and b/lgsl/lgsl_files/locations/NO.png differ
diff --git a/lgsl/lgsl_files/locations/NP.png b/lgsl/lgsl_files/locations/NP.png
new file mode 100644
index 0000000..95b1099
Binary files /dev/null and b/lgsl/lgsl_files/locations/NP.png differ
diff --git a/lgsl/lgsl_files/locations/NR.png b/lgsl/lgsl_files/locations/NR.png
new file mode 100644
index 0000000..705fc33
Binary files /dev/null and b/lgsl/lgsl_files/locations/NR.png differ
diff --git a/lgsl/lgsl_files/locations/NU.png b/lgsl/lgsl_files/locations/NU.png
new file mode 100644
index 0000000..c3ce4ae
Binary files /dev/null and b/lgsl/lgsl_files/locations/NU.png differ
diff --git a/lgsl/lgsl_files/locations/NZ.png b/lgsl/lgsl_files/locations/NZ.png
new file mode 100644
index 0000000..10d6306
Binary files /dev/null and b/lgsl/lgsl_files/locations/NZ.png differ
diff --git a/lgsl/lgsl_files/locations/OFF.png b/lgsl/lgsl_files/locations/OFF.png
new file mode 100644
index 0000000..233bef2
Binary files /dev/null and b/lgsl/lgsl_files/locations/OFF.png differ
diff --git a/lgsl/lgsl_files/locations/OM.png b/lgsl/lgsl_files/locations/OM.png
new file mode 100644
index 0000000..2ffba7e
Binary files /dev/null and b/lgsl/lgsl_files/locations/OM.png differ
diff --git a/lgsl/lgsl_files/locations/PA.png b/lgsl/lgsl_files/locations/PA.png
new file mode 100644
index 0000000..9b2ee9a
Binary files /dev/null and b/lgsl/lgsl_files/locations/PA.png differ
diff --git a/lgsl/lgsl_files/locations/PE.png b/lgsl/lgsl_files/locations/PE.png
new file mode 100644
index 0000000..62a0497
Binary files /dev/null and b/lgsl/lgsl_files/locations/PE.png differ
diff --git a/lgsl/lgsl_files/locations/PF.png b/lgsl/lgsl_files/locations/PF.png
new file mode 100644
index 0000000..771a0f6
Binary files /dev/null and b/lgsl/lgsl_files/locations/PF.png differ
diff --git a/lgsl/lgsl_files/locations/PG.png b/lgsl/lgsl_files/locations/PG.png
new file mode 100644
index 0000000..10d6233
Binary files /dev/null and b/lgsl/lgsl_files/locations/PG.png differ
diff --git a/lgsl/lgsl_files/locations/PH.png b/lgsl/lgsl_files/locations/PH.png
new file mode 100644
index 0000000..b89e159
Binary files /dev/null and b/lgsl/lgsl_files/locations/PH.png differ
diff --git a/lgsl/lgsl_files/locations/PK.png b/lgsl/lgsl_files/locations/PK.png
new file mode 100644
index 0000000..e9df70c
Binary files /dev/null and b/lgsl/lgsl_files/locations/PK.png differ
diff --git a/lgsl/lgsl_files/locations/PL.png b/lgsl/lgsl_files/locations/PL.png
new file mode 100644
index 0000000..d413d01
Binary files /dev/null and b/lgsl/lgsl_files/locations/PL.png differ
diff --git a/lgsl/lgsl_files/locations/PM.png b/lgsl/lgsl_files/locations/PM.png
new file mode 100644
index 0000000..ba91d2c
Binary files /dev/null and b/lgsl/lgsl_files/locations/PM.png differ
diff --git a/lgsl/lgsl_files/locations/PN.png b/lgsl/lgsl_files/locations/PN.png
new file mode 100644
index 0000000..aa9344f
Binary files /dev/null and b/lgsl/lgsl_files/locations/PN.png differ
diff --git a/lgsl/lgsl_files/locations/PR.png b/lgsl/lgsl_files/locations/PR.png
new file mode 100644
index 0000000..82d9130
Binary files /dev/null and b/lgsl/lgsl_files/locations/PR.png differ
diff --git a/lgsl/lgsl_files/locations/PS.png b/lgsl/lgsl_files/locations/PS.png
new file mode 100644
index 0000000..f5f5477
Binary files /dev/null and b/lgsl/lgsl_files/locations/PS.png differ
diff --git a/lgsl/lgsl_files/locations/PT.png b/lgsl/lgsl_files/locations/PT.png
new file mode 100644
index 0000000..ece7980
Binary files /dev/null and b/lgsl/lgsl_files/locations/PT.png differ
diff --git a/lgsl/lgsl_files/locations/PW.png b/lgsl/lgsl_files/locations/PW.png
new file mode 100644
index 0000000..6178b25
Binary files /dev/null and b/lgsl/lgsl_files/locations/PW.png differ
diff --git a/lgsl/lgsl_files/locations/PY.png b/lgsl/lgsl_files/locations/PY.png
new file mode 100644
index 0000000..cb8723c
Binary files /dev/null and b/lgsl/lgsl_files/locations/PY.png differ
diff --git a/lgsl/lgsl_files/locations/QA.png b/lgsl/lgsl_files/locations/QA.png
new file mode 100644
index 0000000..ed4c621
Binary files /dev/null and b/lgsl/lgsl_files/locations/QA.png differ
diff --git a/lgsl/lgsl_files/locations/RE.png b/lgsl/lgsl_files/locations/RE.png
new file mode 100644
index 0000000..8332c4e
Binary files /dev/null and b/lgsl/lgsl_files/locations/RE.png differ
diff --git a/lgsl/lgsl_files/locations/RO.png b/lgsl/lgsl_files/locations/RO.png
new file mode 100644
index 0000000..57e74a6
Binary files /dev/null and b/lgsl/lgsl_files/locations/RO.png differ
diff --git a/lgsl/lgsl_files/locations/RS.png b/lgsl/lgsl_files/locations/RS.png
new file mode 100644
index 0000000..9439a5b
Binary files /dev/null and b/lgsl/lgsl_files/locations/RS.png differ
diff --git a/lgsl/lgsl_files/locations/RU.png b/lgsl/lgsl_files/locations/RU.png
new file mode 100644
index 0000000..47da421
Binary files /dev/null and b/lgsl/lgsl_files/locations/RU.png differ
diff --git a/lgsl/lgsl_files/locations/RW.png b/lgsl/lgsl_files/locations/RW.png
new file mode 100644
index 0000000..5356491
Binary files /dev/null and b/lgsl/lgsl_files/locations/RW.png differ
diff --git a/lgsl/lgsl_files/locations/SA.png b/lgsl/lgsl_files/locations/SA.png
new file mode 100644
index 0000000..b4641c7
Binary files /dev/null and b/lgsl/lgsl_files/locations/SA.png differ
diff --git a/lgsl/lgsl_files/locations/SB.png b/lgsl/lgsl_files/locations/SB.png
new file mode 100644
index 0000000..a9937cc
Binary files /dev/null and b/lgsl/lgsl_files/locations/SB.png differ
diff --git a/lgsl/lgsl_files/locations/SC.png b/lgsl/lgsl_files/locations/SC.png
new file mode 100644
index 0000000..39ee371
Binary files /dev/null and b/lgsl/lgsl_files/locations/SC.png differ
diff --git a/lgsl/lgsl_files/locations/SD.png b/lgsl/lgsl_files/locations/SD.png
new file mode 100644
index 0000000..eaab69e
Binary files /dev/null and b/lgsl/lgsl_files/locations/SD.png differ
diff --git a/lgsl/lgsl_files/locations/SE.png b/lgsl/lgsl_files/locations/SE.png
new file mode 100644
index 0000000..1994653
Binary files /dev/null and b/lgsl/lgsl_files/locations/SE.png differ
diff --git a/lgsl/lgsl_files/locations/SG.png b/lgsl/lgsl_files/locations/SG.png
new file mode 100644
index 0000000..dd34d61
Binary files /dev/null and b/lgsl/lgsl_files/locations/SG.png differ
diff --git a/lgsl/lgsl_files/locations/SH.png b/lgsl/lgsl_files/locations/SH.png
new file mode 100644
index 0000000..4b1d2a2
Binary files /dev/null and b/lgsl/lgsl_files/locations/SH.png differ
diff --git a/lgsl/lgsl_files/locations/SI.png b/lgsl/lgsl_files/locations/SI.png
new file mode 100644
index 0000000..bb1476f
Binary files /dev/null and b/lgsl/lgsl_files/locations/SI.png differ
diff --git a/lgsl/lgsl_files/locations/SJ.png b/lgsl/lgsl_files/locations/SJ.png
new file mode 100644
index 0000000..160b6b5
Binary files /dev/null and b/lgsl/lgsl_files/locations/SJ.png differ
diff --git a/lgsl/lgsl_files/locations/SK.png b/lgsl/lgsl_files/locations/SK.png
new file mode 100644
index 0000000..7ccbc82
Binary files /dev/null and b/lgsl/lgsl_files/locations/SK.png differ
diff --git a/lgsl/lgsl_files/locations/SL.png b/lgsl/lgsl_files/locations/SL.png
new file mode 100644
index 0000000..12d812d
Binary files /dev/null and b/lgsl/lgsl_files/locations/SL.png differ
diff --git a/lgsl/lgsl_files/locations/SM.png b/lgsl/lgsl_files/locations/SM.png
new file mode 100644
index 0000000..3df2fdc
Binary files /dev/null and b/lgsl/lgsl_files/locations/SM.png differ
diff --git a/lgsl/lgsl_files/locations/SN.png b/lgsl/lgsl_files/locations/SN.png
new file mode 100644
index 0000000..eabb71d
Binary files /dev/null and b/lgsl/lgsl_files/locations/SN.png differ
diff --git a/lgsl/lgsl_files/locations/SO.png b/lgsl/lgsl_files/locations/SO.png
new file mode 100644
index 0000000..4a1ea4b
Binary files /dev/null and b/lgsl/lgsl_files/locations/SO.png differ
diff --git a/lgsl/lgsl_files/locations/SR.png b/lgsl/lgsl_files/locations/SR.png
new file mode 100644
index 0000000..5eff927
Binary files /dev/null and b/lgsl/lgsl_files/locations/SR.png differ
diff --git a/lgsl/lgsl_files/locations/ST.png b/lgsl/lgsl_files/locations/ST.png
new file mode 100644
index 0000000..2978557
Binary files /dev/null and b/lgsl/lgsl_files/locations/ST.png differ
diff --git a/lgsl/lgsl_files/locations/SV.png b/lgsl/lgsl_files/locations/SV.png
new file mode 100644
index 0000000..2498799
Binary files /dev/null and b/lgsl/lgsl_files/locations/SV.png differ
diff --git a/lgsl/lgsl_files/locations/SY.png b/lgsl/lgsl_files/locations/SY.png
new file mode 100644
index 0000000..f5ce30d
Binary files /dev/null and b/lgsl/lgsl_files/locations/SY.png differ
diff --git a/lgsl/lgsl_files/locations/SZ.png b/lgsl/lgsl_files/locations/SZ.png
new file mode 100644
index 0000000..914ee86
Binary files /dev/null and b/lgsl/lgsl_files/locations/SZ.png differ
diff --git a/lgsl/lgsl_files/locations/TC.png b/lgsl/lgsl_files/locations/TC.png
new file mode 100644
index 0000000..8fc1156
Binary files /dev/null and b/lgsl/lgsl_files/locations/TC.png differ
diff --git a/lgsl/lgsl_files/locations/TD.png b/lgsl/lgsl_files/locations/TD.png
new file mode 100644
index 0000000..667f21f
Binary files /dev/null and b/lgsl/lgsl_files/locations/TD.png differ
diff --git a/lgsl/lgsl_files/locations/TF.png b/lgsl/lgsl_files/locations/TF.png
new file mode 100644
index 0000000..80529a4
Binary files /dev/null and b/lgsl/lgsl_files/locations/TF.png differ
diff --git a/lgsl/lgsl_files/locations/TG.png b/lgsl/lgsl_files/locations/TG.png
new file mode 100644
index 0000000..3aa00ad
Binary files /dev/null and b/lgsl/lgsl_files/locations/TG.png differ
diff --git a/lgsl/lgsl_files/locations/TH.png b/lgsl/lgsl_files/locations/TH.png
new file mode 100644
index 0000000..dd8ba91
Binary files /dev/null and b/lgsl/lgsl_files/locations/TH.png differ
diff --git a/lgsl/lgsl_files/locations/TJ.png b/lgsl/lgsl_files/locations/TJ.png
new file mode 100644
index 0000000..617bf64
Binary files /dev/null and b/lgsl/lgsl_files/locations/TJ.png differ
diff --git a/lgsl/lgsl_files/locations/TK.png b/lgsl/lgsl_files/locations/TK.png
new file mode 100644
index 0000000..67b8c8c
Binary files /dev/null and b/lgsl/lgsl_files/locations/TK.png differ
diff --git a/lgsl/lgsl_files/locations/TL.png b/lgsl/lgsl_files/locations/TL.png
new file mode 100644
index 0000000..77da181
Binary files /dev/null and b/lgsl/lgsl_files/locations/TL.png differ
diff --git a/lgsl/lgsl_files/locations/TM.png b/lgsl/lgsl_files/locations/TM.png
new file mode 100644
index 0000000..828020e
Binary files /dev/null and b/lgsl/lgsl_files/locations/TM.png differ
diff --git a/lgsl/lgsl_files/locations/TN.png b/lgsl/lgsl_files/locations/TN.png
new file mode 100644
index 0000000..183cdd3
Binary files /dev/null and b/lgsl/lgsl_files/locations/TN.png differ
diff --git a/lgsl/lgsl_files/locations/TO.png b/lgsl/lgsl_files/locations/TO.png
new file mode 100644
index 0000000..f89b8ba
Binary files /dev/null and b/lgsl/lgsl_files/locations/TO.png differ
diff --git a/lgsl/lgsl_files/locations/TR.png b/lgsl/lgsl_files/locations/TR.png
new file mode 100644
index 0000000..be32f77
Binary files /dev/null and b/lgsl/lgsl_files/locations/TR.png differ
diff --git a/lgsl/lgsl_files/locations/TT.png b/lgsl/lgsl_files/locations/TT.png
new file mode 100644
index 0000000..2a11c1e
Binary files /dev/null and b/lgsl/lgsl_files/locations/TT.png differ
diff --git a/lgsl/lgsl_files/locations/TV.png b/lgsl/lgsl_files/locations/TV.png
new file mode 100644
index 0000000..28274c5
Binary files /dev/null and b/lgsl/lgsl_files/locations/TV.png differ
diff --git a/lgsl/lgsl_files/locations/TW.png b/lgsl/lgsl_files/locations/TW.png
new file mode 100644
index 0000000..f31c654
Binary files /dev/null and b/lgsl/lgsl_files/locations/TW.png differ
diff --git a/lgsl/lgsl_files/locations/TZ.png b/lgsl/lgsl_files/locations/TZ.png
new file mode 100644
index 0000000..c00ff79
Binary files /dev/null and b/lgsl/lgsl_files/locations/TZ.png differ
diff --git a/lgsl/lgsl_files/locations/UA.png b/lgsl/lgsl_files/locations/UA.png
new file mode 100644
index 0000000..09563a2
Binary files /dev/null and b/lgsl/lgsl_files/locations/UA.png differ
diff --git a/lgsl/lgsl_files/locations/UG.png b/lgsl/lgsl_files/locations/UG.png
new file mode 100644
index 0000000..33f4aff
Binary files /dev/null and b/lgsl/lgsl_files/locations/UG.png differ
diff --git a/lgsl/lgsl_files/locations/UM.png b/lgsl/lgsl_files/locations/UM.png
new file mode 100644
index 0000000..c1dd965
Binary files /dev/null and b/lgsl/lgsl_files/locations/UM.png differ
diff --git a/lgsl/lgsl_files/locations/US.png b/lgsl/lgsl_files/locations/US.png
new file mode 100644
index 0000000..10f451f
Binary files /dev/null and b/lgsl/lgsl_files/locations/US.png differ
diff --git a/lgsl/lgsl_files/locations/UY.png b/lgsl/lgsl_files/locations/UY.png
new file mode 100644
index 0000000..31d948a
Binary files /dev/null and b/lgsl/lgsl_files/locations/UY.png differ
diff --git a/lgsl/lgsl_files/locations/UZ.png b/lgsl/lgsl_files/locations/UZ.png
new file mode 100644
index 0000000..fef5dc1
Binary files /dev/null and b/lgsl/lgsl_files/locations/UZ.png differ
diff --git a/lgsl/lgsl_files/locations/VA.png b/lgsl/lgsl_files/locations/VA.png
new file mode 100644
index 0000000..b31eaf2
Binary files /dev/null and b/lgsl/lgsl_files/locations/VA.png differ
diff --git a/lgsl/lgsl_files/locations/VC.png b/lgsl/lgsl_files/locations/VC.png
new file mode 100644
index 0000000..8fa17b0
Binary files /dev/null and b/lgsl/lgsl_files/locations/VC.png differ
diff --git a/lgsl/lgsl_files/locations/VE.png b/lgsl/lgsl_files/locations/VE.png
new file mode 100644
index 0000000..00c90f9
Binary files /dev/null and b/lgsl/lgsl_files/locations/VE.png differ
diff --git a/lgsl/lgsl_files/locations/VG.png b/lgsl/lgsl_files/locations/VG.png
new file mode 100644
index 0000000..4156907
Binary files /dev/null and b/lgsl/lgsl_files/locations/VG.png differ
diff --git a/lgsl/lgsl_files/locations/VI.png b/lgsl/lgsl_files/locations/VI.png
new file mode 100644
index 0000000..ed26915
Binary files /dev/null and b/lgsl/lgsl_files/locations/VI.png differ
diff --git a/lgsl/lgsl_files/locations/VN.png b/lgsl/lgsl_files/locations/VN.png
new file mode 100644
index 0000000..ec7cd48
Binary files /dev/null and b/lgsl/lgsl_files/locations/VN.png differ
diff --git a/lgsl/lgsl_files/locations/VU.png b/lgsl/lgsl_files/locations/VU.png
new file mode 100644
index 0000000..b3397bc
Binary files /dev/null and b/lgsl/lgsl_files/locations/VU.png differ
diff --git a/lgsl/lgsl_files/locations/WF.png b/lgsl/lgsl_files/locations/WF.png
new file mode 100644
index 0000000..9f95587
Binary files /dev/null and b/lgsl/lgsl_files/locations/WF.png differ
diff --git a/lgsl/lgsl_files/locations/WS.png b/lgsl/lgsl_files/locations/WS.png
new file mode 100644
index 0000000..c169508
Binary files /dev/null and b/lgsl/lgsl_files/locations/WS.png differ
diff --git a/lgsl/lgsl_files/locations/XX.png b/lgsl/lgsl_files/locations/XX.png
new file mode 100644
index 0000000..628ebbc
Binary files /dev/null and b/lgsl/lgsl_files/locations/XX.png differ
diff --git a/lgsl/lgsl_files/locations/YE.png b/lgsl/lgsl_files/locations/YE.png
new file mode 100644
index 0000000..468dfad
Binary files /dev/null and b/lgsl/lgsl_files/locations/YE.png differ
diff --git a/lgsl/lgsl_files/locations/YT.png b/lgsl/lgsl_files/locations/YT.png
new file mode 100644
index 0000000..c298f37
Binary files /dev/null and b/lgsl/lgsl_files/locations/YT.png differ
diff --git a/lgsl/lgsl_files/locations/ZA.png b/lgsl/lgsl_files/locations/ZA.png
new file mode 100644
index 0000000..57c58e2
Binary files /dev/null and b/lgsl/lgsl_files/locations/ZA.png differ
diff --git a/lgsl/lgsl_files/locations/ZM.png b/lgsl/lgsl_files/locations/ZM.png
new file mode 100644
index 0000000..c25b07b
Binary files /dev/null and b/lgsl/lgsl_files/locations/ZM.png differ
diff --git a/lgsl/lgsl_files/locations/ZW.png b/lgsl/lgsl_files/locations/ZW.png
new file mode 100644
index 0000000..53c9725
Binary files /dev/null and b/lgsl/lgsl_files/locations/ZW.png differ
diff --git a/lgsl/lgsl_files/maps/MAP_IMAGES_GO_HERE.txt b/lgsl/lgsl_files/maps/MAP_IMAGES_GO_HERE.txt
new file mode 100644
index 0000000..985e463
--- /dev/null
+++ b/lgsl/lgsl_files/maps/MAP_IMAGES_GO_HERE.txt
@@ -0,0 +1,2 @@
+
+ http://www.greycube.com/help/readme/lgsl/map_images/
\ No newline at end of file
diff --git a/lgsl/lgsl_files/other/icon_details.gif b/lgsl/lgsl_files/other/icon_details.gif
new file mode 100644
index 0000000..c3b84d0
Binary files /dev/null and b/lgsl/lgsl_files/other/icon_details.gif differ
diff --git a/lgsl/lgsl_files/other/icon_lgsl_16x16.png b/lgsl/lgsl_files/other/icon_lgsl_16x16.png
new file mode 100644
index 0000000..21af873
Binary files /dev/null and b/lgsl/lgsl_files/other/icon_lgsl_16x16.png differ
diff --git a/lgsl/lgsl_files/other/icon_lgsl_32x32.png b/lgsl/lgsl_files/other/icon_lgsl_32x32.png
new file mode 100644
index 0000000..3f18f0f
Binary files /dev/null and b/lgsl/lgsl_files/other/icon_lgsl_32x32.png differ
diff --git a/lgsl/lgsl_files/other/icon_lgsl_48x48.png b/lgsl/lgsl_files/other/icon_lgsl_48x48.png
new file mode 100644
index 0000000..b3e1b65
Binary files /dev/null and b/lgsl/lgsl_files/other/icon_lgsl_48x48.png differ
diff --git a/lgsl/lgsl_files/other/icon_no_response.gif b/lgsl/lgsl_files/other/icon_no_response.gif
new file mode 100644
index 0000000..371ecf0
Binary files /dev/null and b/lgsl/lgsl_files/other/icon_no_response.gif differ
diff --git a/lgsl/lgsl_files/other/icon_online.gif b/lgsl/lgsl_files/other/icon_online.gif
new file mode 100644
index 0000000..2d67c13
Binary files /dev/null and b/lgsl/lgsl_files/other/icon_online.gif differ
diff --git a/lgsl/lgsl_files/other/icon_online_password.gif b/lgsl/lgsl_files/other/icon_online_password.gif
new file mode 100644
index 0000000..34a2b35
Binary files /dev/null and b/lgsl/lgsl_files/other/icon_online_password.gif differ
diff --git a/lgsl/lgsl_files/other/icon_unknown.gif b/lgsl/lgsl_files/other/icon_unknown.gif
new file mode 100644
index 0000000..b7d0366
Binary files /dev/null and b/lgsl/lgsl_files/other/icon_unknown.gif differ
diff --git a/lgsl/lgsl_files/other/map_no_image.jpg b/lgsl/lgsl_files/other/map_no_image.jpg
new file mode 100644
index 0000000..5892384
Binary files /dev/null and b/lgsl/lgsl_files/other/map_no_image.jpg differ
diff --git a/lgsl/lgsl_files/other/map_no_response.jpg b/lgsl/lgsl_files/other/map_no_response.jpg
new file mode 100644
index 0000000..c08213f
Binary files /dev/null and b/lgsl/lgsl_files/other/map_no_response.jpg differ
diff --git a/lgsl/lgsl_files/other/map_overlay.gif b/lgsl/lgsl_files/other/map_overlay.gif
new file mode 100644
index 0000000..0b10f5c
Binary files /dev/null and b/lgsl/lgsl_files/other/map_overlay.gif differ
diff --git a/lgsl/lgsl_files/other/map_overlay_password.gif b/lgsl/lgsl_files/other/map_overlay_password.gif
new file mode 100644
index 0000000..deee325
Binary files /dev/null and b/lgsl/lgsl_files/other/map_overlay_password.gif differ
diff --git a/lgsl/lgsl_style.css b/lgsl/lgsl_style.css
new file mode 100644
index 0000000..9ac00ea
--- /dev/null
+++ b/lgsl/lgsl_style.css
@@ -0,0 +1,29 @@
+body
+{
+ background-color:#ccd5e2;
+ font-size:11px;
+ font-family:verdana,tahoma,arial;
+ word-wrap:break-word;
+}
+
+a:link
+{
+ text-decoration:none;
+ color:#c00000;
+}
+
+a:visited
+{
+ text-decoration:none;
+ color:#c00000;
+}
+
+a:hover
+{
+ color:#7500c0;
+}
+
+a:active
+{
+ color:#7500c0;
+}
diff --git a/lgsl_install_sa.sql b/lgsl_install_sa.sql
new file mode 100644
index 0000000..d0f2b59
--- /dev/null
+++ b/lgsl_install_sa.sql
@@ -0,0 +1,18 @@
+CREATE TABLE `lgsl` (
+
+ `id` INT (11) NOT NULL auto_increment,
+ `type` VARCHAR (50) NOT NULL DEFAULT '',
+ `ip` VARCHAR (255) NOT NULL DEFAULT '',
+ `c_port` VARCHAR (5) NOT NULL DEFAULT '0',
+ `q_port` VARCHAR (5) NOT NULL DEFAULT '0',
+ `s_port` VARCHAR (5) NOT NULL DEFAULT '0',
+ `zone` VARCHAR (255) NOT NULL DEFAULT '',
+ `disabled` TINYINT (1) NOT NULL DEFAULT '0',
+ `comment` VARCHAR (255) NOT NULL DEFAULT '',
+ `status` TINYINT (1) NOT NULL DEFAULT '0',
+ `cache` TEXT NOT NULL,
+ `cache_time` TEXT NOT NULL,
+
+ PRIMARY KEY (`id`)
+
+) ENGINE=MyISAM CHARSET=utf8 COLLATE=utf8_unicode_ci;