You are not logged in.

Razzer2406

Trainee

  • "Razzer2406" started this thread

Posts: 70

Location: Hamburg

Occupation: Einzelhandelskaufmann

wcf.user.option.userOption53: Ja

  • Send private message

1

Wednesday, February 13th 2013, 1:24am

CSS Server auf der Homepage einbinden

hallo ich möchte in ihr skript mehrere css server zur auswahl einbinden. das funktioniert jedoch nicht. was muss ich machen, damit man mehrere css server in das skript einbinden kann?

serverstatus.class.php

Spoiler Spoiler

PHP Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
/**
 * =============================================================================
 * This class will get infos from a HL2 server over php
 * 
 * @author HSFighter
 * @special thx to Chrisber
 * @version 1.1.0
 * @package PHP Server-Query Script
 * @link http://sourceserver.info
 * 
 * @version 1.1.0: serverstatus.class.php by hsfighter $
 * =============================================================================
 */
 
  class HLServerAbfrage {
 
      var $server_address;
      var $ip;
      var $port;
      var $fp;
      var $challenge;
      var $serverinfo;
      var $playerlist;
      var $cvarlist;
 
 
      var $A2S_SERVERQUERY_GETCHALLENGE "\x55\xFF\xFF\xFF\xFF"// challenge 
      var $A2S_INFO "TSource Engine Query\x00"// info
      var $A2S_PLAYER "\x55"// player
      var $A2S_RULES "\x56"// rules
 
      // IP und PORT trennen
      function hlserver($server_address 0) {
            list($this->ip$this->port) = explode(":"$server_address);
      }
 
      // Verbindung zum Server aufbauen
      function connect() {
        $this->fp fsockopen("udp://".$this->ip$this->port$errno$errstr3);
        if (!$this->fp) {
          $Fehler 1;
        }
      }
 
       // String-Command" senden
      function send_strcmd($strcmd) {
        fwrite($this->fpsprintf('%c%c%c%c%s%c'0xFF0xFF0xFF0xFF$strcmd0x00));
      }
 
      // 1 Byte vom Server holen
      function get_byte() {
        return ord(fread($this->fp1));
      }
 
      // 1 Zeichen (1 Byte) vom Server holen
      function get_char() {
        return fread($this->fp1);
      }
 
      // einen int16-Wert (2 Bytes) vom Server holen
      function get_int16() {
        $unpacked unpack('sint'fread($this->fp2));
        return $unpacked["int"];
      }
 
      // einen int32-Wert (4 Bytes) vom Server holen
      function get_int32() {
        $unpacked unpack('iint'fread($this->fp4));
            return $unpacked["int"];
      }
 
      // einen float32-Wert (4 Bytes) vom Server holen
      function get_float32() {
        $unpacked unpack('fint'fread($this->fp4));
        return $unpacked["int"];
      }
 
      // einen String vom Server holen
      function get_string() {
        $str '';
        while(($char fread($this->fp1)) != chr(0)) {
          $str .= $char;
        }
        return $str;
      }
      // 4 bytes von der challenge holen
 
      function get_4()
      {
       return fread($this->fp4);
      }
 
      // Challenger vom Server holen
      function challenge() {
        $this->connect();
        $this->send_strcmd($this->A2S_SERVERQUERY_GETCHALLENGE);
        $this->get_int32();
        $this->get_byte();
        $challenge $this->get_4();
        fclose($this->fp);
        return $challenge;
 
      }
 
      // Infos vom Server holen
      function infos() {
        $this->connect();
        $this->send_strcmd($this -> A2S_INFO);
        $this->get_int32();
        $this->get_byte();
 
        $this->serverinfo["network_version"] = $this->get_byte();
        $this->serverinfo["name"] = $this->get_string();
        $this->serverinfo["map"] = $this->get_string();
        $this->serverinfo["directory"] = $this->get_string();
        $this->serverinfo["discription"]= $this->get_string();
        $this->serverinfo["steam_id"] = $this->get_int16();
        $this->serverinfo["players"] = $this->get_byte();
        $this->serverinfo["maxplayers"] = $this->get_byte();
        $this->serverinfo["bot"] = $this->get_byte();
        $this->serverinfo["dedicated"] = $this->get_char();
        $this->serverinfo["os"] = $this->get_char();
        $this->serverinfo["password"] = $this->get_byte();
        $this->serverinfo["secure"] = $this->get_byte();
        $this->serverinfo["version"] = $this->get_string();
 
        fclose($this->fp);
        return $this->serverinfo;
      }
 
      // Player-Liste vom Server holen
      function players() {
        $challenge $this->challenge();
        $this->connect();
        $this->send_strcmd($this->A2S_PLAYER.$challenge);
        $this->get_int32();
        $this->get_byte();
 
        $playercount $this->get_byte();
 
        for($i=1$i <= $playercount$i++) {
          $this->playerlist["index"][$i] = $this->get_byte();
          $this->playerlist["name"][$i] = $this->get_string();
          $this->playerlist["frags"][$i] = $this->get_int32();
          $this->playerlist["time"][$i] = date('H:i:s'round($this->get_float32(), 0)+82800);
        }
        fclose($this->fp);
        return $this->playerlist;
      }
 
      // Rules-Liste (CVARs) vom Server holen
      function cvars() {
         $challenge $this->challenge();
         $this->connect();
         $this->send_strcmd($this->A2S_RULES.$challenge);
         $this->get_int32();
         $this->get_byte();
 
          $cvarcount $this->get_int16();
 
          for($i=1$i <= $cvarcount$i++) {
            $this->cvarlist[$this->get_string()] = $this->get_string();
          }
          fclose($this->fp);
          return $this->cvarlist;
      }
}




