|
You last visited: Today at 23:55
Advertisement
[Script]Serverstruktur
Discussion on [Script]Serverstruktur within the Metin2 PServer Guides & Strategies forum part of the Metin2 Private Server category.
06/14/2013, 23:15
|
#16
|
elite*gold: 0
Join Date: Jan 2010
Posts: 1,916
Received Thanks: 538
|
Quote:
Originally Posted by CrystalPrime
#Moverequest bitte oder Closen
Denn ich glaube weniger das dieser Dr. Anonymous die Erlaubnis dafür
hat das zu releasen, außerdem ist es ein ganz kleines Script welches
wenn schon hier hin gehört:

|
Und WER hat bitteschön irg.eine erlaubnis hier eigentum von GF4D/Ymir zu releasen? Niemand!
Edit:
What does "SERVER_KEY" do at the configs?
Was bringt "SERVER_KEY" in der Config datei?
|
|
|
06/14/2013, 23:24
|
#17
|
elite*gold: 0
Join Date: May 2013
Posts: 593
Received Thanks: 467
|
Quote:
Originally Posted by 'oShet
Und WER hat bitteschön irg.eine erlaubnis hier eigentum von GF4D/Ymir zu releasen? Niemand!
Edit:
What does "SERVER_KEY" do at the configs?
Was bringt "SERVER_KEY" in der Config datei?
|
Bei Gameforge oder YMIR interessiert das leider keinen, aber wenn etwas von WoM (tim) oder so kommt, ist natürlich jeder voll dagegen und muss dann den Leuten in den ***** kriechen.
Guten Abend.
|
|
|
06/14/2013, 23:26
|
#18
|
elite*gold: 0
Join Date: Jan 2010
Posts: 1,916
Received Thanks: 538
|
Quote:
Originally Posted by #dynastie
Bei Gameforge oder YMIR interessiert das leider keinen, aber wenn etwas von WoM (tim) oder so kommt, ist natürlich jeder voll dagegen und muss dann den Leuten in den ***** kriechen.
Guten Abend.
|
Metin2 halt  Alles kleine arschkriecher die nichts alleine auf die reihe bekommen
|
|
|
06/14/2013, 23:39
|
#19
|
elite*gold: 0
Join Date: Jun 2013
Posts: 20
Received Thanks: 9
|
Script ist schön geschrieben, paar der Zeilen sind für den Coding Style zwar nicht ganz optimal, aber immer noch in Ordnung.
Bei den Formatting Options ist es vllt. der Übersichtlichkeit her hinzugefügt worden, ist aber unnötig, sofern es sowieso nicht geändert werden würde.
Mehr kann man an dem Script nicht aussetzen, ist klar und verständlich gecodet, entspricht bis auf paar langen Zeilen dem kompletten Style Guide und Kommentierung ist durch die sinnvollen Namensbezeichnungen auch nicht unbedingt nötig.
Würde mich mal interessieren, wer das ganze geschrieben hat, ist auf jeden Fall ein sauberes Script.
Ach ja, wer das ganze nutzen möchte, das Script basiert auf 2.x Basis, ist für 3.x inkompatibel, müsstet ihr dafür minimal umschreiben, hat sich nicht ganz so viel geändert.
MfG <Dafuq>
|
|
|
06/14/2013, 23:46
|
#20
|
elite*gold: 99
Join Date: Aug 2009
Posts: 4,295
Received Thanks: 5,091
|
Quote:
Originally Posted by <Dafuq>
Script ist schön geschrieben, paar der Zeilen sind für den Coding Style zwar nicht ganz optimal, aber immer noch in Ordnung.
Bei den Formatting Options ist es vllt. der Übersichtlichkeit her hinzugefügt worden, ist aber unnötig, sofern es sowieso nicht geändert werden würde.
Mehr kann man an dem Script nicht aussetzen, ist klar und verständlich gecodet, entspricht bis auf paar langen Zeilen dem kompletten Style Guide und Kommentierung ist durch die sinnvollen Namensbezeichnungen auch nicht unbedingt nötig.
Würde mich mal interessieren, wer das ganze geschrieben hat, ist auf jeden Fall ein sauberes Script.
MfG <Dafuq>
|
tim66613
|
|
|
06/14/2013, 23:58
|
#21
|
elite*gold: 0
Join Date: Aug 2012
Posts: 974
Received Thanks: 89
|
und wie benutze ich das?
|
|
|
06/15/2013, 00:01
|
#22
|
elite*gold: 99
Join Date: Aug 2009
Posts: 4,295
Received Thanks: 5,091
|
Quote:
Originally Posted by thespeedyy
und wie benutze ich das?
|
Python für dein OS installieren, kleine Veränderungen durchnehmen und ausführen.
|
|
|
06/15/2013, 11:49
|
#23
|
elite*gold: 0
Join Date: Jun 2013
Posts: 20
Received Thanks: 9
|
hab minimale Veränderungen gemacht(Autor namens tim66613 hinzugefügt, encoding hinzugefügt, main function verändert) und das ganze mal kommentiert, nachdem hier einige noch die Fragen hatten was das ganze denn überhaupt machen würde.
PHP Code:
#!/usr/bin/python # -*- coding: utf-8 -*-
from itertools import chain import sys import os import shutil
__author__ = 'tim66613'
# Simple class holding the info from the locale/*/map/index file class AllowedMapList: def __init__(self): # initializes name_to_index_map dictionary ( dict() is equal to {} ) self.name_to_index_map = dict() """ used for loading our index file """ def LoadMapIndexFile(self, filename): # using the opening process of our index file as file var with open(filename) as file: # run loop for every line in the opened file for line in file: # using spaces to split the map index and the map name apart(strip to remove f.e. \n) index, name = line.strip().split() # if our map name is already in the dict, append it to our array if name in self.name_to_index_map: self.name_to_index_map[name].append(index) # else create sub variable in our dictionary and add an single element array ( [index] ) else: self.name_to_index_map[name] = [index] """ used for getting our index vars from the created dictionary """ def GetIndexListFromNameList(self, names): # not as easy to explain as the other script lines, here equal, but more inefficient script to explain it: # initializing our tmp variable(empty array) #tmp = [] # run the loop for every element in our names array #for name in names: # because the map can have multiple index numbers, using " ".join to get them in plain text and append them to our array # tmp.append(" ".join(self.name_to_index_map[name])) # return our created array #return(tmp) return [" ".join(self.name_to_index_map[name]) for name in names]
class TreeCreator: """ basic init function, automatically called if class is called """ def __init__(self): # using our class we explained before as variable self.allowed_map_list = AllowedMapList() # initialize every other variable(defined later) self.output_path = None self.template_path = None self.config_dict = None """ used for our configuration script """ def LoadConfigScript(self, filename): # again equal to {} self.config_dict = dict() # execute our configuration file, to set variables, in this case the file "trunk_server_conf.py" and safe it in self.config_dict execfile(filename, self.config_dict) # define the variables we initialized in the init function with the dict we created from the configuration file self.output_path = self.config_dict["kOutputPath"] self.template_path = self.config_dict["kTemplatePath"] # loading the index file(until now it was barely an unused class) self.allowed_map_list.LoadMapIndexFile(self.config_dict["kMapIndexPath"]) # copy process try: shutil.copytree(self.template_path + "/base", self.output_path) # exception if the path already exists, so remove it(can fail here again if python is using the path already(unhandled exception in this case)) except os.error: print "Output directory already exists. Erasing..." # remove path, exception case is missing shutil.rmtree(self.output_path) # create again shutil.copytree(self.template_path + "/base", self.output_path) # Channels # run for every channel in our config_dict, the channel config var # only used for writing the basic files, you should be able to know what this part is writing ;) for channel in self.config_dict["kChannelConfig"]: os.mkdir(self.output_path + "/" + channel) for game in self.config_dict["kChannelConfig"][channel]: shutil.copytree(self.template_path + "/game", self.output_path + "/" + channel + "/" + game) merged_conf = dict(chain(self.config_dict["kBaseConfig"]["game"].iteritems(), self.config_dict["kChannelConfig"][channel][game].iteritems())) open(self.output_path + "/" + channel + "/" + game + "/CONFIG", "wb").write(self.GetConfigString(merged_conf, self.ProcessGameConfigEntry))
# Special configs merged_conf = dict(chain(self.config_dict["kBaseConfig"]["game"].iteritems(), self.config_dict["kBaseConfig"]["game99"].iteritems())) open(self.output_path + "/game99/CONFIG", "wb").write(self.GetConfigString(merged_conf, self.ProcessGameConfigEntry))
open(self.output_path + "/auth/CONFIG", "wb").write(self.GetConfigString(self.config_dict["kBaseConfig"]["auth"], self.ProcessGameConfigEntry)) open(self.output_path + "/db/conf.txt", "wb").write(self.GetConfigString(self.config_dict["kBaseConfig"]["db"], self.ProcessDbConfigEntry))
# Script files install_sh = open(self.output_path + "/install.sh", "ab") run_sh = open(self.output_path + "/run.sh", "ab") shutdown_sh = open(self.output_path + "/shutdown.sh", "ab") clear_sh = open(self.output_path + "/clear.sh", "ab")
for channel in self.config_dict["kChannelConfig"]: for game in self.config_dict["kChannelConfig"][channel]: install_sh.write("cd $ROOT/%s && sh install.sh\n" % (channel + "/" + game)) run_sh.write("echo \"Starting %s\"\ncd $ROOT/%s && sh run.sh\n\n" % (channel + "/" + game, channel + "/" + game)) shutdown_sh.write("echo \"Stopping %s\"\ncd $ROOT/%s && sh shutdown.sh\n\n" % (channel + "/" + game, channel + "/" + game)) clear_sh.write("cd $ROOT/%s && sh clear.sh\n" % (channel + "/" + game))
install_sh.write("cd $ROOT/%s && sh install.sh\n" % ("game99")) run_sh.write("echo \"Starting %s\"\ncd $ROOT/%s && sh run.sh\nsleep 2\n\n" % ("game99", "game99")) shutdown_sh.write("echo \"Stopping %s\"\ncd $ROOT/%s && sh shutdown.sh\n\n" % ("game99", "game99")) shutdown_sh.write("echo \"Stopping %s\"\ncd $ROOT/%s && sh shutdown.sh\n\n" % ("db", "db")) clear_sh.write("cd $ROOT/%s && sh clear.sh\n" % ("game99")) """ function used to get the configuration as string """ def GetConfigString(self, list, fn): # create array from our list with every key conf_entries = [fn(key, list[key]) for key in list] # sort it based on the key(kv.split(":")[0].lower()), basic sort conf_entries.sort(key = lambda kv: kv.split(":")[0].lower()) # return as plain text, using "\n".join(conf_entries) return '\n'.join(conf_entries) """ function used to get the proper db config entry """ def ProcessDbConfigEntry(self, key, value): # simple if check, if value(!= 0, != False, != null, != "", != " ") and not key == "ITEM_ID_RANGE if not value or (value.find(' ') != -1 and key != "ITEM_ID_RANGE"): return key + " = \"" + value + "\"" # else case else: return key + " = " + value
""" function used to get the proper game config entry """ def ProcessGameConfigEntry(self, key, value): # check the key if key == "MAP_ALLOW": # check if value != > 32(max number of allowed maps for every core) if len(value) > 32: print value print "MAP_ALLOW has too many values!" else: # using the other function the get a plain text string using for our map allow return "MAP_ALLOW: " + " ".join(self.allowed_map_list.GetIndexListFromNameList(value)) else: # else case return key + ": " + value
""" main function """ def main(): creator = TreeCreator() creator.LoadConfigScript("trunk_server_conf.py")
if __name__ == "__main__": main()
|
|
|
06/15/2013, 17:46
|
#24
|
elite*gold: 0
Join Date: Aug 2012
Posts: 974
Received Thanks: 89
|
und wie starte und führe ich das script aus
|
|
|
06/15/2013, 18:11
|
#25
|
elite*gold: 168
Join Date: Feb 2010
Posts: 4,333
Received Thanks: 2,642
|
Quote:
Originally Posted by thespeedyy
und wie starte und führe ich das script aus
|
Das ist nicht dein Ernst?
Script wurde ohne Erlaubnis Public gemacht, es wurde noch erklärt und noch "verbessert" und du Fragst das noch? Payla hats doch gesagt wie es geht.
|
|
|
06/15/2013, 18:30
|
#26
|
elite*gold: 0
Join Date: Aug 2012
Posts: 974
Received Thanks: 89
|
ich hab ja python installiert nur kann ich die make.py nicht ausführen
|
|
|
06/15/2013, 18:39
|
#27
|
elite*gold: 168
Join Date: Feb 2010
Posts: 4,333
Received Thanks: 2,642
|
Liegt daran das es keine gibt?
|
|
|
06/15/2013, 18:47
|
#28
|
elite*gold: 0
Join Date: Aug 2012
Posts: 974
Received Thanks: 89
|
wie soll ich es dann ausführen?!
|
|
|
06/15/2013, 23:11
|
#29
|
elite*gold: 0
Join Date: Jan 2010
Posts: 1,916
Received Thanks: 538
|
Quote:
Originally Posted by thespeedyy
wie soll ich es dann ausführen?!
|
Du kannst damit eh nichts anfangen also lass es einfach...
Begib dich an kleine dinge und wenn du mehr ahnung hast dann komm wieder in diesen thread
|
|
|
 |
