HLSS

(Różnice między wersjami)
Skocz do: nawigacji, wyszukiwania
(Zakończenie)
Linia 315: Linia 315:
  
 
= Zakończenie =
 
= Zakończenie =
This software is being provided free for all users under the GNU GPL license. See the  
+
*This software is being provided free for all users under the GNU GPL license. See the  
 
included license.txt file for futher details. Donations are always welcome.
 
included license.txt file for futher details. Donations are always welcome.
  
 
_KaszpiR_ http://nvt.prv.pl
 
_KaszpiR_ http://nvt.prv.pl
  
Podziękowania dla:
+
=Podziękowania=
PawelS za zwracanie uwagi na CSS i HTML
+
*PawelS za zwracanie uwagi na CSS i HTML
trawiator za fazę testową na swoich serwerach i wskazanie poprawki psychoquery
+
*trawiator za fazę testową na swoich serwerach i wskazanie poprawki psychoquery
FOMFNY za lenistwo w działaniu i nazdwyczajna aktywność w nakłanianiu mnie abym odświeżył porjekt i pokazał jak stosować iframe
+
*FOMFNY za lenistwo w działaniu i nazdwyczajna aktywność w nakłanianiu mnie abym odświeżył porjekt i pokazał jak stosować iframe
graczu za mod phpBB
+
*graczu za mod phpBB
Assasiner za HLS - oryginalny projekt.
+
*Assasiner za HLS - oryginalny projekt.
  
----
+
=Changelog=
'''Changelog:'''
+
  
'''0.7'''
+
==0.7==
- added cache mode - speed improvement and also saves you problem with banned www server on game server
+
- added cache mode - speed improvement and also saves you problem with banned www server on game server
 
in older versions if there were too many queries about server status from certain
 
in older versions if there were too many queries about server status from certain
 
ip, then that ip got banned on game server (the game server wasignoring status request)
 
ip, then that ip got banned on game server (the game server wasignoring status request)
Linia 339: Linia 338:
 
to www in one specified second when the scrit was updating server status, but tis is extremely rare)
 
to www in one specified second when the scrit was updating server status, but tis is extremely rare)
  
- added option to output images
+
- added option to output images
- added some tags in config for:
+
- added some tags in config for:
 
mapsurl - given some examples (to suit better cs and cs:s)
 
mapsurl - given some examples (to suit better cs and cs:s)
 
gameurl - for use in template to change path to maps images and game mod icons
 
gameurl - for use in template to change path to maps images and game mod icons
 
applaunch - example to activate game launch when klicking on server ip
 
applaunch - example to activate game launch when klicking on server ip
  
- added special char change in player names
+
- added special char change in player names
- added tag player_shortname if you want list with truncated nicknames
+
- added tag player_shortname if you want list with truncated nicknames
- added some small tools for image generation
+
- added some small tools for image generation
- changed readme.txt
+
- changed readme.txt
- added doc/ dir
+
- added doc/ dir
- moved readme.txt to doc/readme.html and made it HTML
+
- moved readme.txt to doc/readme.html and made it HTML
- minor typos fixed
+
- minor typos fixed
- favicon in some .html (templates)
+
- favicon in some .html (templates)
  
