Demo

Probiere ClanSphere aus und teste daran herum. Demo


Antworten: 9
Seite [1]
SlayR ClanSphere Team


Geekboy




Herkunft: Calbe (Saale)
Beiträge: 1133
# Thema - 19.06.2011 um 11:37 Uhr
Hi Leutz, ich habe ein paar Daten für die Verbindung von GameQ und Battlefield:Bad Company 2 gefunden.
Eine entsprechende Protokoll-Datei habe ich unter:
/mods/servers/gameq/Protocol angelegt. +-
 
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.
1. / 2. / ... 
<?php
/**
 * This file is part of GameQ.
 *
 * GameQ is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 3 of the License, or
 * (at your option) any later version.
 *
 * GameQ is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 * $Id: bfbc2.php,v 1.2 2010/06/02 23:03:26 evilpie Exp $  
 */
 
require_once GAMEQ_BASE 'Protocol.php';


/**
 * Battlefield Bad Company 2 Protocol
 *
 * See <http://blogs.battlefield.ea.com/battlefield_bad_company/archive/2010/02/05/remote-administration-interface-for-bfbc2-pc.aspx> for more
 * information.
 *
 * @author         Tom Schuster <evilpies@users.sf.net>
 * @version        $Revision: 1.2 $
 */
class GameQ_Protocol_bfbc2 extends GameQ_Protocol
{
    public function 
status()
    {    
        
$this->p->read(8); /* skip header */
        
$words $this->decodeWords();
        
        if (!isset (
$words[0]) || $words[0] != 'OK')
        {
            throw new 
GameQ_ParsingException($this->p);
        }
        
        
$this->r->add('hostname'$words[1]);
        
$this->r->add('numplayers'$words[2]);
        
$this->r->add('maxplayers'$words[3]);
        
$this->r->add('gametype'$words[4]);
        
$this->r->add('map'$words[5]);
        
    }
    
    public function 
version()
    {
        
$this->p->read(8);    
        
$words $this->decodeWords();
        
        
/* version info isnt that important, se we don't throw */
        
if(isset($words[0]) && $words[0] == 'OK')         
        {
            
$this->r->add('version'$words[2]);
        }
    }
    
    public function 
players()
    {
        
$this->p->read(8);        
        
$words $this->decodeWords();
        
        if(!isset(
$words[0]) && $words[0] != 'OK')
            return;
        
        
$num_tags $words[1];
        
$position 2;
        
$tags = array();
        
        for (; 
$position $num_tags $position++)
        {
            
$tags[] = $words[$position];
        }
        
        
$num_players $words[$position];
        
$position++;
        
$start_position $position;        
        
        for (; 
$position $num_players $num_tags $start_position
            
$position += $num_tags)
        {
            for (
$a $position$b 0$a $position $num_tags
                
$a++, $b++)
            {
                
$this->r->addPlayer($tags[$b], $words[$a]);
            }
        }
    }
    
    private function 
decodeWords()
    {
        
$num_words $this->p->readInt32();
        
$result = array ();
        
        for (
$i 0$i $num_words$i++)
        {
            
$len $this->p->readInt32();
            
$result[] = $this->p->read($len);        
            
$this->p->read(1); /* 0x00 string ending */
        
}
        
        return 
$result;
    }

}
?>

Auch an der games.ini hab ich rumgeschraubt:
mehr... +-
 
1.
2.
3.
4.
1. / 2. / ... 
 [bfbc2]
name "Battlefield Bad Company 2"
port 48888
prot 
"bfbc2"

und zum schluss natürlich noch die packets.ini:
mehr... +-
 
1.
2.
3.
4.
1. / 2. / ... 
 [bfbc2]
status "\x00\x00\x00\x00\x1b\x00\x00\x00\x01\x00\x00\x00\n\x00\x00\x00serverInfo\x00"
version "\x00\x00\x00\x00\x18\x00\x00\x00\x01\x00\x00\x00\x07\x00\x00\x00version\x00"
players "\x03\x00\x00\x00$\x00\x00\x00\x02\x00\x00\x00\x0b\x00\x00\x00listPlayers\x00\x03\x00\x00\x00all\x00"


Aber ich bekomme das Spiel einfach das Protokoll nich ins' entsprechende dropdown (servers_create). Was habe ich übersehen?

<EDIT>
Ja, hab' was in der create.php und edit.php übersehen xD hab's gefunden.


------------------
--- CLANSPHERE ---
Professional clan care starts here


Zuletzt editiert von SlayR ClanSphere Team am 19.06.2011 um 11:42 Uhr (1x Editiert)
Inaktiv
hajo ClanSphere Team


VIP - Poster




Herkunft: Barsbüttel
Beiträge: 9411
# Antwort: 1 - 19.06.2011 um 19:51 Uhr
wenn das ohne nachteile für alle funktioniert, kann man das gern noch im svn übernehmen


------------------
ClanSphere - professional clan care starts here

Inaktiv
|
SlayR ClanSphere Team
Thread-Ersteller


Geekboy




