diff --git a/ryzom/server/tools/cfg_creator/create_cfgs.py b/ryzom/server/tools/cfg_creator/create_cfgs.py new file mode 100644 index 000000000..755503b8c --- /dev/null +++ b/ryzom/server/tools/cfg_creator/create_cfgs.py @@ -0,0 +1,52 @@ +#!/usr/bin/python3 +# ______ _____ _ _ _____ _ +# | ___ \ / ___| | | | |_ _| | | +# | |_/ / _ _______ _ __ ___ \ `--.| |__ __ _ _ __ __| | | | ___ ___ | |___ +# | / | | |_ / _ \| '_ ` _ \ `--. \ '_ \ / _` | '__/ _` | | |/ _ \ / _ \| / __| +# | |\ \ |_| |/ / (_) | | | | | | /\__/ / | | | (_| | | | (_| | | | (_) | (_) | \__ \ +# \_| \_\__, /___\___/|_| |_| |_| \____/|_| |_|\__,_|_| \__,_| \_/\___/ \___/|_|___/ +# __/ | +# |___/ +# +# Ryzom - MMORPG Framework +# Copyright (C) 2019 Winch Gate Property Limited +# This program is free software: read https://ryzom.com/dev/copying.html for more details +# +# This script is a helper to generate the configurations files of a ryzom shard +# just reading fields in a globals.cfg file and replacing it in all final cfgs files +# +# Usage are ./create_cfgs.py SHARD_PATH +# + + + +import os, sys + +dstpath = sys.argv[1] + +dir_path = os.path.dirname(os.path.realpath(__file__)) + +templatepath = dir_path+"/templates/" +finalpath = dstpath+"/cfgs/" + +enc = "iso-8859-1" + +with open(dstpath+"/globals.cfg", 'r', encoding=enc) as fd: + if fd: + lines = fd.read().split("\n") + tmp = [] + for n in lines: + if n: + line = n.split(" = ") + if line: + tmp.append(line) + + for f in os.listdir(templatepath): + with open(templatepath+f, 'r', encoding=enc) as content: + if content: + content = content.read() + for k, v in tmp: + content = content.replace(k, v) + with open(finalpath+f, 'w') as fd: + fd.write(content) + print(f) diff --git a/ryzom/server/tools/cfg_creator/templates/admin_executor_service.cfg b/ryzom/server/tools/cfg_creator/templates/admin_executor_service.cfg new file mode 100644 index 000000000..cc80b2908 --- /dev/null +++ b/ryzom/server/tools/cfg_creator/templates/admin_executor_service.cfg @@ -0,0 +1,168 @@ +// Use with commandline: ryzom_admin_service -A. -C. -L. --nobreak --fulladminname=admin_executor_service --shortadminname=AES + +#include "admin_executor_service_default.cfg" + +// ---- config local variables + +// Address of the admin service (default port is 49996) +ASHost = "localhost"; +ASPort="46701"; + +// ---- service NeL variables (used by ConfigFile class) + +AESAliasName= "aes"; + +StartCommands= +{ + // Create a gateway module + "moduleManager.createModule StandardGateway gw", + // add a layer 5 transport + "gw.transportAdd L5Transport l5", + // open the transport + "gw.transportCmd l5(open)", + + /// Create default connection with admin executor service + // Create a gateway module + "moduleManager.createModule StandardGateway gw_aes", + // create the admin executor service module + "moduleManager.createModule AdminExecutorServiceClient aes_client", + "aes_client.plug gw_aes", + + // create a layer 3 client to connect to aes gateway + "gw_aes.transportAdd L3Client aes_l3c", + "gw_aes.transportCmd aes_l3c(connect addr="+AESHost+":"+AESPort+")", + + // create the admin executor service module + "moduleManager.createModule AdminExecutorService aes", + + // create a gateway to connect to as + "moduleManager.createModule StandardGateway asc_gw", + // create a layer 3 client + "asc_gw.transportAdd L3Client l3c", + "asc_gw.transportCmd l3c(connect addr="+ASHost+":"+ASPort+")", + + // create a gateway for services to connect + "moduleManager.createModule StandardGateway aes_gw", + // create a layer 3 server + "aes_gw.transportAdd L3Server l3s", + "aes_gw.transportOptions l3s(PeerInvisible)", + "aes_gw.transportCmd l3s(open port="+AESPort+")", + + // plug the as + "aes.plug asc_gw", + "aes.plug aes_gw", +}; + +StartCommands += +{ + "aes.addRegisteredService bms_master #SHARDNAME#", +// "aes.addRegisteredService bms_pd_master #SHARDNAME#", + "aes.addRegisteredService egs #SHARDNAME#", + "aes.addRegisteredService gpms #SHARDNAME#", + "aes.addRegisteredService ios #SHARDNAME#", + "aes.addRegisteredService rns #SHARDNAME#", + "aes.addRegisteredService rws #SHARDNAME#", + "aes.addRegisteredService ts #SHARDNAME#", + "aes.addRegisteredService ms #SHARDNAME#", + "aes.addRegisteredService ais_newbieland #SHARDNAME#", + "aes.addRegisteredService ais_fyros #SHARDNAME#", + "aes.addRegisteredService ais_roots #SHARDNAME#", + "aes.addRegisteredService ais_matis #SHARDNAME#", + "aes.addRegisteredService ais_tryker #SHARDNAME#", + "aes.addRegisteredService ais_zorai #SHARDNAME#", + "aes.addRegisteredService ais_ark #SHARDNAME#", + "aes.addRegisteredService mfs #SHARDNAME#", + "aes.addRegisteredService su #SHARDNAME#", + "aes.addRegisteredService fes #SHARDNAME#", + "aes.addRegisteredService sbs #SHARDNAME#", + "aes.addRegisteredService lgs #SHARDNAME#", +// "aes.addRegisteredService mos #SHARDNAME#", +// "aes.addRegisteredService pdss #SHARDNAME#", + "aes.addRegisteredService ras #SHARDNAME#", + "aes.addRegisteredService aes #SHARDNAME#", +}; + + +bms_master = { "./", "/home/nevrax/dev/live/service_backup_service/backup_service", "-C. -L. --nobreak --writepid -P49990" }; +bms_pd_master = { "./", "/home/nevrax/dev/live/service_backup_service/backup_service", "-C. -L. --nobreak --writepid -P49992" }; +egs = { "./", "/home/nevrax/dev/live/service_entities_game_service/entities_game_service", "-C. -L. --nobreak --writepid" }; +gpms = { "/home/nevrax/dev/gpms", "/home/nevrax/dev/live/service_gpm_service/gpm_service", "-C. -L. --nobreak --writepid" }; +ios = { "/home/nevrax/dev/ios", "/home/nevrax/dev/live/service_input_output_service/input_output_service", "-C. -L. --nobreak --writepid" }; +rns = { "/home/nevrax/dev/rns", "/home/nevrax/dev/live/service_ryzom_naming_service/ryzom_naming_service", "-C. -L. --nobreak --writepid" }; +rws = { "/home/nevrax/dev/rws", "/home/nevrax/dev/live/service_ryzom_welcome_service/ryzom_welcome_service", "-C. -L. --nobreak --writepid" }; +ts = { "/home/nevrax/dev/ts", "/home/nevrax/dev/live/service_tick_service/tick_service", "-C. -L. --nobreak --writepid" }; +ms = { "/home/nevrax/dev/ms", "/home/nevrax/dev/live/service_mirror_service/mirror_service", "-C. -L. --nobreak --writepid" }; +ais_newbieland = { "/home/nevrax/dev/ais_newbyland", "/home/nevrax/dev/live/service_ai_service/ai_service", "-C. -L. --nobreak --writepid -mCommon:Newbieland:Post" }; +ais_fyros = { "/home/nevrax/dev/ais_newbyland", "/home/nevrax/dev/live/service_ai_service/ai_service", "-C. -L. --nobreak --writepid -mCommon:Newbieland:Post" }; +ais_roots = { "/home/nevrax/dev/ais_newbyland", "/home/nevrax/dev/live/service_ai_service/ai_service", "-C. -L. --nobreak --writepid -mCommon:Newbieland:Post" }; +ais_matis = { "/home/nevrax/dev/ais_newbyland", "/home/nevrax/dev/live/service_ai_service/ai_service", "-C. -L. --nobreak --writepid -mCommon:Newbieland:Post" }; +ais_tryker = { "/home/nevrax/dev/ais_newbyland", "/home/nevrax/dev/live/service_ai_service/ai_service", "-C. -L. --nobreak --writepid -mCommon:Newbieland:Post" }; +ais_zorai = { "/home/nevrax/dev/ais_newbyland", "/home/nevrax/dev/live/service_ai_service/ai_service", "-C. -L. --nobreak --writepid -mCommon:Newbieland:Post" }; +ais_ark = { "/home/nevrax/dev/ais_newbyland", "/home/nevrax/dev/live/service_ai_service/ai_service", "-C. -L. --nobreak --writepid -mCommon:Newbieland:Post" }; +mfs = { "/home/nevrax/dev/mfs", "/home/nevrax/dev/live/service_mail_forum_service/mail_forum_service", "-C. -L. --nobreak --writepid" }; +su = { "/home/nevrax/dev/su", "/home/nevrax/dev/live/service_shard_unifier_service/shard_unifier_service", "-C. -L. --nobreak --writepid" }; +fes = { "/home/nevrax/dev/fes", "/home/nevrax/dev/live/service_frontend_service/frontend_service", "-C. -L. --nobreak --writepid" }; +sbs = { "/home/nevrax/dev/sbs", "/home/nevrax/dev/live/service_session_browser_server/session_browser_server", "-C. -L. --nobreak --writepid" }; +lgs = { "/home/nevrax/dev/lgs", "/home/nevrax/dev/live/service_logger_service/logger_service", "-C. -L. --nobreak --writepid" }; +mos = { "/home/nevrax/dev/mos", "/home/nevrax/dev/live/service_monitor_service/monitor_service", "-C. -L. --nobreak --writepid" }; +pdss = { "/home/nevrax/dev/pdss", "/home/nevrax/dev/live/service_pd_support_service/pd_support_service", "-C. -L. --nobreak --writepid" }; +ras = { "./", "src/ryzom_admin_service/ryzom_admin_service", "--fulladminname=admin_service --shortadminname=AS -C. -L. --nobreak --writepid" }; + +RegisteredServices= +{ + "bms_master", + "bms_pd_master", + "egs", + "gpms", + "ios", + "rns", + "rws", + "ts", + "ms", + "ais_newbieland", + "ais_fyros", + "ais_roots", + "ais_matis", + "ais_tryker", + "ais_zorai", + "ais_ark", + "mfs", + "su", + "fes", + "sbs", + "lgs", + "mos", + "pdss", + "ras", +}; + +// +DontUseStdIn = 0; + +// ---- service NeL variables (used by CVariable class) + +// If the update loop is too slow, a thread will produce an assertion. +// By default, the value is set to 10 minutes. +// Set to 0 for no assertion. +UpdateAssertionThreadTimeout = 0; + +// ---- service custom variables (used by ConfigFile class) + +// ---- service custom variables (used by CVariable class) + +// in second, -1 for not restarting +RestartDelay = 60; + +// how many second before aborting the request if not finished +RequestTimeout = 5; + +// log path for advanced log report +LogPath = "/."; + +// setup for deployment environment with exeternal configuration system responsible for launching apps and +// for configuring AES services +DontLaunchServicesDirectly = 1; +UseExplicitAESRegistration = 1; +KillServicesOnDisconnect = 1; + +ShardName="#SHARDNAME#"; diff --git a/ryzom/server/tools/cfg_creator/templates/admin_executor_service_default.cfg b/ryzom/server/tools/cfg_creator/templates/admin_executor_service_default.cfg new file mode 100644 index 000000000..d975823de --- /dev/null +++ b/ryzom/server/tools/cfg_creator/templates/admin_executor_service_default.cfg @@ -0,0 +1,7 @@ +#include "common.cfg" + +// I'm the AES, I'll not connect to myself! +DontUseAES = 1; + +// I don't need a connection to a naming service +DontUseNS = 1; diff --git a/ryzom/server/tools/cfg_creator/templates/admin_service.cfg b/ryzom/server/tools/cfg_creator/templates/admin_service.cfg new file mode 100644 index 000000000..d3d84c7ec --- /dev/null +++ b/ryzom/server/tools/cfg_creator/templates/admin_service.cfg @@ -0,0 +1,22 @@ +// Use with commandline: ryzom_admin_service --fulladminname=ryzom_admin_service --shortadminname=AS -C. -L. --nobreak --writepid + +// ---- config local variables + +ASWebPort="46700"; +ASPort="46701"; + +#include "admin_service_default.cfg" + +// ---- service NeL variables (used by ConfigFile class) + +AESAliasName= "ras"; + +Paths += { + ".", +}; + +// ---- service NeL variables (used by CVariable class) + +// ---- service custom variables (used by ConfigFile class) + + // ---- service custom variables (used by CVariable class) diff --git a/ryzom/server/tools/cfg_creator/templates/admin_service_default.cfg b/ryzom/server/tools/cfg_creator/templates/admin_service_default.cfg new file mode 100644 index 000000000..4eb2bdfe6 --- /dev/null +++ b/ryzom/server/tools/cfg_creator/templates/admin_service_default.cfg @@ -0,0 +1,27 @@ +#include "common.cfg" + +DontUseNS = 1; + +RRDToolPath = "rrdtool"; +RRDVarPath = "../save/rrd_graphs"; + +// Variables required to be defined by other cfgs +//AESHost="localhost"; +//ASWebPort="46700"; +//ASPort="46701"; + +StartCommands += +{ + // create the admin service module and open the web interface + "moduleManager.createModule AdminService as webPort="+ASWebPort, + + // create a gateway for aes to connect + "moduleManager.createModule StandardGateway as_gw", + // create a layer 3 server + "as_gw.transportAdd L3Server l3s", + "as_gw.transportOptions l3s(PeerInvisible)", + "as_gw.transportCmd l3s(open port="+ASPort+")", + + // plug the as + "as.plug as_gw", +}; diff --git a/ryzom/server/tools/cfg_creator/templates/ags_test_service_default.cfg b/ryzom/server/tools/cfg_creator/templates/ags_test_service_default.cfg new file mode 100644 index 000000000..00859d2be --- /dev/null +++ b/ryzom/server/tools/cfg_creator/templates/ags_test_service_default.cfg @@ -0,0 +1,128 @@ + + +//14.11.02 + +//this is the latest version of the ags script +//contents : matis city NPCs, bush fauna (low level-newbie zone) + + + + + +// link the common configuration file +RootConfigFilename = "common.cfg"; + +DisplayedVariables += {"GlobalActorCount","GlobalActorMoves","GlobalActorUpdates"}; + +// by default, use localhost to find the naming service +//NSHost = "ldserver:50000"; +//NSHost = "gamedev4"; + +// load all continents +UsedContinents = +{ +// "fyros", +// "tryker", + "matis", +// "zorai", +}; + +Paths += { "data_leveldesign" /*, "data_common", "data_shard"*/ }; + + +// StartCommands = { "loadPrim demo.prim" }; // .prim is an obsolete file format (it used to work for collision with trees) + +StartCommandsWhenMirrorReady = { + + // THIS IS GOOD NEW STUFF + "checkGenerateAndRun ags_test_creatures1 1571 -5135 10 25 creature c????1.creature", + "checkGenerateAndRun ags_test_creatures_testroom 1571 -4825 5 50 creature testroom_*.creature", +/* + // THIS IS OLD STUFF + // to be removed later + "checkGenerateAndRun ags_test_lvl_01 1721 -4805 5 20 creature *_lvl_01.creature", + "checkGenerateAndRun ags_test_hom 1721 -4755 5 20 creature *_hom_*.creature", + "checkGenerateAndRun ags_test_hof 1721 -4745 5 20 creature *_hof_*.creature", + "checkGenerateAndRun ags_test_set 1721 -4735 5 20 creature *_set.creature", + "checkGenerateAndRun ags_test_karavan 1721 -4725 5 20 creature karavan_*.creature", + "checkGenerateAndRun ags_test_kami 1721 -4715 5 20 creature kami*_*.creature", +*/ +/* + "generateScript ags_test_lvl_01.script 1721 -5000 5 20 creature *_lvl_01.creature", + "generateScript ags_test_hom.script 1721 -4950 5 20 creature *_hom_*.creature", + "generateScript ags_test_hof.script 1721 -4940 5 20 creature *_hof_*.creature", + "generateScript ags_test_set.script 1721 -4930 5 20 creature *_set.creature", + "generateScript ags_test_karavan.script 1721 -4920 5 20 creature karavan_*.creature", + "generateScript ags_test_kami.script 1721 -4910 5 20 creature kami*_*.creature", + + "runScript lvl_01 ags_test_lvl_01.script on", + "runScript hom ags_test_hom.script on", + "runScript hof ags_test_hof.script on", + "runScript set ags_test_set.script on", + "runScript karanvan ags_test_karavan.script on", + "runScript kami ags_test_kami.script on", +*/ +}; + + +/* + +for scripting : + +one command per line, no surrounding " + +commands are : + +- cmd: Execute a service command + ex: cmd help + cmd actorCreatePosition demo-point-004 + +- setText: Set a variable as plain text. Value can be computed using other + variables to compose strings (with the $(varname) syntax) + ex: setText myVar myValue + setText myVar $(myOtherVar) blah blah + synonym: set$ works like setText + +- setNumeric: set a variable as numeric value. Value can be computed using + other variables (no specific syntax, variable names are written in plain text) + a variable existence can be tested by preceding its name by a ?. If the variable + exists, the ?var is set to 1, otherwise 0. + ex: setNumeric myVar 0.1234 + setNumeric myVar myOtherVar*2.0+55690.1*sin(myVar) + setNumeric isReady ?myVar + synonym: set# works like setNumeric + +- erase: erases a variable. Variable is completely deleted. ?var returns 0 after until var is redefined + ex: erase myVar + +- wait: halt script for n cycles + ex: wait 10 + +- receive: halt script until expression is true (true is a value different from 0) + common operators can be used (<, >, == etc.) + ex: receive myVar>1.0 + receive ?myVar + +- send: send a value to all running scripts. Couple variable/value will be defined then in all running scripts + useful to synchronize scripts, or trigger events... value is text replaced using $(...) syntax + ex: send myVar blah blah + send myVar $(myOtherVar) + +- display: displays a string, text replaced using $(...) syntax + ex: display myVar=$(myVar) + display number of players=$(nbPlayers) + +- if: tests a condition, and runs alternative. alternative bloc can have an else part, and must be ended by endif + ex: if myVar > 10 + display myVar is greater than 10 + else + display myVar is less than 10 + endif + +- while: execute a bloc while a condition is verified. bloc must be ended by endloop + ex: while myVar > 10 + set# myVar myVar-1 + endloop + + +*/ \ No newline at end of file diff --git a/ryzom/server/tools/cfg_creator/templates/ai_build_wmap.cfg b/ryzom/server/tools/cfg_creator/templates/ai_build_wmap.cfg new file mode 100644 index 000000000..d1653de30 --- /dev/null +++ b/ryzom/server/tools/cfg_creator/templates/ai_build_wmap.cfg @@ -0,0 +1,16 @@ + +Paths += +{ + "data_shard/pacs", + "data/3d/continents", + "data_shard", + "data_common" +}; + + +Commands = +{ + "setStartPoint matis 4700 -3500", + + "pacsCrunch matis" +}; diff --git a/ryzom/server/tools/cfg_creator/templates/ai_data_service.cfg b/ryzom/server/tools/cfg_creator/templates/ai_data_service.cfg new file mode 100644 index 000000000..36edeadab --- /dev/null +++ b/ryzom/server/tools/cfg_creator/templates/ai_data_service.cfg @@ -0,0 +1,28 @@ +// link the common configuration file +RootConfigFilename = "common.cfg"; + +DontUseAES = 1; +DontUseNS = 1; + +// Paths += { "data_leveldesign", "data_common" }; +Paths += { "./data_shard/pacs", "./data/3d/continents" }; +Paths += { "data_leveldesign/leveldesign/World" }; + +SrcPaths = { "./data_leveldesign/leveldesign/new_world" }; +ObjPath = "./data_leveldesign/leveldesign/new_world"; +SavPath = "./data_leveldesign/leveldesign/new_world"; + +DisplayedVariables += { "EvaluatedPos" }; + + +StartCommands = +{ + // "pacs_crunch fyros", + // "pacs_crunch matis", + // "pacs_crunch tryker", + // "pacs_crunch bagne", + // "pacs_crunch sources", + +// "aiMake" +}; + diff --git a/ryzom/server/tools/cfg_creator/templates/ai_service.cfg b/ryzom/server/tools/cfg_creator/templates/ai_service.cfg new file mode 100644 index 000000000..2fb67b600 --- /dev/null +++ b/ryzom/server/tools/cfg_creator/templates/ai_service.cfg @@ -0,0 +1,146 @@ +// Use with commandline: ai_service -C. -L. --nobreak --writepid -mCommon:Newbieland:Post + +// ---- config local variables + +SUPort = 50505; +SUHost = "localhost"; +// SU - listen address of the SU service (for L5 connections) +SUAddress = SUHost+":"+SUPort; + +#include "ai_service_default.cfg" + +// ---- service NeL variables (used by ConfigFile class) + +//AESAliasName= "ais_newbieland"; + +GraphVars += { "TickSpeedLoop", "0" }; +GraphVars += { "TickSpeedLoop", "60000" }; +GraphVars += { "L5CallbackCount", "0" }; +GraphVars += { "L5CallbackCount", "60000" }; +GraphVars += { "L5CallbackTime", "0" }; +GraphVars += { "L5CallbackTime", "60000" }; +GraphVars += { "MirrorCallbackCount", "0" }; +GraphVars += { "MirrorCallbackCount", "60000" }; +GraphVars += { "MirrorCallbackTime", "0" }; +GraphVars += { "MirrorCallbackTime", "60000" }; + +Paths += { + "../data", + "../common/", + "../common/data_leveldesign", +}; + +// ---- service NeL variables (used by CVariable class) + +// ---- service custom variables (used by ConfigFile class) + +#include "used_continents.cfg" + +// Mirror limits +DatasetSizefe_temp = 700000; +DatasetSizefame = 26000; + +// define the primitives configuration used. (AIS, EGS) +UsedPrimitives = +{ +"newbieland_all", +// "newbieland", +"matis_newbie_all", +// "matis_newbieland", + +"matis_all", +// "matis_majesticgarden", +// "matis_fleetinggarden", +// "matis_groveofconfusion", +// "matis_hereticshovel", +// "matis_hiddensource", +// "matis_knollofdissent", +// "matis_upperbog", + +"matis_island_all", + +"zorai_newbie_all", +// "zorai_newbieland", + +"zorai_all", +// "zorai_citiesofintuition", +// "zorai_maidengrove", +// "zorai_groveofumbra", +// "zorai_havenofpurity", +// "zorai_knotofdementia", +// "zorai_thevoid", + +"zorai_island_all", + +"fyros_newbie_all", +// "fyros_newbieland", + +"fyros_all", +// "fyros_imperialdune", +// "fyros_oflovaksoasis", +// "fyros_frahartowers", +// "fyros_dunesofexil", +// "fyros_outlawcanyon", +// "fyros_sawdustmines", +// "fyros_thesavagedunes", +// "fyros_thescorchedcorridor", + +"fyros_island_all", + +"tryker_newbie_all", +// "tryker_newbieland", + +"tryker_all", +// "tryker_bountybeaches", +// "tryker_enchantedisle", +// "tryker_lagoonsofloria", +// "tryker_libertylake", +// "tryker_thefount", +// "tryker_windsofmuse", + +"tryker_island_all", + + +"terre_all", +// "terre_forbidden_depths", +// "terre_the_land_of_continuty", +// "terre_the_sunken_city", +"sources_all", +// "sources_the_under_spring", +"route_gouffre_all", +// "route_gouffre_gate_of_obscurity", +// "route_gouffre_the_elusive_forest", +// "route_gouffre_the_trench_of_trials", +// "route_gouffre_the_windy_gate", +"nexus_all", +// "nexus_nexus", +"bagne_all", +// "bagne_the_abyss_of_ichor", + +"kitiniere_all", +// "kitiniere", +//ace kitiniere+tcm "corrupted_moor_all", +}; + +// the following variable must be defined but should be empty - it's presence is used to change the behaviour +// of the packed sheet reader +GeorgePaths = { "" }; + + +// ---- service custom variables (used by CVariable class) + +NbPlayersLimit = PlayerLimit; + +// Entity Limits (AIS) +NbPetLimit = NbPlayersLimit*4; +NbFaunaLimit = 50000; +NbNpcLimit = 20000; +NbFxLimit = 500; + +#include "backup_service_interface.cfg" + +// Set this shard as a ring (1) or mainland (0) shard (main behavior switch) +IsRingShard = 0; + +// Disable ryzom verbose logging +VerboseMIRROR = 0; diff --git a/ryzom/server/tools/cfg_creator/templates/ai_service_default.cfg b/ryzom/server/tools/cfg_creator/templates/ai_service_default.cfg new file mode 100644 index 000000000..cbff84781 --- /dev/null +++ b/ryzom/server/tools/cfg_creator/templates/ai_service_default.cfg @@ -0,0 +1,388 @@ +#include "common.cfg" + +// a list of system command that run at server startup. +SystemCmd = {}; + +////////////////////////////////////////////////////////////////////////////// +//- Basic (specific) heal profile parameters --------------------------------- +// Downtime for normal heal (on other bots of the group) +HealSpecificDowntime = 100; +// Downtime for self heal +HealSpecificDowntimeSelf = 100; +////////////////////////////////////////////////////////////////////////////// + +// Disable caching of ligo primitive in binary files +CachePrims = 0; +CachePrimsLog = 0; + +// do not log the corrected position. +LogAcceptablePos = 0; +// do not log group creation failure +LogGroupCreationFailure = 0; +// do not log aliad tree owner construstion. +LogAliasTreeOwner = 0; +// do not log outpost info +LogOutpostDebug = 0; +// Speed factor, for debug purpose only. Don't set to high speed factor ! +SpeedFactor = 1; +// Speep up the timer triggering. Set a value between 1 (normal) and INT_MAX. +TimerSpeedUp = 1; + +// Default timer for wander behavior +DefaultWanderMinTimer = 50; // 5s +DefaultWanderMaxTimer = 100; // 10s + +// Fame and guard behavior +// Fame value under witch the guard attack the player in sigth +FameForGuardAttack = -450000; +// The minimum of fame for guard to help the player +FameForGuardHelp = -200000; + +// The default aggro distance for NPC +DefaultNpcAggroDist = 15; +// The default escort range for escort behavior +DefaultEscortRange = 10; + +////////////////////////////////////////////////////////////////////////////// +// Aggro // +////////////////////////////////////////////////////////////////////////////// +AggroReturnDistCheck = 15.0; +AggroReturnDistCheckFauna = 15.0; +AggroReturnDistCheckNpc = 1.5; +AggroD1Radius = 250.0; +AggroD2Radius = 150.0; +AggroPrimaryGroupDist = 0.0; +AggroPrimaryGroupCoef = 0.0; +AggroSecondaryGroupDist = 0.0; +AggroSecondaryGroupCoef = 0.0; +AggroPropagationRadius = 60.0; + +BotRepopFx = ""; + +// GROUP KEYWORDS +// used mainly in event handlers to determine to which groups events apply +KeywordsGroupNpc = { + + "patrol", // a group of bots who guard a patrol route or point + "convoy", // a group with pack animals who follow roads from place to place + "with_players", // a group who may travel with players +}; + +// BOT KEYWORDS +// used mainly in npc_state_profile to determine which ai profiles to assign to which bots +KeywordsBotNpc = { + + "team_leader", // a bot who leads the way in front of their team (and acts as leader + // in discussion with players) + "animal_leader", // a bot who leads pack animals + "guard", // a bot who is a guard of some sort (eg karavan guard) + "emissary", // eg karavan emissary + "preacher", // eg kami preacher + "guardian", // typically kami guardians + "vip", // someone who has an escort of players or NPCs (assumed to be harmless) +}; + +// STATE KEYWORDS +// used mainly in event handlers to determine to which state events apply +// eg: when a player goes link dead if the team that this player is escorting +// is in a dangerous area the team may enter a 'protect ourselves and wait for +// players' punctual state +KeywordsStateNpc = { + + "safe", // eg the gathering point at town entrance + "dangerous", // eg a route through the wilds +}; + +ColourNames = +{ + "red : 0", + "beige : 1", + "green : 2", + "turquoise : 3", + "blue : 4", + "violet : 5", + "white : 6", + "black : 7", + + "redHair: 0", + "blackHair: 1", +}; + + +StartCommandsWhenMirrorReady = { +}; + +//--------------------------------------------------------- +// commands for multi IA configuration +// For multi IA config, use the -m command line switch folowed +// by a semicolon separated list of command block to run. +// ex : +// -mCommon:Matis:Post +// will execute the folowing command blocks in order : +// * StartCommandsWhenMirrorReadyCommon +// * StartCommandsWhenMirrorReadyMatis +// * StartCommandsWhenMirrorReadyPost +//--------------------------------------------------------- +// common commands before loading continents +StartCommandsWhenMirrorReadyCommon = +{ + "RandomPosMaxRetry 6400", + "fightRangeRange 4 60", + "LogOutpostDebug 1", + "grpHistoryRecordLog", + + "verboseAIProfiles", + "verboseAliasNodeTreeParserLog", + "verboseCombatLog", + "verboseFaunaMgrLog", + "verboseFaunaParseLog", + "verboseNPCBotProfiles", + "verboseNPCMgrLog", + "verboseNPCParserLog", + "verboseNpcDescriptionMsgLog", + "verbosePrimitiveParserLog", +// "verboseSwitchMultipleChangesOfAProperty", +}; + + +// commands for indoors continent +StartCommandsWhenMirrorReadyIndoors = +{ + "loadContinent indoors", + "createStaticAIInstance indoors", + "loadMapsFromCommon indoors_all", +}; + +// commands for Matis continent +StartCommandsWhenMirrorReadyMatis = +{ + "loadContinent matis", + "createStaticAIInstance matis", + "loadMapsFromCommon matis_all", +}; + +// commands for Matis newbie continent +StartCommandsWhenMirrorReadyMatisNewbie = +{ + "loadContinent matis", + "createStaticAIInstance matis_newbie", + "loadMapsFromCommon matis_newbie_all", +}; + +// commands for Zorai continent +StartCommandsWhenMirrorReadyZorai = +{ + "loadContinent zorai", + "createStaticAIInstance zorai", + "loadMapsFromCommon zorai_all", +}; + +// commands for Zorai newbie continent +StartCommandsWhenMirrorReadyZoraiNewbie = +{ + "loadContinent zorai", + "createStaticAIInstance zorai_newbie", + "loadMapsFromCommon zorai_newbie_all", +}; + +// commands for Fyros continent +StartCommandsWhenMirrorReadyFyros = +{ + "loadContinent fyros", + "createStaticAIInstance fyros", + "loadMapsFromCommon fyros_all", +}; + +// commands for Fyros newbie continent +StartCommandsWhenMirrorReadyFyrosNewbie = +{ + "loadContinent fyros_newbie", + "createStaticAIInstance fyros_newbie", + "loadMapsFromCommon fyros_newbie_all", +}; + +// commands for Tryker continent +StartCommandsWhenMirrorReadyTryker = +{ + "loadContinent tryker", + "createStaticAIInstance tryker", + "loadMapsFromCommon tryker_all", +}; + +// commands for Tryker newbie continent +StartCommandsWhenMirrorReadyTrykerNewbie = +{ + "loadContinent tryker_newbie", + "createStaticAIInstance tryker_newbie", + "loadMapsFromCommon tryker_newbie_all", +}; + +// commands for bagne continents +StartCommandsWhenMirrorReadyBagne = +{ + "loadContinent bagne", + "createStaticAIInstance bagne", + "loadMapsFromCommon bagne_all", +}; + +StartCommandsWhenMirrorReadyNexus = +{ + "loadContinent nexus", + "createStaticAIInstance nexus", + "loadMapsFromCommon nexus_all", +}; + +StartCommandsWhenMirrorReadyRouteGouffre = +{ + "loadContinent route_gouffre", + "createStaticAIInstance route_gouffre", + "loadMapsFromCommon route_gouffre_all", +}; + +StartCommandsWhenMirrorReadySources = +{ + "loadContinent sources_interdites", + "createStaticAIInstance sources", + "loadMapsFromCommon sources_all", +}; + +StartCommandsWhenMirrorReadyTerre = +{ + "loadContinent terre_oubliee", + "createStaticAIInstance terre", + "loadMapsFromCommon terre_all", +}; + +// commands for Fyros Island continent +StartCommandsWhenMirrorReadyFyrosIsland = +{ + "loadContinent fyros_island", + "createStaticAIInstance fyros_island", + "loadMapsFromCommon fyros_island_all", +}; + +// commands for Zorai Island continent +StartCommandsWhenMirrorReadyZoraiIsland = +{ + "loadContinent zorai_island", + "createStaticAIInstance zorai_island", + "loadMapsFromCommon zorai_island_all", +}; + +// commands for Tryker Island continent +StartCommandsWhenMirrorReadyTrykerIsland = +{ + "loadContinent tryker_island", + "createStaticAIInstance tryker_island", + "loadMapsFromCommon tryker_island_all", +}; + +// commands for Matis island continent +StartCommandsWhenMirrorReadyMatisIsland = +{ + "loadContinent matis_island", + "createStaticAIInstance matis_island", + "loadMapsFromCommon matis_island_all", +}; + +// commands for Newbieland continent +StartCommandsWhenMirrorReadyNewbieland = +{ + "loadContinent newbieland", + "createStaticAIInstance newbieland", + "loadMapsFromCommon newbieland_all", +}; + +// commands for Kitiniere continent +StartCommandsWhenMirrorReadyKitiniere = +{ + "loadContinent kitiniere", + "createStaticAIInstance kitiniere", + "loadMapsFromCommon kitiniere_all", +}; + +// commands for R2 continent +StartCommandsWhenMirrorReadyR2Desert = +{ + "loadContinent r2_desert", + "createStaticAIInstance r2_desert", + "loadMapsFromCommon r2_desert_all", +}; + +// commands for R2 continent +StartCommandsWhenMirrorReadyR2Forest = +{ + "loadContinent r2_forest", + "createStaticAIInstance r2_forest", + "loadMapsFromCommon r2_forest_all", +}; + +// commands for R2 continent +StartCommandsWhenMirrorReadyR2Lakes = +{ + "loadContinent r2_lakes", + "createStaticAIInstance r2_lakes", + "loadMapsFromCommon r2_lakes_all", +}; + +// commands for R2 continent +StartCommandsWhenMirrorReadyR2Jungle = +{ + "loadContinent r2_jungle", + "createStaticAIInstance r2_jungle", + "loadMapsFromCommon r2_jungle_all", +}; + +// commands for R2 continent +StartCommandsWhenMirrorReadyR2Roots = +{ + "loadContinent r2_roots", + "createStaticAIInstance r2_roots", + "loadMapsFromCommon r2_roots_all", +}; + + +// commands for post continents loading +StartCommandsWhenMirrorReadyPost = +{ + "spawnInstances", + "updateAI", + "updateAI", +}; + + +// commands for Ring continents +StartCommandsWhenMirrorReadyRing = +{ + "loadContinent r2_desert", + "createDynamicAIInstance 10000", + "loadPrimitiveFile dummy.primitive", + + "loadContinent r2_forest", + "createDynamicAIInstance 10001", + "loadPrimitiveFile dummy.primitive", + + "loadContinent r2_lakes", + "createDynamicAIInstance 10003", + "loadPrimitiveFile dummy.primitive", + + "loadContinent r2_jungle", + "createDynamicAIInstance 10002", + "loadPrimitiveFile dummy.primitive", + + "loadContinent r2_roots", + "createDynamicAIInstance 10004", + "loadPrimitiveFile dummy.primitive", + +// "spawnInstances", + "updateAI", + "updateAI", + + // L5 connect to the shard unifier + "unifiedNetwork.addService ShardUnifier ( address="+SUAddress+" sendId external autoRetry )", + + // Create a shard AIS Module + "moduleManager.createModule AisControl ais", + // Connect AIS + "ais.plug gw" +}; diff --git a/ryzom/server/tools/cfg_creator/templates/backup_service.cfg b/ryzom/server/tools/cfg_creator/templates/backup_service.cfg new file mode 100644 index 000000000..b2668b0f6 --- /dev/null +++ b/ryzom/server/tools/cfg_creator/templates/backup_service.cfg @@ -0,0 +1,34 @@ +// Use with commandline: backup_service -C. -L. --nobreak --writepid -P49990 + +#include "backup_service_default.cfg" + +// ---- config local variables + +// ---- service NeL variables (used by ConfigFile class) + +AESAliasName = "bms_master"; + +Paths += { + ".", + "../common/data_leveldesign", +}; + +// ---- service NeL variables (used by CVariable class) + +// Where to save specific shard data (ie: player backup), relatively to SaveShardRoot +SaveFilesDirectory = ""; + +// where to save generic shard data (ie: packed_sheet) +WriteFilesDirectory = "../data"; + +// ---- service custom variables (used by ConfigFile class) + +WebPort = 49970; + +// ---- service custom variables (used by CVariable class) + +// BS - Root directory where data are backuped to +IncrementalBackupDirectory = "../incremental_backup"; + +// Root directory where data from shards are stored into +SaveShardRoot = "../save/"; diff --git a/ryzom/server/tools/cfg_creator/templates/backup_service_default.cfg b/ryzom/server/tools/cfg_creator/templates/backup_service_default.cfg new file mode 100644 index 000000000..53dc4a8ba --- /dev/null +++ b/ryzom/server/tools/cfg_creator/templates/backup_service_default.cfg @@ -0,0 +1,31 @@ +#include "common.cfg" + +// ---- service NeL variables (used by ConfigFile class) + +DontUseNS = 1; + +// ---- service NeL variables (used by CVariable class) + +ListeningPort = 49990; + +// ---- service custom variables (used by ConfigFile class) + +// Listening port for the Web server to connect in + +WebPort = 49898; + +BSReadState = 1; + + // ---- service custom variables (used by CVariable class) + +// Port for the Layer 3 interface of the backup service +L3ListeningPort = 49950; + +// template path from SaveShardRoot to find character saves +SaveTemplatePath = "$shard/characters/account_$userid_$charid$ext"; + +// character saves possible extension list +SaveExtList = "_pdr.bin _pdr.xml .bin"; + +//BSFilePrefix = "R:/code/ryzom/r2_shard/"; +//BSFileSubst = "r2_shard/"; diff --git a/ryzom/server/tools/cfg_creator/templates/backup_service_interface.cfg b/ryzom/server/tools/cfg_creator/templates/backup_service_interface.cfg new file mode 100644 index 000000000..104cd6ff4 --- /dev/null +++ b/ryzom/server/tools/cfg_creator/templates/backup_service_interface.cfg @@ -0,0 +1,5 @@ +L3BSPort = "49950"; +BSHost = "localhost:49990"; +UseBS = 1; +// Root directory where data from shards are stored into +SaveShardRoot = "../save/"; diff --git a/ryzom/server/tools/cfg_creator/templates/backup_slave_service_default.cfg b/ryzom/server/tools/cfg_creator/templates/backup_slave_service_default.cfg new file mode 100644 index 000000000..96c018e89 --- /dev/null +++ b/ryzom/server/tools/cfg_creator/templates/backup_slave_service_default.cfg @@ -0,0 +1,27 @@ +// link the common configuration file +RootConfigFilename = "common.cfg"; + +DisplayedVariables += { "", "SlowestService", "SlowestTock", "", "WaitingForServices", "", "@Pause|pause" }; + +NegFiltersDebug = { "DELTA_", "DEFAULT_CB", "LNETL", }; +NegFiltersInfo = { "HNETL5" }; + +Paths += { }; + +StartCommands = +{ +}; + +DontUseNS = 1; + +SId = 4; + +ListeningPort = 49990; + +// Listening port for the Web server to connect in +WebPort = 49898; + +BSReadState = 0; +MasterBSHost = "192.168.1.134:49990"; +BSFileSubst = "/home/nevrax/save_shard"; +BSFilePrefix = "/home/nevrax/save_shard_slave"; diff --git a/ryzom/server/tools/cfg_creator/templates/big_brother_service.cfg b/ryzom/server/tools/cfg_creator/templates/big_brother_service.cfg new file mode 100644 index 000000000..04283dbf2 --- /dev/null +++ b/ryzom/server/tools/cfg_creator/templates/big_brother_service.cfg @@ -0,0 +1,3 @@ +// link the common configuration file +RootConfigFilename = "common.cfg"; + diff --git a/ryzom/server/tools/cfg_creator/templates/common.cfg b/ryzom/server/tools/cfg_creator/templates/common.cfg new file mode 100644 index 000000000..ac88aa3c7 --- /dev/null +++ b/ryzom/server/tools/cfg_creator/templates/common.cfg @@ -0,0 +1,106 @@ +// ---- config local variables + +// Used by ConfigFile in EGS and WS +ShardId = #SHARDID#; + +// Used by CVariable in WS +PlayerLimit = 5000; + +Paths += { + "../common/", +}; + +// Used to connect to AES (this file) and to set up AES service (admin_executor_service.cfg) +AESPort="46702"; +AESHost="localhost"; + +// ---- service NeL variables (used by ConfigFile class) + +WindowStyle = "WIN"; + +// don't connect to the old NeLNS AES +DontUseAES = 1; + +// Configure module gateway for layer 5 module comm +StartCommands += +{ + // Create a gateway module + "moduleManager.createModule StandardGateway gw", + // add a layer 5 transport + "gw.transportAdd L5Transport l5", + // open the transport + "gw.transportCmd l5(open)", + + /// Create default connection with admin executor service + // Create a gateway module + "moduleManager.createModule StandardGateway gw_aes", + // create the admin executor service module + "moduleManager.createModule AdminExecutorServiceClient aes_client", + "aes_client.plug gw_aes", + + // create a layer 3 client to connect to aes gateway + "gw_aes.transportAdd L3Client aes_l3c", + "gw_aes.transportCmd aes_l3c(connect addr="+AESHost+":"+AESPort+")", +}; + +NSHost = "localhost"; + +// A list of vars to graph for any service +GraphVars += +{ + "ProcessUsedMemory", "60000", // every minute +}; + +IgnoredFiles = { "continent.cfg", "__read_me.txt", "bandit.html", "flora_primr.primitive" }; + +// Set a mainland SessionId. +// Live: Must be 0 for ring shards, non-zero (usually ShardId) for mainland shards +// Dev: Can be non-zero to initially connect a client to a ring shard +NoWSShardId = ShardId; + +// ---- service NeL variables (used by CVariable class) + +// Disable generation / display of nldebug messages +DisableNLDebug = 1; + +// Disable nel net verbose logging +VerboseNETTC = 0; +VerboseLNETL0 = 0; +VerboseLNETL1 = 0; +VerboseLNETL2 = 0; +VerboseLNETL3 = 0; +VerboseLNETL4 = 0; +VerboseLNETL5 = 0; +VerboseLNETL6 = 0; + +// If the update loop is too slow, a thread will produce an assertion. +// By default, the value is set to 10 minutes. +// Set to 0 for no assertion. +UpdateAssertionThreadTimeout = 6000000; + +// how to sleep between 2 network updates +// 0 = pipe +// 1 = usleep +// 2 = nanosleep +// 3 = sched_yield +// 4 = nothing +UseYieldMethod = 0; + +DefaultMaxExpectedBlockSize = 200000000; // 200 M ! +DefaultMaxSentBlockSize = 200000000; // 200 M ! + +// Will SaveFilesDirectory will be converted to a full path? +ConvertSaveFilesDirectoryToFullPath = 0; + +// Where to save specific shard data (ie: player backup), relatively to SaveShardRoot +SaveFilesDirectory = ""; + +// where to save generic shard data (ie: packed_sheet) +WriteFilesDirectory = "../data/leveldesign"; + +MongoPassword = "feFrvs3rfdcef4"; + + +// ---- service custom variables (used by ConfigFile class) + +// ---- service custom variables (used by CVariable class) diff --git a/ryzom/server/tools/cfg_creator/templates/dynamic_scenario_service.cfg b/ryzom/server/tools/cfg_creator/templates/dynamic_scenario_service.cfg new file mode 100644 index 000000000..87c858448 --- /dev/null +++ b/ryzom/server/tools/cfg_creator/templates/dynamic_scenario_service.cfg @@ -0,0 +1,302 @@ +// Auto generated config file +// Use with commandline: dynamic_scenario_service -C. -L. --nobreak --writepid +AESAliasName= "dss"; + +ASWebPort="46700"; +ASPort="46701"; +AESPort="46702"; +SUPort = 50505; +SUGlobalPort = 50503; +L3BSPort = "49950"; +L3SlaveBSPort = "49951"; +L3MasterLGSPort = 49992; +LGSBSPort = 49994; +L3LGSBSPort = 49995; +SUHost = "localhost"; +MFSHost = "localhost"; +BSHost = "localhost:49990"; +SlaveBSHost = ""; +MasterLGSHost = "localhost"; +SlaveLGSHost = "localhost"; +LGSBSHost = "localhost"; +DBHost = "localhost"; +#define DONT_USE_LGS_SLAVE +// Configure module gateway for layer 5 module comm +StartCommands += +{ +// Create a gateway module +"moduleManager.createModule StandardGateway gw", +// add a layer 5 transport +"gw.transportAdd L5Transport l5", +// open the transport +"gw.transportCmd l5(open)", + +/// Create default connection with admin executor service +// Create a gateway module +"moduleManager.createModule StandardGateway gw_aes", +// create the admin executor service module +"moduleManager.createModule AdminExecutorServiceClient aes_client", +"aes_client.plug gw_aes", + +// create a layer 3 client to connect to aes gateway +"gw_aes.transportAdd L3Client aes_l3c", +"gw_aes.transportCmd aes_l3c(connect addr=localhost:"+AESPort+")", +}; + +/// A list of vars to graph for any service +GraphVars = +{ +"ProcessUsedMemory", "60000", // every minute +}; + + +/* Force default value for PDLib directory (e.g. SaveFilesDirectory...) +* PLEASE NOTICE THAT THIS LINE MUST BE LEFT TO "" +* Only log analyser must have the $shard parameter to find all shards root directory +*/ +PDRootDirectory = ""; + +// Log PD updates to log file (1 enabled, 0 disabled), see PDLogSaveDirectory to choose where to log +PDEnableLog = 1; + +// Log PD StringManager updates to log file (1 enabled, 0 disabled), see PDLogSaveDirectory to choose where to log +PDEnableStringLog = 0; + +// Number of seconds between 2 logs to file +PDLogUpdate = 10; + +// MySGL wrapper strict mode - controls use of asserts if SQL requests fail +MSWStrictMode=0; + +// This is the mapping for logical continent to physical one +ContinentNameTranslator = +{ +"matis_newbie", "matis", +"zorai_newbie", "zorai", +"terre", "terre_oubliee", +"sources", "sources_interdites" +}; + +NegFiltersDebug = { "ZZZZZZZZZZZ" }; +NegFiltersInfo = { "ZZZZZZZZZZZ" }; +NegFiltersWarning = { "ZZZZZZZZZZZ", "Missing log context for log" }; +//NegFiltersDebug = { "NET", "ADMIN", "MIRROR", "NC", "PATH" }; +//NegFiltersInfo = { "NET", "ADMIN", "MIRROR", "NC", "CF", "TimerManagerUpdate" }; +// NegFiltersWarning = { "CT_LRC", "AnimalSpawned" }; + +// Block the system in the tick service that provokes stalls when overloaded +WaitForBSThreshold=0; + +// Only produce log*.log files and not *.log +DontLog=1; + +IgnoredFiles = { "continent.cfg", "__read_me.txt", "bandit.html", "flora_primr.primitive" }; + +// If the update loop is too slow, a thread will produce an assertion. +// By default, the value is set to 10 minutes. +// Set to 0 for no assertion. +UpdateAssertionThreadTimeout = 6000000; + +DefaultMaxExpectedBlockSize = 200000000; // 200 M ! +DefaultMaxSentBlockSize = 200000000; // 200 M ! + +// MS Packet size limit in bytes, PER DATASET (warning: depending on the weights, limits per property may be very small) +MaxOutBandwidth = 100000000; + +// how to sleep between 2 network updates +// 0 = pipe +// 1 = usleep +// 2 = nanosleep +// 3 = sched_yield +// 4 = nothing +UseYieldMethod = 0; + +// The privileges needed to access any ring session +PrivilegeForSessionAccess = ":DEV:SGM:GM:SG:"; + +// The max number of ring points (aka ring access) for each ecosystem +MaxRingPoints = "A1:D7:F7:J8:L6:R13"; + +// Level limit for newb scenarios +FreeTrialSkillLimit=125; + +// Level limit for newb scenarios +DefaultInterShardExchangeLevelCap=0; + +// Configureation for DSS +MaxNpcs = 300; +MaxStaticObjects = 200; + +// the following variable must be defined but should be empty - it's presence is used to change the behaviour +// of the packed sheet reader +GeorgePaths = { "" }; + +// Dissable nel net verbose logging +VerboseNETTC = 0; +VerboseLNETL0 = 0; +VerboseLNETL1 = 0; +VerboseLNETL2 = 0; +VerboseLNETL3 = 0; +VerboseLNETL4 = 0; +VerboseLNETL5 = 0; +VerboseLNETL6 = 0; + +// Dissable ryzom verbose logging +VerboseMIRROR = 0; +VerboseRingRPLog = 0; +VerboseCDBGroup = 0; + +// What to do with characters coming from another mainland shard? +// 0: teleport to the stored session id +// 1: let the character play anyway, but leave the stored session id unchanged +// 2: assign the stored session id with FixedSessionId and let play +AllowCharsFromAllSessions = 0; + +// Use Shard Unifier or not +DontUseSU = 0; + +// the domain's set of useful addresses +LSHost = SUHost; +RSMHost = SUHost; + +// MFS config +WebSrvUsersDirectory = ""; +WebRootDirectory = "/home/nevrax/live/save_shard/www"; +HoFHDTDirectory = "/local/www/hof/hdt"; + +// BS Specifics -------------------------------------------------------------------------- +// BS - set to 1 if a BS is not part of a naming service group (then BS not disclosed +// to other services by the Layer 5, i.e. the services sending requests to BS have +// to know its/their address(es) by another mean) +BSDontUseNS = 1; +// BS - set the host of the naming service where the BS register +BSNSHost = "localhost"; +UseBS = 1; +XMLSave = 0; + +// Where to save specific shard data (ie: player backup), relatively to SaveShardRoot +SaveFilesDirectory = ""; + +// where to save generic shard data (ie: packed_sheet) +WriteFilesDirectory = "../data"; + +// Will SaveFilesDirectory will be converted to a full path? +ConvertSaveFilesDirectoryToFullPath = 0; + +// BS - Root directory where data are backuped to +IncrementalBackupDirectory = "../backup"; + +// IOS - Directory to store ios.string_cache file +StringManagerCacheDirectory = "../cache"; + +// IOS - Directory to log chat into +LogChatDirectory = "../logs"; + +// MFS - Directories +WebRootDirectory = "../cache/www"; + +// Root directory where data from shards are stored into +SaveShardRoot = "../save/"; + +// SU Specifics -------------------------------------------------------------------------- +// SU - set to 1 if SU didn't use a naming service +SUDontUseNS = 1; +// SU - host for the NS used by SU +SUNSHost = "localhost"; +// SU - listen address of the SU service (for L5 connections) +SUAddress = SUHost+":"+SUPort; +// SU - nel and ring database names +DBNelName = "nel"; +DBRingName = "ring_open"; +// Nel DB user +DBNelUser = "open"; +// Ring DB user +DBRingUser = "open"; +// SU - password to access to the nel database with DBNelUseruser (default is no password) +DBNelPass = ""; +// SU - password to access to the ring database with DBRingUser (default is no password) +DBRingPass = ""; + +// WS Specifics -------------------------------------------------------------------------- +// WS - use or not the legacy WelcomeService from nel ns (only for backward compatibility during transition to ring) +DontUseLSService = 1; + +// Global config -------------------------------------------------------------------------- +// set to 0 if you want to use the admin system +DontUseAES = 1; + +// Dissable generation / display of nldebug messages +DissableNLDebug = 1; +DisableNLDebug = 1; +ShardId = #SHARDID#; +BasePort = 51400; +SaveFilesDirectory="open_ring01/"; +NSHost = "localhost"; +// Player limits (AIS, EGS, WS, FS) +NbPlayersLimit = 5000; +NbGuildLimit = 15000; +PlayerLimit = NbPlayersLimit; +ClientLimit = 1000; + +// Set this shard as a ring (1) or mainland (0) shard (main behavior switch) +IsRingShard = 1; + +// Set a mainland SessionId. +// Live: Must be 0 for ring shards, non-zero (usually ShardId) for mainland shards +// Dev: Can be non-zero to initially connect a client to a ring shard +NoWSShardId = ShardId; +FixedSessionId = 0; + +// Mirror limits +DatasetSizefe_temp = 700000; +DatasetSizefame = 26000; + +// FS Specifics -------------------------------------------------------------------------- +// Client bandwidth ratio, set to 1 for standard operation, more than one allocate more bandwidth +BandwidthRatio = 2; + +// EGS Specifics -------------------------------------------------------------------------- +// Entity Limits (EGS) +NbObjectsLimit = 2000; +NbNpcSpawnedByEGSLimit = 5000; +NbForageSourcesLimit = 10000; +NbToxicCloudsLimit = 5000; + +// AIS Specifics -------------------------------------------------------------------------- +// Entity Limits (AIS) +NbPetLimit = NbPlayersLimit*4; +NbFaunaLimit = 50000; +NbNpcLimit = 50000; +NbFxLimit = 500; + +FSListenHost = "localhost"; +#include "dynamic_scenario_service_default.cfg" +WriteFilesDirectory="../live/service_dynamic_scenario_service/"; +DontLog = 1; +WebSrvHost = "http://localhost:50000/"; +Mainlands = { + "#SHARDID#", "#UC_SHARDNAME#", "(#UC_SHARDNAME# Developer Community)", "en" +}; +HomeMainlandNames = +{ + "#SHARDID#", "#UC_SHARDNAME#", "#SHARDNAME#", +}; +RRDVarPath = "../save/rrd_graphs"; +NegFiltersInfo+= {"FESTATS", "FETIME", "FERECV", "FESEND: sent SYNC message to client 1", "EIT: Register EId"}; +NegFiltersWarning+= {"PIPO_SESSION1", "casino_session_matis01", "invalid damage type 10", "_log_Item_Delete", +"_log_Item_Money", "_log_Item_Create", "_log_Item_Move", "botChatMissionAdvance> invalid index 0", +"_MaxRange(0) < _MinRange(1)", "Can't find craft plan sheet 'unknown.unknown'"}; +DontUseAES=1; +RingRPEnabled=0; +DomainName = "#DOMAINNAME#"; +EnableStlAllocatorChecker = 0; +// start commands for setting up the exchange level caps of different ryzom shards +StartCommands += { "setShardExchangeLimit #SHARDID# 250" }; +StartCommands += { "displayShardExchangeLimits" }; +StartCommands += { "EnableStlAllocatorChecker 0" }; + +Paths += { + ".", + "../common/data_common", + "../common/data_leveldesign", +}; diff --git a/ryzom/server/tools/cfg_creator/templates/dynamic_scenario_service_default.cfg b/ryzom/server/tools/cfg_creator/templates/dynamic_scenario_service_default.cfg new file mode 100644 index 000000000..11eb80ce8 --- /dev/null +++ b/ryzom/server/tools/cfg_creator/templates/dynamic_scenario_service_default.cfg @@ -0,0 +1,9 @@ + +DelayBeforeStartAct = 1; +MaxNpcs = 300; +MaxStaticObjects = 200; + +StartCommands += +{ + "unifiedNetwork.addService ShardUnifier ( address="+SUAddress+" sendId external autoRetry )", +}; diff --git a/ryzom/server/tools/cfg_creator/templates/egs_deposit_map_dictionary.cfg b/ryzom/server/tools/cfg_creator/templates/egs_deposit_map_dictionary.cfg new file mode 100644 index 000000000..6fefcd9ac --- /dev/null +++ b/ryzom/server/tools/cfg_creator/templates/egs_deposit_map_dictionary.cfg @@ -0,0 +1,4 @@ +WordsPath = "../tools/translation/work/"; +LanguageCode = "en"; +Filter = "item"; +Utf8 = 0; \ No newline at end of file diff --git a/ryzom/server/tools/cfg_creator/templates/entities_game_service.cfg b/ryzom/server/tools/cfg_creator/templates/entities_game_service.cfg new file mode 100644 index 000000000..0db0cca11 --- /dev/null +++ b/ryzom/server/tools/cfg_creator/templates/entities_game_service.cfg @@ -0,0 +1,236 @@ +// Use with commandline: entities_game_service -C. -L. --nobreak --writepid + +// ---- config local variables + +#define DONT_USE_LGS_SLAVE + +AESPort="46702"; +SUPort = 50505; +SUGlobalPort = 50503; +L3MasterLGSPort = 41292; +L3SlaveLGSPort = 49993; +SUHost = "localhost"; +MasterLGSHost = "localhost"; +SlaveLGSHost = "localhost"; +// SU - listen address of the SU service (for L5 connections) +SUAddress = SUHost+":"+SUPort; + +#include "entities_game_service_default.cfg" + +// ---- service NeL variables (used by ConfigFile class) + +AESAliasName= "egs"; + +StartCommands += { +"moduleManager.createModule AnimSessionManager asm", +"asm.plug gw", +}; + +// start commands for setting up the exchange level caps of different ryzom shards +StartCommands += { "setShardExchangeLimit #SHARDID# 250" }; + +StartCommands += { "displayShardExchangeLimits" }; +StartCommands += { "EnableStlAllocatorChecker 0" }; + +GraphVars += { "CharacterLoadPerTick", "0" }; +GraphVars += { "CharacterLoadPerTick", "60000" }; +GraphVars += { "CharacterSavePerTick", "0" }; +GraphVars += { "CharacterSavePerTick", "60000" }; +GraphVars += { "TickSpeedLoop", "0" }; +GraphVars += { "TickSpeedLoop", "60000" }; +GraphVars += { "L5CallbackCount", "0" }; +GraphVars += { "L5CallbackCount", "60000" }; +GraphVars += { "L5CallbackTime", "0" }; +GraphVars += { "L5CallbackTime", "60000" }; +GraphVars += { "MirrorCallbackCount", "0" }; +GraphVars += { "MirrorCallbackCount", "60000" }; +GraphVars += { "MirrorCallbackTime", "0" }; +GraphVars += { "MirrorCallbackTime", "60000" }; + +NSHost = "localhost"; + +Paths += { + "../data", + "../common/data_leveldesign", +}; +PathsNoRecurse= {"."}; + +// ---- service NeL variables (used by CVariable class) + +// ---- service custom variables (used by ConfigFile class) + +WebSrvHost = "#WEBHOST#"; + +NbPlayersLimit = PlayerLimit; +NbGuildLimit = 15000; + +// Entity Limits (EGS) +NbObjectsLimit = 2000; +NbNpcSpawnedByEGSLimit = 5000; +NbForageSourcesLimit = 10000; +NbToxicCloudsLimit = 5000; + +#include "used_continents.cfg" + +// define the primitives configuration used. +UsedPrimitives = +{ +"newbieland_all", +// "newbieland", +"matis_newbie_all", +// "matis_newbieland", + +"matis_all", +// "matis_majesticgarden", +// "matis_fleetinggarden", +// "matis_groveofconfusion", +// "matis_hereticshovel", +// "matis_hiddensource", +// "matis_knollofdissent", +// "matis_upperbog", + +"matis_island_all", + +"zorai_newbie_all", +// "zorai_newbieland", + +"zorai_all", +// "zorai_citiesofintuition", +// "zorai_maidengrove", +// "zorai_groveofumbra", +// "zorai_havenofpurity", +// "zorai_knotofdementia", +// "zorai_thevoid", + +"zorai_island_all", + +"fyros_newbie_all", +// "fyros_newbieland", + +"fyros_all", +// "fyros_imperialdune", +// "fyros_oflovaksoasis", +// "fyros_frahartowers", +// "fyros_dunesofexil", +// "fyros_outlawcanyon", +// "fyros_sawdustmines", +// "fyros_thesavagedunes", +// "fyros_thescorchedcorridor", + +"fyros_island_all", + +"tryker_newbie_all", +// "tryker_newbieland", + +"tryker_all", +// "tryker_bountybeaches", +// "tryker_enchantedisle", +// "tryker_lagoonsofloria", +// "tryker_libertylake", +// "tryker_thefount", +// "tryker_windsofmuse", + +"tryker_island_all", + + +"terre_all", +// "terre_forbidden_depths", +// "terre_the_land_of_continuty", +// "terre_the_sunken_city", +"sources_all", +// "sources_the_under_spring", +"route_gouffre_all", +// "route_gouffre_gate_of_obscurity", +// "route_gouffre_the_elusive_forest", +// "route_gouffre_the_trench_of_trials", +// "route_gouffre_the_windy_gate", +"nexus_all", +// "nexus_nexus", +"bagne_all", +// "bagne_the_abyss_of_ichor", + +"kitiniere_all", +// "kitiniere", +//ace kitiniere+tcm "corrupted_moor_all", +"r2_desert_all", +"r2_lakes_all", +"r2_forest_all", +"r2_jungle_all", +"r2_roots_all", +}; + +// the following variable must be defined but should be empty - it's presence is used to change the behaviour +// of the packed sheet reader +GeorgePaths = { "" }; + +HomeMainlandNames = +{ + "#SHARDID#", "#UC_SHARDNAME#", "#SHARDNAME#", +}; + +// Mirror limits +DatasetSizefe_temp = 700000; +DatasetSizefame = 26000; + +// ---- service custom variables (used by CVariable class) + +RingRPEnabled=0; +RingRPXPRequiredPerAction=700; +RingRPXPRequiredPerTimeSlice=700; + +MaxXPGainPerPlayer = 30.0; +DeathXPFactor = 0.1; + +MFSHost = "localhost"; + +// Use Shard Unifier or not +DontUseSU = 0; + +// Set this shard as a ring (1) or mainland (0) shard (main behavior switch) +IsRingShard = 0; + +// Set a mainland SessionId. +// Live: Must be 0 for ring shards, non-zero (usually ShardId) for mainland shards +// Dev: Can be non-zero to initially connect a client to a ring shard +FixedSessionId = ShardId; + +// Level limit for newb scenarios +DefaultInterShardExchangeLevelCap=0; + +// Disable ryzom verbose logging +VerboseMIRROR = 0; +VerboseRingRPLog = 0; +VerboseCDBGroup = 0; + +MissionLogFile = "../logs/egs_missions.log"; +AdminLogFile = "../logs/admin_commands.log"; + +// What to do with characters coming from another mainland shard? +// 0: teleport to the stored session id +// 1: let the character play anyway, but leave the stored session id unchanged +// 2: assign the stored session id with FixedSessionId and let play +AllowCharsFromAllSessions = 0; + +/* Force default value for PDLib directory (e.g. SaveFilesDirectory...) + * PLEASE NOTICE THAT THIS LINE MUST BE LEFT TO "" + * Only log analyser must have the $shard parameter to find all shards root directory + */ +PDRootDirectory = ""; + +// Log PD updates to log file (1 enabled, 0 disabled), see PDLogSaveDirectory to choose where to log +PDEnableLog = 1; + +// Log PD StringManager updates to log file (1 enabled, 0 disabled), see PDLogSaveDirectory to choose where to log +PDEnableStringLog = 0; + +// Number of seconds between 2 logs to file +PDLogUpdate = 10; + +#include "backup_service_interface.cfg" + +XMLSave = 0; + +ArkSalt="#ARKSALT#"; + +//AdminCommandAuditHost = "app.ryzom.com"; +//AdminCommandAuditPage = "/audit_gm.php"; diff --git a/ryzom/server/tools/cfg_creator/templates/entities_game_service_default.cfg b/ryzom/server/tools/cfg_creator/templates/entities_game_service_default.cfg new file mode 100644 index 000000000..01235a4cd --- /dev/null +++ b/ryzom/server/tools/cfg_creator/templates/entities_game_service_default.cfg @@ -0,0 +1,1724 @@ +#include "common.cfg" + +StartCommands += +{ + // L5 connect to the shard unifier + "unifiedNetwork.addService ShardUnifier ( address="+SUAddress+" sendId external autoRetry )", + + // Create a gateway for global interconnection + // modules from different shard are visible to each other if they connect to + // this gateway. SU Local module have no interest to be plugged here. + "moduleManager.createModule StandardGateway glob_gw", + // add a layer 3 server transport + "glob_gw.transportAdd L3Client l3c", + // open the transport + "glob_gw.transportCmd l3c(connect addr="+SUHost+":"+SUGlobalPort+")", + + + // Create a gateway for logger service connection + "moduleManager.createModule StandardGateway lgs_gw", + + // add a layer 3 server transport for master logger service + "lgs_gw.transportAdd L3Client masterL3c", + // open the transport + "lgs_gw.transportCmd masterL3c(connect addr="+MasterLGSHost+":"+L3MasterLGSPort+")", +}; + +#ifndef DONT_USE_LGS_SLAVE + +StartCommands += +{ + // add a layer 3 server transport for slave logger service + "lgs_gw.transportAdd L3Client slaveL3c", + // open the transport + "lgs_gw.transportCmd slaveL3c(connect addr="+SlaveLGSHost+":"+L3SlaveLGSPort+")", +}; + +#endif + +StartCommands += +{ + // Create a shard unifier client module + "moduleManager.createModule ShardUnifierClient suc", + // Create a client commands forwader module + "moduleManager.createModule ClientCommandForwader ccf", + + // Create a characer control module + "moduleManager.createModule CharacterControl cc", + + // Create a guild unifier module + "moduleManager.createModule GuildUnifier gu", + + //Create a shard unifier name mapper + "moduleManager.createModule CharNameMapperClient cnmc", + + // Create the logger service client module + "moduleManager.createModule LoggerServiceClient lsc", + + "suc.plug gw", + "ccf.plug gw", + "cc.plug gw", + "gu.plug glob_gw", + "cnmc.plug gw", + "lsc.plug lgs_gw", +}; + +/// A list of vars to graph for EGS +GraphVars += +{ + "TotalNbItemForSale", "60000", // every minutes + "NbPlayers", "60000", // every minutes +}; + +//min fraction of the total damage done on a creature that a group/player must do to be attributed a kill +KillAttribMinFactor = 0.3; + +//max bulk the player can transport * 1000 (*1000 to avoid float operations) +MaxPlayerBulk = 300000; + +//max weight in grammes a player can have on him if his strength is 0 +BaseMaxCarriedWeight = 300000; + +// base bulk of player room +BasePlayerRoomBulk = 2000000; + +// if true, every player that was saved with an invalid position will be corrected the next time he logs in. +CorrectInvalidPlayerPositions = 1; + +// Create Character Start skills value +//CreateCharacterStartSkillsValue = "SCMM1BS:220:SMLOEFA:235:SFM1BMM:215:SKILL_POINTS:200:MONEY:1000"; +//CreateCharacterStartSkillsValue = "SM:20:SMA:50:SMAP:51:SMAE:51:SMT:50:SMTC:51:SMTM:51:SMTO:51:SKILL_POINTS:2550:MONEY:50000"; + + +// Enable caching of ligo primitive in binary files +CachePrims = 1; +// Log to see which primitives where loaded from cache +CachePrimsLog = 0; + +//************************************************************************************************************* +// variable for stop area effect of a gameplay system +//************************************************************************************************************* +FightAreaEffectOn = 1; +MagicAreaEffectOn = 1; +HarvestAreaEffectOn = 1; + +//************************************************************************************************************* +// save period time (ticks). +//************************************************************************************************************* +GuildSavePeriod = 100; +GuildChargeSavePeriod = 99; +GuildMaxMemberCount = 255; + +TickFrequencyPCSave = 4800; +// minimum period between 2 consecutive saves of the same character +MinPlayerSavePeriod = 600; + +StoreSavePeriod = 10; + +//************************************************************************************************************* +// Max duration of death panalty (when you death several times and only style one point in your characteristics due to death penalty +//************************************************************************************************************* +DeathPenaltyMaxDuration = 18000; // 10 ticks per second * 60 for minutes * 30 for 30 minutes // No more used. +DeathXPFactor = 0.1; +DeathXPResorptionTime = 20; + +//************************************************************************************************************* +// Duration of comma +//************************************************************************************************************* +CommaDelayBeforeDeath = 3000; // 10 ticks per second * 60 for minutes * 5 for 5 minutes + +//************************************************************************************************************* +// Duration of dead mektoub stay spawned +//************************************************************************************************************* +SpawnedDeadMektoubDelay = 2592000; // 10 ticks per second * 60 for minutes * 60 for hours * 24 for days * 3 for 3 days + +//************************************************************************************************************* +// Progression +//************************************************************************************************************* +SkillProgressionFactor = 1.0; + +SkillFightValueLimiter = 250; +SkillMagicValueLimiter = 250; +SkillCraftValueLimiter = 250; +SkillHarvestValueLimiter = 250; + +NBMeanCraftRawMaterials = 1; //Mean of raw material used for craft an item, it's used for scale xp win when crafting an item with effective raw material used + +// when in a team value of each member above one for XP division among team members +XPTeamMemberDivisorValue = 0.5; +// distance max for an action to be taken into account when in a team +MaxDistanceForXpGain = 110; + +// Max XP gain by any one player on any creature (each team member can gain up to this value) +MaxXPGainPerPlayer = 30.0; + + +//************************************************************************************************************* +// Characteristics parameters +//************************************************************************************************************* +//characteristic brick progression step +CharacteristicBrickStep = 5; +// Maximum value for characteristics (260 because characters begin with 10) +MaxCharacteristicValue = 260; + + +//************************************************************************************************************* +// Magic parameters +//************************************************************************************************************* +DefaultCastingTime = 1.0; +RechargeMoneyFactor = 1.0; +CristalMoneyFactor = 1.0; + +// int in ticks for following values +NoLinkSurvivalAddTime = 50; +NoLinkTimeFear = 10; +NoLinkTimeSleep = 30; +NoLinkTimeStun = 15; +NoLinkTimeRoot = 30; +NoLinkTimeSnare = 30; +NoLinkTimeSlow = 30; +NoLinkTimeBlind = 20; +NoLinkTimeMadness = 35; +NoLinkTimeDot = 20; +PostCastLatency = 10; // in ticks + +TickFrequencyCompassUpdate = 32; + +// update period of link spell in ticks +UpdatePeriodFear = 40; +UpdatePeriodSleep = 40; +UpdatePeriodStun = 40; +UpdatePeriodRoot = 40; +UpdatePeriodSnare = 40; +UpdatePeriodSlow = 40; +UpdatePeriodBlind = 40; +UpdatePeriodMadness = 40; +UpdatePeriodDot = 40; +DefaultUpdatePeriod = 40; + +// bonus on resist for each received spell +ResistIncreaseFear = 6; +ResistIncreaseSleep = 4; +ResistIncreaseStun = 8; +ResistIncreaseRoot = 4; +ResistIncreaseSnare = 3; +ResistIncreaseSlow = 4; +ResistIncreaseBlind = 7; +ResistIncreaseMadness = 5; + +ResistIncreaseAcid = 0; +ResistIncreaseCold = 0; +ResistIncreaseElectricity= 0; +ResistIncreaseFire = 0; +ResistIncreasePoison = 0; +ResistIncreaseRot = 0; +ResistIncreaseShockwave = 0; + +//************************************************************************************************************* +// Craft parameters +//************************************************************************************************************* +//////////////// +// DURABILITY // some kind of HP +// melee weapons +DaggerDurability = 100.0; +SwordDurability = 100.0; +MaceDurability = 100.0; +AxeDurability = 100.0; +SpearDurability = 100.0; +StaffDurability = 100.0; +MagicianStaffDurability = 100.0; +TwoHandSwordDurability = 100.0; +TwoHandAxeDurability = 100.0; +PikeDurability = 100.0; +TwoHandMaceDurability = 100.0; +// range weapon +AutolauchDurability = 100.0; +BowrifleDurability = 100.0; +LauncherDurability = 100.0; +PistolDurability = 100.0; +BowpistolDurability = 100.0; +RifleDurability = 100.0; +HarpoonDurability = 100.0; +// ammo +AutolaunchAmmoDurability = 100.0; +BowrifleAmmoDurability = 100.0; +GrenadeAmmoDurability = 100.0; +LauncherAmmoDurability = 100.0; +PistolAmmoDurability = 100.0; +BowpistolAmmoDurability = 100.0; +RifleAmmoDurability = 100.0; +HarpoonAmmoDurability = 100.0; +// armor and shield +ShieldDurability = 100.0; +BucklerDurability = 150.0; +LightBootsDurability = 100.0; +LightGlovesDurability = 100.0; +LightPantsDurability = 100.0; +LightSleevesDurability = 100.0; +LightVestDurability = 100.0; +MediumBootsDurability = 150.0; +MediumGlovesDurability = 150.0; +MediumPantsDurability = 150.0; +MediumSleevesDurability = 150.0; +MediumVestDurability = 150.0; +HeavyBootsDurability = 200.0; +HeavyGlovesDurability = 200.0; +HeavyPantsDurability = 200.0; +HeavySleevesDurability = 200.0; +HeavyVestDurability = 200.0; +HeavyHelmetDurability = 200.0; +// jewel +AnkletDurability = 100.0; +BraceletDurability = 100.0; +DiademDurability = 100.0; +EaringDurability = 100.0; +PendantDurability = 100.0; +RingDurability = 100.0; +// tool +ForageToolDurability = 100.0; +AmmoCraftingToolDurability = 100.0; +ArmorCraftingToolDurability = 100.0; +JewelryCraftingToolDurability = 100.0; +RangeWeaponCraftingToolDurability = 100.0; +MeleeWeaponCraftingToolDurability = 100.0; +ToolCraftingToolDurability = 100.0; + +//////////// +// WEIGHT // (Max is *2) +// melee weapons +DaggerWeight = 3.5; // Dg Type (Pierce) +SwordWeight = 4.0; // 1H Type +MaceWeight = 4.0; // 1H Type +AxeWeight = 4.0; // 1H Type +SpearWeight = 4.0; // 1H Type (pierce) +StaffWeight = 1.0; // 1H Type +MagicianStaffWeight = 2.0; // 2H type +TwoHandSwordWeight = 6.0; // 2H Type +TwoHandAxeWeight = 6.0; // 2H Type +PikeWeight = 6.0; // 2H Type (pierce) +TwoHandMaceWeight = 6.0; // 2H Type +// range weapon +PistolWeight = 1.5; +BowpistolWeight = 1.5; +RifleWeight = 2.0; +BowrifleWeight = 2.0; +AutolauchWeight = 8.0; +LauncherWeight = 8.0; +HarpoonWeight = 2.0; +// ammo +PistolAmmoWeight = 0.2; +BowpistolAmmoWeight = 0.2; +RifleAmmoWeight = 0.2; +BowrifleAmmoWeight = 0.2; +AutolaunchAmmoWeight = 4.8; +LauncherAmmoWeight = 10.0; +HarpoonAmmoWeight = 0.2; +GrenadeAmmoWeight = 1.0; +// armor and shield +ShieldWeight = 3.0; +BucklerWeight = 1.5; +// Light +LightBootsWeight = 1.0; +LightGlovesWeight = 1.0; +LightPantsWeight = 2.5; +LightSleevesWeight = 1.0; +LightVestWeight = 2.5; +// Medium +MediumBootsWeight = 2.0; +MediumGlovesWeight = 2.0; +MediumPantsWeight = 5.0; +MediumSleevesWeight = 2.0; +MediumVestWeight = 5.0; +// Heavy +HeavyBootsWeight = 4.0; +HeavyGlovesWeight = 4.0; +HeavyPantsWeight = 10.0; +HeavySleevesWeight = 4.0; +HeavyVestWeight = 10.0; +HeavyHelmetWeight = 4.0; +// jewel +AnkletWeight = 0.1; +BraceletWeight = 0.1; +DiademWeight = 0.1; +EaringWeight = 0.1; +PendantWeight = 0.1; +RingWeight = 0.1; +////////////// +// SAP LOAD // +// MIN +// melee weapons +DaggerSapLoad = 0.0; +SwordSapLoad = 0.0; +MaceSapLoad = 0.0; +AxeSapLoad = 0.0; +SpearSapLoad = 0.0; +StaffSapLoad = 0.0; +MagicianStaffSapLoad = 0.0; +TwoHandSwordSapLoad = 0.0; +TwoHandAxeSapLoad = 0.0; +PikeSapLoad = 0.0; +TwoHandMaceSapLoad = 0.0; +// range weapon +AutolauchSapLoad = 0.0; +BowrifleSapLoad = 0.0; +LauncherSapLoad = 0.0; +PistolSapLoad = 0.0; +BowpistolSapLoad = 0.0; +RifleSapLoad = 0.0; +HarpoonSapLoad = 0.0; +// ammo +AutolaunchAmmoSapLoad = 0.0; +BowrifleAmmoSapLoad = 0.0; +GrenadeAmmoSapLoad = 0.0; +LauncherAmmoSapLoad = 0.0; +PistolAmmoSapLoad = 0.0; +BowpistolAmmoSapLoad = 0.0; +RifleAmmoSapLoad = 0.0; +HarpoonAmmoSapLoad = 0.0; +// armor and shield +ShieldSapLoad = 0.0; +BucklerSapLoad = 0.0; +LightBootsSapLoad = 0.0; +LightGlovesSapLoad = 0.0; +LightPantsSapLoad = 0.0; +LightSleevesSapLoad = 0.0; +LightVestSapLoad = 0.0; +MediumBootsSapLoad = 0.0; +MediumGlovesSapLoad = 0.0; +MediumPantsSapLoad = 0.0; +MediumSleevesSapLoad = 0.0; +MediumVestSapLoad = 0.0; +HeavyBootsSapLoad = 0.0; +HeavyGlovesSapLoad = 0.0; +HeavyPantsSapLoad = 0.0; +HeavySleevesSapLoad = 0.0; +HeavyVestSapLoad = 0.0; +HeavyHelmetSapLoad = 0.0; +// jewel +AnkletSapLoad = 0.0; +BraceletSapLoad = 0.0; +DiademSapLoad = 0.0; +EaringSapLoad = 0.0; +PendantSapLoad = 0.0; +RingSapLoad = 0.0; +// MAX +// melee weapons +DaggerSapLoadMax = 2500.0; +SwordSapLoadMax = 2500.0; +MaceSapLoadMax = 2500.0; +AxeSapLoadMax = 2500.0; +SpearSapLoadMax = 2500.0; +StaffSapLoadMax = 7000.0; +MagicianStaffSapLoadMax = 2500.0; +TwoHandSwordSapLoadMax = 2500.0; +TwoHandAxeSapLoadMax = 2500.0; +PikeSapLoadMax = 2500.0; +TwoHandMaceSapLoadMax = 2500.0; +// range weapon +AutolauchSapLoadMax = 2500.0; +BowrifleSapLoadMax = 2500.0; +LauncherSapLoadMax = 2500.0; +PistolSapLoadMax = 2500.0; +BowpistolSapLoadMax = 2500.0; +RifleSapLoadMax = 2500.0; +HarpoonSapLoadMax = 2500.0; +// ammo +AutolaunchAmmoSapLoadMax = 2500.0; +BowrifleAmmoSapLoadMax = 2500.0; +GrenadeAmmoSapLoadMax = 2500.0; +LauncherAmmoSapLoadMax = 2500.0; +PistolAmmoSapLoadMax = 2500.0; +BowpistolAmmoSapLoadMax = 2500.0; +RifleAmmoSapLoadMax = 2500.0; +HarpoonAmmoSapLoadMax = 2500.0; +// armor and shield +ShieldSapLoadMax = 2500.0; +BucklerSapLoadMax = 2500.0; +LightBootsSapLoadMax = 2500.0; +LightGlovesSapLoadMax = 2500.0; +LightPantsSapLoadMax = 2500.0; +LightSleevesSapLoadMax = 2500.0; +LightVestSapLoadMax = 2500.0; +MediumBootsSapLoadMax = 2500.0; +MediumGlovesSapLoadMax = 2500.0; +MediumPantsSapLoadMax = 2500.0; +MediumSleevesSapLoadMax = 2500.0; +MediumVestSapLoadMax = 2500.0; +HeavyBootsSapLoadMax = 2500.0; +HeavyGlovesSapLoadMax = 2500.0; +HeavyPantsSapLoadMax = 2500.0; +HeavySleevesSapLoadMax = 2500.0; +HeavyVestSapLoadMax = 2500.0; +HeavyHelmetSapLoadMax = 2500.0; +// jewel +AnkletSapLoadMax = 2500.0; +BraceletSapLoadMax = 2500.0; +DiademSapLoadMax = 2500.0; +EaringSapLoadMax = 2500.0; +PendantSapLoadMax = 2500.0; +RingSapLoadMax = 2500.0; +//////////// +// DAMAGE Min +// melee weapons +DaggerDmg = 0.250; // Dg Type (Pierce) +StaffDmg = 0.250; // 1H Type +SwordDmg = 0.666; // 1H Type +MaceDmg = 0.800; // 1H Type +AxeDmg = 0.800; // 1H Type +SpearDmg = 0.550; // 1H Type (pierce) +TwoHandSwordDmg = 1.000; // 2H Type +TwoHandAxeDmg = 1.200; // 2H Type +PikeDmg = 0.800; // 2H Type (pierce) +TwoHandMaceDmg = 1.200; // 2H Type +MagicianStaffDmg = 0.350; // 2H Type +// range weapon (modifier) +PistolDmg = 0.0; +BowpistolDmg = 0.0; +RifleDmg = 0.0; +BowrifleDmg = 0.0; +AutolauchDmg = 0.0; +LauncherDmg = 0.0; +HarpoonDmg = 0.0; +// ammo +PistolAmmoDmg = 0.625; +BowpistolAmmoDmg = 0.625; +RifleAmmoDmg = 0.833; +BowrifleAmmoDmg = 0.833; +AutolaunchAmmoDmg = 2.0; +LauncherAmmoDmg = 3.0; +HarpoonAmmoDmg = 1.0; +GrenadeAmmoDmg = 1.0; +// DAMAGE Max +// melee weapons +DaggerDmgMax = 0.500; // Dg Type (Pierce) +StaffDmgMax = 0.500; // 1H Type +SwordDmgMax = 1.333; // 1H Type +MaceDmgMax = 1.600; // 1H Type +AxeDmgMax = 1.600; // 1H Type +SpearDmgMax = 1.100; // 1H Type (pierce) +TwoHandSwordDmgMax = 2.000; // 2H Type +TwoHandAxeDmgMax = 2.400; // 2H Type +PikeDmgMax = 1.600; // 2H Type (pierce) +TwoHandMaceDmgMax = 2.400; // 2H Type +MagicianStaffDmgMax = 0.350; +// range weapon (modifier) +AutolauchDmgMax = 0.0; +BowrifleDmgMax = 0.0; +LauncherDmgMax = 0.0; +PistolDmgMax = 0.0; +BowpistolDmgMax = 0.0; +RifleDmgMax = 0.0; +HarpoonDmgMax = 0.0; +// ammo +PistolAmmoDmgMax = 1.25; +BowpistolAmmoDmgMax = 1.25; +RifleAmmoDmgMax = 1.666; +BowrifleAmmoDmgMax = 1.666; +AutolaunchAmmoDmgMax = 4.0; +LauncherAmmoDmgMax = 6.0; +HarpoonAmmoDmgMax = 2.0; +GrenadeAmmoDmgMax = 2.0; + +////////////// +// HIT RATE // Hits for 10 sec +// melee weapons +DaggerHitRate = 5.0; // Dg Type (Pierce) +StaffHitRate = 3.333; // 1H Type (blunt) +SwordHitRate = 3.333; // 1H Type +MaceHitRate = 3.030; // 1H Type +AxeHitRate = 3.030; // 1H Type +SpearHitRate = 3.700; // 1H Type (pierce) +TwoHandSwordHitRate = 2.500; // 2H Type +TwoHandAxeHitRate = 2.272; // 2H Type +PikeHitRate = 2.777; // 2H Type (pierce) +TwoHandMaceHitRate = 2.272; // 2H Type +MagicianStaffHitRate = 2.5; // +// range weapon +PistolHitRate = 2.5; +BowpistolHitRate = 2.5; +RifleHitRate = 2.0; +BowrifleHitRate = 2.0; +AutolauchHitRate = 1.0; +LauncherHitRate = 1.0; +HarpoonHitRate = 2.0; +// ammo (modifier) +AutolaunchAmmoHitRate = 0.0; +BowrifleAmmoHitRate = 0.0; +GrenadeAmmoHitRate = 0.0; +LauncherAmmoHitRate = 0.0; +PistolAmmoHitRate = 0.0; +BowpistolAmmoHitRate = 0.0; +RifleAmmoHitRate = 0.0; +HarpoonAmmoHitRate = 0.0; + +////////////// +// Maximum hit rate ( after crafted item parameters applications ) +// melee weapons +DaggerHitRateMax = 10.0; +StaffHitRateMax = 6.666; // 1H Type (blunt) +SwordHitRateMax = 6.666; +MaceHitRateMax = 6.060; +AxeHitRateMax = 6.060; +SpearHitRateMax = 7.400; +TwoHandSwordHitRateMax = 5.0; +TwoHandAxeHitRateMax = 4.545; +PikeHitRateMax = 5.555; +TwoHandMaceHitRateMax = 4.545; +MagicianStaffHitRateMax = 2.5; +// range weapon +PistolHitRateMax = 5.0; +BowpistolHitRateMax = 5.0; +RifleHitRateMax = 4.0; +BowrifleHitRateMax = 4.0; +AutolauchHitRateMax = 2.0; +LauncherHitRateMax = 2.0; +HarpoonHitRateMax = 4.0; +// ammo +AutolaunchAmmoHitRateMax = 0.0; +BowrifleAmmoHitRateMax = 0.0; +GrenadeAmmoHitRateMax = 0.0; +LauncherAmmoHitRateMax = 0.0; +PistolAmmoHitRateMax = 0.0; +BowpistolAmmoHitRateMax = 0.0; +RifleAmmoHitRateMax = 0.0; +HarpoonAmmoHitRateMax = 0.0; + + +/////////// +// Range // for ammo, range weapon (modifier) (max = *2) +// range weapon +AutolauchRange = 25000.0; // Gat +BowrifleRange = 20000.0; +LauncherRange = 30000.0; // Rocket Launcher +PistolRange = 15000.0; +BowpistolRange = 15000.0; +RifleRange = 20000.0; +HarpoonRange = 15000.0; +// ammo +AutolaunchAmmoRange = 0.0; +BowrifleAmmoRange = 0.0; +GrenadeAmmoRange = 0.0; +LauncherAmmoRange = 0.0; +PistolAmmoRange = 0.0; +BowpistolAmmoRange = 0.0; +RifleAmmoRange = 0.0; +HarpoonAmmoRange = 0.0; +//////////////////// +// DODGE MODIFIER // not for ammo and jewel, but for armor too +// melee weapons & armor +DaggerDodgeMinModifier = 0.0; +DaggerDodgeMaxModifier = 20.0; +SwordDodgeMinModifier = -10.0; +SwordDodgeMaxModifier = 10.0; +MaceDodgeMinModifier = -10.0; +MaceDodgeMaxModifier = 10.0; +AxeDodgeMinModifier = -10.0; +AxeDodgeMaxModifier = 10.0; +SpearDodgeMinModifier = -5.0; +SpearDodgeMaxModifier = 15.0; +StaffDodgeMinModifier = -10.0; +StaffDodgeMaxModifier = 10.0; +TwoHandSwordDodgeMinModifier = -20.0; +TwoHandSwordDodgeMaxModifier = 0.0; +TwoHandAxeDodgeMinModifier = -20.0; +TwoHandAxeDodgeMaxModifier = 0.0; +PikeDodgeMinModifier = -20.0; +PikeDodgeMaxModifier = 0.0; +TwoHandMaceDodgeMinModifier = -20.0; +TwoHandMaceDodgeMaxModifier = 0.0; +MagicianStaffDodgeMinModifier = 0.0; +MagicianStaffDodgeMaxModifier = 0.0; +// range weapon +AutolauchDodgeMinModifier = -15.0; +AutolauchDodgeMaxModifier = 5.0; +BowrifleDodgeMinModifier = -10.0; +BowrifleDodgeMaxModifier = 10.0; +LauncherDodgeMinModifier = -20.0; +LauncherDodgeMaxModifier = 0.0; +PistolDodgeMinModifier = 0.0; +PistolDodgeMaxModifier = 20.0; +BowpistolDodgeMinModifier = -5.0; +BowpistolDodgeMaxModifier = 15.0; +RifleDodgeMinModifier = -20.0; +RifleDodgeMaxModifier = 0.0; +HarpoonDodgeMinModifier = 0.0; +HarpoonDodgeMaxModifier = 0.0; +// armor and shield +ShieldDodgeMinModifier = -10.0; +ShieldDodgeMaxModifier = 0.0; +BucklerDodgeMinModifier = 0.0; +BucklerDodgeMaxModifier = 20.0; +LightBootsDodgeMinModifier = 1.0; +LightBootsDodgeMaxModifier = 2.0; +LightGlovesDodgeMinModifier = 1.0; +LightGlovesDodgeMaxModifier = 2.0; +LightPantsDodgeMinModifier = 1.0; +LightPantsDodgeMaxModifier = 2.0; +LightSleevesDodgeMinModifier = 1.0; +LightSleevesDodgeMaxModifier = 2.0; +LightVestDodgeMinModifier = 1.0; +LightVestDodgeMaxModifier = 2.0; +MediumBootsDodgeMinModifier = -2.0; +MediumBootsDodgeMaxModifier = 1.0; +MediumGlovesDodgeMinModifier = -2.0; +MediumGlovesDodgeMaxModifier = 1.0; +MediumPantsDodgeMinModifier = -2.0; +MediumPantsDodgeMaxModifier = 1.0; +MediumSleevesDodgeMinModifier = -2.0; +MediumSleevesDodgeMaxModifier = 1.0; +MediumVestDodgeMinModifier = -2.0; +MediumVestDodgeMaxModifier = 1.0; +HeavyBootsDodgeMinModifier = -4.0; +HeavyBootsDodgeMaxModifier = 0.0; +HeavyGlovesDodgeMinModifier = -4.0; +HeavyGlovesDodgeMaxModifier = 0.0; +HeavyPantsDodgeMinModifier = -4.0; +HeavyPantsDodgeMaxModifier = 0.0; +HeavySleevesDodgeMinModifier = -4.0; +HeavySleevesDodgeMaxModifier = 0.0; +HeavyVestDodgeMinModifier = -4.0; +HeavyVestDodgeMaxModifier = 0.0; +HeavyHelmetDodgeMinModifier = -4.0; +HeavyHelmetDodgeMaxModifier = 0.0; +//////////////////// +// PARRY MODIFIER // not for ammo and jewel, but for armor too +// melee weapons +DaggerParryMinModifier = -20.0; +DaggerParryMaxModifier = 0.0; +SwordParryMinModifier = -10.0; +SwordParryMaxModifier = 10.0; +MaceParryMinModifier = -15.0; +MaceParryMaxModifier = 5.0; +AxeParryMinModifier = -15.0; +AxeParryMaxModifier = 5.0; +SpearParryMinModifier = -20.0; +SpearParryMaxModifier = 0.0; +StaffParryMinModifier = 0.0; +StaffParryMaxModifier = 20.0; +TwoHandSwordParryMinModifier = 0.0; +TwoHandSwordParryMaxModifier = 20.0; +TwoHandAxeParryMinModifier = -10.0; +TwoHandAxeParryMaxModifier = 10.0; +PikeParryMinModifier = -10.0; +PikeParryMaxModifier = 10.0; +TwoHandMaceParryMinModifier = -10.0; +TwoHandMaceParryMaxModifier = 10.0; +MagicianStaffParryMinModifier = 0.0; +MagicianStaffParryMaxModifier = 0.0; +// range weapon +AutolauchParryMinModifier = 0.0; +AutolauchParryMaxModifier = 20.0; +BowrifleParryMinModifier = -10.0; +BowrifleParryMaxModifier = 10.0; +LauncherParryMinModifier = 0.0; +LauncherParryMaxModifier = 20.0; +PistolParryMinModifier = -20.0; +PistolParryMaxModifier = 0.0; +BowpistolParryMinModifier = -5.0; +BowpistolParryMaxModifier = 15.0; +RifleParryMinModifier = 0.0; +RifleParryMaxModifier = 20.0; +HarpoonParryMinModifier = 0.0; +HarpoonParryMaxModifier = 0.0; +// armor and shield +ShieldParryMinModifier = 10.0; +ShieldParryMaxModifier = 30.0; +BucklerParryMinModifier = 0.0; +BucklerParryMaxModifier = 20.0; +LightBootsParryMinModifier = -1.0; +LightBootsParryMaxModifier = 1.0; +LightGlovesParryMinModifier = -1.0; +LightGlovesParryMaxModifier = 1.0; +LightPantsParryMinModifier = -1.0; +LightPantsParryMaxModifier = 1.0; +LightSleevesParryMinModifier = -1.0; +LightSleevesParryMaxModifier = 1.0; +LightVestParryMinModifier = -1.0; +LightVestParryMaxModifier = 1.0; +MediumBootsParryMinModifier = -1.0; +MediumBootsParryMaxModifier = 2.0; +MediumGlovesParryMinModifier = -1.0; +MediumGlovesParryMaxModifier = 2.0; +MediumPantsParryMinModifier = -1.0; +MediumPantsParryMaxModifier = 2.0; +MediumSleevesParryMinModifier = -1.0; +MediumSleevesParryMaxModifier = 2.0; +MediumVestParryMinModifier = -1.0; +MediumVestParryMaxModifier = 2.0; +HeavyBootsParryMinModifier = -1.0; +HeavyBootsParryMaxModifier = 3.0; +HeavyGlovesParryMinModifier = -1.0; +HeavyGlovesParryMaxModifier = 3.0; +HeavyPantsParryMinModifier = -1.0; +HeavyPantsParryMaxModifier = 3.0; +HeavySleevesParryMinModifier = -1.0; +HeavySleevesParryMaxModifier = 3.0; +HeavyVestParryMinModifier = -1.0; +HeavyVestParryMaxModifier = 3.0; +HeavyHelmetParryMinModifier = -1.0; +HeavyHelmetParryMaxModifier = 3.0; +////////////////////////////// +// ADVERSARY DODGE MODIFIER // not for ammo, jewel and armor +// melee weapons +DaggerAdversaryDodgeMinModifier = 0.0; +DaggerAdversaryDodgeMaxModifier = -20.0; +SwordAdversaryDodgeMinModifier = 5.0; +SwordAdversaryDodgeMaxModifier = -15.0; +MaceAdversaryDodgeMinModifier = 5.0; +MaceAdversaryDodgeMaxModifier = -15.0; +AxeAdversaryDodgeMinModifier = 5.0; +AxeAdversaryDodgeMaxModifier = -15.0; +SpearAdversaryDodgeMinModifier = 15.0; +SpearAdversaryDodgeMaxModifier = -5.0; +StaffAdversaryDodgeMinModifier = 0.0; +StaffAdversaryDodgeMaxModifier = -20.0; +TwoHandSwordAdversaryDodgeMinModifier = 30.0; +TwoHandSwordAdversaryDodgeMaxModifier = 15.0; +TwoHandAxeAdversaryDodgeMinModifier = 30.0; +TwoHandAxeAdversaryDodgeMaxModifier = 15.0; +PikeAdversaryDodgeMinModifier = 30.0; +PikeAdversaryDodgeMaxModifier = 15.0; +TwoHandMaceAdversaryDodgeMinModifier = 30.0; +TwoHandMaceAdversaryDodgeMaxModifier = 15.0; +MagicianStaffAdversaryDodgeMinModifier = 0.0; +MagicianStaffAdversaryDodgeMaxModifier = 0.0; +// range weapon +AutolauchAdversaryDodgeMinModifier = 30.0; +AutolauchAdversaryDodgeMaxModifier = 15.0; +BowrifleAdversaryDodgeMinModifier = 0.0; +BowrifleAdversaryDodgeMaxModifier = -20.0; +LauncherAdversaryDodgeMinModifier = 30.0; +LauncherAdversaryDodgeMaxModifier = 20.0; +PistolAdversaryDodgeMinModifier = 0.0; +PistolAdversaryDodgeMaxModifier = -15.0; +BowpistolAdversaryDodgeMinModifier = 0.0; +BowpistolAdversaryDodgeMaxModifier = -15.0; +RifleAdversaryDodgeMinModifier = 0.0; +RifleAdversaryDodgeMaxModifier = -20.0; +HarpoonAdversaryDodgeMinModifier = 0.0; +HarpoonAdversaryDodgeMaxModifier = 0.0; +////////////////////////////// +// ADVERSARY PARRY MODIFIER // not for ammo, jewel and armor +// melee weapons +DaggerAdversaryParryMinModifier = 20.0; +DaggerAdversaryParryMaxModifier = 0.0; +SwordAdversaryParryMinModifier = 10.0; +SwordAdversaryParryMaxModifier = -10.0; +MaceAdversaryParryMinModifier = 15.0; +MaceAdversaryParryMaxModifier = -5.0; +AxeAdversaryParryMinModifier = 15.0; +AxeAdversaryParryMaxModifier = -5.0; +SpearAdversaryParryMinModifier = 5.0; +SpearAdversaryParryMaxModifier = -5.0; +StaffAdversaryParryMinModifier = -5.0; +StaffAdversaryParryMaxModifier = -15.0; +TwoHandSwordAdversaryParryMinModifier = 0.0; +TwoHandSwordAdversaryParryMaxModifier = -30.0; +TwoHandAxeAdversaryParryMinModifier = 0.0; +TwoHandAxeAdversaryParryMaxModifier = -20.0; +PikeAdversaryParryMinModifier = 0.0; +PikeAdversaryParryMaxModifier = -20.0; +TwoHandMaceAdversaryParryMinModifier = 0.0; +TwoHandMaceAdversaryParryMaxModifier = -20.0; +MagicianStaffAdversaryParryMinModifier = 0.0; +MagicianStaffAdversaryParryMaxModifier = 0.0; +// range weapon +AutolauchAdversaryParryMinModifier = 10.0; +AutolauchAdversaryParryMaxModifier = -10.0; +BowrifleAdversaryParryMinModifier = 0.0; +BowrifleAdversaryParryMaxModifier = -20.0; +LauncherAdversaryParryMinModifier = 20.0; +LauncherAdversaryParryMaxModifier = 0.0; +PistolAdversaryParryMinModifier = 0.0; +PistolAdversaryParryMaxModifier = -20.0; +BowpistolAdversaryParryMinModifier = 0.0; +BowpistolAdversaryParryMaxModifier = -20.0; +RifleAdversaryParryMinModifier = 0.0; +RifleAdversaryParryMaxModifier = -20.0; +HarpoonAdversaryParryMinModifier = 0.0; +HarpoonAdversaryParryMaxModifier = -20.0; + +////////////////////////////// +// Cast Modifiers // for melee weapons +//Elemental casting time factor (melee weapon only) +// Min +DaggerElementalCastingTimeFactor = 0.0; +SwordElementalCastingTimeFactor = 0.0; +AxeElementalCastingTimeFactor = 0.0; +MaceElementalCastingTimeFactor = 0.0; +SpearElementalCastingTimeFactor = 0.0; +StaffElementalCastingTimeFactor = 0.0; +MagicianStaffElementalCastingTimeFactor = 0.2; +TwoHandAxeElementalCastingTimeFactor = 0.0; +TwoHandSwordElementalCastingTimeFactor = 0.0; +PikeElementalCastingTimeFactor = 0.0; +TwoHandMaceElementalCastingTimeFactor = 0.0; +// max +DaggerElementalCastingTimeFactorMax = 1.0; +SwordElementalCastingTimeFactorMax = 1.0; +AxeElementalCastingTimeFactorMax = 1.0; +MaceElementalCastingTimeFactorMax = 1.0; +SpearElementalCastingTimeFactorMax = 1.0; +StaffElementalCastingTimeFactorMax = 1.0; +MagicianStaffElementalCastingTimeFactorMax = 1.0; +TwoHandAxeElementalCastingTimeFactorMax = 1.0; +TwoHandSwordElementalCastingTimeFactorMax = 1.0; +PikeElementalCastingTimeFactorMax = 1.0; +TwoHandMaceElementalCastingTimeFactorMax = 1.0; + +//Elemental power factor (melee weapon only) +// Min +DaggerElementalPowerFactor = 0.0; +SwordElementalPowerFactor = 0.0; +AxeElementalPowerFactor = 0.0; +MaceElementalPowerFactor = 0.0; +SpearElementalPowerFactor = 0.0; +StaffElementalPowerFactor = 0.0; +MagicianStaffElementalPowerFactor = 0.2; +TwoHandAxeElementalPowerFactor = 0.0; +TwoHandSwordElementalPowerFactor = 0.0; +PikeElementalPowerFactor = 0.0; +TwoHandMaceElementalPowerFactor = 0.0; +// Max +DaggerElementalPowerFactorMax = 1.0; +SwordElementalPowerFactorMax = 1.0; +AxeElementalPowerFactorMax = 1.0; +MaceElementalPowerFactorMax = 1.0; +SpearElementalPowerFactorMax = 1.0; +StaffElementalPowerFactorMax = 1.0; +MagicianStaffElementalPowerFactorMax = 1.0; +TwoHandAxeElementalPowerFactorMax = 1.0; +TwoHandSwordElementalPowerFactorMax = 1.0; +PikeElementalPowerFactorMax = 1.0; +TwoHandMaceElementalPowerFactorMax = 1.0; + +//OffensiveAffliction casting time factor (melee weapon only) +// Min +DaggerOffensiveAfflictionCastingTimeFactor = 0.0; +SwordOffensiveAfflictionCastingTimeFactor = 0.0; +AxeOffensiveAfflictionCastingTimeFactor = 0.0; +MaceOffensiveAfflictionCastingTimeFactor = 0.0; +SpearOffensiveAfflictionCastingTimeFactor = 0.0; +StaffOffensiveAfflictionCastingTimeFactor = 0.0; +MagicianStaffOffensiveAfflictionCastingTimeFactor = 0.2; +TwoHandAxeOffensiveAfflictionCastingTimeFactor = 0.0; +TwoHandSwordOffensiveAfflictionCastingTimeFactor = 0.0; +PikeOffensiveAfflictionCastingTimeFactor = 0.0; +TwoHandMaceOffensiveAfflictionCastingTimeFactor = 0.0; +// Max +DaggerOffensiveAfflictionCastingTimeFactorMax = 1.0; +SwordOffensiveAfflictionCastingTimeFactorMax = 1.0; +AxeOffensiveAfflictionCastingTimeFactorMax = 1.0; +MaceOffensiveAfflictionCastingTimeFactorMax = 1.0; +SpearOffensiveAfflictionCastingTimeFactorMax = 1.0; +StaffOffensiveAfflictionCastingTimeFactorMax = 1.0; +MagicianStaffOffensiveAfflictionCastingTimeFactorMax = 1.0; +TwoHandAxeOffensiveAfflictionCastingTimeFactorMax = 1.0; +TwoHandSwordOffensiveAfflictionCastingTimeFactorMax = 1.0; +PikeOffensiveAfflictionCastingTimeFactorMax = 1.0; +TwoHandMaceOffensiveAfflictionCastingTimeFactorMax = 1.0; + +//OffensiveAffliction power factor (melee weapon only) +// Min +DaggerOffensiveAfflictionPowerFactor = 0.0; +SwordOffensiveAfflictionPowerFactor = 0.0; +AxeOffensiveAfflictionPowerFactor = 0.0; +MaceOffensiveAfflictionPowerFactor = 0.0; +SpearOffensiveAfflictionPowerFactor = 0.0; +StaffOffensiveAfflictionPowerFactor = 0.0; +MagicianStaffOffensiveAfflictionPowerFactor = 0.2; +TwoHandAxeOffensiveAfflictionPowerFactor = 0.0; +TwoHandSwordOffensiveAfflictionPowerFactor = 0.0; +PikeOffensiveAfflictionPowerFactor = 0.0; +TwoHandMaceOffensiveAfflictionPowerFactor = 0.0; +// Max +DaggerOffensiveAfflictionPowerFactorMax = 1.0; +SwordOffensiveAfflictionPowerFactorMax = 1.0; +AxeOffensiveAfflictionPowerFactorMax = 1.0; +MaceOffensiveAfflictionPowerFactorMax = 1.0; +SpearOffensiveAfflictionPowerFactorMax = 1.0; +StaffOffensiveAfflictionPowerFactorMax = 1.0; +MagicianStaffOffensiveAfflictionPowerFactorMax = 1.0; +TwoHandAxeOffensiveAfflictionPowerFactorMax = 1.0; +TwoHandSwordOffensiveAfflictionPowerFactorMax = 1.0; +PikeOffensiveAfflictionPowerFactorMax = 1.0; +TwoHandMaceOffensiveAfflictionPowerFactorMax = 1.0; + +//Heal casting time factor (melee weapon only) +// Min +DaggerHealCastingTimeFactor = 0.0; +SwordHealCastingTimeFactor = 0.0; +AxeHealCastingTimeFactor = 0.0; +MaceHealCastingTimeFactor = 0.0; +SpearHealCastingTimeFactor = 0.0; +StaffHealCastingTimeFactor = 0.0; +MagicianStaffHealCastingTimeFactor = 0.2; +TwoHandAxeHealCastingTimeFactor = 0.0; +TwoHandSwordHealCastingTimeFactor = 0.0; +PikeHealCastingTimeFactor = 0.0; +TwoHandMaceHealCastingTimeFactor = 0.0; +// Max +DaggerHealCastingTimeFactorMax = 1.0; +SwordHealCastingTimeFactorMax = 1.0; +AxeHealCastingTimeFactorMax = 1.0; +MaceHealCastingTimeFactorMax = 1.0; +SpearHealCastingTimeFactorMax = 1.0; +StaffHealCastingTimeFactorMax = 1.0; +MagicianStaffHealCastingTimeFactorMax = 1.0; +TwoHandAxeHealCastingTimeFactorMax = 1.0; +TwoHandSwordHealCastingTimeFactorMax = 1.0; +PikeHealCastingTimeFactorMax = 1.0; +TwoHandMaceHealCastingTimeFactorMax = 1.0; + +//Heal power factor (melee weapon only) +// Min +DaggerHealPowerFactor = 0.0; +SwordHealPowerFactor = 0.0; +AxeHealPowerFactor = 0.0; +MaceHealPowerFactor = 0.0; +SpearHealPowerFactor = 0.0; +StaffHealPowerFactor = 0.0; +MagicianStaffHealPowerFactor = 0.2; +TwoHandAxeHealPowerFactor = 0.0; +TwoHandSwordHealPowerFactor = 0.0; +PikeHealPowerFactor = 0.0; +TwoHandMaceHealPowerFactor = 0.0; +// Max +DaggerHealPowerFactorMax = 1.0; +SwordHealPowerFactorMax = 1.0; +AxeHealPowerFactorMax = 1.0; +MaceHealPowerFactorMax = 1.0; +SpearHealPowerFactorMax = 1.0; +StaffHealPowerFactorMax = 1.0; +MagicianStaffHealPowerFactorMax = 1.0; +TwoHandAxeHealPowerFactorMax = 1.0; +TwoHandSwordHealPowerFactorMax = 1.0; +PikeHealPowerFactorMax = 1.0; +TwoHandMaceHealPowerFactorMax = 1.0; + +//DefensiveAffliction casting time factor (melee weapon only) +// Min +DaggerDefensiveAfflictionCastingTimeFactor = 0.0; +SwordDefensiveAfflictionCastingTimeFactor = 0.0; +AxeDefensiveAfflictionCastingTimeFactor = 0.0; +MaceDefensiveAfflictionCastingTimeFactor = 0.0; +SpearDefensiveAfflictionCastingTimeFactor = 0.0; +StaffDefensiveAfflictionCastingTimeFactor = 0.0; +MagicianStaffDefensiveAfflictionCastingTimeFactor = 0.2; +TwoHandAxeDefensiveAfflictionCastingTimeFactor = 0.0; +TwoHandSwordDefensiveAfflictionCastingTimeFactor = 0.0; +PikeDefensiveAfflictionCastingTimeFactor = 0.0; +TwoHandMaceDefensiveAfflictionCastingTimeFactor = 0.0; +// Max +DaggerDefensiveAfflictionCastingTimeFactorMax = 1.0; +SwordDefensiveAfflictionCastingTimeFactorMax = 1.0; +AxeDefensiveAfflictionCastingTimeFactorMax = 1.0; +MaceDefensiveAfflictionCastingTimeFactorMax = 1.0; +SpearDefensiveAfflictionCastingTimeFactorMax = 1.0; +StaffDefensiveAfflictionCastingTimeFactorMax = 1.0; +MagicianStaffDefensiveAfflictionCastingTimeFactorMax = 1.0; +TwoHandAxeDefensiveAfflictionCastingTimeFactorMax = 1.0; +TwoHandSwordDefensiveAfflictionCastingTimeFactorMax = 1.0; +PikeDefensiveAfflictionCastingTimeFactorMax = 1.0; +TwoHandMaceDefensiveAfflictionCastingTimeFactorMax = 1.0; + +//DefensiveAffliction power factor (melee weapon only) +// Min +DaggerDefensiveAfflictionPowerFactor = 0.0; +SwordDefensiveAfflictionPowerFactor = 0.0; +AxeDefensiveAfflictionPowerFactor = 0.0; +MaceDefensiveAfflictionPowerFactor = 0.0; +SpearDefensiveAfflictionPowerFactor = 0.0; +StaffDefensiveAfflictionPowerFactor = 0.0; +MagicianStaffDefensiveAfflictionPowerFactor = 0.2; +TwoHandAxeDefensiveAfflictionPowerFactor = 0.0; +TwoHandSwordDefensiveAfflictionPowerFactor = 0.0; +PikeDefensiveAfflictionPowerFactor = 0.0; +TwoHandMaceDefensiveAfflictionPowerFactor = 0.0; +// Max +DaggerDefensiveAfflictionPowerFactorMax = 1.0; +SwordDefensiveAfflictionPowerFactorMax = 1.0; +AxeDefensiveAfflictionPowerFactorMax = 1.0; +MaceDefensiveAfflictionPowerFactorMax = 1.0; +SpearDefensiveAfflictionPowerFactorMax = 1.0; +StaffDefensiveAfflictionPowerFactorMax = 1.0; +MagicianStaffDefensiveAfflictionPowerFactorMax = 1.0; +TwoHandAxeDefensiveAfflictionPowerFactorMax = 1.0; +TwoHandSwordDefensiveAfflictionPowerFactorMax = 1.0; +PikeDefensiveAfflictionPowerFactorMax = 1.0; +TwoHandMaceDefensiveAfflictionPowerFactorMax = 1.0; + + + +/////////////////////// +// PROTECTION FACTOR // +// armor and shield +// Min +BucklerProtectionFactor = 0.08; +ShieldProtectionFactor = 0.16; +LightBootsProtectionFactor = 0.05; +LightGlovesProtectionFactor = 0.05; +LightPantsProtectionFactor = 0.05; +LightSleevesProtectionFactor = 0.05; +LightVestProtectionFactor = 0.05; +MediumBootsProtectionFactor = 0.20; +MediumGlovesProtectionFactor = 0.20; +MediumPantsProtectionFactor = 0.20; +MediumSleevesProtectionFactor = 0.20; +MediumVestProtectionFactor = 0.20; +HeavyBootsProtectionFactor = 0.40; +HeavyGlovesProtectionFactor = 0.40; +HeavyPantsProtectionFactor = 0.40; +HeavySleevesProtectionFactor = 0.40; +HeavyVestProtectionFactor = 0.40; +HeavyHelmetProtectionFactor = 0.40; +// Max +BucklerProtectionFactorMax = 0.12; +ShieldProtectionFactorMax = 0.24; +LightBootsProtectionFactorMax = 0.25; +LightGlovesProtectionFactorMax = 0.25; +LightPantsProtectionFactorMax = 0.25; +LightSleevesProtectionFactorMax = 0.25; +LightVestProtectionFactorMax = 0.25; +MediumBootsProtectionFactorMax = 0.40; +MediumGlovesProtectionFactorMax = 0.40; +MediumPantsProtectionFactorMax = 0.40; +MediumSleevesProtectionFactorMax = 0.40; +MediumVestProtectionFactorMax = 0.40; +HeavyBootsProtectionFactorMax = 0.60; +HeavyGlovesProtectionFactorMax = 0.60; +HeavyPantsProtectionFactorMax = 0.60; +HeavySleevesProtectionFactorMax = 0.60; +HeavyVestProtectionFactorMax = 0.60; +HeavyHelmetProtectionFactorMax = 0.60; +///////////////////////////// +// MAX SLASHING PROTECTION // value to multiply with the item level. +// armor and shield +BucklerMaxSlashingProtection = 0.24; +ShieldMaxSlashingProtection = 0.48; +LightBootsMaxSlashingProtection = 0.56; +LightGlovesMaxSlashingProtection = 0.56; +LightPantsMaxSlashingProtection = 0.56; +LightSleevesMaxSlashingProtection = 0.56; +LightVestMaxSlashingProtection = 0.56; +MediumBootsMaxSlashingProtection = 0.89; +MediumGlovesMaxSlashingProtection = 0.89; +MediumPantsMaxSlashingProtection = 0.89; +MediumSleevesMaxSlashingProtection = 0.89; +MediumVestMaxSlashingProtection = 0.89; +HeavyBootsMaxSlashingProtection = 1.33; +HeavyGlovesMaxSlashingProtection = 1.33; +HeavyPantsMaxSlashingProtection = 1.33; +HeavySleevesMaxSlashingProtection = 1.33; +HeavyVestMaxSlashingProtection = 1.33; +HeavyHelmetMaxSlashingProtection = 1.33; +////////////////////////// +// MAX BLUNT PROTECTION // +// armor and shield +BucklerMaxBluntProtection = 0.24; +ShieldMaxBluntProtection = 0.48; +LightBootsMaxBluntProtection = 0.56; +LightGlovesMaxBluntProtection = 0.56; +LightPantsMaxBluntProtection = 0.56; +LightSleevesMaxBluntProtection = 0.56; +LightVestMaxBluntProtection = 0.56; +MediumBootsMaxBluntProtection = 0.89; +MediumGlovesMaxBluntProtection = 0.89; +MediumPantsMaxBluntProtection = 0.89; +MediumSleevesMaxBluntProtection = 0.89; +MediumVestMaxBluntProtection = 0.89; +HeavyBootsMaxBluntProtection = 1.33; +HeavyGlovesMaxBluntProtection = 1.33; +HeavyPantsMaxBluntProtection = 1.33; +HeavySleevesMaxBluntProtection = 1.33; +HeavyVestMaxBluntProtection = 1.33; +HeavyHelmetMaxBluntProtection = 1.33; +///////////////////////////// +// MAX PIERCING PROTECTION // +// armor and shield +BucklerMaxPiercingProtection = 0.24; +ShieldMaxPiercingProtection = 0.48; +LightBootsMaxPiercingProtection = 0.56; +LightGlovesMaxPiercingProtection = 0.56; +LightPantsMaxPiercingProtection = 0.56; +LightSleevesMaxPiercingProtection = 0.56; +LightVestMaxPiercingProtection = 0.56; +MediumBootsMaxPiercingProtection = 0.89; +MediumGlovesMaxPiercingProtection = 0.89; +MediumPantsMaxPiercingProtection = 0.89; +MediumSleevesMaxPiercingProtection = 0.89; +MediumVestMaxPiercingProtection = 0.89; +HeavyBootsMaxPiercingProtection = 1.33; +HeavyGlovesMaxPiercingProtection = 1.33; +HeavyPantsMaxPiercingProtection = 1.33; +HeavySleevesMaxPiercingProtection = 1.33; +HeavyVestMaxPiercingProtection = 1.33; +HeavyHelmetMaxPiercingProtection = 1.33; +////////////////////////////// +// JEWEL PROTECTION +AcidJewelProtection = 0.08001; // de 0 à 1.0 (1.0 = 100% de protection) +ColdJewelProtection = 0.08001; +FireJewelProtection = 0.08001; +RotJewelProtection = 0.08001; +ShockWaveJewelProtection = 0.08001; +PoisonJewelProtection = 0.08001; +ElectricityJewelProtection = 0.08001; + +MaxMagicProtection = 70; // Maximum protection can be gived by jewelry (clamp value), de 0 à 100 (pourcentage) +HominBaseProtection = 10; // Homin base protection in generic magic damage type +HominRacialProtection = 20; // Homin base protection in racial magic damage type +MaxAbsorptionFactor = 50; // Factor used for compute maximum absorption gived by all jewel (100 = 1.0 factor (100%)) (Max absorbtion = sum(equiped jewels recommandeds) * factor) +////////////////////////////// +// JEWEL RESISTANCE +DesertResistance = 8; // In skill points bonus +ForestResistance = 8; +LacustreResistance = 8; +JungleResistance = 8; +PrimaryRootResistance = 8; + +HominRacialResistance = 10;// Homin racial magic resistance to magic racial spell type +MaxMagicResistanceBonus = 50;// clamp value of resistance bonus resistance after all bonus/malus applied +EcosystemResistancePenalty = 10;// ecosystem resistance penalty value +//************************************************************************************************************* +// regen speed parameters +//************************************************************************************************************* +RegenDivisor = 12.5; +RegenReposFactor = 2.0; +RegenOffset = 0.6; + +//************************************************************************************************************* +// weapon damage table config +//************************************************************************************************************* +MinDamage = 27; +DamageStep = 1; +ExponentialPower = 1; +SmoothingFactor = 0; + +//************************************************************************************************************* +// hand to hand combat config +//************************************************************************************************************* +HandToHandDamageFactor = 0.35; +HandToHandLatency = 25; // 25 ticks = 2.5s + +//************************************************************************************************************* +// combat config +//************************************************************************************************************* +BotDamageFactor = 1; // factor applied on npc and creature damage +// special effects when hit to localisation +HitChestStaLossFactor = 0.5; +HitHeadStunDuration = 2; +HitArmsSlowDuration = 8; +HitArmsSlowFactor = 30; +HitLegsSlowDuration = 8; +HitLegsSlowFactor = -20; +HitHandsDebuffDuration = 8; +HitHandsDebuffValue = -20; +HitFeetDebuffDuration = 8; +HitFeetDebuffValue = -20; +NbOpponentsBeforeMalus = 1; +ModPerSupernumeraryOpponent = -5; +MinTwoWeaponsLatency = 10; + +ShieldingRadius = 5; +CombatFlagLifetime = 50; // (in ticks) used for openings + +DodgeFactorForMagicSkills = 1.0; +DodgeFactorForForageSkills = 0.5; + +MagicResistFactorForCombatSkills = 1.0; +MagicResistFactorForMagicSkills = 1.0; +MagicResistFactorForForageSkills = 0.5; +MagicResistSkillDelta = -25; + +//************************************************************************************************************* +// Price parameters ( price formula is ItemPriceCoeff2 * x2 + ItemPriceCoeff1 * x + ItemPriceCoeff0 ) +//************************************************************************************************************* +// polynom coeff of degree 0 in the price formula +ItemPriceCoeff0 = 100.0; +// polynom coeff of degree 1 in the price formula +ItemPriceCoeff1 = 0.6; +// polynom coeff of degree 2 in the price formula +ItemPriceCoeff2 = 0.02; +// factor to apply on non raw maetrial items to compute their price +ItemPriceFactor = 2.0; +// factor to apply on animal price to get the price a user can buy them +AnimalSellFactor = 0.5; +// factor to apply on teleport price to get the price a user can buy them +TeleportSellFactor = 0.5; +// this factor is applied to all faction point prices +GlobalFactionPointPriceFactor = 1.0; + +// this factor is applied to all faction point prices +GlobalFactionPointPriceFactor = 1.0; + +//************************************************************************************************************* +// Max quality of Raw Material Npc item selled by NPC +//************************************************************************************************************* +MaxNPCRawMaterialQualityInSell = 100; + +//************************************************************************************************************* +// Sell store parameters +//************************************************************************************************************* +// an item can stay 7 days in a sale store (total cumulated time in game cycle) +MaxGameCycleSaleStore = 6048000; + +NBMaxItemPlayerSellDisplay = 128; //NB max item can be displayed for player item list selled +NBMaxItemNpcSellDisplay = 128; //NB max item can be displayed for npc item list selled +NBMaxItemYoursSellDisplay = 128; //NB max item can be displayed for your item list selled, it's also the max items player can put in sale store + +//************************************************************************************************************* +// Factor for apply malus wear equipment to craft ( Recommended max = Recommended - (Recommanded * malus wear * WearMalusCraftFactor ) +//************************************************************************************************************* +WearMalusCraftFactor = 0.1; + +//************************************************************************************************************* +// Item wear config +//************************************************************************************************************* +//MeleeWeaponWearPerAction = 0.01; +//RangeWeaponWearPerAction = 0.01; + +// now we base wear factor for weapons on the ration (WeaponLatency / ReferenceWeaponLatencyForWear) +// MUST be > 0 +ReferenceWeaponLatencyForWear = 20; + +CraftingToolWearPerAction = 0.2; +ForageToolWearPerAction = 0.2; +ArmorWearPerAction = 0.01; +ShieldWearPerAction = 0.05; +JewelryWearPerAction = 0.01; + +// melee weapons +DaggerWearPerAction = 0.01; +SwordWearPerAction = 0.01; +MaceWearPerAction = 0.01; +AxeWearPerAction = 0.01; +SpearWearPerAction = 0.01; +StaffWearPerAction = 0.01; +MagicianStaffWearPerAction = 0.01; +TwoHandSwordWearPerAction = 0.01; +TwoHandAxeWearPerAction = 0.01; +PikeWearPerAction = 0.01; +TwoHandMaceWearPerAction = 0.01; +// range weapon +AutolauchWearPerAction = 0.01; +BowrifleWearPerAction = 0.01; +LauncherWearPerAction = 0.01; +PistolWearPerAction = 0.01; +BowpistolWearPerAction = 0.01; +RifleWearPerAction = 0.01; + +//************************************************************************************************************* +// Fame Variables +//************************************************************************************************************* +// Fame memory interpolation periode (default to 5 days) +FameMemoryInterpolation = 4320000; +// Fame trend reset delay (default to 30 mn) +FameTrendResetDelay = 18000; +// Point of fame lost with the faction of a killed bot +FameByKill = -5000; +// Minimum Fame To Buy a Guild Building +MinFameToBuyGuildBuilding = 0; +// Minimum Fame To Buy a Player Building +MinFameToBuyPlayerBuilding = 0; +// maximum price variation ( in absolute value ) that can be due to fame +MaxFamePriceVariation = 0.3; +// Maximum fame value taken in account in trade +MaxFameToTrade = 600000; +// Minimum fame value taken in account in trade, under this value, the merchant refuse to sell +MinFameToTrade = -200000; +// Minimum of positive or negtative fame for PVP +PVPFameRequired = 25; + +//************************************************************************************************************* +// Guild Variables +//************************************************************************************************************* +//fame to buy a guild building +MinFameToBuyGuildBuilding = 0; +// cost of the guild building in money +MoneyToBuyGuildBuilding = 10; +// base bulk of the guild building +BaseGuildBulk = 10000000; +// cost in money to create a guild +GuildCreationCost = 100000; +// max number of charges a guild can apply for +MaxAppliedChargeCount = 3; + +//************************************************************************************************************* +// Animals +//************************************************************************************************************* +AnimalHungerFactor = 0.026042; +AnimalStopFollowingDistance = 100; +AllowAnimalInventoryAccessFromAnyStable = 0; + +//************************************************************************************************************* +// PVP +//************************************************************************************************************* +DuelQueryDuration = 600; +ChallengeSpawnZones = +{ + "pvp_challenge_fyros_spawn_1", + "pvp_challenge_fyros_spawn_2", +}; + +PVPMeleeCombatDamageFactor = 1.0; +PVPRangeCombatDamageFactor = 1.0; +PVPMagicDamageFactor = 1.0; + +TimeForSetPVPFlag = 1200; // 2 mn Timer for set flag pvp become effective +TimeForResetPVPFlag = 18000; // 30 mn Minimum time pvp flag must stay on before player can reset it +TimeForPVPFlagOff = 300; // 30 s Timer for set pvp off, if player make or suffer any pvp action during this time, the reset flag is anulated +PVPActionTimer = 6000; // 10 mn Timer for be able to play in PVE with neutral or other faction character after made an pvp action + +TotemBuildTime = 6000; +TotemRebuildWait = 72000; + +ResPawnPVPInSameRegionForbiden = 0; // 1 is player character can't respawn in same region of there death in faction PvP. + +BuildSpireActive = 0; + + +// max distance from PvP combat to gain PvP points (faction and HoF points) from team PvP kills (in meters) +MaxDistanceForPVPPointsGain = 50.0; +// minimum delta level used to compute the faction points gain +MinPVPDeltaLevel = -50; +// maximum delta level used to compute the faction points gain +MaxPVPDeltaLevel = 50; +// for team PvP progression add this value to the faction points divisor for each team member above one +PVPTeamMemberDivisorValue = 1.0; +// it is the base used in faction point gain formula +PVPFactionPointBase = 5.0; +// it is the base used in HoF point gain formula +PVPHoFPointBase = 5.0; +// in faction PvP the killed players loses the faction points gained per killer multiplied by this factor +PVPFactionPointLossFactor = 0.1; +// in faction PvP the killed players loses the HoF points gained per killer multiplied by this factor +PVPHoFPointLossFactor = 0.5; +// players will not get any point for the same PvP kill for this time in seconds +TimeWithoutPointForSamePVPKill = 300; + +VerboseFactionPoint = 0; + +//************************************************************************************************************* +// Outpost +//************************************************************************************************************* +// Global flag to activate outpost challenge system +LoadOutposts = 1; +// Outpost saving period in tick (1 outpost saved at a time), default is 10 ticks +OutpostSavingPeriod = 10; +// Period in ticks between 2 updates of the same outpost, default is 10 ticks +OutpostUpdatePeriod = 10; +// Set if the outpost drillers generate mps or not +EnableOutpostDrillerMPGeneration = 1; +// Production time of mp in the driller (in seconds) +OutpostDrillerTimeUnit = 60*60*24; // per day +// Delay in ticks used to check if 2 actions for editing an outpost are concurrent +OutpostEditingConcurrencyCheckDelay = 50; +// Period in seconds between 2 updates of outpost timers on clients +OutpostClientTimersUpdatePeriod = 60; +// Number of rounds in an outpost fight +OutpostFightRoundCount = 24; +// Time of a round in an outpost fight, in seconds +OutpostFightRoundTime = 5*60; +// Time to decrement an outpost level in seconds (in peace time) +OutpostLevelDecrementTime = 60*60*24*2; // an outpost loses 1 level every 2 days +// Delay in ticks used to check if 2 actions for editing an outpost are concurrent +OutpostEditingConcurrencyCheckDelay = 50; +// Time of each outpost state (challenge, beforeAttack, afterAttack, beforeDefense, afterDefense), in seconds. If 0 default computed value is used. +OutpostStateTimeOverride = 0; +// Max time the player has to answer the JoinPvp Window, in seconds +OutpostJoinPvpTimer = 10; +// Time range before next attack period in which a service reboot will cancel the challenge, in seconds +OutpostRangeForCancelOnReset = 60*60*3; // 3 hours +// Max number of outposts per guild (DO NOT exceed outpost count in database.xml) +GuildMaxOutpostCount = 10; +//************************************************************************************************************* + +MonoMissionTimout = 144000; +VerboseMissions = 0; +MissionLogFile = "egs_missions.log"; +AdminLogFile = "admin_commands.log"; +MissionPrerequisitsEnabled = 1; +CheckCharacterVisitPlacePeriodGC = 64; + +// This icon will be used for missions with an invalid mission icon. If +// default icon is invalid too mission will not be displayed at all on client. +DefaultMissionIcon = "generic_rite"; + +// Mission states is read from file mission_validation.cfg. The EGS will load +// only the files which state is in ValidMissionStates list. If that list +// contains the keyword "All" all missions will be loaded. +ValidMissionStates = { + "All", +// "Disabled", +// "Test", +// "Valid", +}; + +StoreBotNames = 1; + +Tocking = 1; + +// unlimited death pact for internal testing +UnlimitedDeathPact = 1; + +//ignore race prerequisits for missions +IgnoreMissionRacePrerequisits = 1; + +// Max distance allowed for bot chat & dyn chat +MaxBotChatDistanceM = 5; + +//zone types that must be set as triggers +TriggerZoneTypes = { "place","region" }; + +// PeopleAutorized 1:fyros 2:matis 4:tryker 8:zorai + + +StartCommandsWhenMirrorReady = +{ + "PeopleAutorized 255", +}; + +// set the world instance activity verbosity +VerboseWorldInstance = 0; + +// set the shop category parser verbosity +VerboseShopParsing = 0; + +// Checking coherency between saved players and CEntityIdTranslator map, may be slow, so put to 0 if you want +CheckEntityIdTranslatorCoherency = 0; + +// Filename that contains the list of invalid entity names +InvalidEntityNamesFilename = "invalid_entity_names.txt"; + +ForageKamiAngerThreshold1 = 9900; +ForageKamiAngerThreshold2 = 10000; +ForageKamiAngerDecreasePerHour = 830.0; +ForageKamiAngerPunishDamage = 6000; + +ForageValidateSourcesSpawnPos = 1; +AutoSpawnForageSourcePeriodOverride = 0; +ForageKamiAngerOverride = 0; +ForageSiteStock = 100; +ForageSiteNbUpdatesToLive = 10; +ForageSiteRadius = 9.0; +ForageExtractionTimeMinGC = 230.0; +ForageExtractionTimeSlopeGC = 2.0; +ForageQuantityBaseRate = 0; +ForageQuantityBrick1 = 0.34; //0.3; +ForageQuantityBrick2 = 0.386; // 0.32; +ForageQuantityBrick3 = 0.432; // 0.34 +ForageQuantityBrick4 = 0.478; // 0.36; +ForageQuantityBrick5 = 0.524; // 0.38; +ForageQuantityBrick6 = 0.57; // 0.4; +ForageQuantityBrick7 = 0.34; // 0.3; +ForageQuantityBrick8 = 0.386; // 0.32; +ForageQuantityBrick9 = 0.432; // 0.34; +ForageQuantityBrick10 = 0.478; // 0.36; +ForageQuantityBrick11 = 0.524; // 0.38; +ForageQuantityBrick12 = 0.57; // 0.4; +ForageQuantitySlowFactor = 0.5; +ForageQualitySlowFactor = 1.69; +ForageQualitySlowFactorQualityLevelRatio = 0.01; +ForageQualitySlowFactorDeltaLevelRatio = 0.08; +ForageQualitySlowFactorMatSpecRatio = 0.8; +ForageQualityCeilingFactor = 1.1; +ForageQualityCeilingClamp = 1; +ForageQuantityImpactFactor = 20.0; +ForageQualityImpactFactor = 1.5; +ForageExtractionAbsorptionMatSpecFactor = 4.0; +ForageExtractionAbsorptionMatSpecMax = 0.8; +ForageExtractionCareMatSpecFactor = 1.2; +ForageExtractionAbsorptionEcoSpecFactor = 3.0; +ForageExtractionAbsorptionEcoSpecMax = 0.8; +ForageExtractionCareEcoSpecFactor = 1.1; +ForageExtractionNaturalDDeltaPerTick = 0.1; +ForageExtractionNaturalEDeltaPerTick = 0.1; +ForageCareFactor = 4.0; +ForageCareBeginZone = 5.0; +ForageHPRatioPerSourceLifeImpact = 0.003937; +ForageExplosionDamage = 3000.0; +ToxicCloudDamage = 600.0; +ForageCareSpeed = 0.05; +ForageKamiOfferingSpeed = 0.02; +ForageDebug = 0; +ForageSourceSpawnDelay = 50; +ForageFocusRatioOfLocateDeposit = 10; +ForageFocusAutoRegenRatio = 1.0; +ForageReduceDamageTimeWindow = 30; +ForageExtractionXPFactor = 9.0; +ForageQuantityXPDeltaLevelBonusRate = 2.0; +ForageProspectionXPBonusRatio = 0.2; +ForageExtractionNbParticipantsXPBonusRatio = 0.1; +ForageExtractionNastyEventXPMalusRatio = 0.1; + +QuarteringQuantityAverageForCraftHerbivore = 2.5; +QuarteringQuantityAverageForCraftCarnivore = 5.0; +QuarteringQuantityAverageForMissions = 1.0; +QuarteringQuantityAverageForBoss5 = 10; +QuarteringQuantityAverageForBoss7 = 60; +QuarteringQuantityForInvasion5 = 40; +QuarteringQuantityForInvasion7 = 80; + +LootMoneyAmountPerXPLevel = 10.0; + +VerboseQuartering = 0; + +// Shutdown handling + +// Time to shutdown server in minutes +ShutdownCounter = 5; + +// Time between to shutdown messages in seconds +BroadcastShutdownMessageRate = 30; + +// Time to shutdown to close access to welcome service, in seconds +CloseShardAccessAt = 300; + +// Persistent Logging + +DatabaseId = 0; + +// delay during character stay in game after disconnection +TimeBeforeDisconnection = 300; + +// File that contains the privileges for client commands +ClientCommandsPrivilegesFile = "client_commands_privileges.txt"; + +// File that contains the info on the current event on the server +GameEventFile = "game_event.txt"; + +// Privilege needed for banner +BannerPriv = ":G:SG:GM:VG:SGM:"; +// Privilege that never aggro the bots +NeverAggroPriv = ":OBSERVER:G:SG:GM:SGM:EM:"; +// Privilege always invisible +AlwaysInvisiblePriv = ":OBSERVER:EM:"; +// Privilege to teleport with a mektoub +TeleportWithMektoubPriv = ":GM:SGM:DEV:"; +// Privilege that forbid action execution +NoActionAllowedPriv = ":OBSERVER"; +// Privilege that bypass value and score checking +NoValueCheckingPriv = ":GM:SGM:DEV:EM:EG:"; +// Privilege that prevent being disconnected in case of shard closing for technical problem +NoForceDisconnectPriv = ":GM:SGM:DEV:"; + +// File used to save position flags +PositionFlagsFile = "position_flags.xml"; + +// load PVP zones from primitives? +LoadPVPFreeZones = 1; +LoadPVPVersusZones = 1; +LoadPVPGuildZones = 1; + +// buffer time in ticks used when entering/leaving a PVP zone +PVPZoneEnterBufferTime = 300; +PVPZoneLeaveBufferTime = 1200; +PVPZoneWarningRepeatTime = 50; +PVPZoneWarningRepeatTimeL = 3000; + +// If 1, use the Death Penalty factor from the PVPZone primitive, else no death penalty +PVPZoneWithDeathPenalty = 1; + +// if 1, pvp duel/challenge will be disabled +DisablePVPDuel = 0; +DisablePVPChallenge = 1; + +// Fame Variables +// All values are multiplied by 6000 compared to values displayed on the client. +FameMinToDeclare = 180000; +FameWarningLevel = 30000; +FameMinToRemain = 0; +FameMinToTrade = -180000; +FameMinToKOS = -300000; +FameMaxDefault = 600000; +FameAbsoluteMin = -600000; +FameAbsoluteMax = 600000; + +FameStartFyrosvFyros = 120000; +FameStartFyrosvMatis = -120000; +FameStartFyrosvTryker = -60000; +FameStartFyrosvZorai = 60000; +FameStartMatisvFyros = -120000; +FameStartMatisvMatis = 120000; +FameStartMatisvTryker = 60000; +FameStartMatisvZorai = -60000; +FameStartTrykervFyros = -60000; +FameStartTrykervMatis = 60000; +FameStartTrykervTryker = 120000; +FameStartTrykervZorai = -120000; +FameStartZoraivFyros = 60000; +FameStartZoraivMatis = -60000; +FameStartZoraivTryker = -120000; +FameStartZoraivZorai = 120000; +FameStartFyrosvKami = 60000; +FameStartFyrosvKaravan = -60000; +FameStartMatisvKami = -120000; +FameStartMatisvKaravan = 120000; +FameStartTrykervKami = -60000; +FameStartTrykervKaravan = 60000; +FameStartZoraivKami = 120000; +FameStartZoraivKaravan = -120000; + +FameMaxNeutralvFyros = 300000; +FameMaxNeutralvMatis = 300000; +FameMaxNeutralvTryker = 300000; +FameMaxNeutralvZorai = 300000; +FameMaxFyrosvFyros = 600000; +FameMaxFyrosvMatis = 0; +FameMaxFyrosvTryker = 150000; +FameMaxFyrosvZorai = 450000; +FameMaxMatisvFyros = 0; +FameMaxMatisvMatis = 600000; +FameMaxMatisvTryker = 450000; +FameMaxMatisvZorai = 150000; +FameMaxTrykervFyros = 150000; +FameMaxTrykervMatis = 450000; +FameMaxTrykervTryker = 600000; +FameMaxTrykervZorai = 0; +FameMaxZoraivFyros = 450000; +FameMaxZoraivMatis = 150000; +FameMaxZoraivTryker = 0000; +FameMaxZoraivZorai = 600000; +FameMaxNeutralvKami = 300000; +FameMaxNeutralvKaravan = 300000; +FameMaxKamivKami = 600000; +FameMaxKamivKaravan = -300000; +FameMaxKaravanvKami = -300000; +FameMaxKaravanvKaravan = 600000; + +// Log switches, turns nlinfo on/off +NameManagerLogEnabled = 1; +GameItemLogEnabled = 1; +EntityCallbacksLogEnabled = 1; +EntityManagerLogEnabled = 1; +GuildManagerLogEnabled = 1; +ForageExtractionLogEnabled = 0; +PhraseManagerLogEnabled = 1; +CharacterLogEnabled = 1; +PlayerLogEnabled = 1; +ShoppingLogEnabled = 0; +PVPLogEnabled = 1; +PersistentPlayerDataLogEnabled = 0; + +DailyShutdownSequenceTime = ""; +DailyShutdownBroadcastMessage = "The shard will be shut down in 1 minute"; +DailyShutdownCounterMinutes = 1; +CheckShutdownPeriodGC = 50; + +PlayerChannelHistoricSize = 50; + +FlushSendingQueuesOnExit = 1; +NamesOfOnlyServiceToFlushSending = "BS"; + +// stat database save period in ticks +StatDBSavePeriod = 20; + +// New Newbieland +UseNewNewbieLandStartingPoint= 1; + +// The domain mainlands configuration +Mainlands = { + "#SHARDID#", "#UC_SHARDNAME#", "#SHARDDESC#)", "en", +}; + +FreeTrialSkillLimit = 125; diff --git a/ryzom/server/tools/cfg_creator/templates/entity_view_service.cfg b/ryzom/server/tools/cfg_creator/templates/entity_view_service.cfg new file mode 100644 index 000000000..c3135cdc7 --- /dev/null +++ b/ryzom/server/tools/cfg_creator/templates/entity_view_service.cfg @@ -0,0 +1,26 @@ +// link the common configuration file +RootConfigFilename = "common.cfg"; + +//NSHost = "itsalive2"; +//NSHost = "pc27"; +//NSHost = "ldserver01"; +//NSHost = "gamedev4"; +//NSHost = "stephanec"; +NSHost = "localhost"; +NSPort = 50000; + +WindowStyle = "WIN"; + +StartCommands = +{ +// "goTo 17960 -33180 10", +// "goTo 16240 -24800 10", +// "goTo 1760 -1440 60", + "goTo 2520 -2100 -5", + "setUpdateTimeout 100", +}; + +Paths += { "data_leveldesign", "data_shard" }; + +DontUseAES = 1; + diff --git a/ryzom/server/tools/cfg_creator/templates/event_manager.cfg b/ryzom/server/tools/cfg_creator/templates/event_manager.cfg new file mode 100644 index 000000000..3fdc5962c --- /dev/null +++ b/ryzom/server/tools/cfg_creator/templates/event_manager.cfg @@ -0,0 +1,6 @@ +RootConfigFilename = "general_utilities_service_events.cfg"; + +Users += +{ + // "user_name pass_phrase" +}; diff --git a/ryzom/server/tools/cfg_creator/templates/frontend_service.cfg b/ryzom/server/tools/cfg_creator/templates/frontend_service.cfg new file mode 100644 index 000000000..6a999deff --- /dev/null +++ b/ryzom/server/tools/cfg_creator/templates/frontend_service.cfg @@ -0,0 +1,53 @@ +// Use with commandline: frontend_service -C. -L. --nobreak --writepid + +// ---- config local variables + +// Client bandwidth ratio, set to 1 for standard opration, more than one allocate more bandwidth +BandwidthRatio = 1; + +FSUDPPort = 47851; + +FSListenHost = "#HOSTNAME#"; + +#include "frontend_service_default.cfg" + +// ---- service NeL variables (used by ConfigFile class) + +AESAliasName= "fes"; + +GraphVars += { "TickSpeedLoop", "0" }; +GraphVars += { "TickSpeedLoop", "60000" }; +GraphVars += { "L5CallbackCount", "0" }; +GraphVars += { "L5CallbackCount", "60000" }; +GraphVars += { "L5CallbackTime", "0" }; +GraphVars += { "L5CallbackTime", "60000" }; +GraphVars += { "MirrorCallbackCount", "0" }; +GraphVars += { "MirrorCallbackCount", "60000" }; +GraphVars += { "MirrorCallbackTime", "0" }; +GraphVars += { "MirrorCallbackTime", "60000" }; + +Paths += { + "../data", + "../common", + "../common/data_leveldesign", +}; + +// ---- service NeL variables (used by CVariable class) + +// ---- service custom variables (used by ConfigFile class) + +//AcceptInvalidCookie = 1; + +ClientLimit = 3000; + +// Mirror limits +DatasetSizefe_temp = 700000; +DatasetSizefame = 26000; + +// ---- service custom variables (used by CVariable class) + +// Disable ryzom verbose logging +VerboseMIRROR = 0; + +// Root directory where data from shards are stored into +SaveShardRoot = "../save/"; diff --git a/ryzom/server/tools/cfg_creator/templates/frontend_service_default.cfg b/ryzom/server/tools/cfg_creator/templates/frontend_service_default.cfg new file mode 100644 index 000000000..b87682906 --- /dev/null +++ b/ryzom/server/tools/cfg_creator/templates/frontend_service_default.cfg @@ -0,0 +1,104 @@ +#include "common.cfg" + +// Configure module gateway for front end operation +StartCommands += +{ + // Add a security plugin (will add player info on player module proxy) + "gw.securityCreate FESecurity", + // create a front end service transport + "gw.transportAdd FEServer fes", + // set the transport option (need PeerInvisible and Firewalled) + "gw.transportOptions fes(PeerInvisible Firewalled)", + // open the transport + "gw.transportCmd fes(open)", +}; + + +// UDP port for client communication +//FrontendPort = 47851; + +ListenAddress = FSListenHost+":"+FSUDPPort; + +// Maximum size that can be read from a client message +DatagramLength = 10000; + +// Time-out before removing a client when it does not send any more data +ClientTimeOut = 600000; // 10 min + +// Time-out before removing a limbo client when it does not send any more data +LimboTimeOut = 60000; // 1 min + +// Maximum bytes per game cycle sent to all clients (currently not used/implemented) +TotalBandwidth = 536870911; // <512 MB : max value for 32 bit bitsize ! + +// Maximum bytes per game cycle sent to a client, including all headers +ClientBandwidth = 332 * BandwidthRatio; // 332 <=> 13 kbit/s at 5 Hz; 202 <=> 16 kbit/s at 10 Hz + +// Maximum bytes for impulsion channels per datagram sent to a client +ImpulsionByteSize0 = 20 * BandwidthRatio; +ImpulsionByteSize1 = 200 * BandwidthRatio; +ImpulsionByteSize2 = 200 * BandwidthRatio; +NbMinimalVisualBytes = 50; + +// Distance/delta ratio that triggers the sending of a position +DistanceDeltaRatioForPos = 100; + +// Number of game cycles per front-end cycle +GameCycleRatio = 1; +// Execution period of distance calculation +CalcDistanceExecutionPeriod = 8; +// Execution period of position prioritization +PositionPrioExecutionPeriod = 2; +// Execution period of orientation prioritization +OrientationPrioExecutionPeriod = 8; +// Execution period of discreet properties prioritization +DiscreetPrioExecutionPeriod = 2; + +SortPrioExecutionPeriod = 1; + +// Display or not the "FE" nlinfos +DisplayInfo = 1; + +// Prioritizer mode (currently the only mode is 1 for DistanceDelta) +PriorityMode = 1; + +// Strategy for selecting pairs to prioritize (Power2WithCeiling=0, Scoring=1) +SelectionStrategy = 1; + +// Minimum number of pairs to select for prioritization +MinNbPairsToSelect = 2000; + +// Index of client to monitor, or 0 for no monitoring +ClientMonitor = 0; + +// Allow or not beeping +AllowBeep = 1; + +Lag = 0; // The lag on the simulated network (used by simlag) +PacketLoss = 0; // percentage of lost packet (used by simlag) +PacketDuplication = 0; // percentage of duplicated packet (used by simlag) +PacketDisordering = 0; // percentage of disordered packet (used by simlag) (Lag must be >100 to use disordering) + +// ---------------------------------------- +// Frontend/Patch mode settings + +// If 1, the frontend server is used in Patch/Frontend mode (0 = only frontend mode, old behaviour) +UseWebPatchServer = 1; + +// If 0, the frontend service is in Patch mode at startup, and it won't accept clients unless WS tells it to do so. +AcceptClientsAtStartup = 1; + +// Patch URL footer. PatchURL will look like 'http://223.254.124.23:43435/patch' +PatchingURLFooter = ":43435/patch"; + +// System command to be executed when FS tries to start Web Patch server (ideally at FS startup) +StartWebServerSysCommand = ""; + +// System command to be executed when FS tries to stop Web Patch server (ideally when FS turns to frontend mode) +StopWebServerSysCommand = ""; + +// Use Thread for sending +UseSendThread = 1; + +// Unidirectional Mirror mode (FS part) +ExpediteTOCK = 1; diff --git a/ryzom/server/tools/cfg_creator/templates/general_utilities_service.cfg b/ryzom/server/tools/cfg_creator/templates/general_utilities_service.cfg new file mode 100644 index 000000000..339e17a18 --- /dev/null +++ b/ryzom/server/tools/cfg_creator/templates/general_utilities_service.cfg @@ -0,0 +1,28 @@ +// link the common configuration file +RootConfigFilename = "general_utilities_service_default.cfg"; + +DontUseAES = 0; +DontUseNS = 1; +DontUseTS = 1; + +NSHost="localhost"; + +Paths += {}; +//PathsNoRecurse = {"r:/code/ryzom/data_leveldesign/leveldesign/Game_elem"}; +GeorgePaths = {}; +WriteFilesDirectory = ""; +SaveFilesDirectory = ""; + +StartCommands = +{ + "" + +// ,"modulesAdd gushub 1234" +// ,"modulesAdd gusnet localhost:1234" + +// ,"modulesAdd cc test1 2" +// ,"ccLoad test.ccs" + +// ,"modulesAdd ce en test1" +// ,"ccRun" +}; diff --git a/ryzom/server/tools/cfg_creator/templates/general_utilities_service_admin.cfg b/ryzom/server/tools/cfg_creator/templates/general_utilities_service_admin.cfg new file mode 100644 index 000000000..3125b7994 --- /dev/null +++ b/ryzom/server/tools/cfg_creator/templates/general_utilities_service_admin.cfg @@ -0,0 +1,5 @@ +// link the common configuration file +RootConfigFilename = "general_utilities_service_common.cfg"; + +DontUseNS = 1; +DontUseTS = 1; diff --git a/ryzom/server/tools/cfg_creator/templates/general_utilities_service_common.cfg b/ryzom/server/tools/cfg_creator/templates/general_utilities_service_common.cfg new file mode 100644 index 000000000..ca307ef01 --- /dev/null +++ b/ryzom/server/tools/cfg_creator/templates/general_utilities_service_common.cfg @@ -0,0 +1,50 @@ +// by default, use WIN displayer +WindowStyle = "WIN"; + +// set to 0 if you want to use the admin system +DontUseAES = 1; + +Paths = +{ + "data_shard" +}; + +PathsNoRecurse = +{ + "data_leveldesign/leveldesign/Game_elem", // for sheet_id.bin +}; + +// where to save generic shard data (ie: packed_sheet) +WriteFilesDirectory = ""; + +// where to save specific shard data (ie: player backup) +SaveFilesDirectory = ""; + +//NegFiltersDebug += { "NET", "ADMIN", "MIRROR", "NC", "PATH" }; +//NegFiltersInfo += { "NET", "ADMIN", "MIRROR", "NC", "CF", "TimerManagerUpdate" }; +//NegFiltersWarning += { "CT_LRC", "AnimalSpawned" }; + +FontName = "Lucida Console"; +FontSize = 9; + +// If the update loop is too slow, a thread will produce an assertion. +// By default, the value is set to 10 minutes. +// Set to 0 for no assertion. +UpdateAssertionThreadTimeout = 0; + +DefaultMaxExpectedBlockSize = 200000000; // 200 M ! +DefaultMaxSentBlockSize = 200000000; // 200 M ! + +// how to sleep between to network update +// 0 = pipe +// 1 = usleep +// 2 = nanosleep +// 3 = sched_yield +// 4 = nothing +UseYieldMethod = 0; + +StartCommands += +{ + "" + ,"modulesAdd gusnet localhost:44748" +}; diff --git a/ryzom/server/tools/cfg_creator/templates/general_utilities_service_events.cfg b/ryzom/server/tools/cfg_creator/templates/general_utilities_service_events.cfg new file mode 100644 index 000000000..2097698ed --- /dev/null +++ b/ryzom/server/tools/cfg_creator/templates/general_utilities_service_events.cfg @@ -0,0 +1,74 @@ +// By default, use WIN displayer +WindowStyle = "WIN"; + +PathsNoRecurse = +{ + "data_leveldesign/leveldesign/Game_elem", // for sheet_id.bin +}; + +// set to 0 if you want to use the admin system +DontUseAES = 1; +DontUseNS = 1; +DontUseTS = 1; + +// where to save specific shard data (ie: player backup) +SaveFilesDirectory = ""; + +NegFiltersDebug += { "NET", "ADMIN", "MIRROR", "NC", "PATH" }; +NegFiltersInfo += { "NET", "SERVICE", "ADMIN", "MIRROR", "NC", "CF", "TimerManagerUpdate", "addSearchPath", "Executing command", "GUSNET" }; +NegFiltersWarning += { "LNETL", "CT_LRC" }; + +FontName = "Lucida Console"; +FontSize = 9; + +// If the update loop is too slow, a thread will produce an assertion. +// By default, the value is set to 10 minutes. +// Set to 0 for no assertion. +UpdateAssertionThreadTimeout = 0; + +DefaultMaxExpectedBlockSize = 200000000; // 200 M ! +DefaultMaxSentBlockSize = 200000000; // 200 M ! + +// how to sleep between to network update +// 0 = pipe +// 1 = usleep +// 2 = nanosleep +// 3 = sched_yield +// 4 = nothing +UseYieldMethod = 0; + +StartCommands += +{ + "" + +// ,"modulesAdd gushub 44748" +// ,"modulesAdd gusnet localhost:44748" + + ,"modulesAdd gusnet 213.208.119.219:44748" + ,"modulesAdd em" +// ,"modulesAdd ee enx ais egs ios" +}; + +Users += +{ + "" + + ,"sadge thata boy" + ,"ravna LeafaithinLlanfrechfa2405" +}; + +DisplayedVariables += +{ + "" + ,"EventName" + ,"" + ,"ActiveShard" + ,"" +// ,"@SetEvent|emWinSetEvent" + ,"@NewEvent|emWinNewEvent" + ,"@Login|emWinLogin" + ,"@Upload|emWinUpload" + ,"" + ,"@View Installed Event|emPeek" + ,"@Unload Installed Event|emUnload" +}; diff --git a/ryzom/server/tools/cfg_creator/templates/general_utilities_service_hub.cfg b/ryzom/server/tools/cfg_creator/templates/general_utilities_service_hub.cfg new file mode 100644 index 000000000..cc114e3ad --- /dev/null +++ b/ryzom/server/tools/cfg_creator/templates/general_utilities_service_hub.cfg @@ -0,0 +1,9 @@ +// link the common configuration file +RootConfigFilename = "general_utilities_service_admin.cfg"; + +StartCommands = +{ + "" + + ,"modulesAdd gushub 44748" +}; diff --git a/ryzom/server/tools/cfg_creator/templates/general_utilities_service_shard.cfg b/ryzom/server/tools/cfg_creator/templates/general_utilities_service_shard.cfg new file mode 100644 index 000000000..d0cc7e591 --- /dev/null +++ b/ryzom/server/tools/cfg_creator/templates/general_utilities_service_shard.cfg @@ -0,0 +1,19 @@ +// link the common configuration file +RootConfigFilename = "general_utilities_service_common.cfg"; + +DontUseNS = 0; +DontUseTS = 1; +UseMirror= 1; + +NSHost = "localhost"; + +GUSMirrorConfig = +{ + "dataset fe_temp", + "property NameIndex rn", +}; + + +DisplayedVariables += { "", "SlowestService", "SlowestTock", "", "WaitingForServices", "", "@Pause|pause" }; + +NegFiltersDebug += { "LNETL" } ; diff --git a/ryzom/server/tools/cfg_creator/templates/general_utilities_service_suk01.cfg b/ryzom/server/tools/cfg_creator/templates/general_utilities_service_suk01.cfg new file mode 100644 index 000000000..4c3ffb644 --- /dev/null +++ b/ryzom/server/tools/cfg_creator/templates/general_utilities_service_suk01.cfg @@ -0,0 +1,9 @@ +// link the common configuration file +RootConfigFilename = "general_utilities_service_shard.cfg"; + +StartCommands += +{ + "" + + ,"modulesAdd ce fr uk" +}; diff --git a/ryzom/server/tools/cfg_creator/templates/general_utilities_service_suk02.cfg b/ryzom/server/tools/cfg_creator/templates/general_utilities_service_suk02.cfg new file mode 100644 index 000000000..121b0d02b --- /dev/null +++ b/ryzom/server/tools/cfg_creator/templates/general_utilities_service_suk02.cfg @@ -0,0 +1,9 @@ +// link the common configuration file +RootConfigFilename = "general_utilities_service_shard.cfg"; + +StartCommands += +{ + "" + + ,"modulesAdd ce de uk" +}; diff --git a/ryzom/server/tools/cfg_creator/templates/general_utilities_service_suk03.cfg b/ryzom/server/tools/cfg_creator/templates/general_utilities_service_suk03.cfg new file mode 100644 index 000000000..97cb43479 --- /dev/null +++ b/ryzom/server/tools/cfg_creator/templates/general_utilities_service_suk03.cfg @@ -0,0 +1,10 @@ +// link the common configuration file +RootConfigFilename = "general_utilities_service_shard.cfg"; + +StartCommands += +{ + "" + + ,"modulesAdd ce en uk" + ,"ceChatTexts gus_ce_chat_texts_en.txt" +}; diff --git a/ryzom/server/tools/cfg_creator/templates/general_utilities_service_sus01.cfg b/ryzom/server/tools/cfg_creator/templates/general_utilities_service_sus01.cfg new file mode 100644 index 000000000..da611ab34 --- /dev/null +++ b/ryzom/server/tools/cfg_creator/templates/general_utilities_service_sus01.cfg @@ -0,0 +1,9 @@ +// link the common configuration file +RootConfigFilename = "general_utilities_service_shard.cfg"; + +StartCommands += +{ + "" + + ,"modulesAdd ce en us" +}; diff --git a/ryzom/server/tools/cfg_creator/templates/general_utilities_service_ukops.cfg b/ryzom/server/tools/cfg_creator/templates/general_utilities_service_ukops.cfg new file mode 100644 index 000000000..e319c0e82 --- /dev/null +++ b/ryzom/server/tools/cfg_creator/templates/general_utilities_service_ukops.cfg @@ -0,0 +1,19 @@ +// link the common configuration file +RootConfigFilename = "general_utilities_service_admin.cfg"; + +StartCommands += +{ + "" + + ,"modulesAdd cc uk 2" + ,"ccLoad" + ,"ccShow" +}; + +DisplayedVariables += +{ + "@Reload|ccLoad" + ,"@Start|ccRun" + ,"@Advance|ccAdvance" + ,"@Stop|ccQuit" +}; diff --git a/ryzom/server/tools/cfg_creator/templates/general_utilities_service_usops.cfg b/ryzom/server/tools/cfg_creator/templates/general_utilities_service_usops.cfg new file mode 100644 index 000000000..ffb1f0f63 --- /dev/null +++ b/ryzom/server/tools/cfg_creator/templates/general_utilities_service_usops.cfg @@ -0,0 +1,19 @@ +// link the common configuration file +RootConfigFilename = "general_utilities_service_admin.cfg"; + +StartCommands += +{ + "" + + ,"modulesAdd cc us 10" + ,"ccLoad" + ,"ccShow" +}; + +DisplayedVariables += +{ + "@Reload|ccLoad" + ,"@Start|ccRun" + ,"@Advance|ccAdvance" + ,"@Stop|ccQuit" +}; diff --git a/ryzom/server/tools/cfg_creator/templates/gpm_service.cfg b/ryzom/server/tools/cfg_creator/templates/gpm_service.cfg new file mode 100644 index 000000000..1bb4361ff --- /dev/null +++ b/ryzom/server/tools/cfg_creator/templates/gpm_service.cfg @@ -0,0 +1,47 @@ +// Use with commandline: gpm_service -C. -L. --nobreak --writepid + +#include "gpm_service_default.cfg" + +// ---- config local variables + +// ---- service NeL variables (used by ConfigFile class) + +AESAliasName= "gpms"; + +GraphVars += { "TickSpeedLoop", "0" }; +GraphVars += { "TickSpeedLoop", "60000" }; +GraphVars += { "L5CallbackCount", "0" }; +GraphVars += { "L5CallbackCount", "60000" }; +GraphVars += { "L5CallbackTime", "0" }; +GraphVars += { "L5CallbackTime", "60000" }; +GraphVars += { "MirrorCallbackCount", "0" }; +GraphVars += { "MirrorCallbackCount", "60000" }; +GraphVars += { "MirrorCallbackTime", "0" }; +GraphVars += { "MirrorCallbackTime", "60000" }; + +Paths += { + "../data", + "../common", + "../common/data_leveldesign", +}; + +// ---- service NeL variables (used by CVariable class) + +// ---- service custom variables (used by ConfigFile class) + +#include "used_continents.cfg" + +// Mirror limits +DatasetSizefe_temp = 700000; +DatasetSizefame = 26000; + +// ---- service custom variables (used by CVariable class) + +// Set this shard as a ring (1) or mainland (0) shard (main behavior switch) +IsRingShard = 0; + +// Disable ryzom verbose logging +VerboseMIRROR = 0; + +WorldMapSizeX = 3000; +WorldMapSizeY = 3000; diff --git a/ryzom/server/tools/cfg_creator/templates/gpm_service_default.cfg b/ryzom/server/tools/cfg_creator/templates/gpm_service_default.cfg new file mode 100644 index 000000000..200eb0ed6 --- /dev/null +++ b/ryzom/server/tools/cfg_creator/templates/gpm_service_default.cfg @@ -0,0 +1,7 @@ +#include "common.cfg" + +CheckPlayerSpeed = 0; +SecuritySpeedFactor = 1.2; + +LoadPacsPrims = 0; +LoadPacsCol = 1; diff --git a/ryzom/server/tools/cfg_creator/templates/gus_test.cfg b/ryzom/server/tools/cfg_creator/templates/gus_test.cfg new file mode 100644 index 000000000..51a3576ce --- /dev/null +++ b/ryzom/server/tools/cfg_creator/templates/gus_test.cfg @@ -0,0 +1,74 @@ +// By default, use WIN displayer +WindowStyle = "WIN"; + +PathsNoRecurse = +{ + "data_leveldesign/leveldesign/Game_elem", // for sheet_id.bin +}; + +// set to 0 if you want to use the admin system +DontUseAES = 1; +DontUseNS = 1; +DontUseTS = 1; +NSHost="localhost"; + +// where to save specific shard data (ie: player backup) +SaveFilesDirectory = ""; + +NegFiltersDebug += { "NET", "ADMIN", "MIRROR", "NC", "PATH" }; +NegFiltersInfo += { "NET", "SERVICE", "ADMIN", "MIRROR", "NC", "CF", "TimerManagerUpdate", "addSearchPath" }; +NegFiltersWarning += { "LNETL", "CT_LRC", "Ignoring map key (__Key__) because __Val__" }; + +//FontName = "Lucida Console"; +FontName = "Courier New"; +FontSize = 9; + +// If the update loop is too slow, a thread will produce an assertion. +// By default, the value is set to 10 minutes. +// Set to 0 for no assertion. +UpdateAssertionThreadTimeout = 0; + +DefaultMaxExpectedBlockSize = 200000000; // 200 M ! +DefaultMaxSentBlockSize = 200000000; // 200 M ! + +// how to sleep between to network update +// 0 = pipe +// 1 = usleep +// 2 = nanosleep +// 3 = sched_yield +// 4 = nothing +UseYieldMethod = 0; + +StartCommands += +{ + "modulesAdd ss", + "ssScrLoad general_utilities_service.gss", + "ssScrDisplay", + "ssScrRoutineRun doTests", +}; + +Users = +{ + "" + + ,"sadge thata boy" +}; + +DisplayedVariables += +{ + "" +// ,"@NewEvent|emWinNewEvent" +// ,"EventName" +// ,"" +// ,"@Login|emWinLogin" +// ,"ActiveShard" +// ,"" +// ,"@Upload|emWinUpload" +// ,"@View Installed Event|emWinPeek" +// ,"@Start Event|emWinEventStart" +// ,"" +// ,"@Stop Event|emWinEventStop" +// ,"@Unload Installed Event|emWinUnload" + + ,"ScanJobState" +}; diff --git a/ryzom/server/tools/cfg_creator/templates/input_output_service.cfg b/ryzom/server/tools/cfg_creator/templates/input_output_service.cfg new file mode 100644 index 000000000..ee17bca50 --- /dev/null +++ b/ryzom/server/tools/cfg_creator/templates/input_output_service.cfg @@ -0,0 +1,79 @@ +// Use with commandline: input_output_service -C. -L. --nobreak --writepid + +// ---- config local variables + +#define DONT_USE_LGS_SLAVE + +AESPort="46702"; +SUPort = 50505; +SUGlobalPort = 50503; +L3MasterLGSPort = 41292; +L3SlaveLGSPort = 49993; +SUHost = "localhost"; +MasterLGSHost = "localhost"; +SlaveLGSHost = "localhost"; +// SU - listen address of the SU service (for L5 connections) +SUAddress = SUHost+":"+SUPort; + +#include "input_output_service_default.cfg" + +// ---- service NeL variables (used by ConfigFile class) + +AESAliasName= "ios"; + +// Create a char name mapper +StartCommands += +{ +"moduleManager.createModule CharNameMapper cnm", +"cnm.plug gw", +"moduleManager.createModule IOSRingModule iosrm", +"iosrm.plug gw", +}; + +Paths += { + "../language/translated", +}; + +// ---- service NeL variables (used by CVariable class) + +// ---- service custom variables (used by ConfigFile class) + +// Mirror limits +DatasetSizefe_temp = 700000; +DatasetSizefame = 26000; + +// the following variable must be defined but should be empty - it's presence is used to change the behaviour +// of the packed sheet reader +GeorgePaths = { "" }; + +// Use Shard Unifier or not +DontUseSU = 0; + +HomeMainlandNames = +{ + "#SHARDID#", "#UC_SHARDNAME#", "#SHARDNAME#", +}; + +// ---- service custom variables (used by CVariable class) + +// Set this shard as a ring (1) or mainland (0) shard (main behavior switch) +IsRingShard = 0; + +// Disable ryzom verbose logging +VerboseMIRROR = 0; + +#include "backup_service_interface.cfg" + +// IOS - Directory to store ios.string_cache file +StringManagerCacheDirectory = "../cache"; + +// IOS - Directory to log chat into +LogChatDirectory = "../logs/chat"; + +ReadTranslationWork = 0; +TranslationWorkPath = ""; +VerboseStringManager = 0; +VerboseStringManagerParser = 0; +VerboseChat = 0; +VerboseChatManagement = 0; +VerboseNameTranslation = 0; diff --git a/ryzom/server/tools/cfg_creator/templates/input_output_service_default.cfg b/ryzom/server/tools/cfg_creator/templates/input_output_service_default.cfg new file mode 100644 index 000000000..b4a1bfe2d --- /dev/null +++ b/ryzom/server/tools/cfg_creator/templates/input_output_service_default.cfg @@ -0,0 +1,94 @@ +#include "common.cfg" + +// ---- service NeL variables (used by ConfigFile class) + +StartCommands += +{ + // L5 connect to the shard unifier + "unifiedNetwork.addService ShardUnifier ( address="+SUAddress+" sendId external autoRetry )", + + // Create a gateway for global interconnection + // modules from different shard are visible to each other if they connect to + // this gateway. SU Local module have no interest to be plugged here. + "moduleManager.createModule StandardGateway glob_gw", + // add a layer 3 server transport + "glob_gw.transportAdd L3Client l3c", + // open the transport + "glob_gw.transportCmd l3c(connect addr="+SUHost+":"+SUGlobalPort+")", + + // Create a gateway for logger service connection + "moduleManager.createModule StandardGateway lgs_gw", + + // add a layer 3 server transport for master logger service + "lgs_gw.transportAdd L3Client masterL3c", + // open the transport + "lgs_gw.transportCmd masterL3c(connect addr="+MasterLGSHost+":"+L3MasterLGSPort+")", +}; + +#ifndef DONT_USE_LGS_SLAVE + +StartCommands += +{ + // add a layer 3 server transport for slave logger service + "lgs_gw.transportAdd L3Client slaveL3c", + // open the transport + "lgs_gw.transportCmd slaveL3c(connect addr="+SlaveLGSHost+":"+L3SlaveLGSPort+")", +}; + +#endif + +StartCommands += +{ + // Create a chat unifier client + "moduleManager.createModule ChatUnifierClient cuc", + + // and plug it on the gateway to reach the SU ChatUnifierServer + "cuc.plug glob_gw", + "cuc.plug gw", + + // Create the logger service client module + "moduleManager.createModule LoggerServiceClient lsc", + "lsc.plug lgs_gw", +}; + +#endif + +// ---- service NeL variables (used by CVariable class) + +// ---- service custom variables (used by ConfigFile class) + +// a list of system command that can be run with "sysCmd" service command. +SystemCmd = {}; + +// IOS don't use work directory by default +ReadTranslationWork = 0; +TranslationWorkPath = "translation/work"; + +// Global shard bot name translation file. You sould overide this +// in input_output_service.cfg to specialize the file +// depending on the shard main language. +BotNameTranslationFile = "bot_names.txt"; + +// Global shard event faction translation file. You sould override this +// in input_output_service.cfg to specialize the file +// depending on the shard main language. +EventFactionTranslationFile = "event_factions.txt"; + + // ---- service custom variables (used by CVariable class) + +// Activate/deactivate debugging of missing paremeter replacement +DebugReplacementParameter = 1; + +// Default verbose debug flags: +//----------------------------- + +// Log bot name translation from 'BotNameTranslationFile' +VerboseNameTranslation = 1; +// Log chat management operation +VerboseChatManagement = 1; +// Log chat event +VerboseChat = 1; +// Log string manager message +VerboseStringManager = 1; +// Log the string manager parsing message +VerboseStringManagerParser = 0; diff --git a/ryzom/server/tools/cfg_creator/templates/log_analyser_service_default.cfg b/ryzom/server/tools/cfg_creator/templates/log_analyser_service_default.cfg new file mode 100644 index 000000000..11e7e1ebf --- /dev/null +++ b/ryzom/server/tools/cfg_creator/templates/log_analyser_service_default.cfg @@ -0,0 +1,18 @@ +// link the common configuration file +RootConfigFilename = "common.cfg"; + +QueryTimeout = 300; +LinePerPage = 50; + +WebPort = 49899; + +DontUseNS = 1; + +/* Set this directory so LAS can find log directory for each shard + * PLEASE NOTICE THAT THIS LINE SHOULD ONLY BE ADDED TO LOG ANALYSER + * Other services that use PDLib should have this set to "". + */ +StartCommands = +{ + "PDRootDirectory /home/nevrax/save_shard/$shard/pds" +}; diff --git a/ryzom/server/tools/cfg_creator/templates/logger_service.cfg b/ryzom/server/tools/cfg_creator/templates/logger_service.cfg new file mode 100644 index 000000000..b2b6f9686 --- /dev/null +++ b/ryzom/server/tools/cfg_creator/templates/logger_service.cfg @@ -0,0 +1,50 @@ +// Use with commandline: logger_service -C. -L. --nobreak --writepid + +#include "logger_service_default.cfg" + +// ---- config local variables + +LGSL3Port = 41292; + +// ---- service NeL variables (used by ConfigFile class) + +AESAliasName= "lgs"; + +StartCommands += +{ +"moduleManager.createModule LoggerService ls", +"moduleManager.createModule StandardGateway lgs_gw", +"ls.plug lgs_gw", +"lgs_gw.transportAdd L3Server l3s", +"lgs_gw.transportOptions l3s(PeerInvisible)", +"lgs_gw.transportCmd l3s(open port="+ LGSL3Port +")", +}; + +DontUseNS = 1; + +Paths += { + "../data", + "../common/data_leveldesign", +}; + +// ---- service NeL variables (used by CVariable class) + + +SaveFilesDirectory = ".."; + +// where to save generic shard data (ie: packed_sheet) +WriteFilesDirectory = "../save"; + +// ---- service custom variables (used by ConfigFile class) + +// Use Shard Unifier or not +DontUseSU = 0; + +HomeMainlandNames = +{ + "#SHARDID#", "#UC_SHARDNAME#", "#SHARDNAME#", +}; + +// ---- service custom variables (used by CVariable class) + +#include "backup_service_interface.cfg" diff --git a/ryzom/server/tools/cfg_creator/templates/logger_service_default.cfg b/ryzom/server/tools/cfg_creator/templates/logger_service_default.cfg new file mode 100644 index 000000000..60d639fe1 --- /dev/null +++ b/ryzom/server/tools/cfg_creator/templates/logger_service_default.cfg @@ -0,0 +1 @@ +#include "common.cfg" diff --git a/ryzom/server/tools/cfg_creator/templates/login_service.cfg b/ryzom/server/tools/cfg_creator/templates/login_service.cfg new file mode 100644 index 000000000..c2c729aed --- /dev/null +++ b/ryzom/server/tools/cfg_creator/templates/login_service.cfg @@ -0,0 +1,25 @@ +// link the common configuration file +RootConfigFilename = "common.cfg"; + +DisplayedVariables += { "", "@Shards|shards", "@RegUsers|registeredUsers", "@OnlineUsers|onlineUsers", "OnlineUsers|OnlineUsersNumber" }; + +WSPort = 49999; // port for the welcome service connection (default is 49999) + +WebPort = 49998; // port for the web server (default 49998) + +AcceptExternalShards = 1; // 1 if you want to accept external shard that are not in database + +Beep = 1; // 1 if you want to beep when a new client comes + +DatabaseHost = "localhost"; // name of the host where the mysql database is (empty string mean localhost) +DatabaseName = "nel"; // name of the database where we can find needed info +DatabaseLogin = ""; // if we need a login to access the database +DatabasePassword = ""; // if we need a password to access the database + +ForceDatabaseReconnection = "dummy"; // change this value to force a configfile reload and reconnection to the database + // to take in count the new value of Database* + // the content of this variable doesn't matter, it s just a fake to reload database var + +DontUseNS = 1; + +SId = 3; \ No newline at end of file diff --git a/ryzom/server/tools/cfg_creator/templates/mail_forum_service.cfg b/ryzom/server/tools/cfg_creator/templates/mail_forum_service.cfg new file mode 100644 index 000000000..5f2009c69 --- /dev/null +++ b/ryzom/server/tools/cfg_creator/templates/mail_forum_service.cfg @@ -0,0 +1,19 @@ +// Use with commandline: mail_forum_service -C. -L. --nobreak --writepid + +#include "mail_forum_service_default.cfg" + +// ---- config local variables + +// ---- service NeL variables (used by ConfigFile class) + +AESAliasName= "mfs"; + +Paths += { + ".", +}; + +// ---- service NeL variables (used by CVariable class) + +// ---- service custom variables (used by ConfigFile class) + +// ---- service custom variables (used by CVariable class) diff --git a/ryzom/server/tools/cfg_creator/templates/mail_forum_service_default.cfg b/ryzom/server/tools/cfg_creator/templates/mail_forum_service_default.cfg new file mode 100644 index 000000000..57d51df78 --- /dev/null +++ b/ryzom/server/tools/cfg_creator/templates/mail_forum_service_default.cfg @@ -0,0 +1,28 @@ +#include "common.cfg" + +// ---- service NeL variables (used by ConfigFile class) + +DontUseNS = 1; + +// ---- service NeL variables (used by CVariable class) + +// ---- service custom variables (used by ConfigFile class) + + // ---- service custom variables (used by CVariable class) + +WebRootDirectory = "save_shard/www"; + +// Set if Hall of Fame generator is enabled +HoFEnableGenerator = 1; + +// Set if HoF generator is verbose +HoFVerbose = 0; + +// Directory where HDT files are +HoFHDTDirectory = "/local/www/hof/hdt"; + +// HoF generator maximum update period in milliseconds +HoFGeneratorUpdatePeriod = 200; + +// HoF generator directory update period in seconds +HoFGeneratorDirUpdatePeriod = 60; diff --git a/ryzom/server/tools/cfg_creator/templates/mirror_service.cfg b/ryzom/server/tools/cfg_creator/templates/mirror_service.cfg new file mode 100644 index 000000000..e4c300ac1 --- /dev/null +++ b/ryzom/server/tools/cfg_creator/templates/mirror_service.cfg @@ -0,0 +1,38 @@ +// Use with commandline: mirror_service -C. -L. --nobreak --writepid + +#include "mirror_service_default.cfg" + +// ---- config local variables + +// ---- service NeL variables (used by ConfigFile class) + +AESAliasName= "ms"; + +GraphVars += { "UserSpeedLoop", "0" }; +GraphVars += { "UserSpeedLoop", "60000" }; +GraphVars += { "L5CallbackCount", "0" }; +GraphVars += { "L5CallbackCount", "60000" }; +GraphVars += { "L5CallbackTime", "0" }; +GraphVars += { "L5CallbackTime", "60000" }; + +Paths += { + ".", + "../common", + "../common/data_leveldesign", +}; + +// ---- service NeL variables (used by CVariable class) + +// ---- service custom variables (used by ConfigFile class) + +// Mirror limits +DatasetSizefe_temp = 700000; +DatasetSizefame = 26000; + +// MS Packet size limit in bytes, PER DATASET (warning: depending on the weights, limits per property may be very small) +MaxOutBandwidth = 100000000; + +// ---- service custom variables (used by CVariable class) + +// Disable ryzom verbose logging +VerboseMIRROR = 0; diff --git a/ryzom/server/tools/cfg_creator/templates/mirror_service_default.cfg b/ryzom/server/tools/cfg_creator/templates/mirror_service_default.cfg new file mode 100644 index 000000000..fc517bbb9 --- /dev/null +++ b/ryzom/server/tools/cfg_creator/templates/mirror_service_default.cfg @@ -0,0 +1,6 @@ +#include "common.cfg" + +// ---- service custom variables (used by ConfigFile class) + +// Linux only +DestroyGhostSegments = 1; diff --git a/ryzom/server/tools/cfg_creator/templates/monitor_service.cfg b/ryzom/server/tools/cfg_creator/templates/monitor_service.cfg new file mode 100644 index 000000000..61207aff2 --- /dev/null +++ b/ryzom/server/tools/cfg_creator/templates/monitor_service.cfg @@ -0,0 +1,39 @@ +// Use with commandline: monitor_service -C. -L. --nobreak --writepid + +#include "monitor_service_default.cfg" + +// ---- config local variables + +// ---- service NeL variables (used by ConfigFile class) + +AESAliasName= "mos"; + +GraphVars += { "UserSpeedLoop", "0" }; +GraphVars += { "UserSpeedLoop", "60000" }; +GraphVars += { "L5CallbackCount", "0" }; +GraphVars += { "L5CallbackCount", "60000" }; +GraphVars += { "L5CallbackTime", "0" }; +GraphVars += { "L5CallbackTime", "60000" }; + +Paths += { + "../data", + "../common", + "../common/data_leveldesign", +}; + +// ---- service NeL variables (used by CVariable class) + +// ---- service custom variables (used by ConfigFile class) + +// Mirror limits +DatasetSizefe_temp = 700000; +DatasetSizefame = 26000; + +// MS Packet size limit in bytes, PER DATASET (warning: depending on the weights, limits per property may be very small) +MaxOutBandwidth = 100000000; + + +// ---- service custom variables (used by CVariable class) + +// Disable ryzom verbose logging +VerboseMIRROR = 0; diff --git a/ryzom/server/tools/cfg_creator/templates/monitor_service_default.cfg b/ryzom/server/tools/cfg_creator/templates/monitor_service_default.cfg new file mode 100644 index 000000000..60d639fe1 --- /dev/null +++ b/ryzom/server/tools/cfg_creator/templates/monitor_service_default.cfg @@ -0,0 +1 @@ +#include "common.cfg" diff --git a/ryzom/server/tools/cfg_creator/templates/naming_service.cfg b/ryzom/server/tools/cfg_creator/templates/naming_service.cfg new file mode 100644 index 000000000..d9a4163f1 --- /dev/null +++ b/ryzom/server/tools/cfg_creator/templates/naming_service.cfg @@ -0,0 +1,21 @@ +// Use with commandline: ryzom_naming_service -C. -L. --nobreak --writepid + +#include "naming_service_default.cfg" + +// ---- config local variables + +// ---- service NeL variables (used by ConfigFile class) + +AESAliasName= "rns"; + +Paths += { + "" +}; + +// ---- service NeL variables (used by CVariable class) + +// ---- service custom variables (used by ConfigFile class) + +BasePort = 51000; + +// ---- service custom variables (used by CVariable class) diff --git a/ryzom/server/tools/cfg_creator/templates/naming_service_default.cfg b/ryzom/server/tools/cfg_creator/templates/naming_service_default.cfg new file mode 100644 index 000000000..354f2df3c --- /dev/null +++ b/ryzom/server/tools/cfg_creator/templates/naming_service_default.cfg @@ -0,0 +1,7 @@ +#include "common.cfg" + +SId = 1; +DontUseNS = 1; + +UniqueOnShardServices = {}; // { "EGS", "GPMS", "IOS", "TICKS", "WS", "AIS", "DSS" }; +UniqueByMachineServices = {}; // { "MS" }; diff --git a/ryzom/server/tools/cfg_creator/templates/persistant_data_service_default.cfg b/ryzom/server/tools/cfg_creator/templates/persistant_data_service_default.cfg new file mode 100644 index 000000000..412155aec --- /dev/null +++ b/ryzom/server/tools/cfg_creator/templates/persistant_data_service_default.cfg @@ -0,0 +1,4 @@ +// link the common configuration file +RootConfigFilename = "common.cfg"; + +SaveRootPath = "data_shard/pd_save"; diff --git a/ryzom/server/tools/cfg_creator/templates/sabrina_test.cfg b/ryzom/server/tools/cfg_creator/templates/sabrina_test.cfg new file mode 100644 index 000000000..5a2ffa432 --- /dev/null +++ b/ryzom/server/tools/cfg_creator/templates/sabrina_test.cfg @@ -0,0 +1,39 @@ +DontUseNS = 1; +DontUseAES = 1; + +WindowStyle = "WIN"; +FontName = "Lucida Console"; +FontSize = 8; + +Paths = { "data_leveldesign/leveldesign/DFN", "src_v2/sabrina_test" }; +WriteFilesDirectory = "src_v2/sabrina_test"; +SaveFilesDirectory = "src_v2/sabrina_test"; + +// factor for damage ( damage *= DamageFactor ) +DamageFactor = 1.0; +// factor to accelerate sentence execution in the brick service (executionTime /= SpeedFactor) +SpeedFactor = 1.0; +// the length of a cycle (default = 4.0 s) +CombatCycleLength = 4.0; + +StartCommands = +{ + "makeSheetId", + + // setup a pair of actors with a targeting b + "newPlayer bob", + "newPlayer fred", + "plrTarget bob fred", + + // basic targeted spell test (with .sphrase phrase) + "plrMemSPhrase bob default 0 magic1.sphrase", // memorise spell in mem 0 slot 0 + "plrUsePhrase bob default 0", // use the phrase in mem 0 slot 0 + + // custome phrase test +// "plrMemUserPhrase default 1 bla.sbrick bla2.sbrick", // memorise spell in mem 0 slot 1 +// "plrUsePhrase bob default 1", // use the phrase in mem 0 slot 1 + + // display the actors after processing + "listActors", + "simTick 15", +}; \ No newline at end of file diff --git a/ryzom/server/tools/cfg_creator/templates/scenario.cfg b/ryzom/server/tools/cfg_creator/templates/scenario.cfg new file mode 100644 index 000000000..d1ff91a38 --- /dev/null +++ b/ryzom/server/tools/cfg_creator/templates/scenario.cfg @@ -0,0 +1,2 @@ +ScenarioTypes = {"Roleplay", "Combat"}; +ScenarioLanguages = {"French", "English", "Deutsch"}; \ No newline at end of file diff --git a/ryzom/server/tools/cfg_creator/templates/session_browser_server.cfg b/ryzom/server/tools/cfg_creator/templates/session_browser_server.cfg new file mode 100644 index 000000000..63c193b1f --- /dev/null +++ b/ryzom/server/tools/cfg_creator/templates/session_browser_server.cfg @@ -0,0 +1,49 @@ +// Use with commandline: session_browser_server -C. -L. --nobreak --writepid + +#include "session_browser_server_default.cfg" + +// ---- config local variables + +#include "sql.cfg" + +SBSPort = 48851; + +SUHost = "localhost"; + +// ---- service NeL variables (used by ConfigFile class) + +AESAliasName= "sbs"; + +StartCommands += +{ +"moduleManager.createModule SessionBrowserServerMod sbs suAddr="+SUHost+":49999 listenPort="+SBSPort+" ring_db(host="+DBHost+" user="+DBRingUser+" password="+DBRingPass+" base="+DBRingName+")", +"sbs.plug gw", +}; + +GraphVars += { "NetSpeedLoop", "0" }; +GraphVars += { "NetSpeedLoop", "60000" }; +GraphVars += { "L5CallbackCount", "0" }; +GraphVars += { "L5CallbackCount", "60000" }; +GraphVars += { "L5CallbackTime", "0" }; +GraphVars += { "L5CallbackTime", "60000" }; + +Paths += { + ".", +}; + +// ---- service NeL variables (used by CVariable class) + +// ---- service custom variables (used by ConfigFile class) + +// Use Shard Unifier or not +DontUseSU = 0; + +HomeMainlandNames = +{ + "#SHARDID#", "#UC_SHARDNAME#", "#SHARDNAME#", +}; + +// The max number of ring points (aka ring access) for each ecosystem +MaxRingPoints = "A1:D7:F7:J8:L6:R13"; + +// ---- service custom variables (used by CVariable class) diff --git a/ryzom/server/tools/cfg_creator/templates/session_browser_server_default.cfg b/ryzom/server/tools/cfg_creator/templates/session_browser_server_default.cfg new file mode 100644 index 000000000..60d639fe1 --- /dev/null +++ b/ryzom/server/tools/cfg_creator/templates/session_browser_server_default.cfg @@ -0,0 +1 @@ +#include "common.cfg" diff --git a/ryzom/server/tools/cfg_creator/templates/shard_unifier_service.cfg b/ryzom/server/tools/cfg_creator/templates/shard_unifier_service.cfg new file mode 100644 index 000000000..1b8df31ea --- /dev/null +++ b/ryzom/server/tools/cfg_creator/templates/shard_unifier_service.cfg @@ -0,0 +1,53 @@ +// Use with commandline: shard_unifier_service -C. -L. --nobreak --writepid + +// ---- config local variables + +SUGlobalPort = 50503; + +#include "sql.cfg" + +#include "shard_unifier_service_default.cfg" + +// ---- service NeL variables (used by ConfigFile class) + +AESAliasName= "su"; + +// Create a command executor +StartCommands += +{ +"moduleManager.createModule CommandExecutor ce", +"ce.plug gw", +}; + +GraphVars += { "TotalConcurentUser", "60000" }; +GraphVars += { "NetSpeedLoop", "0" }; +GraphVars += { "NetSpeedLoop", "60000" }; +GraphVars += { "L5CallbackCount", "0" }; +GraphVars += { "L5CallbackCount", "60000" }; +GraphVars += { "L5CallbackTime", "0" }; +GraphVars += { "L5CallbackTime", "60000" }; + +Paths += { + ".", +}; + +// ---- service NeL variables (used by CVariable class) + +// ---- service custom variables (used by ConfigFile class) + +// Use Shard Unifier or not +DontUseSU = 0; + +HomeMainlandNames = +{ + "#SHARDID#", "#UC_SHARDNAME#", "#SHARDNAME#", +}; + +// ---- service custom variables (used by CVariable class) + +DomainName = "#DOMAINNAME#"; + +// The privileges needed to access any ring session +PrivilegeForSessionAccess = ":DEV:SGM:GM:SG:"; + +#include "backup_service_interface.cfg" diff --git a/ryzom/server/tools/cfg_creator/templates/shard_unifier_service_default.cfg b/ryzom/server/tools/cfg_creator/templates/shard_unifier_service_default.cfg new file mode 100644 index 000000000..a46bf0d95 --- /dev/null +++ b/ryzom/server/tools/cfg_creator/templates/shard_unifier_service_default.cfg @@ -0,0 +1,33 @@ +#include "common.cfg" + +DontUseNS = 1; + +StartCommands += +{ + // Create a gateway for global interconnection + // modules from different shard are visible to each other if they connect to + // this gateway. SU Local module have no interest to be plugged here. + "moduleManager.createModule StandardGateway glob_gw", + // add a layer 3 server transport + "glob_gw.transportAdd L3Server l3s", + // open the transport + "glob_gw.transportCmd l3s(open port="+SUGlobalPort+")", + // Create a session manager module + "moduleManager.createModule RingSessionManager rsm web(port=49999) ring_db(host="+DBHost+" user="+DBRingUser+" password="+DBRingPass+" base="+DBRingName+") nel_db(host="+DBHost+" user="+DBNelUser+" password="+DBNelPass+" base="+DBNelName+")", + "rsm.plug gw", + // Create a login service module + "moduleManager.createModule LoginService ls ring_db(host="+DBHost+" user="+DBRingUser+" password="+DBRingPass+" base="+DBRingName+") web(port=49998) nel_db(host="+DBHost+" user="+DBNelUser+" password="+DBNelPass+" base="+DBNelName+")", + "ls.plug gw", + // Create a character synchronization module + "moduleManager.createModule CharacterSynchronisation cs fake_edit_char ring_db(host="+DBHost+" user="+DBRingUser+" password="+DBRingPass+" base="+DBRingName+")", + "cs.plug gw", + // Create entity locator module + "moduleManager.createModule EntityLocator el ring_db(host="+DBHost+" user="+DBRingUser+" password="+DBRingPass+" base="+DBRingName+") nel_db(host="+DBHost+" user="+DBNelUser+" password="+DBNelPass+" base="+DBNelName+")", + "el.plug gw", + // Create a mail forum notifier forwarder + "moduleManager.createModule MailForumNotifierFwd mfnfwd ring_db(host="+DBHost+" user="+DBRingUser+" password="+DBRingPass+" base="+DBRingName+") web(port=49897)", + "mfnfwd.plug gw", + // Create a chat unifier server module + "moduleManager.createModule ChatUnifierServer cus ring_db(host="+DBHost+" user="+DBRingUser+" password="+DBRingPass+" base="+DBRingName+")", + "cus.plug gw", +}; diff --git a/ryzom/server/tools/cfg_creator/templates/sheets_packer.cfg b/ryzom/server/tools/cfg_creator/templates/sheets_packer.cfg new file mode 100644 index 000000000..db04a2989 --- /dev/null +++ b/ryzom/server/tools/cfg_creator/templates/sheets_packer.cfg @@ -0,0 +1,7 @@ +///////////////////////////////// +///////////////////////////////// +/// SHEETS PACKER CONFIG FILE /// +///////////////////////////////// +///////////////////////////////// +DataPath = { "patch", "../common/data_leveldesign", "../common/data_common", "data" }; +LigoPrimitiveClass = "world_editor_classes.xml"; diff --git a/ryzom/server/tools/cfg_creator/templates/sql.cfg b/ryzom/server/tools/cfg_creator/templates/sql.cfg new file mode 100644 index 000000000..6454fcbb1 --- /dev/null +++ b/ryzom/server/tools/cfg_creator/templates/sql.cfg @@ -0,0 +1,15 @@ +//DBHost = "web.ryzom.com"; +DBHost = "#DBHOST#"; +DBNelName = "nel"; +DBRingName = "#DBRING#"; +// Nel DB user +DBNelUser = "#DBUSER#"; +// Ring DB user +DBRingUser = "#DBUSER#"; +// SU - password to access to the nel database with DBNelUseruser (default is no password) +DBNelPass = "#DBPASS#"; +// SU - password to access to the ring database with DBRingUser (default is no password) +DBRingPass = "#DBPASS#"; + +// MySQL wrapper strict mode - controls use of asserts if SQL requests fail +MSWStrictMode=0; diff --git a/ryzom/server/tools/cfg_creator/templates/stats_scan_service.cfg b/ryzom/server/tools/cfg_creator/templates/stats_scan_service.cfg new file mode 100644 index 000000000..59dd39642 --- /dev/null +++ b/ryzom/server/tools/cfg_creator/templates/stats_scan_service.cfg @@ -0,0 +1,13 @@ +// link the common configuration file +RootConfigFilename = "stats_scan_service_default.cfg"; + +DontUseAES = 1; +DontUseNS = 1; +DontUseTS = 1; + +Paths += {}; +PathsNoRecurse = {"r:/code/ryzom/data_leveldesign/leveldesign/Game_elem"}; +GeorgePaths = {}; +WriteFilesDirectory = ""; +SaveFilesDirectory = ""; + diff --git a/ryzom/server/tools/cfg_creator/templates/stats_scan_service_default.cfg b/ryzom/server/tools/cfg_creator/templates/stats_scan_service_default.cfg new file mode 100644 index 000000000..d54d46a81 --- /dev/null +++ b/ryzom/server/tools/cfg_creator/templates/stats_scan_service_default.cfg @@ -0,0 +1,17 @@ +// link the common configuration file +RootConfigFilename = "common.cfg"; + +DisplayedVariables += { "", "SlowestService", "SlowestTock", "", "WaitingForServices", "", "@Pause|pause" }; + +NegFiltersDebug += { "DELTA_", "DEFAULT_CB", "LNETL", }; +NegFiltersInfo += { "HNETL5" }; + +Paths += {}; +PathsNoRecurse = {}; +GeorgePaths = {}; +WriteFilesDirectory = ""; +SaveFilesDirectory = ""; + +StartCommands = +{ +}; diff --git a/ryzom/server/tools/cfg_creator/templates/test_service.cfg b/ryzom/server/tools/cfg_creator/templates/test_service.cfg new file mode 100644 index 000000000..1c425f801 --- /dev/null +++ b/ryzom/server/tools/cfg_creator/templates/test_service.cfg @@ -0,0 +1,27 @@ +// link the common configuration file +RootConfigFilename = "test_service_default.cfg"; + +DontUseAES = 1; +DontUseNS = 1; +DontUseTS = 1; + +Paths += {}; +PathsNoRecurse = {}; +GeorgePaths = {}; +WriteFilesDirectory = ""; +SaveFilesDirectory = ""; + +StartCommands = +{ + "" + +// ,"pdrRead a pdrLines.txt" +// ,"pdrWrite a pdrLines_out.xml" + +// ,"pdrRead b pdrLines_out.xml" +// ,"pdrWrite b pdrLines_out.txt" + +// ,"pdrRead c pdr_account.xml" +// ,"pdrWrite c pdr_account_out.txt" + +}; diff --git a/ryzom/server/tools/cfg_creator/templates/test_service_default.cfg b/ryzom/server/tools/cfg_creator/templates/test_service_default.cfg new file mode 100644 index 000000000..d54d46a81 --- /dev/null +++ b/ryzom/server/tools/cfg_creator/templates/test_service_default.cfg @@ -0,0 +1,17 @@ +// link the common configuration file +RootConfigFilename = "common.cfg"; + +DisplayedVariables += { "", "SlowestService", "SlowestTock", "", "WaitingForServices", "", "@Pause|pause" }; + +NegFiltersDebug += { "DELTA_", "DEFAULT_CB", "LNETL", }; +NegFiltersInfo += { "HNETL5" }; + +Paths += {}; +PathsNoRecurse = {}; +GeorgePaths = {}; +WriteFilesDirectory = ""; +SaveFilesDirectory = ""; + +StartCommands = +{ +}; diff --git a/ryzom/server/tools/cfg_creator/templates/test_suite.cfg b/ryzom/server/tools/cfg_creator/templates/test_suite.cfg new file mode 100644 index 000000000..cd6f5a5e4 --- /dev/null +++ b/ryzom/server/tools/cfg_creator/templates/test_suite.cfg @@ -0,0 +1,16 @@ +// List of directory where to find dll +TestDllPaths = +{ +}; + +// List of test dll to load without compilation mode spec (d, df, rd, d) nor extension (.dll or .so) +// The dll name is followed by the working directory to set before loading the dll +TestDllList = +{ + "../nel/tools/nel_unit_test/misc_ut/misc_unit_test", "../nel/tools/nel_unit_test/misc_ut", + "../nel/tools/nel_unit_test/ligo_ut/ligo_unit_test", "../nel/tools/nel_unit_test/ligo_ut", + "../nel/tools/nel_unit_test/net_ut/net_unit_test", "../nel/tools/nel_unit_test/net_ut", + "game_share_test", ".", + "shard_unifier_test", "test_files/shard_unifier_test", + "session_browser_test", "test_files/session_browser_test", +}; \ No newline at end of file diff --git a/ryzom/server/tools/cfg_creator/templates/test_web_interface_default.cfg b/ryzom/server/tools/cfg_creator/templates/test_web_interface_default.cfg new file mode 100644 index 000000000..b52958352 --- /dev/null +++ b/ryzom/server/tools/cfg_creator/templates/test_web_interface_default.cfg @@ -0,0 +1,9 @@ +// by default, use WIN displayer +WindowStyle = "WIN"; + +DontUseAES = 1; +DontUseNS = 1; +NSHost = ""; + + +NegFiltersDebug = { "LNETL1" }; \ No newline at end of file diff --git a/ryzom/server/tools/cfg_creator/templates/testing_tool_service.cfg b/ryzom/server/tools/cfg_creator/templates/testing_tool_service.cfg new file mode 100644 index 000000000..4a42614c0 --- /dev/null +++ b/ryzom/server/tools/cfg_creator/templates/testing_tool_service.cfg @@ -0,0 +1,12 @@ +// link the common configuration file +RootConfigFilename = "common.cfg"; + +//DisplayedVariables += {"GlobalActorCount","GlobalActorMoves","GlobalActorUpdates"}; + +// by default, use localhost to find the naming service +//NSHost = "nevrax-01"; + + +//StartCommands = { +// "execute_test test.combat.test" +//}; diff --git a/ryzom/server/tools/cfg_creator/templates/tick_service.cfg b/ryzom/server/tools/cfg_creator/templates/tick_service.cfg new file mode 100644 index 000000000..0aa3f82da --- /dev/null +++ b/ryzom/server/tools/cfg_creator/templates/tick_service.cfg @@ -0,0 +1,30 @@ +// Use with commandline: tick_service -C. -L. --nobreak --writepid + +#include "tick_service_default.cfg" + +// ---- config local variables + +// ---- service NeL variables (used by ConfigFile class) + +AESAliasName= "ts"; + +Paths += { + "../data", + "../common/data_leveldesign", +}; + +// ---- service NeL variables (used by CVariable class) + +// ---- service custom variables (used by ConfigFile class) + +// Mirror limits +DatasetSizefe_temp = 700000; +DatasetSizefame = 26000; + + +// ---- service custom variables (used by CVariable class) + +// Disable ryzom verbose logging +VerboseMIRROR = 0; + +#include "backup_service_interface.cfg" diff --git a/ryzom/server/tools/cfg_creator/templates/tick_service_default.cfg b/ryzom/server/tools/cfg_creator/templates/tick_service_default.cfg new file mode 100644 index 000000000..d4c8630ee --- /dev/null +++ b/ryzom/server/tools/cfg_creator/templates/tick_service_default.cfg @@ -0,0 +1,8 @@ +#include "common.cfg" + +/// A list of vars to graph for TS +GraphVars += +{ + "TotalSpeedLoop", "60000", // low rez, every minutes + "TotalSpeedLoop", "0", // high rez, every tick +}; diff --git a/ryzom/server/tools/cfg_creator/templates/used_continents.cfg b/ryzom/server/tools/cfg_creator/templates/used_continents.cfg new file mode 100644 index 000000000..86dfbb350 --- /dev/null +++ b/ryzom/server/tools/cfg_creator/templates/used_continents.cfg @@ -0,0 +1,40 @@ +// This is the mapping for logical continent to physical one (server_share/used_continent.cpp) +ContinentNameTranslator = +{ + "matis_newbie", "matis", + "zorai_newbie", "zorai", + "terre", "terre_oubliee", + "sources", "sources_interdites" +}; + +// This is the list of continent to use with their unique instance number (server_share/used_continent.cpp) +UsedContinents = +{ + "bagne", "0", + "fyros", "1", + "fyros_island", "2", + "fyros_newbie", "3", + "indoors", "4", + "matis", "5", + "matis_newbie", "7", + "matis_island", "8", + "nexus", "9", + "route_gouffre","10", + "sources", "11", + "terre", "12", + // "testroom", "13", + "tryker", "14", + "tryker_island","15", + "tryker_newbie","16", + "zorai", "17", + "zorai_island", "18", + "zorai_newbie", "19", + "newbieland", "20", + "kitiniere", "21", + "r2_desert", "22", + "r2_forest", "23", + "r2_lakes", "24", + "r2_jungle", "25", + "r2_roots", "26" + //ace kitiniere+tcm "corrupted_moor", "22" +}; diff --git a/ryzom/server/tools/cfg_creator/templates/welcome_service.cfg b/ryzom/server/tools/cfg_creator/templates/welcome_service.cfg new file mode 100644 index 000000000..d74d2c866 --- /dev/null +++ b/ryzom/server/tools/cfg_creator/templates/welcome_service.cfg @@ -0,0 +1,34 @@ +// Use with commandline: ryzom_welcome_service -C. -L. --nobreak --writepid + +// ---- config local variables + +SUPort = 50505; +SUHost = "localhost"; +// SU - listen address of the SU service (for L5 connections) +SUAddress = SUHost+":"+SUPort; + +#include "welcome_service_default.cfg" + +// ---- service NeL variables (used by ConfigFile class) + +AESAliasName= "rws"; + +Paths += { + "../data", +}; + +// ---- service NeL variables (used by CVariable class) + +// ---- service custom variables (used by ConfigFile class) + +// WS - use or not the legacy WelcomeService from nel ns (only for backward compatibility during transition to ring) +DontUseLSService = 1; + +LSHost = SUHost; + +// Set a mainland SessionId. +// Live: Must be 0 for ring shards, non-zero (usually ShardId) for mainland shards +// Dev: Can be non-zero to initially connect a client to a ring shard +FixedSessionId = ShardId; + + // ---- service custom variables (used by CVariable class) diff --git a/ryzom/server/tools/cfg_creator/templates/welcome_service_default.cfg b/ryzom/server/tools/cfg_creator/templates/welcome_service_default.cfg new file mode 100644 index 000000000..172a8ec34 --- /dev/null +++ b/ryzom/server/tools/cfg_creator/templates/welcome_service_default.cfg @@ -0,0 +1,38 @@ +#include "common.cfg" + +// short name of the frontend service +FrontendServiceName = "FS"; + +// in ring architecture, we no more use the legacy LS +DontUseLS = 1; + +// if any of this services is not connected, the WS is closed. +ExpectedServices = { "FS", "MS", "EGS", "GPMS", "IOS", "TICKS" }; + +// Access level to shard +// 0: only dev +// 1: dev + privileged users (see also OpenGroups variable) +// 2: open for all +ShardOpen = 2; + +// File that contains the ShardOpen value (used to override ShardOpen value through AES' command createFile) +// For instance, ShardOpen default value is 0, then AES creates a file to set ShardOpen to 2. If WS crashes, +// ShardOpen is still set to 2 when it relaunches... +// ShardOpenStateFile = "/tmp/shard_open_state"; + +// Privileged Groups +OpenGroups = ":GM:SGM:G:SG:GUEST:"; + +UsePatchMode = 0; + +// create welcome service module +StartCommands += +{ + // create the service + "moduleManager.createModule WelcomeService ws", + // plug it in the gateway + "ws.plug gw", + + // add the SU service + "unifiedNetwork.addService ShardUnifier ( address="+SUAddress+" sendId external autoRetry )", +}; diff --git a/ryzom/server/tools/config_default.sh b/ryzom/server/tools/config_default.sh new file mode 100644 index 000000000..649887cc9 --- /dev/null +++ b/ryzom/server/tools/config_default.sh @@ -0,0 +1,29 @@ +#!/bin/bash +# ______ _____ _ _ _____ _ +# | ___ \ / ___| | | | |_ _| | | +# | |_/ / _ _______ _ __ ___ \ `--.| |__ __ _ _ __ __| | | | ___ ___ | |___ +# | / | | |_ / _ \| '_ ` _ \ `--. \ '_ \ / _` | '__/ _` | | |/ _ \ / _ \| / __| +# | |\ \ |_| |/ / (_) | | | | | | /\__/ / | | | (_| | | | (_| | | | (_) | (_) | \__ \ +# \_| \_\__, /___\___/|_| |_| |_| \____/|_| |_|\__,_|_| \__,_| \_/\___/ \___/|_|___/ +# __/ | +# |___/ +# +# Ryzom - MMORPG Framework +# Copyright (C) 2019 Winch Gate Property Limited +# This program is free software: read https://ryzom.com/dev/copying.html for more details +# +# Config file for ryzom shard tools +# + +# Automatic restart of services +AUTO_RESTART=1 + +# Web url use to notify and manage apps who need know when a service is started +NOTIFY_URL_SERVICE_RESTARTED="https://app.ryzom.com/app_arcc/services_started.php" +NOTIFY_URL_KEY="C6tLpddu8NJjvhyzBLqjw4uQWRXbGRsQ" + +# Use gdb +USE_GDB=1 + +# Notification command +NOTIFY_COMMAND="" diff --git a/ryzom/server/tools/notify.sh b/ryzom/server/tools/notify.sh new file mode 100644 index 000000000..4e9ee9d49 --- /dev/null +++ b/ryzom/server/tools/notify.sh @@ -0,0 +1,35 @@ +#!/bin/bash +# ______ _____ _ _ _____ _ +# | ___ \ / ___| | | | |_ _| | | +# | |_/ / _ _______ _ __ ___ \ `--.| |__ __ _ _ __ __| | | | ___ ___ | |___ +# | / | | |_ / _ \| '_ ` _ \ `--. \ '_ \ / _` | '__/ _` | | |/ _ \ / _ \| / __| +# | |\ \ |_| |/ / (_) | | | | | | /\__/ / | | | (_| | | | (_| | | | (_) | (_) | \__ \ +# \_| \_\__, /___\___/|_| |_| |_| \____/|_| |_|\__,_|_| \__,_| \_/\___/ \___/|_|___/ +# __/ | +# |___/ +# +# Ryzom - MMORPG Framework +# Copyright (C) 2019 Winch Gate Property Limited +# This program is free software: read https://ryzom.com/dev/copying.html for more details +# +# This script will notify external services like RocketChat or Web Apps +# + +COMMAND=$1 +shift + +CWD=$(dirname "$0") +. "$CWD/config.sh" + +if [[ "$COMMAND" = "ServiceStarted" ]] +then + if [[ -z "$NOTIFY_URL_SERVICE_RESTARTED" ]] + then + curl "$NOTIFY_URL_SERVICE_RESTARTED?command=started&shard=$(hostname -s)&apikey=$NOTIFY_URL_KEY&service=$2" + fi + +elif [[ "$COMMAND" = "ServiceStoped" ]] +then + curl "$NOTIFY_URL_SERVICE_RESTARTED?command=stoped&shard=$(hostname -s)&apikey=$NOTIFY_URL_KEY&service=$2" +fi + diff --git a/ryzom/server/tools/service_launcher.sh b/ryzom/server/tools/service_launcher.sh new file mode 100644 index 000000000..3d9b73e95 --- /dev/null +++ b/ryzom/server/tools/service_launcher.sh @@ -0,0 +1,119 @@ +#!/bin/bash +# ______ _____ _ _ _____ _ +# | ___ \ / ___| | | | |_ _| | | +# | |_/ / _ _______ _ __ ___ \ `--.| |__ __ _ _ __ __| | | | ___ ___ | |___ +# | / | | |_ / _ \| '_ ` _ \ `--. \ '_ \ / _` | '__/ _` | | |/ _ \ / _ \| / __| +# | |\ \ |_| |/ / (_) | | | | | | /\__/ / | | | (_| | | | (_| | | | (_) | (_) | \__ \ +# \_| \_\__, /___\___/|_| |_| |_| \____/|_| |_|\__,_|_| \__,_| \_/\___/ \___/|_|___/ +# __/ | +# |___/ +# +# Ryzom - MMORPG Framework +# Copyright (C) 2019 Winch Gate Property Limited +# This program is free software: read https://ryzom.com/dev/copying.html for more details +# +# This script is a service launcher that works with a command file +# to determine when to launch the application that it is responsible for +# + +CWD=$(dirname "$0") +. "$CWD/config.sh" + +NAME="$1" +shift + +EXECUTABLE=$1 +shift + +CTRL_CMDLINE=$* + + +mkdir -p $NAME + +DOMAIN=shard +NAME_BASE="$NAME/$NAME" +CTRL_FILE=${NAME_BASE}_immediate.launch_ctrl +NEXT_CTRL_FILE=${NAME_BASE}_waiting.launch_ctrl +STATE_FILE=${NAME_BASE}.state +START_COUNTER_FILE=${NAME_BASE}.start_count + +echo +echo --------------------------------------------------------------------------------- +echo Starting service launcher +echo --------------------------------------------------------------------------------- +printf "%-16s = " CMDLINE ; echo $CTRL_CMDLINE +printf "%-16s = " CTRL_FILE ; echo $CTRL_FILE +printf "%-16s = " NEXT_CTRL_FILE ; echo $NEXT_CTRL_FILE +printf "%-16s = " STATE_FILE ; echo $STATE_FILE +echo --------------------------------------------------------------------------------- +echo + +# reinit the start counter +echo 0 > $START_COUNTER_FILE +START_COUNTER=0 + +while true +do + # see if the conditions are right to launch the app + if [ -e $CTRL_FILE ] + then + + # a control file exists so read it's contents + CTRL_COMMAND=_$(cat $CTRL_FILE)_ + + # do we have a 'launch' command? + if [ $CTRL_COMMAND = _LAUNCH_ ] + then + + # update the start counter + START_COUNTER=$(( $START_COUNTER + 1 )) + echo $START_COUNTER > $START_COUNTER_FILE + + # we have a launch command so prepare, launch, wait for exit and do the housekeeping + echo ----------------------------------------------------------------------- + echo Launching ... + echo + printf RUNNING > $STATE_FILE + + #notify start + "$CWD/notify.sh" ServiceStarted $NAME + + if [[ "$USE_GDB" == "1" ]] + then + if [ "$NAME" = "egs" ] || [ "$NAME" = "ios" ] || [ "$NAME" = "ais_fyros" ] || [ "$NAME" = "ais_matis" ] || [ "$NAME" = "ais_tryker" ] || [ "$NAME" = "ais_roots" ] || [ "$NAME" = "ais_zorai" ] || [ "$NAME" = "ais_ark" ] || [ "$NAME" = "ais_gpms" ] + then + gdb -batch -ex "set logging file $NAME/gdb_dump.txt" -ex "set logging on" -ex "run $CTRL_CMDLINE" -ex "bt" $EXECUTABLE + fi + $EXECUTABLE $CTRL_CMDLINE + else + $EXECUTABLE $CTRL_CMDLINE + fi + + #notify stop + "$CWD/notify.sh" ServiceStopped $NAME + + echo ----------------------------------------------------------------------- + printf STOPPED > $STATE_FILE + + # consume (remove) the control file to allow start once + rm $CTRL_FILE + + if [[ "$AUTO_RESTART" == "0" ]] + then + echo "Press ENTER to relaunch" + read + fi + fi + fi + + # either we haven't launched the app yet or we have launched and it has exitted + if [ -e $NEXT_CTRL_FILE ] + then + # we have some kind of relaunch directive lined up so deal with it + mv $NEXT_CTRL_FILE $CTRL_FILE + else + # automatic launch + printf LAUNCH > $CTRL_FILE + fi +done + diff --git a/ryzom/server/tools/services/install_rocketchat.sh b/ryzom/server/tools/services/install_rocketchat.sh new file mode 100644 index 000000000..ccdb9ba49 --- /dev/null +++ b/ryzom/server/tools/services/install_rocketchat.sh @@ -0,0 +1,68 @@ +#!/bin/bash +# ______ _____ _ _ _____ _ +# | ___ \ / ___| | | | |_ _| | | +# | |_/ / _ _______ _ __ ___ \ `--.| |__ __ _ _ __ __| | | | ___ ___ | |___ +# | / | | |_ / _ \| '_ ` _ \ `--. \ '_ \ / _` | '__/ _` | | |/ _ \ / _ \| / __| +# | |\ \ |_| |/ / (_) | | | | | | /\__/ / | | | (_| | | | (_| | | | (_) | (_) | \__ \ +# \_| \_\__, /___\___/|_| |_| |_| \____/|_| |_|\__,_|_| \__,_| \_/\___/ \___/|_|___/ +# __/ | +# |___/ +# +# Ryzom - MMORPG Framework +# Copyright (C) 2019 Winch Gate Property Limited +# This program is free software: read https://ryzom.com/dev/copying.html for more details +# +# Script to build Rocketchat with ryzombridge +# + +VERSION="1.0.0-rc.0" +BUILD_PATH=~/builds + +echo "INSTALLATION OF VERSION $VERSION !!!!" + +echo "If you don't have install all requirements check at:" +echo "https://rocket.chat/docs/installation/manual-installation/ubuntu/" +echo "To install meteor : curl https://install.meteor.com/ | sh" +echo "Ctrl+c to abort..." +read + +echo "Erasing old..." +rm -rf $BUILD_PATH/RocketChat/Rocket.Chat.old + +mv Rocket.Chat Rocket.Chat.old + +cd ~/builds/RocketChat/ +if [[ ! -d "megacorp" ]] + echo "Missing megacorp. Cloning it.." + hg clone ssh://hg@bitbucket.org/ryzom/megacorp +fi + +cd megacorp +hg pull +hg update -v +cd .. + +git clone https://github.com/RocketChat/Rocket.Chat.git + +cd Rocket.Chat +git checkout $VERSION + +cp $BUILD_PATH/RocketChat/megacorp/ryzom-rocket-bridge/ packages/ +echo -e "\nryzom-rocket-bridge" >> .meteor/packages + +npm install --production + +rm -rf ../rc-bundle +meteor build ../rc-bundle --architecture os.linux.x86_64 +meteor build ../rc-bundle --architecture os.linux.x86_64 + +cd ../rc-bundle +tar xvfz Rocket.Chat.tar.gz + +cd ~ +mv Rocket.Chat/ Rocket.Chat.old +cp -r src/rc-bundle/bundle/ Rocket.Chat/ + +cd ~/Rocket.Chat/programs/server +npm install + diff --git a/ryzom/server/tools/shard b/ryzom/server/tools/shard new file mode 100644 index 000000000..be1fbafb1 --- /dev/null +++ b/ryzom/server/tools/shard @@ -0,0 +1,120 @@ +#!/bin/bash +# ______ _____ _ _ _____ _ +# | ___ \ / ___| | | | |_ _| | | +# | |_/ / _ _______ _ __ ___ \ `--.| |__ __ _ _ __ __| | | | ___ ___ | |___ +# | / | | |_ / _ \| '_ ` _ \ `--. \ '_ \ / _` | '__/ _` | | |/ _ \ / _ \| / __| +# | |\ \ |_| |/ / (_) | | | | | | /\__/ / | | | (_| | | | (_| | | | (_) | (_) | \__ \ +# \_| \_\__, /___\___/|_| |_| |_| \____/|_| |_|\__,_|_| \__,_| \_/\___/ \___/|_|___/ +# __/ | +# |___/ +# +# Ryzom - MMORPG Framework +# Copyright (C) 2019 Winch Gate Property Limited +# This program is free software: read https://ryzom.com/dev/copying.html for more details +# +# This script helps to manage the shard using a screen session. +# You can start, join, stop and get state of services +# + +CMD=$1 +DOMAIN=shard + +if [[ ! -z "$2" ]] +then + SHARD_PATH=$2 +fi + +if [[ -z "$CMD" ]] +then + echo + echo Screen sessions currently running: + screen -list + echo + echo "Commands:" + echo " 'start' to start the ${DOMAIN}" + echo " 'stop' to stop the ${DOMAIN}" + echo " 'join' to join the ${DOMAIN}'s screen session" + echo " 'share' to join the ${DOMAIN} in shared mode" + echo " 'state' to view state information for the ${DOMAIN}" + echo + printf "Enter a command: " + read CMD +fi + +if [ "$CMD" = "stop" ] +then + if [ $(screen -list | grep \\\.${DOMAIN} | wc -l) != 1 ] + then + echo Cannot stop domain \'${DOMAIN}\' because no screen by that name appears to be running + screen -list + else + screen -d -r $(screen -list | grep \\\.${DOMAIN}| sed 's/(.*)//') -X quit > /dev/null + if [ -f $SHARD_PATH/run/aes_state.txt ] + then + rm -r $SHARD_PATH/run/* + fi + fi +fi + +STARTARGS= +if [ "$CMD" = "batchstart" ] +then + STARTARGS="-d -m" + CMD="start" +fi + +LIGHT= +if [ "$CMD" = "light" ] +then + LIGHT=".light" + CMD="start" +fi + +if [ "$CMD" = "start" ] +then + + cd $SHARD_PATH/run + + ulimit -c unlimited + screen -wipe > /dev/null + + if [ $( screen -list | grep \\\.${DOMAIN} | wc -w ) != 0 ] + then + echo Cannot start domain \'${DOMAIN}\' because this domain is already started + screen -list | grep $DOMAIN + else + export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$SHARD_PATH/lib + export SHARD_PATH=$SHARD_PATH + screen $STARTARGS -S ${DOMAIN} -c $SHARD_PATH/tools/${DOMAIN}.screen${LIGHT}.rc + fi +fi + +JOINARGS= +if [ "$CMD" = "share" ] +then + JOINARGS="-x" + CMD="join" +fi + +if [ "$CMD" = "join" ] +then + if [ $(screen -list | grep \\\.${DOMAIN} | wc -l) != 1 ] + then + echo Cannot join domain \'${DOMAIN}\' because no screen by that name appears to be running + screen -list + else + screen -r ${JOINARGS} $(screen -list | grep \\\.${DOMAIN}| sed 's/(.*)//') + fi +fi + +if [ "$CMD" = "state" ] +then + cd $SHARD_PATH/run + echo State of domain ${DOMAIN}: + if [ $(echo */*.state) = "*/*.state" ] + then + echo - No state files found + else + grep RUNNING */*state + fi +fi diff --git a/ryzom/server/tools/shard.screen.light.rc b/ryzom/server/tools/shard.screen.light.rc new file mode 100644 index 000000000..48c8f1875 --- /dev/null +++ b/ryzom/server/tools/shard.screen.light.rc @@ -0,0 +1,95 @@ +# +# ______ _____ _ _ _____ _ +# | ___ \ / ___| | | | |_ _| | | +# | |_/ / _ _______ _ __ ___ \ `--.| |__ __ _ _ __ __| | | | ___ ___ | |___ +# | / | | |_ / _ \| '_ ` _ \ `--. \ '_ \ / _` | '__/ _` | | |/ _ \ / _ \| / __| +# | |\ \ |_| |/ / (_) | | | | | | /\__/ / | | | (_| | | | (_| | | | (_) | (_) | \__ \ +# \_| \_\__, /___\___/|_| |_| |_| \____/|_| |_|\__,_|_| \__,_| \_/\___/ \___/|_|___/ +# __/ | +# |___/ +# +# Ryzom - MMORPG Framework +# Copyright (C) 2019 Winch Gate Property Limited +# This program is free software: read https://ryzom.com/dev/copying.html for more details +# +# This rc script is used to start all services of the shard into a screen session +# This is the light version (only one ai service) ! +# + +# ------------------------------------------------------------------------------ +# SCREEN KEYBINDINGS +# ------------------------------------------------------------------------------ + +# Remove some stupid / dangerous key bindings +bind ^k +#bind L +bind ^\ +# Make them better +bind \\ quit +bind K kill +bind I login on +bind O login off + +if [ "x$1" != "x" ] +then + SHARD_PATH=$1 +fi + +chdir $SHARD_PATH/run + +echo "Started at $(date) in $SHARD_PATH" > /tmp/started.run + +screen -t aes /bin/bash $SHARD_PATH/tools/service_launcher.sh aes ../sbin/ryzom_admin_service -A. -C../cfgs -L../logs --nobreak --fulladminname=admin_executor_service --shortadminname=AES + +# bms_master +screen -t bms_master /bin/bash $SHARD_PATH/tools/service_launcher.sh bms_master ../sbin/ryzom_backup_service -C../cfgs -L../logs --nobreak --writepid -P49990 + +# bms_pd_master +#screen -t bms_pd_master /bin/bash $SHARD_PATH/tools/service_launcher.sh bms_pd_master ../sbin/ryzom_backup_service -C../cfgs -L../logs --nobreak --writepid -P49992 + +# egs +screen -t egs /bin/bash $SHARD_PATH/tools/service_launcher.sh egs ../sbin/ryzom_entities_game_service -C../cfgs -L../logs --nobreak --writepid + +# gpms +screen -t gpms /bin/bash $SHARD_PATH/tools/service_launcher.sh gpms ../sbin/ryzom_gpm_service -C../cfgs -L../logs --nobreak --writepid + +# ios +screen -t ios /bin/bash $SHARD_PATH/tools/service_launcher.sh ios ../sbin/ryzom_ios_service -C../cfgs -L../logs --nobreak --writepid + +# rns +screen -t rns /bin/bash $SHARD_PATH/tools/service_launcher.sh rns ../sbin/ryzom_naming_service -C../cfgs -L../logs --nobreak --writepid + +# rws +screen -t rws /bin/bash $SHARD_PATH/tools/service_launcher.sh rws ../sbin/ryzom_welcome_service -C../cfgs -L../logs --nobreak --writepid + +# ts +screen -t ts /bin/bash $SHARD_PATH/tools/service_launcher.sh ts ../sbin/ryzom_tick_service -C../cfgs -L../logs --nobreak --writepid + +# ms +screen -t ms /bin/bash $SHARD_PATH/tools/service_launcher.sh ms ../sbin/ryzom_mirror_service -C../cfgs -L../logs --nobreak --writepid + +#ais_ark +screen -t ais_ark /bin/bash $SHARD_PATH/tools/service_launcher.sh ais_ark ../sbin/ryzom_ai_service -C../cfgs -L../logs -Nais_ark --nobreak --writepid -mCommon:Indoors::R2Desert:R2Roots:R2Jungle:R2Forest:R2Lakes:Post + +# mfs +screen -t mfs /bin/bash $SHARD_PATH/tools/service_launcher.sh mfs ../sbin/ryzom_mail_forum_service -C../cfgs -L../logs --nobreak --writepid + +# su +screen -t su /bin/bash $SHARD_PATH/tools/service_launcher.sh su ../sbin/ryzom_shard_unifier_service -C../cfgs -L../logs --nobreak --writepid +# fes +screen -t fes /bin/bash $SHARD_PATH/tools/service_launcher.sh fes ../sbin/ryzom_frontend_service -C../cfgs -L../logs --nobreak --writepid + +# sbs +screen -t sbs /bin/bash $SHARD_PATH/tools/service_launcher.sh sbs ../sbin/ryzom_session_browser_service -C../cfgs -L../logs --nobreak --writepid + +# lgs +screen -t lgs /bin/bash $SHARD_PATH/tools/service_launcher.sh lgs ../sbin/ryzom_logger_service -C../cfgs -L../logs --nobreak --writepid + +# mos +screen -t mos /bin/bash $SHARD_PATH/tools/service_launcher.sh mos ../sbin/ryzom_monitor_service -C../cfgs -L../logs --nobreak --writepid + +# pdss +#screen -t pdss /bin/bash $SHARD_PATH/tools/service_launcher.sh pdss ../sbin/ryzom_pd_support_service -C../cfgs -L../logs --nobreak --writepid + +# ras +screen -t ras /bin/bash $SHARD_PATH/tools/service_launcher.sh ras ../sbin/ryzom_admin_service --fulladminname=admin_service --shortadminname=AS -C../cfgs -L../logs --nobreak --writepid diff --git a/ryzom/server/tools/shard.screen.rc b/ryzom/server/tools/shard.screen.rc new file mode 100644 index 000000000..81e8266df --- /dev/null +++ b/ryzom/server/tools/shard.screen.rc @@ -0,0 +1,119 @@ +# +# ______ _____ _ _ _____ _ +# | ___ \ / ___| | | | |_ _| | | +# | |_/ / _ _______ _ __ ___ \ `--.| |__ __ _ _ __ __| | | | ___ ___ | |___ +# | / | | |_ / _ \| '_ ` _ \ `--. \ '_ \ / _` | '__/ _` | | |/ _ \ / _ \| / __| +# | |\ \ |_| |/ / (_) | | | | | | /\__/ / | | | (_| | | | (_| | | | (_) | (_) | \__ \ +# \_| \_\__, /___\___/|_| |_| |_| \____/|_| |_|\__,_|_| \__,_| \_/\___/ \___/|_|___/ +# __/ | +# |___/ +# +# Ryzom - MMORPG Framework +# Copyright (C) 2019 Winch Gate Property Limited +# This program is free software: read https://ryzom.com/dev/copying.html for more details +# +# This rc script is used to start all services of the shard into a screen session +# + +# ------------------------------------------------------------------------------ +# SCREEN KEYBINDINGS +# +shell /bin/bash +defscrollback 5000 +hardstatus on +hardstatus alwayslastline +hardstatus string "%{.kW}%-w%{.bW}%t [%n]%{-}%+w %=%{..G} %H %{..Y} %Y/%m/%d %c" + +# Remove some stupid / dangerous key bindings +bind "^k" +bind "^\" +bindkey "^C" echo 'Blocked. Please use [Ctrl]+[A] + [Ctrl]+[Enter] + [Y]' +bindkey "^D" echo 'Blocked. Please use [Ctrl]+[A] + [Ctrl]+[Enter] + [Y]' + +# Make them better +bind \\ quit +bind K kill +bind I login on +bind O login off +bindkey "^[[1;5D" prev +bindkey "^[[1;5C" next + +# egs +screen -t EGS /bin/bash $SHARD_PATH/tools/service_launcher.sh egs ../sbin/ryzom_entities_game_service -C../cfgs -L../logs --nobreak --writepid + +# ios +screen -t IOS /bin/bash $SHARD_PATH/tools/service_launcher.sh ios ../sbin/ryzom_ios_service -C../cfgs -L../logs --nobreak --writepid + +# gpms +screen -t GPM /bin/bash $SHARD_PATH/tools/service_launcher.sh gpms ../sbin/ryzom_gpm_service -C../cfgs -L../logs --nobreak --writepid + +# ais_newbieland +screen -t New /bin/bash $SHARD_PATH/tools/service_launcher.sh ais_newbieland ../sbin/ryzom_ai_service -C../cfgs -L../logs -Nais_newbieland --nobreak --writepid -mCommon:Newbieland:Post + +# ais_fyros +screen -t Fyr /bin/bash $SHARD_PATH/tools/service_launcher.sh ais_fyros ../sbin/ryzom_ai_service -C../cfgs -L../logs -Nais_fyros --nobreak --writepid -mCommon:Indoors:Fyros:FyrosNewbie:FyrosIsland:Post + +# ais_matis +screen -t Mat /bin/bash $SHARD_PATH/tools/service_launcher.sh ais_matis ../sbin/ryzom_ai_service -C../cfgs -L../logs -Nais_matis --nobreak --writepid -mCommon:Indoors:Matis:MatisNewbie:MatisIsland:Post + +# ais_tryker +screen -t Trk /bin/bash $SHARD_PATH/tools/service_launcher.sh ais_tryker ../sbin/ryzom_ai_service -C../cfgs -L../logs -Nais_tryker --nobreak --writepid -mCommon:Indoors:Tryker:TrykerNewbie:TrykerIsland:Post + +# ais_zorai +screen -t Zor /bin/bash $SHARD_PATH/tools/service_launcher.sh ais_zorai ../sbin/ryzom_ai_service -C../cfgs -L../logs -Nais_zorai --nobreak --writepid -mCommon:Indoors:Zorai:ZoraiNewbie:ZoraiIsland:Post + +# ais_roots +screen -t Pri /bin/bash $SHARD_PATH/tools/service_launcher.sh ais_roots ../sbin/ryzom_ai_service -C../cfgs -L../logs -Nais_roots --nobreak --writepid -mCommon:Bagne:Nexus:RouteGouffre:Sources:Terre:Kitiniere:Post + +#ais_ark +screen -t Ark /bin/bash $SHARD_PATH/tools/service_launcher.sh ais_ark ../sbin/ryzom_ai_service -C../cfgs -L../logs -Nais_ark --nobreak --writepid -mCommon:Indoors::R2Desert:R2Roots:R2Jungle:R2Forest:R2Lakes:Post + + +# aes +screen -t aes /bin/bash $SHARD_PATH/tools/service_launcher.sh aes ../sbin/ryzom_admin_service -A. -C../cfgs -L../logs --nobreak --fulladminname=admin_executor_service --shortadminname=AES + +# bms_master +screen -t bms_master /bin/bash $SHARD_PATH/tools/service_launcher.sh bms_master ../sbin/ryzom_backup_service -C../cfgs -L../logs --nobreak --writepid -P49990 + +# su +screen -t su /bin/bash $SHARD_PATH/tools/service_launcher.sh su ../sbin/ryzom_shard_unifier_service -C../cfgs -L../logs --nobreak --writepid + +# ras +screen -t ras /bin/bash $SHARD_PATH/tools/service_launcher.sh ras ../sbin/ryzom_admin_service --fulladminname=admin_service --shortadminname=AS -C../cfgs -L../logs --nobreak --writepid + + +# bms_pd_master +#screen -t bms_pd_master /bin/bash $SHARD_PATH/tools/service_launcher.sh bms_pd_master ../sbin/ryzom_backup_service -C../cfgs -L../logs --nobreak --writepid -P49992 + +# rns +screen -t rns /bin/bash $SHARD_PATH/tools/service_launcher.sh rns ../sbin/ryzom_naming_service -C../cfgs -L../logs --nobreak --writepid + +# rws +screen -t rws /bin/bash $SHARD_PATH/tools/service_launcher.sh rws ../sbin/ryzom_welcome_service -C../cfgs -L../logs --nobreak --writepid + +# ts +screen -t ts /bin/bash $SHARD_PATH/tools/service_launcher.sh ts ../sbin/ryzom_tick_service -C../cfgs -L../logs --nobreak --writepid + +# ms +screen -t ms /bin/bash $SHARD_PATH/tools/service_launcher.sh ms ../sbin/ryzom_mirror_service -C../cfgs -L../logs --nobreak --writepid + +# mfs +screen -t mfs /bin/bash $SHARD_PATH/tools/service_launcher.sh mfs ../sbin/ryzom_mail_forum_service -C../cfgs -L../logs --nobreak --writepid + +# fes +screen -t fes /bin/bash $SHARD_PATH/tools/service_launcher.sh fes ../sbin/ryzom_frontend_service -C../cfgs -L../logs --nobreak --writepid + +# sbs +screen -t sbs /bin/bash $SHARD_PATH/tools/service_launcher.sh sbs ../sbin/ryzom_session_browser_service -C../cfgs -L../logs --nobreak --writepid + +# lgs +screen -t lgs /bin/bash $SHARD_PATH/tools/service_launcher.sh lgs ../sbin/ryzom_logger_service -C../cfgs -L../logs --nobreak --writepid + +# mos +screen -t mos /bin/bash $SHARD_PATH/tools/service_launcher.sh mos ../sbin/ryzom_monitor_service -C../cfgs -L../logs --nobreak --writepid + +# pdss +#screen -t pdss /bin/bash $SHARD_PATH/tools/service_launcher.sh pdss ../sbin/ryzom_pd_support_service -C../cfgs -L../logs --nobreak --writepid + + +termcapinfo xterm* 'hs:ts=\E]2;:fs=\007:ds=\E]2;screen\007:ti@:te@' diff --git a/ryzom/server/www/config_example.php b/ryzom/server/www/config_example.php new file mode 100644 index 000000000..63dadf97f --- /dev/null +++ b/ryzom/server/www/config_example.php @@ -0,0 +1,27 @@ +setName("GCMD"); + + + $msg->serialString($command); + + return parent::sendMessage($msg); + + + } + + function controlCmd($serviceAlias, $command) + { + $msg = new CMessage; + $msg->setName("CCMD"); + + + $msg->serialString($serviceAlias); + $msg->serialString($command); + + return parent::sendMessage($msg); + + + } + + function serviceCmd($serviceAlias, $command) + { + $msg = new CMessage; + $msg->setName("SCMD"); + + + $msg->serialString($serviceAlias); + $msg->serialString($command); + + return parent::sendMessage($msg); + + + } + + function getShardOrders() + { + $msg = new CMessage; + $msg->setName("GSO"); + + + + $ret = ""; + $ret = parent::sendMessage($msg); + if ($ret == false) + { + // error during send + $this->invokeError("getShardOrders", "Error in 'sendMessage'"); + return false; + } + + $retMsg = parent::waitMessage(); + if ($ret == false) + { + // error during send + $this->invokeError("getShardOrders", "Error in 'waitMessage'"); + return false; + } + if (!($retMsg->MsgName === "R_GSO")) + { + // error during send + $this->invokeError("getShardOrders", "Invalid response, awaited 'R_GSO', received '".$retMsg->MsgName."'"); + return false; + } + + // serial the return value + $nbElem = 0; + $retMsg->serialUInt32($nbElem); + $retValue = array(); + for ($i=0; $i<$nbElem;$i++) + { + $retMsg->serialString($item); + $retValue[] = $item; + } + + + // return the return value + return $retValue; + + + } + + function getStates() + { + $msg = new CMessage; + $msg->setName("GS"); + +echo "ok"; + + $ret = ""; + $ret = parent::sendMessage($msg); + if ($ret == false) + { + // error during send + $this->invokeError("getStates", "Error in 'sendMessage'"); + return false; + } +echo "ok"; + $retMsg = parent::waitMessage(); + if ($ret == false) + { + // error during send + $this->invokeError("getStates", "Error in 'waitMessage'"); + return false; + } +echo "ok"; + if (!($retMsg->MsgName === "R_GS")) + { + // error during send + $this->invokeError("getStates", "Invalid response, awaited 'R_GS', received '".$retMsg->MsgName."'"); + return false; + } +echo "ok\n"; + // serial the return value + $nbElem = 0; + $retMsg->serialUInt32($nbElem); + $retValue = array(); + echo $nbElem."\n"; + for ($i=0; $i<$nbElem;$i++) + { + $retMsg->serialString($item); + $retValue[] = $item; + } + + + // return the return value + return $retValue; + + + } + + function getHighRezGraph($varAddr, $startDate, $endDate, $milliStep) + { + $msg = new CMessage; + $msg->setName("GHRG"); + + + $msg->serialString($varAddr); + $msg->serialUint32($startDate); + $msg->serialUint32($endDate); + $msg->serialUint32($milliStep); + + $ret = ""; + $ret = parent::sendMessage($msg); + if ($ret == false) + { + // error during send + $this->invokeError("getHighRezGraph", "Error in 'sendMessage'"); + return false; + } + + $retMsg = parent::waitMessage(); + if ($ret == false) + { + // error during send + $this->invokeError("getHighRezGraph", "Error in 'waitMessage'"); + return false; + } + if (!($retMsg->MsgName === "R_GHRG")) + { + // error during send + $this->invokeError("getHighRezGraph", "Invalid response, awaited 'R_GHRG', received '".$retMsg->MsgName."'"); + return false; + } + + // serial the return value + $nbElem = 0; + $retMsg->serialUInt32($nbElem); + $retValue = array(); + for ($i=0; $i<$nbElem;$i++) + { + $retMsg->serialString($item); + $retValue[] = $item; + } + + + // return the return value + return $retValue; + + + } + + + function waitCallback() + { + $message = parent::waitMessage(); + + if ($message == false) + return false; + + switch($message->MsgName) + { + case "CMDR": + $this->commandResult_skel($message); + break; + default: + return false; + } + + return true; + } + + + function commandResult_skel(&$message) + { +$message->serialString($serviceAlias); + $message->serialString($result); + + $this->commandResult($serviceAlias, $result); + } + + + ///////////////////////////////////////////////////////////////// + // Copy paste this part of code in your derived class + // and implement code to ract to incoming message + ///////////////////////////////////////////////////////////////// + + function commandResult($serviceAlias, $result) + { + } + + } + + class MyAdminService extends CAdminServiceWeb + { + function commandResult($serviceModuleName, $result) + { + global $command_return_data; + + $command_return_data = trim("===[ Service ". strtoupper($serviceModuleName) ." returned ]===\n". trim($result) ."\n\n"); + } + } + + + function parseDumpGuildList($data) + { + $server = ''; + $result = array(); + + reset($data); + foreach($data as $server_data) + { + $data_ary = explode("\n",$server_data); + reset($data_ary); + foreach($data_ary as $rline) + { + $rline = trim($rline); + + if (preg_match('/^===\[ Service ([^\ ]+) returned \]===/', $rline, $params)) + { + $server = $params[1]; + $result[$server] = array(); + $result[$server]['name'] = array(); + $result[$server]['dump'] = array(); + } + elseif (preg_match("/^id = ([[:digit:]]+)\:([[:digit:]]+) \(([^\ ]+)\) (\(0x[[:alnum:]]+\:[[:alnum:]]+\:[[:alnum:]]+\:[[:alnum:]]+\)), name = '([^\']+)', ([[:digit:]]+) members/",$rline,$params)) + { + // id = 101:1 (Local) (0x0006500001:0c:00:88), name = 'Les Gardiens de l Atrium', 21 members + if ($server != '') + { + $result[$server]['dump'][] = $params; + $result[$server]['name'][] = $params[5]; + } + } + } + } + + + return $result; + } + + + function parseDumpOutpostList($data) + { + $server = ''; + $result = array(); + + reset($data); + foreach($data as $server_data) + { + $data_ary = explode("\n",$server_data); + reset($data_ary); + foreach($data_ary as $rline) + { + $rline = trim($rline); + + if (preg_match("/^([[:digit:]]+)\: Alias\: \((A\:[[:digit:]]+\:[[:digit:]]+)\), Name\: '([^\']+)', Sheet\: '([^\']+)', State\: '([^\']+)', Level\: ([[:digit:]]+), Owner\: '([^\']+)'/",$rline,$params)) + { + $result[$params[3]] = $params; + } + } + } + + + return $result; + } + + + + function parseDisplayPlayers($data) + { + $server = ''; + $result = array(); + + reset($data); + $data = str_replace('\\\'', '', $data); + + foreach($data as $server_data) + { + $data_ary = explode("\n",$server_data); + reset($data_ary); + foreach($data_ary as $rline) + { + $rline = trim($rline); + + if (preg_match('/^Player: ([[:digit:]]+) Name: ([^ ]+) ID: (\(0x[[:alnum:]]+\:[[:alnum:]]+\:[[:alnum:]]+\:[[:alnum:]]+\)) FE: [[:digit:]]+ Sheet: [a-z]+\.race_stats - [[:digit:]]+ Priv: ([^ ]+) Pos: ([0-9]+),(-[0-9]+),([0-9\-]+) Session: [0-9]01/',$rline,$params)) + { + // Player: 723931 Name: Deodand(Atys) ID: (0x0000b0bdb0:00:00:8b) FE: 139 Sheet: tryker.race_stats - 533 Priv: \'\' Pos: 15264,-34428,-3 Session: 101 + $result[$params[1]] = $params; + } + } + } + + + return $result; + } + + + function parseDumpGuild($data) + { + $server = ''; + $result = array(); + + reset($data); + foreach($data as $server_data) + { + $data_ary = explode("\n",$server_data); + + reset($data_ary); + foreach($data_ary as $rline) + { + if (preg_match('/^===\[ Service ([^\ ]+) returned \]===/',$rline,$params)) + { + $server = $params[1]; + $result[$server] = array(); + } + // Guild id: 1, name: 'Les Gardiens de l Atrium', eid: (0x0000000001:0c:00:81) + //if (ereg("^[[:space:]]*\ Guild id: ([[:digit:]]+), name: \'([[:alnum:]]+)\', eid: (\(0x[[:alnum:]]+\:[[:alnum:]]+\:[[:alnum:]]+\:[[:alnum:]]+\))$",$rline,$params)) + elseif (preg_match('/^\ Guild id: ([[:digit:]]+)\:([[:digit:]]+) \(([^\ ]+)\), name: \'([A-Za-z0-9\ _-]+)\', eid: (\(0x[[:alnum:]]+\:[[:alnum:]]+\:[[:alnum:]]+\:[[:alnum:]]+\))/',$rline,$params)) + { + $guild_name = $params[4]; + $result[$server] = array(); + $result[$server]['dump'] = $params; + } + // Description: 'French CSR' + elseif (preg_match('/^[[:space:]]*Description: \'(.*)\'/',$rline,$params)) + { + if ($server != '') + { + $result[$server]['desc'] = $params[1]; + } + } + // Icon: 0x0000000000000681 + elseif (preg_match('/^[[:space:]]*Icon: (0x[[:alnum:]]+)/',$rline,$params)) + { + if ($server != '') + { + $result[$server]['icon'] = hexdec($params[1]); + } + } + // Money: 65500000 + elseif (preg_match('/^[[:space:]]*Money: ([[:alnum:]]+)/',$rline,$params)) + { + if ($server != '') + { + $result[$server]['money'] = $params[1]; + } + } + // Race: Fyros + elseif (preg_match('/^[[:space:]]*Race: (.*)/',$rline,$params)) + { + if ($server != '') + { + $result[$server]['race'] = $params[1]; + } + } + // Building: building_instance_FY_guild_327 + elseif (preg_match('/^[[:space:]]*Building: (.*)/',$rline,$params)) + { + if ($server != '') + { + $result[$server]['building'] = $params[1]; + } + } + // Civ Allegiance: Fyros + elseif (preg_match('/^[[:space:]]*Civ Allegiance: (.*)/',$rline,$params)) + { + if ($server != '') + { + $result[$server]['civ'] = $params[1]; + } + } + // Cult Allegiance: Kami + elseif (preg_match('/^[[:space:]]*Cult Allegiance: (.*)/',$rline,$params)) + { + if ($server != '') + { + $result[$server]['cult'] = $params[1]; + } + } + // Nb of members: 27 + elseif (preg_match('/^[[:space:]]*Nb of members: ([[:digit:]]+)/',$rline,$params)) + { + if ($server != '') + { + $result[$server]['count'] = $params[1]; + } + } + // Member 'Yotto' (0x00000096f0:00:00:86), index: 2, grade: HighOfficer, enter time: 60960905 + elseif (preg_match('/^[[:space:]]*Member \'([^\ ]+)\' (\(0x[[:alnum:]]+\:[[:alnum:]]+\:[[:alnum:]]+\:[[:alnum:]]+\)), index: ([[:digit:]]+), grade: ([[:alnum:]]+), enter time: ([[:digit:]]+)/',$rline,$params)) + { + if ($server != '') + { + $result[$server][$params[4]][] = $params[1]; + } + } + } + } + return $result; + } + + function querySelectedShard($name, $service_name, $fullcmd, $cmd='', $waitCallback=true, $is_control=false) { + global $command_return_data; + + $nel_result = array(); + $nel_status = !$waitCallback; + + $p_result = null; + + $adminService = new MyAdminService; + + if ($adminService->connect($name, '46700', $res) !== false) { + $command_return_data = ''; + + //echo "NEL[$service_name] : $service_command\n"; + if (is_array($fullcmd)) { + foreach ($fullcmd as $service_command) { + if ($is_control) + $adminService->controlCmd($service_name, $service_command); + else + $adminService->serviceCmd($service_name, $service_command); + } + } else { + if ($is_control) + $adminService->controlCmd($service_name, $fullcmd); + else + $adminService->serviceCmd($service_name, $fullcmd); + $service_command = $fullcmd; + //echo "NEL[$service_name] : OK\n"; + if ($waitCallback && $adminService->waitCallback()) { + //echo "NEL[$service_name] : Successful!\n"; + + $nel_status = true; + $nel_result[] = $command_return_data; + //print_r($command_return_data); + } else { + //echo "NEL[$service_name] : Failed!\n"; + } + } + + @$adminService->close(); + } + + if ($nel_status) { + if (strlen($cmd) > 0) { + $func_name = 'parse'.ucfirst($cmd); + if (function_exists($func_name)) + $p_result = call_user_func($func_name,$nel_result); + } + } + + return array('status' => $nel_status, 'query' => $service_name.':'.$service_command, 'raw' => $nel_result, 'parsed' => $p_result); + } + + function queryShard($service_name, $fullcmd, $cmd='', $waitCallback=true, $is_control=false) + { + return querySelectedShard('localhost', $service_name, $fullcmd, $cmd, $waitCallback, $is_control); + } + diff --git a/ryzom/server/www/libs/nel_message.php b/ryzom/server/www/libs/nel_message.php new file mode 100644 index 000000000..b2dc74484 --- /dev/null +++ b/ryzom/server/www/libs/nel_message.php @@ -0,0 +1,296 @@ +InputStream = false; + $this->Pos = 0; + $this->Buffer = ""; + debug("A : ".gettype($this->Buffer)."
"); + } + + function setBuffer ($Buffer) + { + $this->InputStream = true; + $this->Buffer = $Buffer; + $this->Pos = 0; + } + + function isReading () { return $this->InputStream; } + + function serialUInt8 (&$val) + { + if ($this->isReading()) + { + $val = ord($this->Buffer{$this->Pos++}); + debug(sprintf ("read uint8 '%d'
\n", $val)); + } + else + { + debug("B".gettype($this->Buffer)."
"); + debug(sprintf ("write uint8 Buffer size before = %u
\n", strlen($this->Buffer))); + $this->Buffer = $this->Buffer . chr($val & 0xFF); + $this->Pos++; + debug("C".gettype($this->Buffer)."
"); + debug(sprintf ("write uint8 '%d' %d
\n", $val, $this->Pos)); + debug(sprintf ("write uint8 Buffer size after = %u
\n", strlen($this->Buffer))); + } + } + + function serialUInt32 (&$val) + { + if ($this->isReading()) + { + $val = ord($this->Buffer{$this->Pos++}); + $val += ord($this->Buffer{$this->Pos++})*256; + $val += ord($this->Buffer{$this->Pos++})*(double)256*256; + $val += ord($this->Buffer{$this->Pos++})*(double)256*256*256; + debug(sprintf ("read uint32 '%d'
\n", $val)); +// var_dump($val); + } + else + { + debug("D".gettype($this->Buffer)."
"); + $this->Buffer .= chr($val & 0xFF); + $this->Buffer .= chr(($val>>8) & 0xFF); + $this->Buffer .= chr(($val>>16) & 0xFF); + $this->Buffer .= chr(($val>>24) & 0xFF); + $this->Pos += 4; + debug("E".gettype($this->Buffer)."
"); + debug(sprintf ("write uint32 '%d' %d
\n", $val, $this->Pos)); + } + } + + function serialString (&$val) + { + if ($this->isReading()) + { + $this->serialUInt32($size); + debug(sprintf ("read string : size = %u
\n", $size)); + $val = substr ($this->Buffer, $this->Pos, $size); + debug(sprintf ("read string '%s'
\n", $val)); + $this->Pos += strlen($val); + } + else + { + $valLen = strlen($val); + $this->serialUInt32($valLen); + $this->Buffer .= $val; + $this->Pos += $valLen; + debug(sprintf ("write string '%s' %d
\n", $val, $this->Pos)); + } + } + function serialEnum (&$val) + { + if ($this->isReading()) + { + $intValue = 0; + $this->serialUInt32($intValue); + $val->fromInt((int)$intValue); + debug(sprintf ("read enum '%s'
\n", $val->toString())); + } + else + { + $intValue = $val->toInt(); + $this->serialUInt32($intValue); + debug(sprintf ("write enum '%s' %d
\n", $val->toString(), $this->Pos)); + } + } + } + + class CMessage extends CMemStream + { + var $MsgName; + + function CMessage() + { + $this->CMemStream(); + } + + function setName($name) + { + $this->MsgName = $name; + } + } + + class CCallbackClient + { + var $ConSock = false; + + var $MsgNum = 0; + + function connect($addr, $port, &$res) + { + global $SockTimeOut; + + debug(sprintf("Connect
")); + $this->MsgNum = 0; + + $this->ConSock = fsockopen ($addr, $port, $errno, $errstr, $SockTimeOut); + debug("H".gettype($this->ConSock)."
"); + + if (!$this->ConSock) + { + $res = "Can't connect to the callback server '$addr:$port' ($errno: $errstr)"; + + return false; + } + else + { + // set time out on the socket to 2 secondes + stream_set_timeout($this->ConSock, $SockTimeOut); + $res = ""; + return true; + } + } + + function close() + { + if ($this->ConSock) + { + fclose($this->ConSock); + debug(sprintf("Close
")); + } + else + debug(sprintf("Already Closed !
")); + } + + function sendMessage(&$message) + { + if (!$this->ConSock) + { + debug(sprintf ("Socket is not valid\n")); + return false; + } + debug(sprintf ("sendMessage : message Buffer is '%d'
\n", $message->Pos)); + debug(sprintf ("sendMessage : message Buffer is '%d'
\n", strlen($message->Buffer))); + $hd = new CMemStream; + debug(sprintf("SendMessage number %u
", $this->MsgNum)); + $hd->serialUInt32 ($this->MsgNum); // number the packet + $this->MsgNum += 1; + debug(sprintf("After SendMessage, number %u
", $this->MsgNum)); + $messageType = 0; + $hd->serialUInt8 ($messageType); + $hd->serialString ($message->MsgName); + + debug(sprintf ("sendMessage : header size is '%d'
\n", $hd->Pos)); + +// $sb .= $message->Buffer; + + $size = $hd->Pos + $message->Pos; + $Buffer = (string) chr(($size>>24)&0xFF); + $Buffer .= chr(($size>>16)&0xFF); + $Buffer .= chr(($size>>8)&0xFF); + $Buffer .= chr($size&0xFF); + debug( "E".gettype($hd->Buffer)."
"); + debug("F".gettype($message->Buffer)."
"); + $Buffer .= (string) $hd->Buffer; + $Buffer .= (string) $message->Buffer; + + debug("G".gettype($this->ConSock)."
"); + + if (!fwrite ($this->ConSock, $Buffer)) + { + debug(sprintf ("Error writing to socket\n")); + return false; + } + debug(sprintf ("sent packet size '%d' (written size = %d)
\n", strlen($Buffer), $size)); + fflush ($this->ConSock); + + return true; + } + + function waitMessage() + { + if (!$this->ConSock) + { + debug(sprintf ("Socket is not valid\n")); + return false; + } + + + $size = 0; + $val = fread ($this->ConSock, 1); + $info = stream_get_meta_data($this->ConSock); + if ($info['timed_out']) + { + debug('Connection timed out!'); + return false; + } + $size = ord($val) << 24; + $val = fread ($this->ConSock, 1); + $info = stream_get_meta_data($this->ConSock); + if ($info['timed_out']) + { + debug('Connection timed out!'); + return false; + } + $size = ord($val) << 16; + $val = fread ($this->ConSock, 1); + $info = stream_get_meta_data($this->ConSock); + if ($info['timed_out']) + { + debug('Connection timed out!'); + return false; + } + $size += ord($val) << 8; + $val = fread ($this->ConSock, 1); + $info = stream_get_meta_data($this->ConSock); + if ($info['timed_out']) + { + debug('Connection timed out!'); + return false; + } + $size += ord($val); + debug(sprintf ("receive packet size '%d'
\n", $size)); + $fake = fread ($this->ConSock, 5); + $info = stream_get_meta_data($this->ConSock); + if ($info['timed_out']) + { + debug('Connection timed out!'); + return false; + } + $size -= 5; // remove the fake + + $Buffer = ""; + while ($size > 0 && strlen($Buffer) != $size) + { + $Buffer .= fread ($this->ConSock, $size - strlen($Buffer)); + $info = stream_get_meta_data($this->ConSock); + if ($info['timed_out']) + { + debug('Connection timed out!'); + return false; + } + } + $msgin = new CMemStream; + $msgin->setBuffer ($Buffer); + + // decode msg name + $msgin->serialString($name); + + debug(sprintf("Message name = '%s'
", $name)); + $message = new CMessage; + $message->setBuffer(substr($msgin->Buffer, $msgin->Pos)); + $message->setName($name); + + debug(sprintf("In message name = '%s'
", $message->MsgName)); + + return $message; + } + } + +?> diff --git a/ryzom/server/www/login/libs/domain_info.php b/ryzom/server/www/login/libs/domain_info.php new file mode 100644 index 000000000..816958bd2 --- /dev/null +++ b/ryzom/server/www/login/libs/domain_info.php @@ -0,0 +1,25 @@ + diff --git a/ryzom/server/www/login/libs/join_shard.php b/ryzom/server/www/login/libs/join_shard.php new file mode 100644 index 000000000..e97ccdd6f --- /dev/null +++ b/ryzom/server/www/login/libs/join_shard.php @@ -0,0 +1,249 @@ +

Back to menu'; + } + } + else + { + // ok, we have the info to connect ! + // generate the lua script + $cookie=convertCookieForActionHandler($_COOKIE["ryzomId"]); + global $FSHostLuaMode, $FSHostResult, $FSHostResultStr; + $FSHostResult = 1; + $FSHostResultStr = $shardAddr; + if ($FSHostLuaMode) + { + $luaScript='runAH(nil, "on_connect_to_shard", "cookie='.$cookie.'|fsAddr='.$shardAddr.'")'; + //echo 'luaScript : '.$luaScript.'
'; + echo ''.$luaScript.''; + global $verbose; + if ($verbose) + echo '
Teleporting to shard
'; + } + } + } + + /** + * Receive the result of the shard list, then call the global $getShardListCallback with the associative array as argument + */ + function getShardsResult($userId, $resultStr) + { + global $getShardListCallback; + + $onlineShardsBySessionId = array(); + $resultArray = split(';', $resultStr); + foreach ($resultArray as $shardInfo) + { + $shardAttr = split(',', $shardInfo); + if (isset($shardAttr[1])) + $onlineShardsBySessionId[$shardAttr[0]] = $shardAttr[1]; + } + $getShardListCallback($onlineShardsBySessionId); + } +} + +// External use +$FSHostLuaMode = false; +$FSHostResultStr = 0; + +// Internal use +$verbose = true; +$FSHostResult = 0; + +// THE ABOVE DECLARATIONS ARE NEEDED FOR ALL CODE BELOW THIS LINE +if (isset($_POST["ml"])) + joinMainlandPost(); +if (isset($_POST["destSessionId"])) + joinShardFromIdPost($_POST["destSessionId"]); + +/** + * Authenticate and request to join a mainland shard + */ +function joinMainlandPost() +{ + global $FSHostLuaMode; + $FSHostLuaMode = true; + $domainId = -1; + if (!validateCookie($userId, $domainId, $charId)) + { + echo "Invalid cookie !"; + die(); + } + else + { + joinMainland($userId, $domainId); + } +} + +/** + * Authenticate and request to join the specified shard + */ +function joinShardFromIdPost( $destSessionId ) +{ + $domainId = -1; + if (!validateCookie($userId, $domainId, $charId)) + { + echo "Invalid cookie !"; + die(); + } + else + { + joinShardFromId($userId, $domainId, $destSessionId); + } +} + +/** + * Request to join the specified shard + */ +function joinShardFromId( $userId, $domainId, $destSessionId ) +{ + $domainInfo = getDomainInfo($domainId); + $addr = split(":", $domainInfo["session_manager_address"]); + $RSMHost = $addr[0]; + $RSMPort = $addr[1]; + + // request join to the session manager + $joinShard = new JoinShardCb; + $res = ""; + $joinShard->connect($RSMHost, $RSMPort, $res); + $charSlot = getCharSlot(); // if ingame (!=15), the RSM can check if this character has the right to connect to the specified shard + $charId = ($userId<<4) + $charSlot; + echo "Requesting teleportation of $charId/$userId to shard session ".$destSessionId."...
"; + $joinShard->joinSession($charId, $destSessionId, $domainInfo["domain_name"]); + + // wait the the return message + if ($joinShard->waitCallback() == false) + { + // Note: the answer is a joinSessionResult message + echo "No response from server, joinShard failed
"; + } + exit; +} + +/** + * Request to get the shard list + */ +function getShardList($userId, $domainId) +{ + $domainInfo = getDomainInfo($domainId); + $addr = split(":", $domainInfo["session_manager_address"]); + $RSMHost = $addr[0]; + $RSMPort = $addr[1]; + + // request get to the session manager + $joinShard = new JoinShardCb; + $res = ""; + $joinShard->connect($RSMHost, $RSMPort, $res); + + $charId = ($userId<<4)+15; + echo "Retrieving online shards for $charId...
"; + $joinShard->getShards($charId); + + // wait the the return message + if ($joinShard->waitCallback() == false) + { + echo "No response from server, getShards failed
"; + } + exit; +} + +/** + * Display the list of mainland shards + * This is a candidate to the callback $getShardListCallback + */ +function displayAllShards(&$onlineShardsBySessionId) +{ + // Get the userId and domainId back + $domainId = -1; + if (!validateCookie($userId, $domainId, $charId)) + { + echo "Invalid cookie !"; + die(); + } + + // List all shards of the domain, including offline ones + global $DBName; + mysql_select_db ($DBName) or die ("Can't access to the db dbname:$DBName"); + $query = "select * from shard where domain_id = $domainId"; + $resShards = mysql_query ($query) or die ("Can't execute the query: ".$query." ".mysql_error()); + echo "Select a shard to join:
"; + //echo "

"; + while ($rowShard = mysql_fetch_array($resShards)) + { + $mainlandSessionId = $rowShard['FixedSessionId']; + $isOnline = isset($onlineShardsBySessionId[$mainlandSessionId]); + // Radio button not supported by Client's html component. Instead: one form (button) per shard. + //echo "".$rowShard['Name']." (".($isOnline?"online with $nbOnlinePlayers players":"offline").", version ".$rowShard['Version'].")
"; + echo ""; + echo ""; + echo ""; + echo " ".$rowShard['Name']." ".$rowShard['ShardId']." (".($isOnline ? $onlineShardsBySessionId[$mainlandSessionId]." online)" : "offline)"); + if ($isOnline) + echo ""; + echo "

"; + } + + //echo ""; + //echo ""; + exit; +} + + +/** + * Auto-join a shard. + * Returns true in case of success, and the FSHost address in $FSHostResultStr. + * Returns false in case of error, and an explanatory string in $FSHostResultStr. + */ +function joinMainland($userId, $domainId) +{ + $domainInfo = getDomainInfo($domainId); +// $addr = split(":", $domainInfo["session_manager_address"]); + $addr = explode(":", $domainInfo["session_manager_address"]); + $RSMHost = $addr[0]; + $RSMPort = $addr[1]; + + // request get to the session manager + $joinsShard = new JoinShardCb; + $res = ""; + $joinsShard->connect($RSMHost, $RSMPort, $res); + + // set the shard Id to allow any character (by using the special value '15') + $charId = ($userId<<4)+15; + global $FSHostLuaMode, $verbose; + if ($FSHostLuaMode && $verbose) + echo "Joining a mainland shard for $charId...
"; + $joinsShard->joinMainland($charId, $domainInfo["domain_name"]); + + // wait the the return message + if ($joinsShard->waitCallback() == false) + { + global $FSHostResultStr; + $FSHostResultStr = "No response from server for joinMainland
"; + return false; + } + global $FSHostResult; + return $FSHostResult; +} +?> diff --git a/ryzom/server/www/login/libs/login_service_itf.php b/ryzom/server/www/login/libs/login_service_itf.php new file mode 100644 index 000000000..51cce5788 --- /dev/null +++ b/ryzom/server/www/login/libs/login_service_itf.php @@ -0,0 +1,108 @@ +setName("LG"); + + + $msg->serialUint32($userId); + $msg->serialString($ipAddress); + $msg->serialUint32($domainId); + + return parent::sendMessage($msg); + + + } + + function logout($userId) + { + $msg = new CMessage; + $msg->setName("LO"); + + + $msg->serialUint32($userId); + + return parent::sendMessage($msg); + + + } + + + function waitCallback() + { + $message = parent::waitMessage(); + + if ($message == false) + return false; + + switch($message->MsgName) + { + case "LGR": + $this->loginResult_skel($message); + break; + case "LGOR": + $this->logoutResult_skel($message); + break; + default: + return false; + } + + return true; + } + + + function loginResult_skel(&$message) + { + $message->serialUint32($userId); + $message->serialString($cookie); + $message->serialUint32($resultCode); + $message->serialString($errorString); + + $this->loginResult($userId, $cookie, $resultCode, $errorString); + } + + function logoutResult_skel(&$message) + { + $message->serialUint32($errorCode); + $message->serialString($reason); + + $this->logoutResult($errorCode, $reason); + } + + + ///////////////////////////////////////////////////////////////// + // Copy paste this part of code in your derived class + // and implement code to ract to incoming message + ///////////////////////////////////////////////////////////////// + // Return the cookie generated for this user session + // Eventualy, return an empty string as cookie in case of error + // resultCode : 0 - ok, login success + // 1 - invalid user + // 2 - user already online, must relog + // errorString contain a stringified description in case of error + + function loginResult($userId, $cookie, $resultCode, $errorString) + { + } + + // Return an error code for the logout attemp + // If return is not 0, then reason contains a debug string + // Return values : 0 - ok + // 1 - invalid user + // 2 - user already offline + + function logoutResult($errorCode, $reason) + { + } + + } +?> diff --git a/ryzom/server/www/login/libs/login_translations.php b/ryzom/server/www/login/libs/login_translations.php new file mode 100644 index 000000000..2fcff90d2 --- /dev/null +++ b/ryzom/server/www/login/libs/login_translations.php @@ -0,0 +1,310 @@ + ex 56; signup_data => ex 56B +$ErrMsgs[2004]['en'] = "Invalid password"; +$ErrMsgs[2004]['fr'] = "Mot de passe erroné"; +$ErrMsgs[2004]['de'] = "Falsches Passwort"; +$ErrMsgs[2004]['log'] = false; + +// Translated Login Service error messages +define('BASE_TRANSLATED_LS_ERROR_NUM', 2100); + +$ErrMsgs[2101]['dbg'] = '(LS error %1: %2 for userId %3)'; +$ErrMsgs[2101]['en'] = 'Invalid account'; // ex 1?: 'invalid user' +$ErrMsgs[2101]['fr'] = 'Compte erroné'; +$ErrMsgs[2101]['de'] = 'Ungültiger Account'; + +$ErrMsgs[2102]['dbg'] = '(LS error %1: %2 for userId %3)'; +$ErrMsgs[2102]['en'] = 'Your account is already in online state, please retry in a few seconds'; // ex 2: 'User already online, please relog' +$ErrMsgs[2102]['fr'] = "Votre compte est encore dans l'état en ligne, merci de réessayer dans quelques secondes"; +$ErrMsgs[2102]['de'] = 'Dein Account ist schon als online gekennzeichnet, bitte versuche es in ein paar Sekunden nochmals'; +$ErrMsgs[2102]['log'] = false; + +$ErrMsgs[2103]['dbg'] = '(LS error %1: %2 for userId %3)'; +$ErrMsgs[2103]['en'] = 'Dual logging with a Privileged account is not permitted; this action has been logged and Gameforge CS has been notified'; +$ErrMsgs[2103]['fr'] = 'TODO'; +$ErrMsgs[2103]['de'] = 'TODO'; +$ErrMsgs[2103]['mail'] = array('duallog@ryzom.com', "Dual Logging with GM account detected", + "UserId %3 attempted to log-in while related account (linked through GMId) was in online state (error code %0).\n". + "Message from server: %2\n". + "This could be a false positive if the user just disconnected without waiting for 30 s, and tried to log-in with their other account."); + +$ErrMsgs[2104]['dbg'] = '(LS error %1: %2 for userId %3)'; +$ErrMsgs[2104]['lnk'] = $ErrMsgs[2103]; + +$ErrMsgs[2105]['dbg'] = '(LS error %1: %2 for userId %3)'; +$ErrMsgs[2105]['lnk'] = $ErrMsgs[2101]; + +$ErrMsgs[2106]['dbg'] = '(LS error %1: %2 for userId %3)'; +$ErrMsgs[2106]['lnk'] = $msgDBInMaintenance; + + +/* + * Technical error messages: + * "visible" error messages (server down, etc.) are localized, + * unlike errors that should never occur (ex: bad parameters from client) + */ +define('BASE_TECHNICAL_ERROR_NUM', 3000); + +$ErrMsgs[3001]['dbg'] = 'Failed to find a ring domain record for domainId: %1'; + +$ErrMsgs[3002]['dbg'] = 'Missing cmd'; + +$ErrMsgs[3003]['dbg'] = 'No response from Shard Unifier'; +$ErrMsgs[3003]['lnk'] = $msgLSInMaintenance; + +$ErrMsgs[3004]['dbg'] = "Can't connect to the %1 db server host:%2 user:%3"; +$ErrMsgs[3004]['lnk'] = $msgDBInMaintenance; + +$ErrMsgs[3005]['dbg'] = "Can't access the %1 database db:%2 host:%3 user:%4 (check privileges)"; +$ErrMsgs[3005]['lnk'] = $msgDBInMaintenance; + +$ErrMsgs[3006]['dbg'] = "Can't execute query '%1' on the %2 database db:%3 host:%4 user:%5 error:%6"; +$ErrMsgs[3006]['lnk'] = $msgDBInMaintenance; + +$ErrMsgs[3007]['dbg'] = "Can't find domain: %1"; // ex 'x' +$ErrMsgs[3007]['lnk'] = $msgMisconfiguredClient; +$ErrMsgs[3007]['add'] = 'dbg'; + +$ErrMsgs[3008]['dbg'] = "Login '%1' was created because it was not found in database"; // ex 50 + +$ErrMsgs[3009]['dbg'] = "Can't fetch login '%1' after insertion"; // ex 51 + +$ErrMsgs[3010]['dbg'] = "No permission found, but I need to accept Unknown user, so permission created, please RELOG"; + +$ErrMsgs[3011]['dbg'] = "(client application: %1 domain: %2)"; // ex 53 +$ErrMsgs[3011]['en'] = "Your account needs a proper subscription to connect"; +$ErrMsgs[3011]['fr'] = "Votre compte doit avoir un abonnement actif pour se connecter"; +$ErrMsgs[3011]['de'] = 'Du kannst dich nicht ohne abgeschlossenes Abonemment in deinen Account einloggen'; +$ErrMsgs[3011]['add'] = 'dbg'; +$ErrMsgs[3011]['log'] = false; + +$ErrMsgs[3012]['dbg'] = "No access privilege found for %1, but I need to accept Unknown user, so permission created, RELOG"; + +$ErrMsgs[3013]['dbg'] = "(client application: %1 domain: %2 reqPriv: %3)"; +$ErrMsgs[3013]['en'] = "You don't have sufficient privilege to connect now, please try later"; +$ErrMsgs[3013]['fr'] = "Vous n'avez pas les privilèges nécessaires pour vous connecter maintenant, veuillez essayer plus tard"; +$ErrMsgs[3013]['de'] = 'Du hast nicht die nötigen Rechte um dich jetzt zu verbinden, bitte versuch es später nochmal'; +$ErrMsgs[3013]['log'] = false; + +// Translated Ring Session Manager (joinSession) error messages +define('BASE_TRANSLATED_RSM_ERROR_NUM', 4000); + +$ErrMsgs[4001]['dbg'] = 'joinSession error %1: %2 for userId %3'; +$ErrMsgs[4002]['dbg'] = 'joinSession error %1: %2 for userId %3'; +$ErrMsgs[4003]['dbg'] = 'joinSession error %1: %2 for userId %3'; +$ErrMsgs[4004]['dbg'] = 'joinSession error %1: %2 for userId %3'; + +$ErrMsgs[4005]['dbg'] = '(joinSession error %1: %2 for userId %3)'; +$ErrMsgs[4005]['lnk'] = $msgGameServersClosed; + +$ErrMsgs[4006]['dbg'] = 'joinSession error %1: %2 for userId %3'; +$ErrMsgs[4007]['dbg'] = 'joinSession error %1: %2 for userId %3'; +$ErrMsgs[4008]['dbg'] = 'joinSession error %1: %2 for userId %3'; +$ErrMsgs[4009]['dbg'] = 'joinSession error %1: %2 for userId %3'; + +$ErrMsgs[4010]['dbg'] = '(joinSession error %1: %2 for userId %3)'; +$ErrMsgs[4010]['lnk'] = $msgGameServersClosed; + +$ErrMsgs[4011]['dbg'] = 'joinSession error %1: %2 for userId %3'; +$ErrMsgs[4012]['dbg'] = 'joinSession error %1: %2 for userId %3'; +$ErrMsgs[4013]['dbg'] = 'joinSession error %1: %2 for userId %3'; + +$ErrMsgs[4014]['dbg'] = '(joinSession error %1: %2 for userId %3)'; +$ErrMsgs[4014]['lnk'] = $msgGameServersClosed; + +$ErrMsgs[4015]['dbg'] = 'joinSession error %1: %2 for userId %3'; +$ErrMsgs[4016]['dbg'] = 'joinSession error %1: %2 for userId %3'; +$ErrMsgs[4017]['dbg'] = 'joinSession error %1: %2 for userId %3'; +$ErrMsgs[4018]['dbg'] = 'joinSession error %1: %2 for userId %3'; +$ErrMsgs[4019]['dbg'] = 'joinSession error %1: %2 for userId %3'; +$ErrMsgs[4020]['dbg'] = 'joinSession error %1: %2 for userId %3'; + + +$MsgLanguages = array('en'); +$DisplayDbg = true; + +/** + * Whenever a language information is known, use this method to refine the language used for error messages. + * Accepted values: + * 'en', 'fr', 'de', array of this values, or 'all' ('all' will display all versions) + */ +function setMsgLanguage($languages='en') +{ + global $MsgLanguages; + if ($languages == 'all') + { + $MsgLanguages = $languages; + return; + } + if (!is_array($languages)) + $languages = array($languages); + foreach ($languages as $index => $lg) + { + switch ($lg) + { + case 'fr': + case 'de':; + break; + default: + $languages[$index] = 'en'; + } + } + $MsgLanguages = $languages; +} + +/** + * Find the specified error message, and return the first found with the following precedence: + * 1. Current language(s) set by setMsgLangage() + * 2. English message + * 3. Debug message + * 4. Generic error + * Each language can be found through ['lnk'] if needed + * Tags (%1..%n) in the message are replaced by mixed arguments specified after $errNum. + * Ex: errorMsg(55, $domainName) + * if 'dbg' is found in ['add'] or $DisplayDbg is true, the 'dbg' version is appended to the found version. + */ +function errorMsg($errNum=GENERIC_ERROR_NUM) // $mixedArgs +{ + // Find specified message using precedence rules + global $MsgLanguages; + $precedence = array( + array($errNum, ($MsgLanguages == 'all') ? array('en', 'fr', 'de') : $MsgLanguages), + array($errNum, array('en')), + array($errNum, array('dbg')), + array(GENERIC_ERROR_NUM, $MsgLanguages), + array(GENERIC_ERROR_NUM, array('en'))); + global $ErrMsgs; + $args = func_get_args(); + $msg = ''; + foreach ($precedence as $rule) + { + // Find message + list($actualErrNum, $languages) = $rule; + foreach ($languages as $lg) + { + if (isset($ErrMsgs[$actualErrNum][$lg]) && ($ErrMsgs[$actualErrNum][$lg] != 'TODO')) + appendToMsg($msg, $errNum, $ErrMsgs[$actualErrNum][$lg], $args); + else if (isset($ErrMsgs[$actualErrNum]['lnk']) && isset($ErrMsgs[$actualErrNum]['lnk'][$lg]) && ($ErrMsgs[$actualErrNum]['lnk'][$lg] != 'TODO')) + appendToMsg($msg, $errNum, $ErrMsgs[$actualErrNum]['lnk'][$lg], $args); + } + + // Try next rule only if not found + if (!empty($msg)) + break; + } + + // Add debug version if needed + global $DisplayDbg; + $msgHasDebug = in_array('dbg', $languages); + $logExtMsg = ''; + if ((!$msgHasDebug) && isset($ErrMsgs[$actualErrNum]['dbg'])) + { + if ($DisplayDbg || (isset($ErrMsgs[$actualErrNum]['add']) && ($ErrMsgs[$actualErrNum]['add'] == 'dbg'))) + $msg .= '['.$ErrMsgs[$actualErrNum]['dbg']."]\n"; // to result/screen message + else + $logExtMsg .= '['.$ErrMsgs[$actualErrNum]['dbg'].']'; // to log message + } + + // Get mail data if specified + $mailData = (isset($ErrMsgs[$actualErrNum]['mail']) ? $ErrMsgs[$actualErrNum]['mail'] : + (isset($ErrMsgs[$actualErrNum]['lnk']['mail']) ? $ErrMsgs[$actualErrNum]['lnk']['mail'] : + array())); + + // Apply params if applicable + $numArgs = func_num_args(); + if ($numArgs > 1) + { + for ($i=0; $i!=$numArgs; ++$i) // include $errNum (%0) + { + $msg = str_replace("%$i", $args[$i], $msg); + $logExtMsg = str_replace("%$i", $args[$i], $logExtMsg); + $mIdx = 0; + foreach ($mailData as $field) + { + $mailData[$mIdx] = str_replace("%$i", $args[$i], $field); + ++$mIdx; + } + } + } + + // Log technical errors if possible + $logMode = (isset($ErrMsgs[$actualErrNum]['log']) ? $ErrMsgs[$actualErrNum]['log'] : + (isset($ErrMsgs[$actualErrNum]['lnk']['log']) ? $ErrMsgs[$actualErrNum]['lnk']['log'] : + true)); + if ($logMode && class_exists('CWwwLog')) + { + $logFile = new CWwwLog(); + $logFile->logStr(/*$msg.*/$logExtMsg); // message is already logged by ob_callback_r2login() + } + + return $msg; +} + +// Helper for errorMsg() +function appendToMsg(&$msg, $errNum, $str, &$args) +{ + $msg .= "$str ($errNum)"; + if (($errNum == GENERIC_ERROR_NUM) && !empty($args)) + { + foreach ($args as $arg) + { + $msg .= " [$arg]"; // display all passed args if returning the default generic error + } + } + $msg .= "\n"; +} + + +?> diff --git a/ryzom/server/www/login/libs/r2_login_db.php b/ryzom/server/www/login/libs/r2_login_db.php new file mode 100644 index 000000000..f1320535a --- /dev/null +++ b/ryzom/server/www/login/libs/r2_login_db.php @@ -0,0 +1,52 @@ +db, $value); +} + +class LoginDB { + + function __construct($DBHost, $DBUserName, $DBPassword, $DefaultDBName) { + $this->host = $DBHost; + $this->user = $DBUserName; + $this->pass = $DBPassword; + $this->default_name = $DefaultDBName; + return $this->connect(); + } + + function connect() { + $this->db = mysqli_connect($this->host, $this->user, $this->pass) or die(errorMsgBlock(3004, 'DB', $this->host, $this->user)); + return $this->db; + } + + function select($db='') { + if ($db) + $this->name = $db; + else + $this->name = $this->default_name; + mysqli_select_db($this->db, $this->name) or die(errorMsgBlock(3005, 'DB', $this->name, $this->host, $this->user)); + } + + function query($query) { + $result = mysqli_query($this->db, $query) or die(errorMsgBlock(3006, $query, 'DB', $this->name, $this->host, $this->user, mysqli_error($this->db))); + $ret = array(); + if (!is_bool($result)) { + while ($row = mysqli_fetch_array($result)) + $ret[] = $row; + } + return $ret; + } + + function querySingle($query) { + $result = mysqli_query($this->db, $query) or die(errorMsgBlock(3006, $query, 'DB', $this->name, $this->host, $this->user, mysqli_error($this->db))); + if (mysqli_num_rows($result)) + return mysqli_fetch_array($result); + return array(); + } + + function getLastId() { + return mysqli_insert_id($this->db); + } + +} diff --git a/ryzom/server/www/login/libs/r2_login_domain.php b/ryzom/server/www/login/libs/r2_login_domain.php new file mode 100644 index 000000000..8599176ab --- /dev/null +++ b/ryzom/server/www/login/libs/r2_login_domain.php @@ -0,0 +1,56 @@ +db = $db; + $this->db->select(); + $this->domainInfo = $this->db->querySingle('SELECT * FROM domain WHERE domain_name = "'._e($clientApplication).'"'); + if (!$this->domainInfo) + die('Can\'t find row for domain '.$clientApplication); + $this->id = $this->domainInfo['domain_id']; + $this->shardInfo = $this->db->querySingle('SELECT * FROM shard WHERE domain_id = "'.$this->id.'"'); + if (!$this->shardInfo) + die('Can\'t find row for shard '.$clientApplication); + $this->domainInfo['shard'] = $this->shardInfo; + return $this->domainInfo; + } + + function get($info) { + return $this->domainInfo[$info]; + } + + function getShard($info) { + return $this->domainInfo['shard'][$info]; + } + + function checkStatus($status, $User) { + $error = ''; + + if ($status == 'ds_close') + $error = '0:Reboot sequence...'; + else if ($status == 'ds_dev' && strstr($User->priv, ':DEV:') == false) + $error = '0:You are not allowed to connect now, retry later'; + else if ($status == 'ds_restricted') { + if ( strstr($User->priv, ':DEV:') == false + && strstr($User->priv, ':SGM:') == false + && strstr($User->priv, ':GM:') == false + && strstr($User->priv, ':EM:') == false + && strstr($User->priv, ':EG:') == false + && strstr($User->priv, ':TEST:') == false + ) { + $error = '0: Reboot sequence...'."\n\n"; + $error .= 'The server has been rebooted. The Ryzom Team are carefully inspecting the shard to get it ready for you.'."\n\n"; + $error .= 'Le serveur a été redémarré. L\'équipe de Ryzom est en train de le vérifier méticuleusement et le prépare pour vous.'."\n\n"; + $error .= 'Der Server wurde neu gestartet. Das Ryzom-Team führt eine ausführliche Ãœberprüfung des Servers durch, um ihn für Dich vorzubereiten!'."\n\n"; + $error .= 'El servidor va a reiniciar. El equipo de Ryzom está revisando suavemente el servidor y preparándolo para ti!'."\n\n"; + } + } + + if ($error) { + echo iconv('UTF-8', 'ISO-8859-1', $error); + die(); + } + } + +} diff --git a/ryzom/server/www/login/libs/r2_login_logincb.php b/ryzom/server/www/login/libs/r2_login_logincb.php new file mode 100644 index 000000000..83bdf91d8 --- /dev/null +++ b/ryzom/server/www/login/libs/r2_login_logincb.php @@ -0,0 +1,48 @@ +db = $db; + $this->domainInfo = $ServerDomain->domainInfo; + $this->domainId = $ServerDomain->id; + } + + + // receive the login result sent back by the LS + function loginResult($userId, $cookie, $resultCode, $errorString) { + if ($resultCode == 0 && $cookie != '') { + // gather the domain informations (server version, patch urls and backup patch url + + $RingWebHost = $this->domainInfo['web_host']; + $RingWebHostPHP = $this->domainInfo['web_host_php']; + + // set the cookie + setcookie('ryzomId' , $cookie, 0, '/'); + $_COOKIE['ryzomId'] = $cookie; // make it available immediately + + // Auto-join an available mainland shard + global $FSHostLuaMode, $FSHostResultStr; + $FSHostLuaMode = false; + $res = joinMainland($userId, $this->domainId, $this->domainInfo['domain_name']); + + if ($res) { + // return the cookie to the user, il will then be used as an auth to browse the site and to connect to the shard + //echo "1#".$cookie."#http://".$RingWebHost."/ring/web_start.php\n"; +// use this line to use woopra stats +// echo "1#".$cookie."#".$FSHostResultStr."#http://".$RingWebHost."/ring/web_start.php#http://".$RingWebHostPHP."/ring/#1\n"; + echo '1#'.$cookie.'#'.$FSHostResultStr.'#http://'.$RingWebHost.'/ring/web_start.php#http://'.$RingWebHostPHP.'/ring/'."\n"; + // return the ring domain information + echo $this->domainInfo['patch_version'].'#'.$this->domainInfo['backup_patch_url'].'#'.$this->domainInfo['patch_urls']; + + } else { + global $JoinSessionResultCode, $JoinSessionResultMsg; + echo errorMsgBlock(BASE_TRANSLATED_RSM_ERROR_NUM + $JoinSessionResultCode, $JoinSessionResultCode, $JoinSessionResultMsg, $userId); + } + } else { + // empty cookie, this mean the user id can't be validated by the LS + echo errorMsgBlock(BASE_TRANSLATED_LS_ERROR_NUM + $resultCode, $resultCode, $errorString, $userId); + } + } +} diff --git a/ryzom/server/www/login/libs/r2_login_logs.php b/ryzom/server/www/login/libs/r2_login_logs.php new file mode 100644 index 000000000..e9a748857 --- /dev/null +++ b/ryzom/server/www/login/libs/r2_login_logs.php @@ -0,0 +1,68 @@ +logStr(str_replace("\n",'\n',$buffer)); + } + return $buffer; // sent to output +} + + +/////////////////////////////////////////////////////// +// Callback called on error +function err_callback($errno, $errmsg, $filename, $linenum, $vars) +{ + // don't log "PHP ERROR/2048 Only variables should be passed by reference" + if($errno == 2048) return; + + $logFile = new CWwwLog(); + $logFile->logStr("PHP ERROR/$errno $errmsg ($filename:$linenum)"); + // Never die after an error +} + +function dieError($errNum=GENERIC_ERROR_NUM) // $mixedArgs +{ + $args = func_get_args(); + die('0:'.call_user_func_array('errorMsg', $args)); +} diff --git a/ryzom/server/www/login/libs/r2_login_user.php b/ryzom/server/www/login/libs/r2_login_user.php new file mode 100644 index 000000000..21431258f --- /dev/null +++ b/ryzom/server/www/login/libs/r2_login_user.php @@ -0,0 +1,108 @@ +db = $db; + $this->login = $login; + $this->password = $password; + $this->lang = $submittedLang; + $this->client = $clientApplication; + + $this->db->select(); + + $this->user = $this->db->querySingle('SELECT * FROM user WHERE Login="'._e($this->login).'"'); + if ($this->user) { + $this->uid = $this->user['UId']; + } else { + if ($AcceptUnknownUser && $this->password) { + $this->db->query('INSERT INTO user SET Login = "'._e($this->login).'", Password = "'._e($this->password).'", ShardId=-1, Privilege=":DEV:"'); + $this->user = $this->db->querySingle('SELECT * FROM user WHERE Login="'._e($this->login).'"'); + $this->uid = $this->user['UId']; + } else { + $this->uid = 0; + $this->user = array('Password' => 'AA'); + } + } + $this->authenticate = False; + setMsgLanguage($submittedLang); + } + + + function askSalt() { + $user = $this->user; + if ($user) + echo '1:'.substr($user['Password'], 0, 2); + else + dieError(2001, '', 'askSalt'); + } + + function createRingInfo($ServerDomain) { + $domainInfo = $ServerDomain->domainInfo; + $this->db->select($domainInfo['ring_db_name']); + $result = $this->db->querySingle('SELECT user_id FROM ring_users where user_id = "'._e($this->uid).'"'); + if (!$result) + $this->db->query('INSERT INTO ring_users SET user_id = "'._e($this->uid).'", user_name = "'._e($this->login).'", user_type="ut_pioneer"'); + } + + function checkAccess() { + } + + function updatePrivs($privs) { + $this->db->query('UPDATE user SET ExtendedPrivilege="'._e($privs).'" WHERE UId='._e($this->uid)); + $this->user['ExtendedPrivilege'] = $privs; + } + + function addPriv($priv) { + $eprivs = explode(':', $this->user['ExtendedPrivilege']); + $privs = array(); + foreach ($eprivs as $p) + $privs[$p] = $p; + unset($privs['']); + $privs[$priv] = $priv; + $this->updatePrivs(':'.implode(':', array_keys($privs)).':'); + } + + function removePriv($priv) { + $eprivs = explode(':', $this->user['ExtendedPrivilege']); + $privs = array(); + foreach ($eprivs as $p) + $privs[$p] = $p; + unset($privs['']); + unset($privs[$priv]); + $this->updatePrivs(':'.implode(':', array_keys($privs)).':'); + } + + + function checkPermission($ServerDomain) { + $perm = $this->db->querySingle('SELECT * FROM permission WHERE UId="'._e($this->uid).'" AND ClientApplication="'._e($this->client).'"'); + if (!$perm) + $this->db->query('INSERT INTO permission (UId, ClientApplication, ShardId, AccessPrivilege) VALUES ("'._e($this->uid).'", "'._e($this->client).'", "'.$ServerDomain->getShard('ShardId').'", "OPEN")'); + } + + function logConnection() { + } + + function checkValidity($password, $ServerDomain) { + $user = $this->user; + + if (!$user) + dieError(3009, $this->login); + + if ($this->user['Password'] == $password) { + $this->login = $this->user['Login']; // Correct case + + $this->checkAccess(); + $this->checkPermission($ServerDomain); + $this->logConnection(); + + $this->priv = $this->user['Privilege']; + + return True; + } else + dieError(2004); + return False; + } + +} diff --git a/ryzom/server/www/login/libs/ring_session_manager_itf.php b/ryzom/server/www/login/libs/ring_session_manager_itf.php new file mode 100644 index 000000000..26386487c --- /dev/null +++ b/ryzom/server/www/login/libs/ring_session_manager_itf.php @@ -0,0 +1,1876 @@ + +Value = $RSMGR_TSessionPartStatus_InvalidValue; + } + + function toString() + { + global $RSMGR_TSessionPartStatus_EnumValues; + return $RSMGR_TSessionPartStatus_EnumValues[$this->Value]; + } + + function fromString($strValue) + { + global $RSMGR_TSessionPartStatus_EnumValues; + foreach ($RSMGR_TSessionPartStatus_EnumValues as $k => $v) + { + if ($strValue === $v) + { + $this->Value = $k; + return; + } + } + + $this->Value = $RSMGR_TSessionPartStatus_InvalidValue; + } + + function toInt() + { + return $this->Value; + } + + function fromInt($intValue) + { + global $RSMGR_TSessionPartStatus_InvalidValue; + global $RSMGR_TSessionPartStatus_EnumValues; + if (array_key_exists($intValue, $RSMGR_TSessionPartStatus_EnumValues)) + $this->Value = $intValue; + else + $this->Value = $RSMGR_TSessionPartStatus_InvalidValue; + } + } +?> +Value = $RSMGR_TSessionType_InvalidValue; + } + + function toString() + { + global $RSMGR_TSessionType_EnumValues; + return $RSMGR_TSessionType_EnumValues[$this->Value]; + } + + function fromString($strValue) + { + global $RSMGR_TSessionType_EnumValues; + foreach ($RSMGR_TSessionType_EnumValues as $k => $v) + { + if ($strValue === $v) + { + $this->Value = $k; + return; + } + } + + $this->Value = $RSMGR_TSessionType_InvalidValue; + } + + function toInt() + { + return $this->Value; + } + + function fromInt($intValue) + { + global $RSMGR_TSessionType_InvalidValue; + global $RSMGR_TSessionType_EnumValues; + if (array_key_exists($intValue, $RSMGR_TSessionType_EnumValues)) + $this->Value = $intValue; + else + $this->Value = $RSMGR_TSessionType_InvalidValue; + } + } +?> +Value = $RSMGR_TSessionOrientation_InvalidValue; + } + + function toString() + { + global $RSMGR_TSessionOrientation_EnumValues; + return $RSMGR_TSessionOrientation_EnumValues[$this->Value]; + } + + function fromString($strValue) + { + global $RSMGR_TSessionOrientation_EnumValues; + foreach ($RSMGR_TSessionOrientation_EnumValues as $k => $v) + { + if ($strValue === $v) + { + $this->Value = $k; + return; + } + } + + $this->Value = $RSMGR_TSessionOrientation_InvalidValue; + } + + function toInt() + { + return $this->Value; + } + + function fromInt($intValue) + { + global $RSMGR_TSessionOrientation_InvalidValue; + global $RSMGR_TSessionOrientation_EnumValues; + if (array_key_exists($intValue, $RSMGR_TSessionOrientation_EnumValues)) + $this->Value = $intValue; + else + $this->Value = $RSMGR_TSessionOrientation_InvalidValue; + } + } +?> +Value = $RSMGR_TSessionState_InvalidValue; + } + + function toString() + { + global $RSMGR_TSessionState_EnumValues; + return $RSMGR_TSessionState_EnumValues[$this->Value]; + } + + function fromString($strValue) + { + global $RSMGR_TSessionState_EnumValues; + foreach ($RSMGR_TSessionState_EnumValues as $k => $v) + { + if ($strValue === $v) + { + $this->Value = $k; + return; + } + } + + $this->Value = $RSMGR_TSessionState_InvalidValue; + } + + function toInt() + { + return $this->Value; + } + + function fromInt($intValue) + { + global $RSMGR_TSessionState_InvalidValue; + global $RSMGR_TSessionState_EnumValues; + if (array_key_exists($intValue, $RSMGR_TSessionState_EnumValues)) + $this->Value = $intValue; + else + $this->Value = $RSMGR_TSessionState_InvalidValue; + } + } +?> +Value = $RSMGR_TAnimMode_InvalidValue; + } + + function toString() + { + global $RSMGR_TAnimMode_EnumValues; + return $RSMGR_TAnimMode_EnumValues[$this->Value]; + } + + function fromString($strValue) + { + global $RSMGR_TAnimMode_EnumValues; + foreach ($RSMGR_TAnimMode_EnumValues as $k => $v) + { + if ($strValue === $v) + { + $this->Value = $k; + return; + } + } + + $this->Value = $RSMGR_TAnimMode_InvalidValue; + } + + function toInt() + { + return $this->Value; + } + + function fromInt($intValue) + { + global $RSMGR_TAnimMode_InvalidValue; + global $RSMGR_TAnimMode_EnumValues; + if (array_key_exists($intValue, $RSMGR_TAnimMode_EnumValues)) + $this->Value = $intValue; + else + $this->Value = $RSMGR_TAnimMode_InvalidValue; + } + } +?> +Value = $RSMGR_TAccessType_InvalidValue; + } + + function toString() + { + global $RSMGR_TAccessType_EnumValues; + return $RSMGR_TAccessType_EnumValues[$this->Value]; + } + + function fromString($strValue) + { + global $RSMGR_TAccessType_EnumValues; + foreach ($RSMGR_TAccessType_EnumValues as $k => $v) + { + if ($strValue === $v) + { + $this->Value = $k; + return; + } + } + + $this->Value = $RSMGR_TAccessType_InvalidValue; + } + + function toInt() + { + return $this->Value; + } + + function fromInt($intValue) + { + global $RSMGR_TAccessType_InvalidValue; + global $RSMGR_TAccessType_EnumValues; + if (array_key_exists($intValue, $RSMGR_TAccessType_EnumValues)) + $this->Value = $intValue; + else + $this->Value = $RSMGR_TAccessType_InvalidValue; + } + } +?> +Value = $RSMGR_TRuleType_InvalidValue; + } + + function toString() + { + global $RSMGR_TRuleType_EnumValues; + return $RSMGR_TRuleType_EnumValues[$this->Value]; + } + + function fromString($strValue) + { + global $RSMGR_TRuleType_EnumValues; + foreach ($RSMGR_TRuleType_EnumValues as $k => $v) + { + if ($strValue === $v) + { + $this->Value = $k; + return; + } + } + + $this->Value = $RSMGR_TRuleType_InvalidValue; + } + + function toInt() + { + return $this->Value; + } + + function fromInt($intValue) + { + global $RSMGR_TRuleType_InvalidValue; + global $RSMGR_TRuleType_EnumValues; + if (array_key_exists($intValue, $RSMGR_TRuleType_EnumValues)) + $this->Value = $intValue; + else + $this->Value = $RSMGR_TRuleType_InvalidValue; + } + } +?> +Value = $RSMGR_TLevelFilter_InvalidValue; + } + + function toString() + { + global $RSMGR_TLevelFilter_EnumValues; + return $RSMGR_TLevelFilter_EnumValues[$this->Value]; + } + + function fromString($strValue) + { + global $RSMGR_TLevelFilter_EnumValues; + foreach ($RSMGR_TLevelFilter_EnumValues as $k => $v) + { + if ($strValue === $v) + { + $this->Value = $k; + return; + } + } + + $this->Value = $RSMGR_TLevelFilter_InvalidValue; + } + + function toInt() + { + return $this->Value; + } + + function fromInt($intValue) + { + global $RSMGR_TLevelFilter_InvalidValue; + global $RSMGR_TLevelFilter_EnumValues; + if (array_key_exists($intValue, $RSMGR_TLevelFilter_EnumValues)) + $this->Value = $intValue; + else + $this->Value = $RSMGR_TLevelFilter_InvalidValue; + } + } +?> +Value = $RSMGR_TEstimatedDuration_InvalidValue; + } + + function toString() + { + global $RSMGR_TEstimatedDuration_EnumValues; + return $RSMGR_TEstimatedDuration_EnumValues[$this->Value]; + } + + function fromString($strValue) + { + global $RSMGR_TEstimatedDuration_EnumValues; + foreach ($RSMGR_TEstimatedDuration_EnumValues as $k => $v) + { + if ($strValue === $v) + { + $this->Value = $k; + return; + } + } + + $this->Value = $RSMGR_TEstimatedDuration_InvalidValue; + } + + function toInt() + { + return $this->Value; + } + + function fromInt($intValue) + { + global $RSMGR_TEstimatedDuration_InvalidValue; + global $RSMGR_TEstimatedDuration_EnumValues; + if (array_key_exists($intValue, $RSMGR_TEstimatedDuration_EnumValues)) + $this->Value = $intValue; + else + $this->Value = $RSMGR_TEstimatedDuration_InvalidValue; + } + } +?> +Value = $RSMGR_TRaceFilter_InvalidValue; + } + + function toString() + { + global $RSMGR_TRaceFilter_EnumValues; + return $RSMGR_TRaceFilter_EnumValues[$this->Value]; + } + + function fromString($strValue) + { + global $RSMGR_TRaceFilter_EnumValues; + foreach ($RSMGR_TRaceFilter_EnumValues as $k => $v) + { + if ($strValue === $v) + { + $this->Value = $k; + return; + } + } + + $this->Value = $RSMGR_TRaceFilter_InvalidValue; + } + + function toInt() + { + return $this->Value; + } + + function fromInt($intValue) + { + global $RSMGR_TRaceFilter_InvalidValue; + global $RSMGR_TRaceFilter_EnumValues; + if (array_key_exists($intValue, $RSMGR_TRaceFilter_EnumValues)) + $this->Value = $intValue; + else + $this->Value = $RSMGR_TRaceFilter_InvalidValue; + } + } +?> +Value = $RSMGR_TReligionFilter_InvalidValue; + } + + function toString() + { + global $RSMGR_TReligionFilter_EnumValues; + return $RSMGR_TReligionFilter_EnumValues[$this->Value]; + } + + function fromString($strValue) + { + global $RSMGR_TReligionFilter_EnumValues; + foreach ($RSMGR_TReligionFilter_EnumValues as $k => $v) + { + if ($strValue === $v) + { + $this->Value = $k; + return; + } + } + + $this->Value = $RSMGR_TReligionFilter_InvalidValue; + } + + function toInt() + { + return $this->Value; + } + + function fromInt($intValue) + { + global $RSMGR_TReligionFilter_InvalidValue; + global $RSMGR_TReligionFilter_EnumValues; + if (array_key_exists($intValue, $RSMGR_TReligionFilter_EnumValues)) + $this->Value = $intValue; + else + $this->Value = $RSMGR_TReligionFilter_InvalidValue; + } + } +?> +Value = $RSMGR_TGuildFilter_InvalidValue; + } + + function toString() + { + global $RSMGR_TGuildFilter_EnumValues; + return $RSMGR_TGuildFilter_EnumValues[$this->Value]; + } + + function fromString($strValue) + { + global $RSMGR_TGuildFilter_EnumValues; + foreach ($RSMGR_TGuildFilter_EnumValues as $k => $v) + { + if ($strValue === $v) + { + $this->Value = $k; + return; + } + } + + $this->Value = $RSMGR_TGuildFilter_InvalidValue; + } + + function toInt() + { + return $this->Value; + } + + function fromInt($intValue) + { + global $RSMGR_TGuildFilter_InvalidValue; + global $RSMGR_TGuildFilter_EnumValues; + if (array_key_exists($intValue, $RSMGR_TGuildFilter_EnumValues)) + $this->Value = $intValue; + else + $this->Value = $RSMGR_TGuildFilter_InvalidValue; + } + } +?> +Value = $RSMGR_TShardFilter_InvalidValue; + } + + function toString() + { + global $RSMGR_TShardFilter_EnumValues; + return $RSMGR_TShardFilter_EnumValues[$this->Value]; + } + + function fromString($strValue) + { + global $RSMGR_TShardFilter_EnumValues; + foreach ($RSMGR_TShardFilter_EnumValues as $k => $v) + { + if ($strValue === $v) + { + $this->Value = $k; + return; + } + } + + $this->Value = $RSMGR_TShardFilter_InvalidValue; + } + + function toInt() + { + return $this->Value; + } + + function fromInt($intValue) + { + global $RSMGR_TShardFilter_InvalidValue; + global $RSMGR_TShardFilter_EnumValues; + if (array_key_exists($intValue, $RSMGR_TShardFilter_EnumValues)) + $this->Value = $intValue; + else + $this->Value = $RSMGR_TShardFilter_InvalidValue; + } + } +?> +Value = $RSMGR_TSessionEvent_InvalidValue; + } + + function toString() + { + global $RSMGR_TSessionEvent_EnumValues; + return $RSMGR_TSessionEvent_EnumValues[$this->Value]; + } + + function fromString($strValue) + { + global $RSMGR_TSessionEvent_EnumValues; + foreach ($RSMGR_TSessionEvent_EnumValues as $k => $v) + { + if ($strValue === $v) + { + $this->Value = $k; + return; + } + } + + $this->Value = $RSMGR_TSessionEvent_InvalidValue; + } + + function toInt() + { + return $this->Value; + } + + function fromInt($intValue) + { + global $RSMGR_TSessionEvent_InvalidValue; + global $RSMGR_TSessionEvent_EnumValues; + if (array_key_exists($intValue, $RSMGR_TSessionEvent_EnumValues)) + $this->Value = $intValue; + else + $this->Value = $RSMGR_TSessionEvent_InvalidValue; + } + } +?> +setName("SSS"); + + + $msg->serialUint32($charId); + $msg->serialEnum($sessionType); + $msg->serialString($sessionTitle); + $msg->serialString($sessionDesc); + $msg->serialEnum($sessionLevel); + $msg->serialEnum($ruleType); + $msg->serialEnum($estimatedDuration); + $msg->serialUint32($subscriptionSlot); + $msg->serialEnum($animMode); + $msg->serialEnum($raceFilter); + $msg->serialEnum($religionFilter); + $msg->serialEnum($guildFilter); + $msg->serialEnum($shardFilter); + $msg->serialEnum($levelFilter); + $msg->serialString($language); + $msg->serialEnum($orientation); + $msg->serialUint32($subscriptionClosed); + $msg->serialUint32($autoInvite); + + return parent::sendMessage($msg); + + + } + + function setSessionStartParams($charId, $sessionId, $initialIslandLocation, $initialEntryPointLocation, $initialSeason) + { + $msg = new CMessage; + $msg->setName("SSSP"); + + + $msg->serialUint32($charId); + $msg->serialUint32($sessionId); + $msg->serialUint32($initialIslandLocation); + $msg->serialUint32($initialEntryPointLocation); + $msg->serialUint32($initialSeason); + + return parent::sendMessage($msg); + + + } + + function getSessionInfo($charId, $sessionId) + { + $msg = new CMessage; + $msg->setName("GSI"); + + + $msg->serialUint32($charId); + $msg->serialUint32($sessionId); + + return parent::sendMessage($msg); + + + } + + function updateSessionInfo($charId, $sessionId, $sessionTitle, $plannedDate, $sessionDesc, $sessionLevel, $estimatedDuration, $subscriptionSlot, $raceFilter, $religionFilter, $guildFilter, $shardFilter, $levelFilter, $subscriptionClosed, $autoInvite, $language, $orientation) + { + $msg = new CMessage; + $msg->setName("USS"); + + + $msg->serialUint32($charId); + $msg->serialUint32($sessionId); + $msg->serialString($sessionTitle); + $msg->serialUint32($plannedDate); + $msg->serialString($sessionDesc); + $msg->serialEnum($sessionLevel); + $msg->serialEnum($estimatedDuration); + $msg->serialUint32($subscriptionSlot); + $msg->serialEnum($raceFilter); + $msg->serialEnum($religionFilter); + $msg->serialEnum($guildFilter); + $msg->serialEnum($shardFilter); + $msg->serialEnum($levelFilter); + $msg->serialUint32($subscriptionClosed); + $msg->serialUint32($autoInvite); + $msg->serialString($language); + $msg->serialEnum($orientation); + + return parent::sendMessage($msg); + + + } + + function cancelSession($charId, $sessionId) + { + $msg = new CMessage; + $msg->setName("CANSS"); + + + $msg->serialUint32($charId); + $msg->serialUint32($sessionId); + + return parent::sendMessage($msg); + + + } + + function startSession($charId, $sessionId) + { + $msg = new CMessage; + $msg->setName("STSS"); + + + $msg->serialUint32($charId); + $msg->serialUint32($sessionId); + + return parent::sendMessage($msg); + + + } + + function closeSession($charId, $sessionId) + { + $msg = new CMessage; + $msg->setName("CLSS"); + + + $msg->serialUint32($charId); + $msg->serialUint32($sessionId); + + return parent::sendMessage($msg); + + + } + + function closeEditSession($charId) + { + $msg = new CMessage; + $msg->setName("CLESS"); + + + $msg->serialUint32($charId); + + return parent::sendMessage($msg); + + + } + + function addFriendCharacter($userId, $friendCharId) + { + $msg = new CMessage; + $msg->setName("AFC"); + + + $msg->serialUint32($userId); + $msg->serialUint32($friendCharId); + + return parent::sendMessage($msg); + + + } + + function removeFriendCharacter($userId, $friendCharId) + { + $msg = new CMessage; + $msg->setName("RFC"); + + + $msg->serialUint32($userId); + $msg->serialUint32($friendCharId); + + return parent::sendMessage($msg); + + + } + + function addBannedCharacter($userId, $bannedCharId) + { + $msg = new CMessage; + $msg->setName("ABC"); + + + $msg->serialUint32($userId); + $msg->serialUint32($bannedCharId); + + return parent::sendMessage($msg); + + + } + + function removeBannedCharacter($userId, $bannedCharId) + { + $msg = new CMessage; + $msg->setName("RBC"); + + + $msg->serialUint32($userId); + $msg->serialUint32($bannedCharId); + + return parent::sendMessage($msg); + + + } + + function addFriendDMCharacter($userId, $friendDMCharId) + { + $msg = new CMessage; + $msg->setName("AFDC"); + + + $msg->serialUint32($userId); + $msg->serialUint32($friendDMCharId); + + return parent::sendMessage($msg); + + + } + + function removeFriendDMCharacter($userId, $friendDMCharId) + { + $msg = new CMessage; + $msg->setName("RFDC"); + + + $msg->serialUint32($userId); + $msg->serialUint32($friendDMCharId); + + return parent::sendMessage($msg); + + + } + + function setKnownCharacterComments($userId, $charId, $relation, $comments) + { + $msg = new CMessage; + $msg->setName("SKCC"); + + + $msg->serialUint32($userId); + $msg->serialUint32($charId); + $msg->serialString($relation); + $msg->serialString($comments); + + return parent::sendMessage($msg); + + + } + + function inviteCharacter($ownerCharId, $sessionId, $invitedCharId, $charRole) + { + $msg = new CMessage; + $msg->setName("IC"); + + + $msg->serialUint32($ownerCharId); + $msg->serialUint32($sessionId); + $msg->serialUint32($invitedCharId); + $msg->serialEnum($charRole); + + return parent::sendMessage($msg); + + + } + + function removeInvitedCharacter($ownerCharId, $sessionId, $removedCharId) + { + $msg = new CMessage; + $msg->setName("RIC"); + + + $msg->serialUint32($ownerCharId); + $msg->serialUint32($sessionId); + $msg->serialUint32($removedCharId); + + return parent::sendMessage($msg); + + + } + + function subscribeSession($charId, $sessionId) + { + $msg = new CMessage; + $msg->setName("SBS"); + + + $msg->serialUint32($charId); + $msg->serialUint32($sessionId); + + return parent::sendMessage($msg); + + + } + + function unsubscribeSession($charId, $sessionId) + { + $msg = new CMessage; + $msg->setName("USBS"); + + + $msg->serialUint32($charId); + $msg->serialUint32($sessionId); + + return parent::sendMessage($msg); + + + } + + function joinSession($charId, $sessionId, $clientApplication) + { + $msg = new CMessage; + $msg->setName("JSS"); + + + $msg->serialUint32($charId); + $msg->serialUint32($sessionId); + $msg->serialString($clientApplication); + + return parent::sendMessage($msg); + + + } + + function joinMainland($charId, $clientApplication) + { + $msg = new CMessage; + $msg->setName("JML"); + + + $msg->serialUint32($charId); + $msg->serialString($clientApplication); + + return parent::sendMessage($msg); + + + } + + function joinEditSession($charId, $clientApplication) + { + $msg = new CMessage; + $msg->setName("JES"); + + + $msg->serialUint32($charId); + $msg->serialString($clientApplication); + + return parent::sendMessage($msg); + + + } + + function hibernateEditSession($charId) + { + $msg = new CMessage; + $msg->setName("HES"); + + + $msg->serialUint32($charId); + + return parent::sendMessage($msg); + + + } + + function getShards($charId) + { + $msg = new CMessage; + $msg->setName("GSH"); + + + $msg->serialUint32($charId); + + return parent::sendMessage($msg); + + + } + + function kickCharacter($ownerCharId, $sessionId, $kickedCharId) + { + $msg = new CMessage; + $msg->setName("KC"); + + + $msg->serialUint32($ownerCharId); + $msg->serialUint32($sessionId); + $msg->serialUint32($kickedCharId); + + return parent::sendMessage($msg); + + + } + + function unkickCharacter($ownerCharId, $sessionId, $unkickedCharId) + { + $msg = new CMessage; + $msg->setName("UKC"); + + + $msg->serialUint32($ownerCharId); + $msg->serialUint32($sessionId); + $msg->serialUint32($unkickedCharId); + + return parent::sendMessage($msg); + + + } + + function inviteGuild($charId, $sessionId, $guildId) + { + $msg = new CMessage; + $msg->setName("IG"); + + + $msg->serialUint32($charId); + $msg->serialUint32($sessionId); + $msg->serialUint32($guildId); + + return parent::sendMessage($msg); + + + } + + function removeInvitedGuild($charId, $sessionId, $guildId) + { + $msg = new CMessage; + $msg->setName("RIG"); + + + $msg->serialUint32($charId); + $msg->serialUint32($sessionId); + $msg->serialUint32($guildId); + + return parent::sendMessage($msg); + + + } + + function setScenarioInfo($charId, $sessionId, $title, $numPlayer, $playType) + { + $msg = new CMessage; + $msg->setName("SSCI"); + + + $msg->serialUint32($charId); + $msg->serialUint32($sessionId); + $msg->serialString($title); + $msg->serialUint32($numPlayer); + $msg->serialString($playType); + + return parent::sendMessage($msg); + + + } + + function addJournalEntry($charId, $sessionId, $entryType, $text) + { + $msg = new CMessage; + $msg->setName("AJE"); + + + $msg->serialUint32($charId); + $msg->serialUint32($sessionId); + $msg->serialString($entryType); + $msg->serialString($text); + + return parent::sendMessage($msg); + + + } + + function setPlayerRating($charId, $sessionId, $rateFun, $rateDifficulty, $rateAccessibility, $rateOriginality, $rateDirection) + { + $msg = new CMessage; + $msg->setName("SPR"); + + + $msg->serialUint32($charId); + $msg->serialUint32($sessionId); + $msg->serialUint32($rateFun); + $msg->serialUint32($rateDifficulty); + $msg->serialUint32($rateAccessibility); + $msg->serialUint32($rateOriginality); + $msg->serialUint32($rateDirection); + + return parent::sendMessage($msg); + + + } + + + function waitCallback() + { + $message = parent::waitMessage(); + + if ($message == false) + return false; + + switch($message->MsgName) + { + case "RET": + $this->invokeResult_skel($message); + break; + case "SSSR": + $this->scheduleSessionResult_skel($message); + break; + case "SIR": + $this->sessionInfoResult_skel($message); + break; + case "JSSR": + $this->joinSessionResult_skel($message); + break; + case "JSSRE": + $this->joinSessionResultExt_skel($message); + break; + case "GSHR": + $this->getShardsResult_skel($message); + break; + default: + return false; + } + + return true; + } + + + function invokeResult_skel(&$message) + { + $message->serialUint32($userId); + $message->serialUint32($resultCode); + $message->serialString($resultString); + + $this->invokeResult($userId, $resultCode, $resultString); + } + + function scheduleSessionResult_skel(&$message) + { + $message->serialUint32($charId); + $message->serialUint32($sessionId); + $message->serialUInt8($result); + $message->serialString($resultString); + + $this->scheduleSessionResult($charId, $sessionId, $result, $resultString); + } + + function sessionInfoResult_skel(&$message) + { + $message->serialUint32($charId); + $message->serialUint32($sessionId); + + $raceFilter = new RSMGR_TRaceFilter; + $message->serialEnum($raceFilter); + + $religionFilter = new RSMGR_TReligionFilter; + $message->serialEnum($religionFilter); + + $guildFilter = new RSMGR_TGuildFilter; + $message->serialEnum($guildFilter); + + $shardFilter = new RSMGR_TShardFilter; + $message->serialEnum($shardFilter); + + $levelFilter = new RSMGR_TLevelFilter; + $message->serialEnum($levelFilter); + $message->serialUint32($subscriptionClosed); + $message->serialUint32($autoInvite); + $message->serialString($language); + + $orientation = new RSMGR_TSessionOrientation; + $message->serialEnum($orientation); + $message->serialString($description); + + $this->sessionInfoResult($charId, $sessionId, $raceFilter, $religionFilter, $guildFilter, $shardFilter, $levelFilter, $subscriptionClosed, $autoInvite, $language, $orientation, $description); + } + + function joinSessionResult_skel(&$message) + { + $message->serialUint32($userId); + $message->serialUint32($sessionId); + $message->serialUint32($result); + $message->serialString($shardAddr); + + $participantStatus = new RSMGR_TSessionPartStatus; + $message->serialEnum($participantStatus); + + $this->joinSessionResult($userId, $sessionId, $result, $shardAddr, $participantStatus); + } + + function joinSessionResultExt_skel(&$message) + { + $message->serialUint32($userId); + $message->serialUint32($sessionId); + $message->serialUint32($result); + $message->serialString($shardAddr); + + $participantStatus = new RSMGR_TSessionPartStatus; + $message->serialEnum($participantStatus); + $message->serialUint32($securityCheckForFastDisconnection); + + $this->joinSessionResultExt($userId, $sessionId, $result, $shardAddr, $participantStatus, $securityCheckForFastDisconnection); + } + + function getShardsResult_skel(&$message) + { + $message->serialUint32($userId); + $message->serialString($result); + + $this->getShardsResult($userId, $result); + } + + + ///////////////////////////////////////////////////////////////// + // Copy paste this part of code in your derived class + // and implement code to ract to incoming message + ///////////////////////////////////////////////////////////////// + // Generic response to invoke. + // result contains 0 if no error, more than 0 in case of error + + function invokeResult($userId, $resultCode, $resultString) + { + } + + // result is : 0 : session have been created fine + // 1 : invalid session type + // 2 : invalid level + // 3 : unknown character + // 4 : not used + // 5 : invalid access type + // 6 : invalid rule type + // 7 : invalid duration + // 8 : invalid user + // 9 : free trial account can't create anim session + // 10 : user is ban from ring anim session + + function scheduleSessionResult($charId, $sessionId, $result, $resultString) + { + } + + // session info result (anim) + + function sessionInfoResult($charId, $sessionId, $raceFilter, $religionFilter, $guildFilter, $shardFilter, $levelFilter, $subscriptionClosed, $autoInvite, $language, $orientation, $description) + { + } + + // Return the result of the session joining attempt + // If join is ok, the shardAddr contain of the + // Front end that waits for the player to come in and the. + // participation mode for the character (editor, animator or player). + // If ok, the web must return a page with a lua script. + // that trigger the action handler 'on_connect_to_shard' : + // runAH(nul, "on_connect_to_shard", "cookie=cookieValue|fsAddr=shardAddr|mode=participantStatus"); + // result : 0 : ok the client can join the session + // 1 : char not found + // 2 : session not found + // 3 : no session participant for this character (not used for a mainland shard) + // 4 : can't find session server (not used for a mainland shard) + // 5 : shard hosting session is not reachable + // 6 : nel user info not found + // 7 : ring user not found + // 8 : welcome service rejected connection request + // 9 : session service shutdown (not used for a mainland shard) + // 10 : no mainland shard found (joinMainland only) + // 11 : internal error + // 12 : failed to request for access permission + // 13 : can't find access permission for user and domain + // 14 : Welcome service is closed for you + // 15 : Session is not open + // 16 : User banned from ring + // 17 : Newcomer flag missmatch + // 18 : Can't find session log to validate session access + // 19 : Can't find scenario info to validate session access + // 20 : Scenario is not allowed to free trial players + + function joinSessionResult($userId, $sessionId, $result, $shardAddr, $participantStatus) + { + } + + // See joinSessionResult. + // Adds a security code. + + function joinSessionResultExt($userId, $sessionId, $result, $shardAddr, $participantStatus, $securityCheckForFastDisconnection) + { + } + + // Return the list of online shards on which the user is allowed to connect, + // and their current dynamic attributes. Other attributes (e.g. names) + // can be queried from the database. Offline shards are the ones in the database + // of the same domain but not listed in the result. + // Then the client will have to call joinShard to connect on an online shard. + + function getShardsResult($userId, $result) + { + } + + } +?> +setName("AUTH"); + + + $msg->serialUint32($userId); + $msg->serialUint32($cookie); + + return parent::sendMessage($msg); + + + } + + function getSessionList($charId) + { + $msg = new CMessage; + $msg->setName("GSL"); + + + $msg->serialUint32($charId); + + return parent::sendMessage($msg); + + + } + + function getCharList($charId, $sessionId) + { + $msg = new CMessage; + $msg->setName("GCL"); + + + $msg->serialUint32($charId); + $msg->serialUint32($sessionId); + + return parent::sendMessage($msg); + + + } + + function inviteCharacterByName($charId, $invitedCharName) + { + $msg = new CMessage; + $msg->setName("ICBN"); + + + $msg->serialUint32($charId); + $msg->serialUint32($invitedCharName); + + return parent::sendMessage($msg); + + + } + + function getMyRatings($charId, $sessionId) + { + $msg = new CMessage; + $msg->setName("GMSR"); + + + $msg->serialUint32($charId); + $msg->serialUint32($sessionId); + + return parent::sendMessage($msg); + + + } + + function getSessionAverageScores($sessionId) + { + $msg = new CMessage; + $msg->setName("GSAS"); + + + $msg->serialUint32($sessionId); + + return parent::sendMessage($msg); + + + } + + function getScenarioAverageScores($md5) + { + $msg = new CMessage; + $msg->setName("GSCAS"); + + + $msg->serialUint32($md5); + + return parent::sendMessage($msg); + + + } + + function getRingRatings($charId) + { + $msg = new CMessage; + $msg->setName("GRR"); + + + $msg->serialUint32($charId); + + return parent::sendMessage($msg); + + + } + + function getRingPoints($charId) + { + $msg = new CMessage; + $msg->setName("GRP"); + + + $msg->serialUint32($charId); + + return parent::sendMessage($msg); + + + } + + function forwardToDss($charId, $msg) + { + $msg = new CMessage; + $msg->setName("DSS_FW"); + + + $msg->serialUint32($charId); + $msg->serialUint32($msg); + + return parent::sendMessage($msg); + + + } + + + function waitCallback() + { + $message = parent::waitMessage(); + + if ($message == false) + return false; + + switch($message->MsgName) + { + case "SL": + $this->sessionList_skel($message); + break; + case "CL": + $this->charList_skel($message); + break; + case "PR": + $this->playerRatings_skel($message); + break; + case "SAS": + $this->sessionAverageScores_skel($message); + break; + case "SCAS": + $this->scenarioAverageScores_skel($message); + break; + case "RR": + $this->ringRatings_skel($message); + break; + case "RP": + $this->ringPoints_skel($message); + break; + default: + return false; + } + + return true; + } + + + function sessionList_skel(&$message) + { + $message->serialUint32($charId); + $message->serialUint32($sessions); + + $this->sessionList($charId, $sessions); + } + + function charList_skel(&$message) + { + $message->serialUint32($charId); + $message->serialUint32($sessionId); + $message->serialUint32($characters); + + $this->charList($charId, $sessionId, $characters); + } + + function playerRatings_skel(&$message) + { + $message->serialUint32($charId); + $message->serialUint32($scenarioRated); + $message->serialUint32($rateFun); + $message->serialUint32($rateDifficulty); + $message->serialUint32($rateAccessibility); + $message->serialUint32($rateOriginality); + $message->serialUint32($rateDirection); + + $this->playerRatings($charId, $scenarioRated, $rateFun, $rateDifficulty, $rateAccessibility, $rateOriginality, $rateDirection); + } + + function sessionAverageScores_skel(&$message) + { + $message->serialUint32($scenarioRated); + $message->serialUint32($rateFun); + $message->serialUint32($rateDifficulty); + $message->serialUint32($rateAccessibility); + $message->serialUint32($rateOriginality); + $message->serialUint32($rateDirection); + $message->serialUint32($rrpTotal); + + $this->sessionAverageScores($scenarioRated, $rateFun, $rateDifficulty, $rateAccessibility, $rateOriginality, $rateDirection, $rrpTotal); + } + + function scenarioAverageScores_skel(&$message) + { + $message->serialUint32($scenarioRated); + $message->serialUint32($rateFun); + $message->serialUint32($rateDifficulty); + $message->serialUint32($rateAccessibility); + $message->serialUint32($rateOriginality); + $message->serialUint32($rateDirection); + $message->serialUint32($rrpTotal); + + $this->scenarioAverageScores($scenarioRated, $rateFun, $rateDifficulty, $rateAccessibility, $rateOriginality, $rateDirection, $rrpTotal); + } + + function ringRatings_skel(&$message) + { + $message->serialUint32($charId); + $message->serialUint32($authorRating); + $message->serialUint32($AMRating); + $message->serialUint32($masterlessRating); + + $this->ringRatings($charId, $authorRating, $AMRating, $masterlessRating); + } + + function ringPoints_skel(&$message) + { + $message->serialUint32($charId); + $message->serialUint32($ringPoints); + $message->serialUint32($maxRingPoints); + + $this->ringPoints($charId, $ringPoints, $maxRingPoints); + } + + + ///////////////////////////////////////////////////////////////// + // Copy paste this part of code in your derived class + // and implement code to ract to incoming message + ///////////////////////////////////////////////////////////////// + // Return the list of available session + + function sessionList($charId, $sessions) + { + } + + // Return the list of player characters in the session + + function charList($charId, $sessionId, $characters) + { + } + + // Return current player rating of the current session scenario + + function playerRatings($charId, $scenarioRated, $rateFun, $rateDifficulty, $rateAccessibility, $rateOriginality, $rateDirection) + { + } + + // Return average scores of a session + + function sessionAverageScores($scenarioRated, $rateFun, $rateDifficulty, $rateAccessibility, $rateOriginality, $rateDirection, $rrpTotal) + { + } + + // Return average scores of a scenario + + function scenarioAverageScores($scenarioRated, $rateFun, $rateDifficulty, $rateAccessibility, $rateOriginality, $rateDirection, $rrpTotal) + { + } + + // Return the author rating, the AM rating and the Masterless rating + + function ringRatings($charId, $authorRating, $AMRating, $masterlessRating) + { + } + + // Return the ring points of the character + + function ringPoints($charId, $ringPoints, $maxRingPoints) + { + } + + } +?> diff --git a/ryzom/server/www/login/libs/validate_cookie.php b/ryzom/server/www/login/libs/validate_cookie.php new file mode 100644 index 000000000..d0ff8dd26 --- /dev/null +++ b/ryzom/server/www/login/libs/validate_cookie.php @@ -0,0 +1,79 @@ +"; + return false; + } + + // read the ip and compare with client ip + $cookie = $_COOKIE["ryzomId"]; + echo "Cookie is $cookie
"; + sscanf($cookie, "%02X%02X%02X%02X", $b0, $b1, $b2, $b3); + $addr = $b0 + ($b1<<8) + ($b2<<16) + ($b3<<24); + printf("Addr is %X
", $addr); + $addrStr = long2ip($addr); + echo "addrStr is $addrStr
"; + + if ($_SERVER["REMOTE_ADDR"] != $addrStr) + { + echo "Client ip don't match cookie
"; + return false; + } + + // check the cookie in the database + $link = mysqli_connect($DBHost, $DBUserName, $DBPassword) or die ("Can't connect to database host:$DBHost user:$DBUserName"); + mysqli_select_db($link, $RingDBName) or die ("Can't access to the table dbname:$RingDBName"); + $query = "SELECT user_id, current_status, current_domain_id FROM ring_users where cookie='$cookie'"; + $result = mysqli_query($link, $query) or die ("Can't execute the query: ".$query); + + if (mysqli_num_rows($result) == 0) + { + echo "Can't find cookie $cookie in database
"; + return false; + } + + $row = mysqli_fetch_array($result); + + if ($row["current_status"] != "cs_logged" && $row["current_status"] != "cs_online" ) + { + echo "User $row[user_id] is not looged or online
"; + return false; + } + + $userId = $row["user_id"]; + $domainId = $row["current_domain_id"]; +// $charId = ($userId*16) + (getCharSlot()) & 0xf; + $charId = $userId*16 + getCharSlot(); + + return true; +} + +function getCharSlot() +{ + global $_GET, $_POST; + if (isset($_GET["charSlot"])) + return $_GET["charSlot"]; + else if (isset($_POST["charSlot"])) + return $_POST["charSlot"]; + else + return 0; // temp dev: use 0 as the "ring character" +} diff --git a/ryzom/server/www/login/libs/welcome_service_itf.php b/ryzom/server/www/login/libs/welcome_service_itf.php new file mode 100644 index 000000000..9c31cbbf3 --- /dev/null +++ b/ryzom/server/www/login/libs/welcome_service_itf.php @@ -0,0 +1,59 @@ +Value = $WS_TUserRole_InvalidValue; + } + + function toString() + { + global $WS_TUserRole_EnumValues; + return $WS_TUserRole_EnumValues[$this->Value]; + } + + function fromString($strValue) + { + global $WS_TUserRole_EnumValues; + foreach ($WS_TUserRole_EnumValues as $k => $v) + { + if ($strValue === $v) + { + $this->Value = $k; + return; + } + } + + $this->Value = $WS_TUserRole_InvalidValue; + } + + function toInt() + { + return $this->Value; + } + + function fromInt($intValue) + { + global $WS_TUserRole_InvalidValue; + global $WS_TUserRole_EnumValues; + if (array_key_exists($intValue, $WS_TUserRole_EnumValues)) + $this->Value = $intValue; + else + $this->Value = $WS_TUserRole_InvalidValue; + } + } +?> diff --git a/ryzom/server/www/login/logs/.empty b/ryzom/server/www/login/logs/.empty new file mode 100644 index 000000000..e69de29bb diff --git a/ryzom/server/www/login/nel.sql b/ryzom/server/www/login/nel.sql new file mode 100644 index 000000000..c32434ba6 --- /dev/null +++ b/ryzom/server/www/login/nel.sql @@ -0,0 +1,201 @@ +-- phpMyAdmin SQL Dump +-- version 4.8.5 +-- https://www.phpmyadmin.net/ +-- +-- Hôte : localhost:3306 +-- Généré le : jeu. 21 fév. 2019 à 23:46 +-- Version du serveur : 5.7.25-0ubuntu0.18.04.2 +-- Version de PHP : 7.2.15-0ubuntu0.18.04.1 + +SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; +SET AUTOCOMMIT = 0; +START TRANSACTION; +SET time_zone = "+00:00"; + + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES utf8mb4 */; + +-- +-- Base de données : `nel` +-- + +-- -------------------------------------------------------- + +-- +-- Structure de la table `domain` +-- + +CREATE TABLE `domain` ( + `domain_id` int(10) UNSIGNED NOT NULL, + `domain_name` varchar(32) NOT NULL DEFAULT '', + `status` enum('ds_close','ds_dev','ds_restricted','ds_open') NOT NULL DEFAULT 'ds_dev', + `patch_version` int(10) UNSIGNED NOT NULL DEFAULT '0', + `backup_patch_url` varchar(255) DEFAULT NULL, + `patch_urls` text, + `login_address` varchar(255) NOT NULL DEFAULT '', + `session_manager_address` varchar(255) NOT NULL DEFAULT '', + `ring_db_name` varchar(255) NOT NULL DEFAULT '', + `web_host` varchar(255) NOT NULL DEFAULT '', + `web_host_php` varchar(255) NOT NULL DEFAULT '', + `description` varchar(200) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1; + +-- -------------------------------------------------------- + +-- +-- Structure de la table `permission` +-- + +CREATE TABLE `permission` ( + `UId` int(10) UNSIGNED NOT NULL DEFAULT '0', + `ClientApplication` char(64) NOT NULL DEFAULT 'r2', + `ShardId` int(10) NOT NULL DEFAULT '-1', + `AccessPrivilege` set('DEV','RESTRICTED','OPEN') NOT NULL DEFAULT 'OPEN', + `prim` int(10) UNSIGNED NOT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1; + +-- -------------------------------------------------------- + +-- +-- Structure de la table `shard` +-- + +CREATE TABLE `shard` ( + `ShardId` int(10) NOT NULL DEFAULT '0', + `domain_id` int(11) UNSIGNED NOT NULL DEFAULT '0', + `WsAddr` varchar(64) DEFAULT NULL, + `NbPlayers` int(10) UNSIGNED DEFAULT '0', + `Name` varchar(255) DEFAULT 'unknown shard', + `WSOnline` tinyint(1) UNSIGNED DEFAULT '0', + `ClientApplication` varchar(64) DEFAULT 'ryzom', + `Version` varchar(64) NOT NULL DEFAULT '', + `PatchURL` varchar(255) NOT NULL DEFAULT '', + `DynPatchURL` varchar(255) NOT NULL DEFAULT '', + `FixedSessionId` int(11) UNSIGNED NOT NULL DEFAULT '0', + `State` enum('ds_close','ds_dev','ds_restricted','ds_open') NOT NULL DEFAULT 'ds_dev', + `MOTD` text NOT NULL, + `prim` int(10) UNSIGNED NOT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='contains all shards informations for login system'; + +-- -------------------------------------------------------- + +-- +-- Structure de la table `user` +-- + +CREATE TABLE `user` ( + `UId` int(10) NOT NULL, + `Login` varchar(64) NOT NULL DEFAULT '', + `Password` varchar(13) DEFAULT NULL, + `ShardId` int(10) NOT NULL DEFAULT '-1', + `State` enum('Offline','Online') NOT NULL DEFAULT 'Offline', + `Privilege` varchar(255) DEFAULT NULL, + `GroupName` varchar(255) NOT NULL DEFAULT '', + `FirstName` varchar(255) NOT NULL DEFAULT '', + `LastName` varchar(255) NOT NULL DEFAULT '', + `Birthday` varchar(32) NOT NULL DEFAULT '', + `Gender` tinyint(1) UNSIGNED NOT NULL DEFAULT '0', + `Country` char(2) NOT NULL DEFAULT '', + `Email` varchar(255) NOT NULL DEFAULT '', + `Address` varchar(255) NOT NULL DEFAULT '', + `City` varchar(100) NOT NULL DEFAULT '', + `PostalCode` varchar(10) NOT NULL DEFAULT '', + `USState` char(2) NOT NULL DEFAULT '', + `Chat` char(2) NOT NULL DEFAULT '0', + `BetaKeyId` int(10) UNSIGNED NOT NULL DEFAULT '0', + `CachedCoupons` varchar(255) NOT NULL DEFAULT '', + `ProfileAccess` varchar(45) DEFAULT NULL, + `Level` int(2) NOT NULL DEFAULT '0', + `CurrentFunds` int(4) NOT NULL DEFAULT '0', + `IdBilling` varchar(255) NOT NULL DEFAULT '', + `Community` char(2) NOT NULL DEFAULT '--', + `Newsletter` tinyint(1) NOT NULL DEFAULT '1', + `Account` varchar(64) NOT NULL DEFAULT '', + `ChoiceSubLength` tinyint(2) NOT NULL DEFAULT '0', + `CurrentSubLength` varchar(255) NOT NULL DEFAULT '0', + `ValidIdBilling` int(4) NOT NULL DEFAULT '0', + `GMId` int(4) NOT NULL DEFAULT '0', + `ExtendedPrivilege` varchar(255) NOT NULL DEFAULT '', + `ToolsGroup` varchar(255) NOT NULL DEFAULT '', + `Unsubscribe` date DEFAULT NULL, + `SubDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, + `SubIp` varchar(20) NOT NULL DEFAULT '', + `SecurePassword` varchar(32) NOT NULL DEFAULT '', + `LastInvoiceEmailCheck` date DEFAULT NULL, + `FromSource` varchar(8) NOT NULL DEFAULT '', + `ValidMerchantCode` varchar(11) NOT NULL DEFAULT '', + `PBC` tinyint(1) NOT NULL DEFAULT '0' +) ENGINE=InnoDB DEFAULT CHARSET=latin1; + +-- +-- Index pour les tables déchargées +-- + +-- +-- Index pour la table `domain` +-- +ALTER TABLE `domain` + ADD PRIMARY KEY (`domain_id`), + ADD UNIQUE KEY `name_idx` (`domain_name`); + +-- +-- Index pour la table `permission` +-- +ALTER TABLE `permission` + ADD PRIMARY KEY (`prim`), + ADD KEY `UIdIndex` (`UId`); + +-- +-- Index pour la table `shard` +-- +ALTER TABLE `shard` + ADD PRIMARY KEY (`prim`); + +-- +-- Index pour la table `user` +-- +ALTER TABLE `user` + ADD PRIMARY KEY (`UId`), + ADD KEY `LoginIndex` (`Login`), + ADD KEY `GroupIndex` (`GroupName`), + ADD KEY `Email` (`Email`), + ADD KEY `ToolsGroup` (`ToolsGroup`), + ADD KEY `CurrentSubLength` (`CurrentSubLength`), + ADD KEY `Community` (`Community`), + ADD KEY `GMId` (`GMId`); + +-- +-- AUTO_INCREMENT pour les tables déchargées +-- + +-- +-- AUTO_INCREMENT pour la table `domain` +-- +ALTER TABLE `domain` + MODIFY `domain_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT; + +-- +-- AUTO_INCREMENT pour la table `permission` +-- +ALTER TABLE `permission` + MODIFY `prim` int(10) UNSIGNED NOT NULL AUTO_INCREMENT; + +-- +-- AUTO_INCREMENT pour la table `shard` +-- +ALTER TABLE `shard` + MODIFY `prim` int(10) UNSIGNED NOT NULL AUTO_INCREMENT; + +-- +-- AUTO_INCREMENT pour la table `user` +-- +ALTER TABLE `user` + MODIFY `UId` int(10) NOT NULL AUTO_INCREMENT; +COMMIT; + +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; diff --git a/ryzom/server/www/login/r2_login.php b/ryzom/server/www/login/r2_login.php new file mode 100644 index 000000000..283bcf544 --- /dev/null +++ b/ryzom/server/www/login/r2_login.php @@ -0,0 +1,66 @@ +askSalt(); + die(); + + case 'login': + // client sent is login info + $ServerDomain = new ServerDomain($RingDb, $clientApplication); + if ($User->checkValidity($password, $ServerDomain)) { + + if ($AutoCreateRingInfo) + $User->createRingInfo($ServerDomain); + + $LSaddr = explode(":", $ServerDomain->domainInfo['login_address']); + // ask for a session cookie to the login service + $Login = new LoginCb(); + $Login->init($RingDb, $ServerDomain); + + $res = ""; + $Login->connect($LSaddr[0], $LSaddr[1], $res); + $Login->login($User->uid, $_SERVER['REMOTE_ADDR'], $ServerDomain->id); + + if (!$Login->waitCallback()) + die(errorMsgBlock(3003)); + + } + + die(); +} + diff --git a/ryzom/server/www/login/ring.sql b/ryzom/server/www/login/ring.sql new file mode 100644 index 000000000..e9dc9c967 --- /dev/null +++ b/ryzom/server/www/login/ring.sql @@ -0,0 +1,524 @@ +-- phpMyAdmin SQL Dump +-- version 4.8.5 +-- https://www.phpmyadmin.net/ +-- +-- Hôte : localhost:3306 +-- Généré le : jeu. 21 fév. 2019 à 23:47 +-- Version du serveur : 5.7.25-0ubuntu0.18.04.2 +-- Version de PHP : 7.2.15-0ubuntu0.18.04.1 + +SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; +SET AUTOCOMMIT = 0; +START TRANSACTION; +SET time_zone = "+00:00"; + + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES utf8mb4 */; + +-- +-- Base de données : `ring_test` +-- + +-- -------------------------------------------------------- + +-- +-- Structure de la table `characters` +-- + +CREATE TABLE `characters` ( + `char_id` int(10) UNSIGNED NOT NULL DEFAULT '0', + `char_name` varchar(20) NOT NULL DEFAULT '', + `user_id` int(10) UNSIGNED NOT NULL DEFAULT '0', + `guild_id` int(10) UNSIGNED NOT NULL DEFAULT '0', + `best_combat_level` int(10) UNSIGNED NOT NULL DEFAULT '0', + `home_mainland_session_id` int(10) UNSIGNED NOT NULL DEFAULT '0', + `ring_access` varchar(63) NOT NULL DEFAULT '', + `race` enum('r_fyros','r_matis','r_tryker','r_zorai') NOT NULL DEFAULT 'r_fyros', + `civilisation` enum('c_neutral','c_fyros','c_fyros','c_matis','c_tryker','c_zorai') NOT NULL DEFAULT 'c_neutral', + `cult` enum('c_neutral','c_kami','c_karavan') NOT NULL DEFAULT 'c_neutral', + `current_session` int(11) UNSIGNED NOT NULL DEFAULT '0', + `rrp_am` int(11) UNSIGNED NOT NULL DEFAULT '0', + `rrp_masterless` int(11) UNSIGNED NOT NULL DEFAULT '0', + `rrp_author` int(11) UNSIGNED NOT NULL DEFAULT '0', + `newcomer` tinyint(1) NOT NULL DEFAULT '1', + `creation_date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `last_played_date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00' +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + +-- -------------------------------------------------------- + +-- +-- Structure de la table `folder` +-- + +CREATE TABLE `folder` ( + `Id` int(10) UNSIGNED NOT NULL, + `owner` int(10) UNSIGNED NOT NULL DEFAULT '0', + `title` varchar(40) NOT NULL DEFAULT '', + `comments` text NOT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1; + +-- -------------------------------------------------------- + +-- +-- Structure de la table `folder_access` +-- + +CREATE TABLE `folder_access` ( + `Id` int(10) UNSIGNED NOT NULL, + `folder_id` int(10) UNSIGNED NOT NULL DEFAULT '0', + `user_id` int(10) UNSIGNED NOT NULL DEFAULT '0' +) ENGINE=InnoDB DEFAULT CHARSET=latin1; + +-- -------------------------------------------------------- + +-- +-- Structure de la table `guilds` +-- + +CREATE TABLE `guilds` ( + `guild_id` int(10) UNSIGNED NOT NULL DEFAULT '0', + `guild_name` varchar(20) NOT NULL DEFAULT '', + `shard_id` int(11) NOT NULL DEFAULT '0' +) ENGINE=InnoDB DEFAULT CHARSET=latin1; + +-- -------------------------------------------------------- + +-- +-- Structure de la table `guild_invites` +-- + +CREATE TABLE `guild_invites` ( + `Id` int(10) UNSIGNED NOT NULL, + `session_id` int(10) UNSIGNED NOT NULL DEFAULT '0', + `guild_id` int(10) UNSIGNED NOT NULL DEFAULT '0' +) ENGINE=InnoDB DEFAULT CHARSET=latin1; + +-- -------------------------------------------------------- + +-- +-- Structure de la table `journal_entry` +-- + +CREATE TABLE `journal_entry` ( + `Id` int(10) UNSIGNED NOT NULL, + `session_id` int(10) UNSIGNED NOT NULL DEFAULT '0', + `author` int(10) UNSIGNED NOT NULL DEFAULT '0', + `type` enum('jet_credits','jet_notes') NOT NULL DEFAULT 'jet_notes', + `text` text NOT NULL, + `time_stamp` datetime NOT NULL DEFAULT '2005-09-07 12:41:33' +) ENGINE=InnoDB DEFAULT CHARSET=latin1; + +-- -------------------------------------------------------- + +-- +-- Structure de la table `known_users` +-- + +CREATE TABLE `known_users` ( + `Id` int(10) UNSIGNED NOT NULL, + `owner` int(10) UNSIGNED NOT NULL DEFAULT '0', + `targer_user` int(10) UNSIGNED NOT NULL DEFAULT '0', + `targer_character` int(10) UNSIGNED NOT NULL DEFAULT '0', + `relation_type` enum('rt_friend','rt_banned','rt_friend_dm') NOT NULL DEFAULT 'rt_friend', + `comments` varchar(255) NOT NULL DEFAULT '' +) ENGINE=InnoDB DEFAULT CHARSET=latin1; + +-- -------------------------------------------------------- + +-- +-- Structure de la table `mfs_erased_mail_series` +-- + +CREATE TABLE `mfs_erased_mail_series` ( + `erased_char_id` int(11) UNSIGNED NOT NULL DEFAULT '0', + `erased_char_name` varchar(32) NOT NULL DEFAULT '', + `erased_series` int(11) UNSIGNED NOT NULL, + `erase_date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00' +) ENGINE=InnoDB DEFAULT CHARSET=latin1; + +-- -------------------------------------------------------- + +-- +-- Structure de la table `mfs_guild_thread` +-- + +CREATE TABLE `mfs_guild_thread` ( + `thread_id` int(11) NOT NULL, + `guild_id` int(11) UNSIGNED NOT NULL DEFAULT '0', + `topic` varchar(255) NOT NULL DEFAULT '', + `author_name` varchar(32) NOT NULL DEFAULT '', + `last_post_date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `post_count` int(11) UNSIGNED NOT NULL DEFAULT '0' +) ENGINE=InnoDB DEFAULT CHARSET=latin1; + +-- -------------------------------------------------------- + +-- +-- Structure de la table `mfs_guild_thread_message` +-- + +CREATE TABLE `mfs_guild_thread_message` ( + `id` int(11) NOT NULL, + `thread_id` int(11) UNSIGNED NOT NULL DEFAULT '0', + `author_name` varchar(32) NOT NULL DEFAULT '', + `date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `content` text NOT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1; + +-- -------------------------------------------------------- + +-- +-- Structure de la table `mfs_mail` +-- + +CREATE TABLE `mfs_mail` ( + `id` int(11) NOT NULL, + `sender_name` varchar(32) NOT NULL DEFAULT '', + `subject` varchar(250) NOT NULL DEFAULT '', + `date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `status` enum('ms_new','ms_read','ms_erased') NOT NULL DEFAULT 'ms_new', + `dest_char_id` int(11) UNSIGNED NOT NULL DEFAULT '0', + `erase_series` int(11) UNSIGNED NOT NULL DEFAULT '0', + `content` text NOT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1; + +-- -------------------------------------------------------- + +-- +-- Structure de la table `player_rating` +-- + +CREATE TABLE `player_rating` ( + `Id` int(10) UNSIGNED NOT NULL, + `session_id` int(10) UNSIGNED NOT NULL DEFAULT '0', + `author` int(10) UNSIGNED NOT NULL DEFAULT '0', + `rating` int(10) NOT NULL DEFAULT '0', + `comments` text NOT NULL, + `time_stamp` datetime NOT NULL DEFAULT '2005-09-07 12:41:33' +) ENGINE=InnoDB DEFAULT CHARSET=latin1; + +-- -------------------------------------------------------- + +-- +-- Structure de la table `ring_users` +-- + +CREATE TABLE `ring_users` ( + `user_id` int(10) UNSIGNED NOT NULL DEFAULT '0', + `user_name` varchar(20) NOT NULL DEFAULT '', + `user_type` enum('ut_character','ut_pioneer') NOT NULL DEFAULT 'ut_character', + `current_char` varchar(255) NOT NULL DEFAULT '', + `current_session` int(10) UNSIGNED NOT NULL DEFAULT '0', + `current_activity` enum('ca_none','ca_play','ca_edit','ca_anim') NOT NULL DEFAULT 'ca_none', + `current_status` enum('cs_offline','cs_logged','cs_online') NOT NULL DEFAULT 'cs_offline', + `public_level` varchar(255) NOT NULL DEFAULT 'pl_none', + `account_type` enum('at_normal','at_gold') NOT NULL DEFAULT 'at_normal', + `content_access_level` varchar(20) NOT NULL DEFAULT '', + `description` text, + `lang` enum('lang_en','lang_fr','lang_de') NOT NULL DEFAULT 'lang_en', + `cookie` varchar(30) NOT NULL DEFAULT '', + `current_domain_id` int(10) NOT NULL DEFAULT '-1', + `pioneer_char_id` int(11) UNSIGNED NOT NULL DEFAULT '0', + `add_privileges` varchar(255) NOT NULL DEFAULT '' +) ENGINE=InnoDB DEFAULT CHARSET=latin1; + +-- -------------------------------------------------------- + +-- +-- Structure de la table `scenario_desc` +-- + +CREATE TABLE `scenario_desc` ( + `session_id` int(10) UNSIGNED NOT NULL DEFAULT '0', + `parent_scenario` int(10) UNSIGNED NOT NULL DEFAULT '0', + `description` text NOT NULL, + `relation_to_parent` enum('rtp_same','rtp_variant','rtp_different') NOT NULL DEFAULT 'rtp_same', + `title` varchar(40) NOT NULL DEFAULT '', + `num_player` int(10) UNSIGNED NOT NULL DEFAULT '0', + `content_access_level` varchar(20) NOT NULL DEFAULT '' +) ENGINE=InnoDB DEFAULT CHARSET=latin1; + +-- -------------------------------------------------------- + +-- +-- Structure de la table `sessions` +-- + +CREATE TABLE `sessions` ( + `session_id` int(10) UNSIGNED NOT NULL, + `session_type` enum('st_edit','st_anim','st_outland','st_mainland') NOT NULL DEFAULT 'st_edit', + `title` varchar(40) NOT NULL DEFAULT '', + `owner` int(10) UNSIGNED NOT NULL DEFAULT '0', + `plan_date` datetime NOT NULL DEFAULT '2005-09-21 12:41:33', + `start_date` datetime NOT NULL DEFAULT '2005-08-31 00:00:00', + `description` text NOT NULL, + `orientation` enum('so_newbie_training','so_story_telling','so_mistery','so_hack_slash','so_guild_training','so_other') NOT NULL DEFAULT 'so_other', + `level` enum('sl_a','sl_b','sl_c','sl_d','sl_e','sl_f') NOT NULL DEFAULT 'sl_a', + `rule_type` enum('rt_strict','rt_liberal') NOT NULL DEFAULT 'rt_strict', + `access_type` enum('at_public','at_private') NOT NULL DEFAULT 'at_private', + `state` enum('ss_planned','ss_open','ss_locked','ss_closed') NOT NULL DEFAULT 'ss_planned', + `host_shard_id` int(11) NOT NULL DEFAULT '0', + `subscription_slots` int(11) UNSIGNED NOT NULL DEFAULT '0', + `reserved_slots` int(10) UNSIGNED NOT NULL DEFAULT '0', + `free_slots` int(10) UNSIGNED NOT NULL DEFAULT '0', + `estimated_duration` enum('et_short','et_medium','et_long') NOT NULL DEFAULT 'et_short', + `final_duration` int(10) UNSIGNED NOT NULL DEFAULT '0', + `folder_id` int(10) UNSIGNED NOT NULL DEFAULT '0', + `lang` varchar(20) NOT NULL DEFAULT '', + `icone` varchar(70) NOT NULL DEFAULT '', + `anim_mode` enum('am_dm','am_autonomous') NOT NULL DEFAULT 'am_dm', + `race_filter` set('rf_fyros','rf_matis','rf_tryker','rf_zorai') NOT NULL DEFAULT '', + `religion_filter` set('rf_kami','rf_karavan','rf_neutral') NOT NULL DEFAULT '', + `guild_filter` enum('gf_only_my_guild','gf_any_player') DEFAULT 'gf_only_my_guild', + `shard_filter` set('sf_shard00','sf_shard01','sf_shard02','sf_shard03','sf_shard04','sf_shard05','sf_shard06','sf_shard07','sf_shard08','sf_shard09','sf_shard10','sf_shard11','sf_shard12','sf_shard13','sf_shard14','sf_shard15','sf_shard16','sf_shard17','sf_shard18','sf_shard19','sf_shard20','sf_shard21','sf_shard22','sf_shard23','sf_shard24','sf_shard25','sf_shard26','sf_shard27','sf_shard28','sf_shard29','sf_shard30','sf_shard31') NOT NULL DEFAULT 'sf_shard00,sf_shard01,sf_shard02,sf_shard03,sf_shard04,sf_shard05,sf_shard06,sf_shard07,sf_shard08,sf_shard09,sf_shard10,sf_shard11,sf_shard12,sf_shard13,sf_shard14,sf_shard15,sf_shard16,sf_shard17,sf_shard18,sf_shard19,sf_shard20,sf_shard21,sf_shard22,sf_shard23,sf_shard24,sf_shard25,sf_shard26,sf_shard27,sf_shard28,sf_shard29,sf_shard30,sf_shard31', + `level_filter` set('lf_a','lf_b','lf_c','lf_d','lf_e','lf_f') NOT NULL DEFAULT 'lf_a,lf_b,lf_c,lf_d,lf_e,lf_f', + `subscription_closed` tinyint(1) NOT NULL DEFAULT '0', + `newcomer` tinyint(1) UNSIGNED ZEROFILL NOT NULL DEFAULT '0' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC; + +-- -------------------------------------------------------- + +-- +-- Structure de la table `session_participant` +-- + +CREATE TABLE `session_participant` ( + `Id` int(10) UNSIGNED NOT NULL, + `session_id` int(10) UNSIGNED NOT NULL DEFAULT '0', + `char_id` int(10) UNSIGNED NOT NULL DEFAULT '0', + `status` enum('sps_play_subscribed','sps_play_invited','sps_edit_invited','sps_anim_invited','sps_playing','sps_editing','sps_animating') NOT NULL DEFAULT 'sps_play_subscribed', + `kicked` tinyint(1) UNSIGNED NOT NULL DEFAULT '0', + `session_rated` tinyint(1) UNSIGNED NOT NULL DEFAULT '0' +) ENGINE=InnoDB DEFAULT CHARSET=latin1; + +-- -------------------------------------------------------- + +-- +-- Structure de la table `shard` +-- + +CREATE TABLE `shard` ( + `shard_id` int(10) NOT NULL DEFAULT '0', + `WSOnline` tinyint(1) NOT NULL DEFAULT '0', + `MOTD` text NOT NULL, + `OldState` enum('ds_close','ds_dev','ds_restricted','ds_open') NOT NULL DEFAULT 'ds_restricted', + `RequiredState` enum('ds_close','ds_dev','ds_restricted','ds_open') NOT NULL DEFAULT 'ds_dev' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 ROW_FORMAT=FIXED; + +-- +-- Index pour les tables déchargées +-- + +-- +-- Index pour la table `characters` +-- +ALTER TABLE `characters` + ADD PRIMARY KEY (`char_id`), + ADD UNIQUE KEY `char_name_idx` (`char_name`,`home_mainland_session_id`), + ADD KEY `user_id_idx` (`user_id`), + ADD KEY `guild_idx` (`guild_id`), + ADD KEY `guild_id_idx` (`guild_id`); + +-- +-- Index pour la table `folder` +-- +ALTER TABLE `folder` + ADD PRIMARY KEY (`Id`), + ADD KEY `owner_idx` (`owner`), + ADD KEY `title_idx` (`title`); + +-- +-- Index pour la table `folder_access` +-- +ALTER TABLE `folder_access` + ADD PRIMARY KEY (`Id`), + ADD KEY `folder_id_idx` (`folder_id`), + ADD KEY `user_idx` (`user_id`); + +-- +-- Index pour la table `guilds` +-- +ALTER TABLE `guilds` + ADD PRIMARY KEY (`guild_id`), + ADD UNIQUE KEY `huild_name_idx` (`guild_name`), + ADD KEY `shard_id_idx` (`shard_id`); + +-- +-- Index pour la table `guild_invites` +-- +ALTER TABLE `guild_invites` + ADD PRIMARY KEY (`Id`), + ADD KEY `guild_id_idx` (`guild_id`), + ADD KEY `session_id_idx` (`session_id`); + +-- +-- Index pour la table `journal_entry` +-- +ALTER TABLE `journal_entry` + ADD PRIMARY KEY (`Id`), + ADD KEY `session_id_idx` (`session_id`); + +-- +-- Index pour la table `known_users` +-- +ALTER TABLE `known_users` + ADD PRIMARY KEY (`Id`), + ADD KEY `user_index` (`owner`); + +-- +-- Index pour la table `mfs_erased_mail_series` +-- +ALTER TABLE `mfs_erased_mail_series` + ADD PRIMARY KEY (`erased_series`); + +-- +-- Index pour la table `mfs_guild_thread` +-- +ALTER TABLE `mfs_guild_thread` + ADD PRIMARY KEY (`thread_id`), + ADD KEY `guild_index` (`guild_id`); + +-- +-- Index pour la table `mfs_guild_thread_message` +-- +ALTER TABLE `mfs_guild_thread_message` + ADD PRIMARY KEY (`id`); + +-- +-- Index pour la table `mfs_mail` +-- +ALTER TABLE `mfs_mail` + ADD PRIMARY KEY (`id`), + ADD KEY `dest_index` (`dest_char_id`); + +-- +-- Index pour la table `player_rating` +-- +ALTER TABLE `player_rating` + ADD PRIMARY KEY (`Id`), + ADD KEY `session_id_idx` (`session_id`), + ADD KEY `author_idx` (`author`); + +-- +-- Index pour la table `ring_users` +-- +ALTER TABLE `ring_users` + ADD PRIMARY KEY (`user_id`), + ADD UNIQUE KEY `user_name_idx` (`user_name`), + ADD KEY `cookie_idx` (`cookie`); + +-- +-- Index pour la table `scenario_desc` +-- +ALTER TABLE `scenario_desc` + ADD PRIMARY KEY (`session_id`), + ADD UNIQUE KEY `title_idx` (`title`), + ADD KEY `parent_idx` (`parent_scenario`); + +-- +-- Index pour la table `sessions` +-- +ALTER TABLE `sessions` + ADD PRIMARY KEY (`session_id`), + ADD KEY `owner_idx` (`owner`), + ADD KEY `folder_idx` (`folder_id`), + ADD KEY `state_type_idx` (`state`,`session_type`); + +-- +-- Index pour la table `session_participant` +-- +ALTER TABLE `session_participant` + ADD PRIMARY KEY (`Id`), + ADD KEY `session_idx` (`session_id`), + ADD KEY `user_idx` (`char_id`); + +-- +-- Index pour la table `shard` +-- +ALTER TABLE `shard` + ADD PRIMARY KEY (`shard_id`); + +-- +-- AUTO_INCREMENT pour les tables déchargées +-- + +-- +-- AUTO_INCREMENT pour la table `folder` +-- +ALTER TABLE `folder` + MODIFY `Id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT; + +-- +-- AUTO_INCREMENT pour la table `folder_access` +-- +ALTER TABLE `folder_access` + MODIFY `Id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT; + +-- +-- AUTO_INCREMENT pour la table `guild_invites` +-- +ALTER TABLE `guild_invites` + MODIFY `Id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT; + +-- +-- AUTO_INCREMENT pour la table `journal_entry` +-- +ALTER TABLE `journal_entry` + MODIFY `Id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT; + +-- +-- AUTO_INCREMENT pour la table `known_users` +-- +ALTER TABLE `known_users` + MODIFY `Id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT; + +-- +-- AUTO_INCREMENT pour la table `mfs_erased_mail_series` +-- +ALTER TABLE `mfs_erased_mail_series` + MODIFY `erased_series` int(11) UNSIGNED NOT NULL AUTO_INCREMENT; + +-- +-- AUTO_INCREMENT pour la table `mfs_guild_thread` +-- +ALTER TABLE `mfs_guild_thread` + MODIFY `thread_id` int(11) NOT NULL AUTO_INCREMENT; + +-- +-- AUTO_INCREMENT pour la table `mfs_guild_thread_message` +-- +ALTER TABLE `mfs_guild_thread_message` + MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; + +-- +-- AUTO_INCREMENT pour la table `mfs_mail` +-- +ALTER TABLE `mfs_mail` + MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; + +-- +-- AUTO_INCREMENT pour la table `player_rating` +-- +ALTER TABLE `player_rating` + MODIFY `Id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT; + +-- +-- AUTO_INCREMENT pour la table `sessions` +-- +ALTER TABLE `sessions` + MODIFY `session_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT; + +-- +-- AUTO_INCREMENT pour la table `session_participant` +-- +ALTER TABLE `session_participant` + MODIFY `Id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT; +COMMIT; + +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; diff --git a/ryzom/server/www/tools/broadcast.php b/ryzom/server/www/tools/broadcast.php new file mode 100644 index 000000000..f9384a751 --- /dev/null +++ b/ryzom/server/www/tools/broadcast.php @@ -0,0 +1,39 @@ + diff --git a/ryzom/server/www/tools/get_connected_players.php b/ryzom/server/www/tools/get_connected_players.php new file mode 100644 index 000000000..bb0894ecf --- /dev/null +++ b/ryzom/server/www/tools/get_connected_players.php @@ -0,0 +1,29 @@ += 1) { + foreach ($data['parsed'] as $cid => $user) { + $name = explode('(', $user[2]); + $priv = substr($user[4], 2, strlen($user[4])-4); + if ($priv) + $priv_users[] = array($name[0], $priv); + else + $users[] = array($name[0]); + } + echo ''.count($priv_users).' Users with Privs
'; + foreach($priv_users as $u) + echo ''.$u[0].'('.$u[1].') '; + echo '
'.count($users).' Users
'; + foreach($users as $u) + echo $u[0].' '; + echo ''; +} else { + echo 'No players connected!'; + exit(1); +} diff --git a/ryzom/server/www/tools/getfromshard.php b/ryzom/server/www/tools/getfromshard.php new file mode 100644 index 000000000..3071f9254 --- /dev/null +++ b/ryzom/server/www/tools/getfromshard.php @@ -0,0 +1,14 @@ + $id) { + $sid = explode(' ', $id); + if ($sid[0] == 'Player:') { + queryShard('egs', 'disconnectPlayer '.$sid[1], false); + echo $sid[3].' has been kicked!'."\n"; + } + } + sendToChat('is killing all services...', '#pub-general', $ShardName, ':broken_heart:'); + break; +} + diff --git a/ryzom/server/www/tools/sendtoios.php b/ryzom/server/www/tools/sendtoios.php new file mode 100644 index 000000000..3c6429a47 --- /dev/null +++ b/ryzom/server/www/tools/sendtoios.php @@ -0,0 +1,6 @@ + diff --git a/ryzom/server/www/tools/utils.php b/ryzom/server/www/tools/utils.php new file mode 100644 index 000000000..edaab0228 --- /dev/null +++ b/ryzom/server/www/tools/utils.php @@ -0,0 +1,34 @@ + $channel, + 'username' => $username, + 'icon_emoji' => $icon, + 'text' => $message, + ) + ); + $ch = curl_init('https://'.$RocketChatServer.'/hooks/'.$RocketChatHook); + curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST'); + curl_setopt($ch, CURLOPT_POSTFIELDS, $data); + curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json')); + $result = curl_exec($ch); + curl_close($ch); + return $result; + } else { + echo ''.$message.'
'; + return true; + } +} + + +function shardLockAccess() { + global $ShardId; + @queryShard('su', 'rsm.setWSState '. $ShardId .' RESTRICTED ""'); +} +