'''0.6'''
+
==0.6==
- rewritten config
+
- rewritten config
- changed direcotry structure (cleaner)
+
- changed direcotry structure (cleaner)
- if calling with id=0 (that means alist all servers, server uses only one template,  
+
- if calling with id=0 (that means alist all servers, server uses only one template,  
 
and does not include, separate templates specfic for each server
 
and does not include, separate templates specfic for each server
 
this was introduced for security reasons
 
this was introduced for security reasons
- output buffering (i forgot :D)
+
- output buffering (i forgot :D)
- renamed .tpl to .html, better usage for morons
+
- renamed .tpl to .html, better usage for morons
- few examples like nano, and nano_list
+
- few examples like nano, and nano_list
- the idea for users how and which tags to use (at the end of readme)
+
- the idea for users how and which tags to use (at the end of readme)
  
'''0.5''' unreleased (or if realeased, the do not use it)
+
==0.5==
- added option to parse the GET['id'], so if you run your script like index.php? it shows all
+
unreleased (or if realeased, the do not use it)
  servers in a list, and if you run index.php?id=0 it will display only server number zero  
+
- added option to parse the GET['id'], so if you run your script like index.php? it shows all
  that is a first server in a config.php, use respectively index.php?id=1 for second server etc.
+
  servers in a list, and if you run index.php?id=0 it will display only server number zero  
 +
  that is a first server in a config.php, use respectively index.php?id=1 for second server etc.
  
 
   notice this required .tpl change.
 
   notice this required .tpl change.
  
'''0.4'''
+
==0.4==
- minor tweaks
+
- minor tweaks
  
'''0.3'''
+
==0.3==
- initial release
+
- initial release
----
+
'''Powered by:'''
+
----
+
  
Psycho Query PHP script from Psychostats 2.3.1 http://www.psychostats.com/
+
==Powered by==
Psychostats created by Jason Morriss aka. "Stormtrooper"
+
*Psycho Query PHP script from Psychostats 2.3.1 http://www.psychostats.com/
 +
*Psychostats created by Jason Morriss aka. "Stormtrooper"
  
----
+
*xtemplate class 0.3pre + MODIFIED FOR LDU Website engine http://www.neocrome.net / read below
 
+
html generation with templates - fast & easy
xtemplate class 0.3pre + MODIFIED FOR LDU Website engine http://www.neocrome.net / read below
+
copyright (c) 2000-2001 Barnabás Debreceni [cranx@users.sourceforge.net]
html generation with templates - fast & easy
+
copyright (c) 2000-2001 Barnabás Debreceni [cranx@users.sourceforge.net]
+
latest stable & CVS versions always available @
 
+
http://sourceforge.net/projects/xtpl/
latest stable & CVS versions always available @
+
http://sourceforge.net/projects/xtpl/
+
Modifcations made by Olivier "Neuro" C. (http://www.neocrome.net) :
 
+
Modifcations made by Olivier "Neuro" C. (http://www.neocrome.net) :
+
* 10-jun-2003 :
 
+
- Function assign modified, for parsing of arrays in arrays.
* 10-jun-2003 :
+
- Function assign modified, for parsing of arrays in arrays.
+
* 02-feb-2004 :
 
+
- Added the function out_to_file
* 02-feb-2004 :
+
- Commented out the "header(content-length)".
- Added the function out_to_file
+
- Commented out the error message if block do not exists.
- Commented out the "header(content-length)".
+
- Commented out the error message if block do not exists.
+

Wersja z 19:12, 19 sie 2006

Spis treści

Opis

HLSS 2 jest skryptem w PHP do wyświetlania statusu serwera albo serwerów gry Half-Life i Source na stronie WWW. Potrafi zwracać status jako listę serwerów, jako pojedyńczy serwer, może zwracać jako HTML, jako wybrany plik textowy, jako obrazek (bardzo uproszczone).

Aktualna wersja to 0.8, autor _KaszpiR_ http://nvt.prv.pl Oryginalnie napisany po angielsku.

Przykład działania brak :)

Testowane na:

  • Counter-Strike 1.6 (2005.08.08)
  • Counter-Strike: Source (2005.08.08)
  • Half-Life2 DeathMatch (2006-03-04)
  • Day Of Defeat (2006-03-04)
  • Day Of Defeat: Source (2006-03-04)
  • Quake3 i jego klony (beta)

Wymagania

PHP 4.3 z funkcją [url=http://www.php.net/fsockopen]fsockopen()[/url] - oznacza to, że php musi byc skompilowany z opcją --enable-sockets (przeważnie jest, jak instalujesz z pakietów instalacyjnych). Dodatkowo funkcja fsockopen() nie może być blokowana jako funkcja niedozwolona w php.ini, na serwerze www lepiej abyś nie miał żadnego firewall'a albo odblokowane połączenia na porty gier. Opcjonlanie bilbioteka GD2 w PHP (tylko do generacji obrazków w katalogu tools/


Instalacja

  • Zrób kopie bezpieczeństwa starszej wersji :)

Osoby znające język anglieski - zalecam przeczytać plik docs/readme.html

  • Rozpakuj plik .zip do katalogu na serwerze, zachowując strukturę katalogów, oraz zachowując wielkość liter w nazwach plików.
  • Upewnij się, że plik hlss2_cache.txt ma tak ustawione prawa do zapisu, że może byc zapisyawlny przez wszystkich ( chmod 666 ).

albu ustaw $main['cache'] = ""; jesli nie chcesz korzystać z tej opcji cache (nie yżuwanie cahce jest nie zalecane ze względów wydajności i poprawności działania skryptu).

  • Zedytuj plik config.php - na szczęście jest tam parę przykładów które powiny ci pomóc. Warto abyś użył słownika do angielskiego bo wiele opisów dałem w tym języku.
  • Ale pare informacji naprowadzających:

$main['template'] ="list.html"; - definiuje plik do wyświetlenia stanmdardowej listy serwerów, pliki template są w katalogu skin i mają rozszerzenie .html

Następnie konfigurujesz serwer albo serwery - chodzi o $server[] Wypełnij dane zgodnie z ustawieniami swojego serwera "ip" => "ADRES:PORT", - numer ip naszego serwea w postaci ADRES:PORT , jeśli nie ma portu (czyli jest tylko ADRES) to domyślnie będzie użyty port 27015), w nazwie adresu można podać nazwę hosta serwera

"disable" => 0, - ustawiając 1 albo 0 możemy szybko ukryć/pokazać nasz serwer przed wyświetlaniem, bez potrzeby kasowania zbędnych linii

"template" => "default.html" - plik który będzie uzywany do wyświetlenia detalicznego, specyficznego statusu dla tego serwera, dzięki temu możesz miec inne pliki dla każdego serwera, np DOD, CS czy CS:Source itp. Pliki są w katalogu skins, możesz stworzyc własne bazując na już istniejących, dane dotyczące tagów są w dalszej części artykułu.

"name" => "serwer1", - ustawia nazwę serwera, jeśli nie mozna jej pobrać bezpośrednio - uzyteczne jak serwer nie odpowiada a nie chcemy mieć pustej nazwy

"ha" => "Admin", - Imię headadmina, ewentualne tag do wykorzystania w skinie

"ha_mail" => "Admin@mail.com", - mail admina, ale przy modyfikacji skina mozna to zmienić np na numer GG czy cos podobnego

"timeout" => 1, - czas oczekiwania na odpowiedź od serwera w sekundach, lepiej nie schodzic poniżej sekundy, ani nie zwiększać - bo wydłuża to czas ładowania strony jeśli serwer nie odpowiada.

"gameurl" => "halflife", - podaje rodzaj gry (opcja halflife albo halflife2, potem stosowana w skórkach .html

nicklength" => "29", - długość nazwy gracza, jeśli używamy tagu payer_shortname - gdzy chcemy aby wygląd był w ograniczonychr amach a nicki są za długie, tutaj możesz ustawi 35 aby wyświetlić cały nick

"mapurl" => "../maps/halflife" - ścieżka do obrazków mapy, może byc względna albo bezwzględna (czyli zawierająca http://), map nie ma w zipie - musisz ściągnąć je sam np ze strony [page=10]psychostats[/page], uwaga, w skinach jeste jescze używany tag {gamerul} oraz {gamedir} - jeśli masz specyficzny mod do gry musisz stworzyć katalog o nazwie modu i tam umieścić obrazki map

"mapext" => "jpg" - rozszerzenie obrazków map - ten tag jest specyficzny dla skina

"applaunch" => "30" - rodzaj gry do uruchomienia jeśli klikniesz na numerze ip serwera, zależy od gry (http:/www.steampowered.com) oraz skina


$main['showall'] = 0; - ustaw 1 oraz w jednym z serwerów ustaw template na showall.html i zobacz co sie będzie działo, mniej więcej w 80% od góry strony będą interesujące cię tagi (a tak to wszstkie dostępne tagi i nie tylko.

$main['debug'] = 0; - ustaw na 1 aby włączyć wyświetlanie błędów, dobre jak cos ci nie działa.

  • Po tym zapisujemy config, i kierujemy przeglądarkę na adres i sprawdzamy czy wszystko chodzi.

Nastepny punkt zawiera inforamcje o zastosowaniu na stronach klanowych.


Zwracanie obrazków

Od wesjo 0.7 skrypt potrafi zwracać status serwera jako prosty obrazek - uzyteczne na stronach gównych albo forum gdzie ni jesteś w stanie wstawić znacznika iframe.

Ten tryb działa tylko dla pojedyńczego serwera - więc jeśli masz np 5 serwerów - musisz stworzyc pięc oddzielnych wpisów aby zwracały obrazki.

Tryby zwracania obrazków: - podstawowy - zwraca tylko obrazek online/offline - liczbowy - zwraca obrazek w zależności od ilości graczy na serwerze - procentowy - zwraca obrazek w zależności od ilości zajętych slotów na serwerze w procentach.

Jak to zrobić: Musisz po prostu wywołac specyficzny adres url w tagu img src obrazka. X oznacza tutaj specyficzny server id ( 1 to pierwszy, 2 to drugi ...)

- podstawowy

index.php?id=X&img=1

- liczbowy

index.php?id=X&img=1&plr=1

- procentowy

index.php?id=X&img=1&plr=2

Poniższy przykład rozwieje pewne wątpliwości - każdy jest dla innego serwera oraz każdy zwróci inny stan

<img src="index.php?id=1&img=1" />
<img src="index.php?id=2&img=1&plr=1" />
<img src="index.php?id=3&img=1&plr=2" />

<img src="datas/files/hlss2/hlss2/index.php?id=1&img=1" /> Festung-Breslau.pl #1 [DOD 1.3] <img src="datas/files/hlss2/hlss2/index.php?id=2&img=1" /> Festung-Breslau.pl #2 [DOD 1.3] <img src="datas/files/hlss2/hlss2/index.php?id=3&img=1" /> Festung-Breslau.pl [DOD:Source] <img src="datas/files/hlss2/hlss2/index.php?id=4&img=1" /> Festung-Breslau.pl 3.1 [DOD 3.1]


<img src="datas/files/hlss2/hlss2/index.php?id=1&img=1&plr=1" /> Festung-Breslau.pl #1 [DOD 1.3] <img src="datas/files/hlss2/hlss2/index.php?id=2&img=1&plr=1" /> Festung-Breslau.pl #2 [DOD 1.3] <img src="datas/files/hlss2/hlss2/index.php?id=3&img=1&plr=1" /> Festung-Breslau.pl [DOD:Source] <img src="datas/files/hlss2/hlss2/index.php?id=4&img=1&plr=1" /> Festung-Breslau.pl 3.1 [DOD 3.1]



<img src="datas/files/hlss2/hlss2/index.php?id=1&img=1&plr=2" /> Festung-Breslau.pl #1 [DOD 1.3] <img src="datas/files/hlss2/hlss2/index.php?id=2&img=1&plr=2" /> Festung-Breslau.pl #2 [DOD 1.3] <img src="datas/files/hlss2/hlss2/index.php?id=3&img=1&plr=2" /> Festung-Breslau.pl [DOD:Source] <img src="datas/files/hlss2/hlss2/index.php?id=4&img=1&plr=2" /> Festung-Breslau.pl 3.1 [DOD 3.1]

Wywołanie skryptu, skiny, iframe i tagi

Zauważcie, że wywołanie pliku index.php?id=0 powoduje wyświetlenie listy serwerów, a wywołanie index.php?id=1 wyświetli pierwszy serwer, index.php?id=2 drugi serwer i tak dalej.

Polecam zajrzeć do pliku config.php i na przykład zmienić $main['template'] na nano_list.html, podobnie zmienić paru serwerom template na nano.html i zobaczyć jak wygląda wygląd statusu dla wszystkich serwerów jak i dla pojedyńczego serwera. Oczywiście zajrzyjcie do tych plików .html

Iframe - połącz to ze swoją stroną Chyba najwięcej ci wyjaśni plik [url=datas/files/hlss2/hlss2/iframe.html]iframe.html[/url] (otwórz w przeglądarce na serwerze) a następnie przeanalizuj kod źródłowy. Na stronie klanowej musisz w wybranym miejscu wstawić po prostu znacznik iframe z ustawionymi parametrami. Starczy potem poprawic wygląd aby mieściło się w ramce pliku .html oraz style .css aby pasowały do reszty strony.

Zwróć uwagę na obrazki!


Tagi Dzięki tagom wyświetlamy interesującą nas zawartość na strone. Radzę popatrzeć po prostu na rózne pliki html w katalogu skins.

Wszelkie elemety typu [tag] => wartosc powinniscie traktowac jako {tag} oraz jaką wartość on zwraca


Uniwersalne uzycie zmiennych z PHP Używaj {PHP.nazwa_zmiennej}, działa także z tablicami, na przykład {PHP.tablica.klucz}, na przykład {PHP._SERVER.SERVER_NAME}

najlepiej jest poeksperymentować.


Pomiędzy znacznikami PLAYERS na przykład {player_id}, {player_name}

[player_name] => [P0D]Trust Noone "(88)"
[player_id] => 5
[player_kills] => 1
[player_time] => 225
[player_time_min] => 00:03:45
[player_shortname] => [P0D]Trust...
'' => 0
[j] => 1



Pomiędzy znacznikami STATUS na przykład {template}, {skin}, {map}

	    [disable] => 0
            [ip] => 192.168.1.1
            [template] => showall.html
            [name] => Szambo
            [ha] => 
            [ha_mail] => 
            [timeout] => 0
            [id] => 4
            [skin] => showall
            [ping] => 11
            [ipport] => 192.168.1.1:27015
            [port] => 27015
            [int_ipport] => 127.0.0.1:27015
            [int_port] => 27015
            [int_ip] => 127.0.0.1
            [map] => de_nuke
            [gamedir] => cstrike
            [gamename] => Counter-Strike
            [totalplayers] => 5
            [maxplayers] => 20
            [protocol] => 47
            [servertype] => d
            [serveros] => l
            [serverlocked] => 0
            [modrunning] => 1
            [modurl] => www.counter-strike.net
            [modftp] => 
            [modver] => 1.0
            [modsize] => 184000000
            [modserveronly] => 0
            [modclientdll] => 1
            [hlss_update_time] => 1141777570
            [update_time] => 2006-03-08

Pomiędzy znacznikami STATUS z użyciem rules na przykład {rules.amx_nextmap} {rules.mp_timelimit} etc

    [_tutor_bomb_viewable_check_interval] => 0.5
    [_tutor_debug_level] => 0
    [_tutor_examine_time] => 0.5
    [_tutor_hint_interval_time] => 10.0
    [_tutor_look_angle] => 10
    [_tutor_look_distance] => 200
    [_tutor_message_character_display_time_coefficient] => 0.07
    [_tutor_message_minimum_display_time] => 1
    [_tutor_message_repeats] => 5
    [_tutor_view_distance] => 1000
    [allow_spectators] => 1
    [amx_match_deluxe] => 1.72
    [amx_nextmap] => cs_estate
    [amx_timeleft] => 17:51
    [amx_version] => 0.9.9b (5 modules)
    [atac_version] => 2.5.3
    [coop] => 0
    [deathmatch] => 1
    [decalfrequency] => 30
    [edgefriction] => 2
    [fun_version] => 0.9.9b
    [hostage_debug] => 0
    [hostage_stop] => 0
    [humans_join_team] => any
    [max_queries_sec] => 1
    [max_queries_sec_global] => 1
    [max_queries_window] => 1
    [metamod_version] => 1.17.3
    [mp_allowmonsters] => 0
    [mp_autokick] => 0
    [mp_autoteambalance] => 0
    [mp_buytime] => 0.25
    [mp_c4timer] => 35
    [mp_chattime] => 10
    [mp_consistency] => 1
    [mp_fadetoblack] => 0
    [mp_flashlight] => 1
    [mp_footsteps] => 1
    [mp_forcecamera] => 2
    [mp_forcechasecam] => 1
    [mp_fragsleft] => 0
    [mp_freezetime] => 6
    [mp_friendlyfire] => 1
    [mp_ghostfrequency] => 0.1
    [mp_hostagepenalty] => 0
    [mp_kickpercent] => 0.66
    [mp_limitteams] => 0
    [mp_logdetail] => 3
    [mp_logfile] => 1
    [mp_logmessages] => 1
    [mp_mapvoteratio] => 0.66
    [mp_maxrounds] => 0
    [mp_mirrordamage] => 0
    [mp_playerid] => 0
    [mp_roundtime] => 1.75
    [mp_startmoney] => 800
    [mp_timeleft] => 0
    [mp_timelimit] => 20
    [mp_tkpunish] => 0
    [mp_windifference] => 1
    [mp_winlimit] => 0
    [pausable] => 0
    [smyga_plugin] => ;Destuckme 2.1;
    [sv_accelerate] => 5
    [sv_aim] => 0
    [sv_airaccelerate] => 10
    [sv_airmove] => 1
    [sv_allowupload] => 1
    [sv_alltalk] => 0
    [sv_bounce] => 1
    [sv_cheats] => 0
    [sv_clienttrace] => 1
    [sv_clipmode] => 0
    [sv_contact] => 
    [sv_friction] => 4
    [sv_gravity] => 800
    [sv_logblocks] => 1
    [sv_maxrate] => 20000
    [sv_maxspeed] => 320
    [sv_minrate] => 0
    [sv_password] => 0
    [sv_proxies] => 1
    [sv_region] => 3
    [sv_restart] => 0
    [sv_restartround] => 0
    [sv_stepsize] => 18
    [sv_stopspeed] => 75
    [sv_uploadmax] => 0.5
    [sv_voiceenable] => 1
    [sv_wateraccelerate] => 10


Modyfikacje

HLSS2 phpBB mod - modyfikacja skryptu pod forum phpBB



Zakończenie

  • This software is being provided free for all users under the GNU GPL license. See the

included license.txt file for futher details. Donations are always welcome.

_KaszpiR_ http://nvt.prv.pl

Podziękowania

  • PawelS za zwracanie uwagi na CSS i HTML
  • trawiator za fazę testową na swoich serwerach i wskazanie poprawki psychoquery
  • FOMFNY za lenistwo w działaniu i nazdwyczajna aktywność w nakłanianiu mnie abym odświeżył porjekt i pokazał jak stosować iframe
  • graczu za mod phpBB
  • Assasiner za HLS - oryginalny projekt.

Changelog

0.7

- added cache mode - speed improvement and also saves you problem with banned www server on game server

in older versions if there were too many queries about server status from certain ip, then that ip got banned on game server (the game server wasignoring status request) that caused that you could no more get server status info the cache is updating server status from time to time, - increases speed and decreases ban possibilty to almost zero (well unless you suddenly get over 100 hits to www in one specified second when the scrit was updating server status, but tis is extremely rare)

- added option to output images
- added some tags in config for:

mapsurl - given some examples (to suit better cs and cs:s) gameurl - for use in template to change path to maps images and game mod icons applaunch - example to activate game launch when klicking on server ip

- added special char change in player names
- added tag player_shortname if you want list with truncated nicknames
- added some small tools for image generation
- changed readme.txt
- added doc/ dir
- moved readme.txt to doc/readme.html and made it HTML
- minor typos fixed
- favicon in some .html (templates)

0.6

- rewritten config
- changed direcotry structure (cleaner)
- if calling with id=0 (that means alist all servers, server uses only one template, 

and does not include, separate templates specfic for each server this was introduced for security reasons

- output buffering (i forgot :D)
- renamed .tpl to .html, better usage for morons
- few examples like nano, and nano_list
- the idea for users how and which tags to use (at the end of readme)

0.5

unreleased (or if realeased, the do not use it)
- added option to parse the GET['id'], so if you run your script like index.php? it shows all
  servers in a list, and if you run index.php?id=0 it will display only server number zero 
  that is a first server in a config.php, use respectively index.php?id=1 for second server etc.
 notice this required .tpl change.

0.4

- minor tweaks

0.3

- initial release

Powered by

html generation with templates - fast & easy
copyright (c) 2000-2001 Barnabás Debreceni [cranx@users.sourceforge.net]

latest stable & CVS versions always available @
http://sourceforge.net/projects/xtpl/

Modifcations made by Olivier "Neuro" C. (http://www.neocrome.net) :

* 10-jun-2003 :
- Function assign modified, for parsing of arrays in arrays.

* 02-feb-2004 :
- Added the function out_to_file
- Commented out the "header(content-length)".
- Commented out the error message if block do not exists.
Osobiste
Przestrzenie nazw
Warianty
Działania
HLDS.pl - Menu:
Inne
IRC
Inne sekcje:
Znajomi:
Narzędzia