index.php

Spoiler Spoiler

PHP Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
// Server Angaben
 
$ip = '85.214.238.171';
$port = '27026';
$mappic_path = 'http://www.nsc-radio.com/assa/css_server/bhop/bilder/';
 
// Klasse Laden
include ("serverstatus.class.php");
 
// Verbindung zum Server herstellen
 
$verbindung = new HLServerAbfrage;
$verbindung -> hlserver($ip.':'.$port);
 
// Serverinfos abfragen
 
$infos = $verbindung->infos();
 
//$infos["os"] = str_replace("l", 'Linux', $infos["os"]);
//$infos["os"] = str_replace("w", 'Windows', $infos["os"]);
//$infos["password"] = str_replace("1", 'Yes', $infos["password"]);
//$infos["password"] = str_replace("0", 'No', $infos["password"]);
//$infos["secure"] = str_replace("1", 'VAC2', $infos["secure"]);
//$infos["secure"] = str_replace("0", 'None', $infos["secure"]);
//$infos["dedicated"] = str_replace("l", 'Listen', $infos["dedicated"]);
//$infos["dedicated"] = str_replace("d", 'Dedicated', $infos["dedicated"]);
//$infos["dedicated"] = str_replace("p", 'SourceTV', $infos["dedicated"]);
 
// Serverinfos abfragen
 
echo 'Name: '.$infos["name"].'<br>';
echo '<IMG src="'.$mappic_path.$infos["map"].'.jpg" border=0><br>';
?>
IP: <a href="steam://85.214.238.171:27026" target='_blank'>85.214.238.171:27026</a><br>
<?php
//echo 'OS: '.$infos["os"].'<br>';
//echo 'Dedicated: '.$infos["dedicated"].'<br>';
//echo 'Version: '.$infos["version"].'<br>';
//echo 'Discription: '.$infos["discription"].'<br>';
echo 'Map: '.$infos["map"].'<br>';
echo 'Players: '.$infos["players"].'/'.$infos["maxplayers"].'<br>';

//echo 'Bots: '.$infos["bot"].'<br>';
//echo 'VAC: '.$infos["secure"].'<br>';
//echo 'Password: '.$infos["password"].'<br>';

 
// Playerinfos abfragen
 
$players $verbindung->players();
if (isSet($players)){
  arsort ($players["frags"]); // Player nach Frags sortieren
  $x 0;
  foreach($players["frags"] as $key => $value) {
    $x++;
 //   Echo '#'.$x.' -- '; // Nummer
 //   Echo ''.$players["index"][$key].' -- '; // Index
  // Echo ''.$players["name"][$key].' -- ';  // Name
 //   Echo ''.$players["frags"][$key].' -- '; // Frags
  //  Echo ''.$players["time"][$key].' -- '; // Zeit
    Echo '<br>';
 }
}else
//{
//  echo "server leer";
//} 
 
// Cvarinfos abfragen
 
//$nextmap = 'Unknow!!!';
//$cvars = $verbindung->cvars();
// Schleife um das Array aus zu lesen
//foreach($cvars as $key => $value) {
  // Prüfung des Key's.
//  if ($key == 'amx_nextmap')$nextmap = $value;
//  if ($key == 'cm_nextmap')$nextmap = $value;
//  if ($key == 'am_nextmap')$nextmap = $value;
//  if ($key == 'mp_nextmap')$nextmap = $value;
//  if ($key == 'mani_nextmap')$nextmap = $value;
//  // Anzeige aller Cvars!!!
//  Echo ''.$key.' = '.$value.'<br>';
//
//Echo '<br>Next map is: <b>'.$nextmap.'</b><br>';

