[2010-Client]Serverinfo mit 2 Server'n

03/25/2011 15:12 sLay.#1
ahoi.
Ich denke jeder darf mal bisschen 'noobig' sein ;p
Also ich scheitere schon seit 2 Tagen daran eine einfache Serverinfo für den 10er Client mit 2 Servern zu machen.
Es sollte aber halt die akutelle Serverinfo sein mit der man auf die 10er Files connecten kann.

Hier meine jetzige Serverinfo mit einem Server & 4 Channels:

PHP Code:

import os
import app
import locale
import debugInfo

CHINA_PORT 
50000

def BuildServerList
(orderList):
    
retMarkAddrDict = {}
    
retAuthAddrDict = {}
    
retRegion0 = {}

    
ridx 1
    
for regionauthmarkchannels in orderList:
        
cidx 1
        channelDict 
= {}
        for 
channel in channels:
            
key ridx 10 cidx
            channel
["key"] = key
            channelDict
[cidx] = channel
            cidx 
+= 1

        region
["channel"] = channelDict

        retRegion0
[ridx] = region
        retAuthAddrDict
[ridx] = auth
        retMarkAddrDict
[ridx*10] = mark
        ridx 
+= 1

    
return retRegion0retAuthAddrDictretMarkAddrDict

app
.ServerName None


if locale.IsEUROPE():
    
info = {
        
'MARKADDR': {
        
10: {
            
'tcp_port'13000'ip''MEINEIP''symbol_path''10''mark''10.tga'
            
}
        },
        
'GAMEADDR': {
            
0: {
                
1: {
                    
'name''MEINSERVERNAME',
                    
'channel':
                {
                    
1: {'state''...''name''channel1''key'11'ip''MEINEIP''tcp_port'MEINPORT'udp_port'MEINPORT},
                    
2: {'state''...''name''channel2''key'12'ip''MEINEIP''tcp_port'MEINPORT'udp_port'MEINPORT},
                    
3: {'state''...''name''channel3''key'13'ip''MEINEIP''tcp_port'MEINPORT'udp_port'MEINPORT},
                    
4: {'state''...''name''channel4''key'14'ip''MEINEIP''tcp_port'MEINPORT'udp_port'MEINPORT}
                }
            },
        } }, 
'NAME': { 0'GERMANY' }, 'AUTHADDR': { 0: {
        
1: {
            
'ip''MEINEIP''port'11002
            
}
        } }
    }

    
STATE_NONE "..."

    
STATE_DICT = {
        
"....",
        
"NORM",
        
"BUSY",
        
"FULL"
    
}

    
REGION_NAME_DICT info["NAME"]
    
REGION_AUTH_SERVER_DICT info["AUTHADDR"]
    
REGION_DICT info["GAMEADDR"]
    
MARKADDR_DICT info["MARKADDR"
Wäre echt geil wenn mir jemand einen 2.Server mit 1 oder 2 Channels hinzufügen könnte :)

Vielen Dank.

sLay.
03/25/2011 15:17 'Blutwolf#2
Kenne mich nicht wirklich mit Client aus, aber könnte man den Text nicht einfach Copy+Paste machen und auf den 2. Server beziehen?

PS: Sry, wenns falsch ist
Quote:
Kenne mich nicht wirklich mit Client aus
03/25/2011 15:22 lfcmaus#3
Quote:
import os
import app
import locale
import debugInfo

CHINA_PORT = 50000

def BuildServerList(orderList):
retMarkAddrDict = {}
retAuthAddrDict = {}
retRegion0 = {}

ridx = 1
for region, auth, mark, channels in orderList:
cidx = 1
channelDict = {}
for channel in channels:
key = ridx * 10 + cidx
channel["key"] = key
channelDict[cidx] = channel
cidx += 1

region["channel"] = channelDict

retRegion0[ridx] = region
retAuthAddrDict[ridx] = auth
retMarkAddrDict[ridx*10] = mark
ridx += 1

return retRegion0, retAuthAddrDict, retMarkAddrDict

app.ServerName = None


if locale.IsEUROPE():
info = {
'MARKADDR': {
10: {
'tcp_port': 13000, 'ip': 'MEINEIP', 'symbol_path': '10', 'mark': '10.tga'
}
11: {
'tcp_port': tcpport anderer server, 'ip': 'MEINEIP', 'symbol_path': '11', 'mark': '11.tga'
}
},
'GAMEADDR': {
0: {
1: {
'name': 'MEINSERVERNAME',
'channel':
{
1: {'state': '...', 'name': 'channel1', 'key': 11, 'ip': 'MEINEIP', 'tcp_port': MEINPORT, 'udp_port': MEINPORT},
2: {'state': '...', 'name': 'channel2', 'key': 12, 'ip': 'MEINEIP', 'tcp_port': MEINPORT, 'udp_port': MEINPORT}
}
2: {
'name': 'servername vom 2ten server',
'channel':
{
1: {'state': '...', 'name': 'channel1', 'key': 11, 'ip': '2te server ip', 'tcp_port': tcpport 2ter server, 'udp_port': udpport 2ter server},
2: {'state': '...', 'name': 'channel2', 'key': 12, 'ip': '2te server ip', 'tcp_port': tcpport 2ter server, 'udp_port': udpport 2ter server}
}
},
} }, 'NAME': { 0: 'GERMANY' }, 'AUTHADDR': { 0: {
1: {
'ip': 'MEINEIP', 'port': 11002
}
2: {
'ip': '2te server ip', 'port': loginport vom 2ten server
}
} }
}

STATE_NONE = "..."

STATE_DICT = {
0 : "....",
1 : "NORM",
2 : "BUSY",
3 : "FULL"
}

REGION_NAME_DICT = info["NAME"]
REGION_AUTH_SERVER_DICT = info["AUTHADDR"]
REGION_DICT = info["GAMEADDR"]
MARKADDR_DICT = info["MARKADDR"]
habs so und beimir gehts ...
probiers einfahc bei dir mal
nur ich hab je server nur 1 channel
03/25/2011 15:28 'Blutwolf#4
So sieht dann bei 4 Channels aus:
03/25/2011 17:18 .Shanks#5
Quote:
Originally Posted by lfcmaus View Post
habs so und beimir gehts ...
probiers einfahc bei dir mal
nur ich hab je server nur 1 channel

Danke erstmal für die Hilfe, aber könntest du es vllt mal in [code] text [/code ] schreiben?
danke im vorraus

Mfg