Changeset 3218

Show
Ignore:
Timestamp:
01/16/10 19:06:39 (8 weeks ago)
Author:
sience
Message:
-CustomArtFilterFile sample (iris.filter.lua) for Shards added to "/config" and "/config/shards/zwischenwelt.xml
-obsolete shardconfig removed from config defaults
-gUOAMEnabled added to config defaults
-uoam folder moved from "/data" to "/config"  (should be in shard config later)
-"/tmp" dir moved from default "/data" to "iris2" root
-mark.uoam file moved to "/tmp"
-some optimizations to default dir handling in main.lua
Location:
trunk
Files:
5 added
6 modified

Legend:

Unmodified
Added
Removed
  • trunk/config/shards/zwischenwelt.xml

    r3074 r3218  
    66    <string key="gPassword"></string> 
    77    <string key="gLoginServerIP">zwischenwelt.org</string> 
     8    <string key="gCustomArtFilterFile">iris.filter.lua</string> 
    89    <table key="gMaps" keytype="string"> 
    910        <table key="0" keytype="number"> 
  • trunk/lua/config_declarations.lua

    r3127 r3218  
    144144gShardList = {} 
    145145 
    146  
    147146--~ preset shards now loaded from config/shards/*.xml 
    148  
    149 --[[ 
    150 gShardList["localhost"] = { 
    151                 gLoginname = "admin",   -- Loginname 
    152                 gPassword = "admin",    -- Password 
    153                 gLoginServerIP = "localhost", 
    154                 gLoginServerPort = 2593, 
    155                 gServerSeed = hex2num("0xFFFFFFFF"), 
    156                 gPolServer = false 
    157         } 
    158  
    159 gShardList["vetus-mundus"] = { 
    160                 gLoginname = "",        -- Loginname 
    161                 gPassword = "",         -- Password 
    162                 gLoginServerIP = "shard.vetus-mundus.de", 
    163                 gLoginServerPort = 2594, 
    164                 gWalkMinDiagonalBlock = 2, 
    165                 gServerSeed = hex2num("0xFFFFFFFF"), 
    166                 gPolServer = false 
    167         } 
    168  
    169 gShardList["Jarrys (chinese)"] = { 
    170                 gLoginname = "",        -- Loginname 
    171                 gPassword = "",         -- Password 
    172                 gLoginServerIP = "login.uofans.com",  
    173                 gLoginServerPort = 2593,  
    174                 gServerSeed = 1,  
    175                 gPolServer = false  
    176         } 
    177  
    178 -- demise admins banned iris =(  http://www.uodemise.com/forum/showthread.php?p=477997 
    179 --~ gShardList["uodemise.com"] = { 
    180                 --~ gLoginname = "",    -- Loginname 
    181                 --~ gPassword = "",             -- Password 
    182                 --~ gLoginServerIP = "login.uodemise.com", 
    183                 --~ gLoginServerPort = 2593, 
    184                 --~ gServerSeed = hex2num("0xFFFFFFFF"), 
    185                 --~ gPolServer = false 
    186         --~ } 
    187  
    188 gShardList["uogamers.com"] = { 
    189                 gLoginname = "",        -- Loginname 
    190                 gPassword = "",         -- Password 
    191                 gLoginServerIP = "login.uogamers.com", 
    192                 gLoginServerPort = 2593, 
    193                 gServerSeed = hex2num("0xFFFFFFFF"), 
    194                 gPolServer = false, 
    195                 --~ gbAutoClickItems = true -- preaos (causes lag) 
    196         } 
    197  
    198 gShardList["defianceuo.com"] = {  
    199                 gLoginname = "",        -- Loginname 
    200                 gPassword = "",         -- Password 
    201                 gLoginServerIP = "dfi.defianceuo.com",  
    202                 gLoginServerPort = 2593, 
    203                 gServerSeed = hex2num("0xFFFFFFFF"), 
    204                 gPolServer = false 
    205         } 
    206 ]]-- 
    207  
    208 -- in config.lua you can add shards like this:   
    209 -- gShardList["myshard"] = { ..... }  
    210  
    211 -- in config.lua you can set login infos like this: (not recommended for security reasons)   
    212 -- gShardList["uogamers.com"].gLoginname = "YOUR_USERNAME"  
    213 -- gShardList["uogamers.com"].gPassword = "YOUR_PASSWORD"  
    214  
    215 -- for pol servers use this: 
    216 -- gShardList["localhost"].gPolServer=true 
    217 -- gShardList["localhost"].gLoginServerPort=5003 
    218 -- gShardList["localhost"].gGameServerPort=5003 
    219  
    220 -- you can specify a specialised filter file for your shard 
    221 -- gShardList["localhost"].gCustomArtFilterFilePath = "config\\iris.filter.lua" 
    222147 
    223148 
     
    226151gConfig:DeclareBoolean("gStartGameWithoutNetwork", "client", "start without network", 'TODO', false) 
    227152gConfig:DeclareBoolean("gStartInDebugMode", "client", "start in debug mode", 'TODO', false) 
    228  
    229 gConfig:DeclareString("gCustomArtFilterFilePath", "path", "art filter path", 'TODO', "") 
    230153 
    231154gServerEmulator=0 
     
    495418gConfig:DeclareBoolean("gEnableGotoOnClick", "input", "goto on click", 'TODO', false) 
    496419 
    497 gMarkFile = "../data/uoam/mark.uoam" 
     420-- UOAM Server support 
     421gConfig:DeclareBoolean("gUOAMEnabled", "protocol", "Enabled UOAM", 'TODO', false) 
    498422 
    499423gConfig:DeclareBoolean("gTileFreeWalkDiagonalOptimization", "input", "diagonal walk optimize", 'experimental code for faster diagonal movement (tries to avoid stair effect)', true) 
     
    518442 
    519443gConfig:DeclareFloat("gMaxFPS", "gfx", "max fps", 'upper fps limit', 50) 
    520  
    521444 
    522445 
  • trunk/lua/lib.compass.lua

    r3214 r3218  
    6060 
    6161function MarkCurrentPosition    (name) 
    62     if gMarkFile then 
    63         local fp = io.open(gMarkFile,"a") 
     62    if gUoamMarkFilePath then 
     63        local fp = io.open(gUoamMarkFilePath,"a") 
    6464        if (fp) then 
    6565            local x,y,z = MacroRead_GetPlayerPosition() 
     
    7070    end 
    7171    gPositionMarkers = {} 
    72     LoadUOAutomapFiles("../data/uoam/", gPositionMarkers) 
    73 end 
    74  
    75 LoadUOAutomapFiles("../data/uoam/", gPositionMarkers) 
     72    LoadUOAutomapFiles(gUOAMDir, gPositionMarkers) 
     73end 
     74 
     75LoadUOAutomapFiles(gUOAMDir, gPositionMarkers) 
    7676 
    7777function SetPositionMarker(mapindex,name,xloc,yloc,r,g,b,a) 
  • trunk/lua/lib.macrolist.lua

    r3214 r3218  
    12841284        local shard = gShardList[shardname]  assert(shard) 
    12851285        gShardName = shardname 
    1286     LoadShardfilter(shard.gCustomArtFilterFilePath) -- todo : revert on error or back-button ? 
     1286    LoadShardfilter(shard.gCustomArtFilterFile) -- todo : revert on error or back-button ? 
    12871287         
    12881288    -- load global config from shard 
  • trunk/lua/lib.mainmenu.lua

    r3191 r3218  
    8989-- ***** ***** ***** ***** ***** Shardfilter 
    9090 
    91 function LoadShardfilter (filterfilepath) 
    92     if (filterfilepath) then 
    93         if (file_exists(gMainWorkingDir..filterfilepath) ) then 
    94             print("Load custom shard-specific Filter: "..gMainWorkingDir..filterfilepath) 
    95             dofile(gMainWorkingDir..filterfilepath) 
     91function LoadShardfilter (filterfile) 
     92    if (filterfile) then 
     93        if (file_exists(gConfigPath..filterfile) ) then 
     94            print("Load custom shard-specific Filter: "..gConfigPath..filterfile) 
     95            dofile(gConfigPath..filterfile) 
    9696        else 
    97             print("Shard-specific Filter not found: "..gMainWorkingDir..filterfilepath) 
     97            print("Shard-specific Filter not found: "..gConfigPath..filterfile) 
    9898        end 
    9999    end 
     
    106106    MainMenuStopAllMenus() 
    107107     
    108     LoadShardfilter(shard.gCustomArtFilterFilePath) -- todo : revert on error or back-button ? 
     108    LoadShardfilter(shard.gCustomArtFilterFile) -- todo : revert on error or back-button ? 
    109109     
    110110    -- load global config from shard 
  • trunk/lua/main.lua

    r3217 r3218  
    33--############################### 
    44 
    5  
     5-- Iris2 Directories/Files 
    66gMainWorkingDir     = GetMainWorkingDir and GetMainWorkingDir() or "" 
    77datapath            = gMainWorkingDir.."data/" 
    88libpath             = gMainWorkingDir.."lua/" 
    9 lugreluapath        = (file_exists(gMainWorkingDir.."mylugre") and gMainWorkingDir.."mylugre/lua/" or GetLugreLuaPath()) 
    109gMacroPathFallback  = gMainWorkingDir.."lua/config_macros_declarations.lua" 
    1110gMainPluginDir      = gMainWorkingDir.."plugins/" 
     11gIrisWidgetDir      = libpath.."widgets/" 
     12 
     13lugreluapath        = (file_exists(gMainWorkingDir.."mylugre") and gMainWorkingDir.."mylugre/lua/" or GetLugreLuaPath()) -- this is should also in USERHOME dir 
     14 
     15-- User Directories/Files 
     16gTempPath           = gMainWorkingDir.."tmp/" 
     17gUoamMarkFile           = "mark.uoam" 
     18gUoamMarkFilePath       = gTempPath..gUoamMarkFile 
     19gScreenshotDir          = gMainWorkingDir.."screenshots/" 
    1220gConfigPath         = gMainWorkingDir.."config/" 
    13 gScreenshotDir          = gMainWorkingDir.."screenshots/" 
     21gConfigFile         = "config.lua" 
     22gConfigPathFile     = gConfigPath..gConfigFile 
     23gConfigPathFile_old = datapath..gConfigFile         -- only as Fallback for old users 
    1424gMacroFile          = "mymacros.lua" 
    1525gMacroPathFile      = gConfigPath..gMacroFile 
    1626gMacroPathFile_old  = datapath..gMacroFile          -- only as Fallback for old users 
    17 gConfigFile         = "config.lua" 
    18 gConfigPathFile     = gConfigPath..gConfigFile 
    19 gConfigPathFile_old = datapath..gConfigFile         -- only as Fallback for old users 
    20 gIrisWidgetDir      = libpath.."widgets/" 
    2127gDesktopDir                     = gConfigPath.."desktop/" -- old was data/desktop/ 
    22 gTempPath           = datapath.."tmp/" 
    2328gPacketVideoFileName_folderpath = gMainWorkingDir.."videos/" 
     29gUOAMDir                        = gConfigPath.."uoam/" 
     30 
    2431gSecondsSinceLastFrame = 0 
    25  
    2632gInGameStarted = false 
    2733gNet_State = false 
     
    3945                if (not home) then return end 
    4046 
    41                 if (WIN32) then home = home .. "/Anwendungsdaten" end 
     47                if (WIN32) then home = home .. "/Anwendungsdaten" end   -- TODO: other Languages!!! 
    4248                 
    4349                gHomeIrisPath           = home.."/.iris/" 
     
    4955                gDesktopDir                     = gConfigPath.."desktop/" 
    5056                gPacketVideoFileName_folderpath = gHomeIrisPath.."videos/" -- todo : text='will be saved as .ipv files in iris/videos/' 
     57                gUOAMDir                        = gConfigPath.."uoam/" 
    5158                 
    52                  
    53                 if (not file_exists(gHomeIrisPath)) then 
     59                -- check if config.lua is already copied 
     60                if (not file_exists(gConfigPathFile)) then 
    5461                        print("initializing "..gHomeIrisPath) 
    5562                        mkdir(gHomeIrisPath) 
     
    5966                        mkdir(gDesktopDir) 
    6067                        mkdir(gPacketVideoFileName_folderpath) 
     68                        mkdir(gUOAMDir) 
    6169 
    6270                        print("Copy config from: " .. gMainWorkingDir.."config/" .. " to: " .. gConfigPath)