|
Similar Threads
|
[S] Facebook-Like Script oder Twitter Mass Follow Script [B] e*gold
03/06/2013 - General Coding - 2 Replies
Hey, Leute..
Ich suche ein Facebook-Like Script oder ein Twitter Mass Follow Script das mit GreaseMonkey funkt.
Entweder selber coden oder im Internet danach suchen. Wer mir es liefert wird auch entsprechend belohnt.
|
[Biete] Scripteen Ajax Photo Rating Script V2 License (Hot or Not Script) [S] Paypal
01/31/2013 - Trading - 0 Replies
Hey,
und zwar brauche ich das Script nicht mehr und stelle meine License deshalb hier zum Verkauf.
Link zum Script: Hot or Not Script | Photo Rating Script | Scripteen PHP Scripts
Macht mir Angebote suche Paypal.
Screenshots:
http://scripteen.com/uploads/156-Screen%20Shot%20 2012-05-19%20at%2010.32.56%20AM.png
http://scripteen.com/uploads/381-Screen%20Shot%20 2012-05-19%20at%2010.33.07%20AM.png
|
[Hinweis] Änderung der Serverstruktur am 05.12.2012
12/07/2012 - WarRock - 19 Replies
Soldaten,
Wie euch vielleicht schon aufgefallen ist hören wir euch manchmal zu und releasen ein oder den anderen Uservorschlag. In diesem Falle haben wir den Spielern aus den USA, Canada und Südamerika zugehört die sich über leere Server beklagten.
Also um die Server wieder voll zu kriegen und jedem die möglichkeit zu geben um jede Zeit des Tages ein offenes Game zu finden , werden wir die Serverstruktur komplett erneueren.
Am 05.12.2012 nach der wöchentlichen Wartung wird die neue...
|
All times are GMT +1. The time now is 23:56.
|
|