This post has been edited 2 times, last edit by "Razzer2406" (Feb 13th 2013, 1:47am)


GeNeRaLbEaM

Professional

Posts: 1,537

Location: Krefeld

Occupation: Student

wcf.user.option.userOption53: Nein

  • Send private message

2

Wednesday, February 13th 2013, 1:36am

Quellcode bitte in Spoiler packen. Danke.
LG
GeNeRaLbEaM

Wer Rechtschreibfehler findet, darf sie behalten.

Razzer2406

Trainee

  • "Razzer2406" started this thread

Posts: 70

Location: Hamburg

Occupation: Einzelhandelskaufmann

wcf.user.option.userOption53: Ja

  • Send private message

3

Wednesday, February 13th 2013, 1:47am

habe ich gemacht sorry ;)

Lacrimosa99

Intermediate

Posts: 275

Location: Leipzig

Occupation: IT-Systemintegrator

wcf.user.option.userOption53: Ja

  • Send private message

4

Wednesday, February 13th 2013, 4:28am

Versuch mal folgendes:

Spoiler Spoiler


index.php Zeile 4:
$port = '27026';'27027';'27028';usw


kann dir leider nicht versprechen ob das geht...

Ansonnsten wartest auf eine Antwort von HSFighter.. er ist hier auch im Board ;)

MFG




Posts: 14

wcf.user.option.userOption53: Ja

  • Send private message

5

Wednesday, February 13th 2013, 5:43pm

ich glaube die Class unterstützt das nicht mit mehreren Servern bin mir grade aber nicht sicher hab auch wenig Zeit aber

notfalls kannst du von dem Inhalt der index.php paar Kopien machen und die unternander anzeigen nur dann jedes mal ein anderen Port eintragen. Oder z.b. verstecken und mit anklicken öffnen sowas meine ich

und @Lacrimosa99
das geht so nicht dann musste wenigstens ein Array nehmen

This post has been edited 1 times, last edit by "server-aufsetzen" (Feb 13th 2013, 5:50pm)


Razzer2406

Trainee

  • "Razzer2406" started this thread

Posts: 70

Location: Hamburg

Occupation: Einzelhandelskaufmann

wcf.user.option.userOption53: Ja

  • Send private message

6

Wednesday, February 13th 2013, 8:57pm

also ich habe es versucht die datein mehrmals zukopieren in verschiedenen ordnern leider crahst er dabei und spuckt nur fehler aus. hmm villlt kann mir da jemand ja noch helfen ich schau trotzdem mal weiter aber sonst danke :)

Posts: 14

wcf.user.option.userOption53: Ja

  • Send private message

7

Wednesday, February 13th 2013, 10:58pm

lass es mit mehreren Ordnern kopier nur die index.php oder füg den Inhalt in ihr einfach darunter nochmal ein.
Oder wenn mehrere Ordner dann musst du die Class auch kopieren und alle Variablen einstellen

Razzer2406

Trainee

  • "Razzer2406" started this thread

Posts: 70

Location: Hamburg

Occupation: Einzelhandelskaufmann

wcf.user.option.userOption53: Ja

  • Send private message

8

Thursday, February 14th 2013, 1:07am

Habe ich auch schon gemacht crasht er trotzdem hmm aber trotzdem danke für deine hilfe

Posts: 14

wcf.user.option.userOption53: Ja

  • Send private message

9

Thursday, February 14th 2013, 9:59am

kannst du mal die Fehlermeldung posten

Blacksilver

Intermediate

Posts: 298

Location: 127.0.0.1

Occupation: FISI

wcf.user.option.userOption53: Nein

  • Send private message

10

Thursday, February 14th 2013, 2:11pm

Eine kurze Frage bzw ein Einschub.
Benutzt du ein CMD? Wie ilch oder Webspell?
Dann könnte man dort Script/Plugins suchen.
Come to the dark side,
we have cookies ;)

Razzer2406

Trainee

  • "Razzer2406" started this thread

Posts: 70

Location: Hamburg

Occupation: Einzelhandelskaufmann

wcf.user.option.userOption53: Ja

  • Send private message

11

Thursday, March 7th 2013, 4:18am

Hi, sorry das ich jetzt erst antworte ich habe das Problem anders behoben ist einfacher für mich und auch von der Zeit her schneller. Ich habe über Gametracker einfach ein Banner genommen und als Iframe auf meiner Homepage eingebunden aber trotzdem danke an euch ;) villt wenn ich mal zeit dafür habe frage ich nochmal genauer bzw such danach genauer.

Similar threads