Herkunft: Calbe (Saale)
Beiträge: 1133
# Antwort: 2 - 20.06.2011 um 12:00 Uhr
Ich mach' mal ein Paket meines laufenden Server-Moduls fertig. Ich hab's hinbekommen, das die eingetragenen BF:BC2 Server Ihren Live-Status an Clansphere ausspucken. Vielleicht sollte freeze aber nochmal drüberschauen, ich bekomme in der debug Fehlermeldungen über fehlende indexes der mods/servers/servers.php som um Line 46 herum. Ich stell's mal heute noch hier rein.


------------------
--- CLANSPHERE ---
Professional clan care starts here


Inaktiv
|
hajo ClanSphere Team


VIP - Poster




Herkunft: Barsbüttel
Beiträge: 9411
# Antwort: 3 - 20.06.2011 um 12:12 Uhr
wenn du kannst sync deine dateien am besten mit dem aktuellen svn trunk, also mit markezzz änderungen.


------------------
ClanSphere - professional clan care starts here

Inaktiv
|
SlayR ClanSphere Team
Thread-Ersteller


Geekboy




Herkunft: Calbe (Saale)
Beiträge: 1133
# Antwort: 4 - 20.06.2011 um 12:18 Uhr
Habe ich schon schreibrechte auf den trunk?

Nochwas, in meinen Augen wäre es Sinnvoll gewesen, das Maps-Modul mit dem Servers-Modul zu koppeln. Lädt man also unter maps, karten für ein Spiel hoch, landen diese in uploads/servers/SPIELNAME, beziehungsweise greift das Servers-Modul auf uploads/maps/SPIELNAME/KARTENNAME zurück. dazu müsste natürlich ein funktionierendes Kürzel für SPIELNAME verwendet werden, in meinem Fall: bfbc2
by the way, hier mal eben als zip-package:
Dateianhänge:
zip Servers-Modul-bfbc2-added.zip (155.32 KiB - 21 mal heruntergeladen )


------------------
--- CLANSPHERE ---
Professional clan care starts here


Zuletzt editiert von SlayR ClanSphere Team am 20.06.2011 um 12:28 Uhr (1x Editiert)
Inaktiv
|
hajo ClanSphere Team


VIP - Poster




Herkunft: Barsbüttel
Beiträge: 9411
# Antwort: 5 - 20.06.2011 um 13:13 Uhr
danke, wäre gut, wenn das jemand testen könnte bzw. freeze das beim server modul rework beachtet. dafür wäre sonst auch ein ticket im trac mit der zip als anhang gut, so geht es nicht im forum unter.


------------------
ClanSphere - professional clan care starts here

Inaktiv
|
Fr33z3m4n ClanSphere Team


Medal of Honor




Herkunft: Hamm
Beiträge: 11094
# Antwort: 6 - 20.06.2011 um 13:23 Uhr
ein ticket im trac mit der zip als anhang gut, so geht es nicht im forum unter.

agree


------------------
mfg
Patrick "Fr33z3m4n" Jaskulski

Antoine de Saint-Exupéry: Wenn Du ein Schiff bauen willst, so trommle nicht Männer zusammen, um Holz zu beschaffen, Aufgaben zu verteilen, sondern lehre die Männer die Sehnsucht nach dem endlosen weiten Meer.

Inaktiv
|
SlayR ClanSphere Team
Thread-Ersteller


Geekboy




Herkunft: Calbe (Saale)
Beiträge: 1133
# Antwort: 7 - 20.06.2011 um 13:58 Uhr
Okay, ticket created
http://trac.csphere.eu/csp/ticket/1087


------------------
--- CLANSPHERE ---
Professional clan care starts here


Inaktiv
|
Markezzz


Rock the board




Herkunft: Chemnitz
Beiträge: 74
# Antwort: 8 - 20.06.2011 um 14:51 Uhr
20.06.2011 um 12:12 Uhr - hajo:
wenn du kannst sync deine dateien am besten mit dem aktuellen svn trunk, also mit markezzz änderungen.


Das mit meiner Änderung sehe ich erst jetzt das diese schon bearbeitet wurde.
Eventuell kann man das noch so hinbiegen, das der Spielname richtig angezeigt wird und nicht so abgekürzt?
Desweiteren ist das mit dem Serverlink noch nicht korrekt beim Hostname. Eventuell funktioniert das beim offline Modus auch nicht?


Zuletzt editiert von Markezzz am 20.06.2011 um 15:06 Uhr (2x Editiert)
Inaktiv
|
hajo ClanSphere Team


VIP - Poster




Herkunft: Barsbüttel
Beiträge: 9411
# Antwort: 9 - 20.06.2011 um 15:28 Uhr
mir fehlt leider die zeit das server modul mal ordentlich aufzuräumen, von daher öffnet am besten tickets bei problemen und wenn es patch sets gibt prüfe ich die kurz lokal und überfliege den code, bevor es eingespielt wird.


------------------
ClanSphere - professional clan care starts here

Inaktiv
|
Antworten: 9
Seite [1]


Sie müssen sich registrieren, um zu antworten.