Jump to content

Phat Looser

Members
  • Posts

    627
  • Joined

  • Last visited

Posts posted by Phat Looser

  1. The teargas had a different issue.

    Since it uses an alpha channel and a lot of dust, I had to remove it from the game so that the players with bad gfx cards have less issues...

    Thats pretty much the point.

    Since a list of teargasses was less then the player count, I solved it that way.

    About the anticheat stuff: Is it syncro only, now?

    Can I have a look?

    In this case getElementsByType is used verily often, true.

  2. Just a question:

    You have at least 1 GB RAM, at least 2 GHz of CPU...

    What does it matter if the table is 1 KB bigger?

    About pairs and ipairs:

    in a benchmark, pairs is faster than ipairs, but ipairs is sorted for sure.

    Also, have you ever benchmarked "getElementsByType" and the table yourself? Just let it run 200 times and check how long it takes. I'd still use "getElementsByType" since it is easier to manage and less prone to bugs. Also don't forget that calling a code each 300 ms is kind of useless. It just means that the LUA engine has more stuff to do, even though it doesn't need to do it.

  3. Up to now I've been hosting a freeroam server with about 80-100 players on.

    I don't really like it, so if anyone does not mind hosting a freeroam server with a 10 mBit load I'll give him the whole server setup (excluding the databases, of course).

    That means you must host it yourself, and I will forward all players to you.

    Why did I stop hosting such a "successfull" freeroam server?

    First off, I host servers for other people. One of them, in this case Edd, had that Freeroam server, but stopped working for it so he simply gave it to me.

    Since there was a lot of players on that server which don't really belong to my community, I tried to integrate Freeroam a bit but totally failed at it.

    Also, I'm acutally an enemy of freeroam. Its a dumb gamemode I don't like, and I don't really care about the player count. I want to host (pretty much) unique servers, or self-scripted servers. Non-standard servers so to say.

    Only drawback is that you have to start all resources manually.

    But if you can't do that don't host a server.

  4. Currently I'm hosting about 10 MTA servers on linux, and experience tells me that the MTA servers can be crashed by DDoSing the http port.

    That means: Normally the MTA servers keep running (and running and running) for ages, but once you attack the http port, sudden crash.

    Normally once the MTA server crashes, its completely gone. That means you can check if its running

      
    local array=( $(pidof $mainfolder$currID$subfolder"mta-server") ); 
                if [ ${#array[@]} -ne 1 ]; then 
                    echo "starting server "$currID; 
                    stopup; 
                    startup; 
                fi 
      
    

    If its not running, it means it crashed.

    Now, about the port:

    If MTA cannot initialize the server doe to ANY reason (.so missing, port wrong, mtaserver.conf, acl.xml) it keeps running with the message "press Q to shut down the server".

  5. Shellscript:

      
    #!/bin/bash 
    # 
    # Minecraft Server Launcher 
    # 
    # chkconfig: 35 90 12 
    # description: Launcher for Minecraft modified to work with MTA 
    # author: original Dragonshadow, modified by BigBadButler, stolen by someone-else-whose-name-i-won't-mention-cause-he's-not-important 
    # 
    # source function library 
    SERVER_IDENT="$1" 
    SCREEN_NAME="MTA_SERV_"$SERVER_IDENT 
    GAME_PATH="/emul/ia32-linux/mta-servers/$SERVER_IDENT/" 
    SERVER_FILE="mta-server" 
      
      
      
      
    message() 
    { 
    echo "Server should show message now $1" 
    screen -D -r $SCREEN_NAME -p 0 -X stuff "say $1"`echo -ne '\015'` 
    } 
      
      
    start() 
    { 
    if [[ $(ps fxa | grep $SCREEN_NAME | grep SCREEN | awk '{ if ($1 != "") print $1 ;}') = "" ]]; then 
            # cd $GAME_PATH 
            #ausführen von Screen um den Server zu starten 
                screen -S $SCREEN_NAME -d -m $GAME_PATH$SERVER_FILE 
            # cd 
                echo "Server Started" 
        else 
                echo "Server Already Running" 
        fi 
    } 
      
    stop() 
    { 
    if [[ $(ps fax | grep $SCREEN_NAME | grep SCREEN | awk '{ if ($1 != "") print $1 ;}') = "" ]]; then 
                echo "Server not found or Offline" 
        else 
    screen -D -r $SCREEN_NAME -p 0 -X stuff "say Shutdown in 5 second(s)"`echo -ne '\015'` 
    sleep 1 
    screen -D -r $SCREEN_NAME -p 0 -X stuff "say Shutdown in 4 second(s)"`echo -ne '\015'` 
    sleep 1 
    screen -D -r $SCREEN_NAME -p 0 -X stuff "say Shutdown in 3 second(s)"`echo -ne '\015'` 
    sleep 1 
    screen -D -r $SCREEN_NAME -p 0 -X stuff "say Shutdown in 2 second(s)"`echo -ne '\015'` 
    sleep 1 
    screen -D -r $SCREEN_NAME -p 0 -X stuff "say Shutdown in 1 second(s)"`echo -ne '\015'` 
    sleep 1 
    if ! [[ $(ps fax | grep $SCREEN_NAME | grep SCREEN | awk '{ if ($1 != "") print $1 ;}') = "" ]]; then 
      PID=`ps fax | grep $SCREEN_NAME | grep SCREEN | awk '{ print $1 }'` 
      kill $PID 
    fi 
      echo "Server Stopped" 
    fi 
    } 
      
      
    restart() 
    { 
    backup 
    sleep 5 
    stop 
    start 
    echo -e "Server Restarted" 
    } 
      
    status() 
    { 
    if [[ $(ps fax | grep $SCREEN_NAME | grep SCREEN | awk '{ if ($1 != "") print $1 ;}') = "" ]]; then 
                echo "Server offline or crashed... Restarting"    
                $0 start 
                screen -X $SCREEN_NAME -X exec .\!\! echo save-all 
        else 
                echo "Server Online" 
        fi 
    } 
      
    check() 
    { 
    #awk '{ if ($1 != "") print $1 ;}': Sorgt dafür, dass das erste Wort gefunden wird. Wenn das erste Wort "" ist, bedeutet das, dass die Liste leer ist. Oder: Der Prozess läuft nicht. 
    if [[ $(ps fax | grep $SCREEN_NAME | grep SCREEN | awk '{ if ($1 != "") print $1 ;}') = "" ]]; then 
                echo "Server Offline" 
        else 
                echo "Server Online" 
        fi 
    } 
      
    case "$2" in 
    start) 
    start 
    ;; 
    stop) 
    stop 
    ;; 
    status) 
    status 
    ;; 
    check) 
    check 
    ;; 
    message) 
    message "$3" 
    ;; 
    restart) 
    stop 
    start 
    ;; 
    *) 
    echo $"Use: $0 {start stop status check restart}" 
    exit 1 
    esac 
    exit 0 
      
      
      
    

    You need to modify it a bit, but:

    ./server.sh

    ./server.sh

  6. Hy AtiBoy94,

    das Ganze ist an sich ganz einfach.

    nur anstelle von

    engineLoadDFF 
    

    und

    engineReplaceModel 
    

    nimmst du

    engineLoadTXD ( string txd_file [, bool filteringEnabled = true ] ) 
    

    und

    engineImportTXD ( txd texture, int model_id )  
    

    dann schaut das ganze so aus

      
    function pj_sultan1( commandName ) 
    [color=#FF0000]txd[/color]1 = engineLoadTXD ( "Sultan1.txt" ) 
    engineImportTXD ([color=#FF0000]txd[/color]1,560) 
    end 
    function pj_sultan2( commandName ) 
    [color=#FF0000]txd[/color]2 = engineLoadTXD ( "Sultan2.txt" ) 
    engineImportTXD ([color=#FF0000]txd[/color]2,560) 
    end 
    function pj_sultan3( commandName ) 
    [color=#FF0000]txd[/color]3 = engineLoadTXD ( "Sultan3.txt" ) 
    engineImportTXD ([color=#FF0000]txd[/color]3,560) 
    end 
      
    addCommandHandler ( "sultan1", pj_sultan1) 
    addCommandHandler ( "sultan2", pj_sultan2) 
    addCommandHandler ( "sultan3", pj_sultan3) 
      
      
    

    Hab leider nix anderes gefunden fl. könnte mir mal jemand sagen wie ich in ein Command eine variable ein bau und auslesen kann

    MFG

    cs8898

      
    function MONSTER_INIT() 
        for i,elm in pairs(aSkinList) do 
            if elm[2] ~= -1 then 
                local texture = nil; 
                local iCounter = 0; 
                while not texture do 
                    texture = engineLoadTXD ( "models/"..elm[1].."txd", true ); 
                    iCounter = iCounter + 1; 
                    if iCounter > 20 then 
                        outputDebugString("Texture loading failed."); 
                        break; 
                    end 
                end 
                local model = engineLoadDFF ( "models/"..elm[1].."dff", elm[2] ); 
                if model and texture then 
                    local iCounter = 0; 
                    local bLoaded = true; 
                    while not engineImportTXD ( texture, elm[2] ) do 
                        iCounter = iCounter + 1; 
                        if iCounter > 20 then 
                            outputDebugString("Texture import failed."); 
                            bLoaded = false; 
                            break; 
                        end 
                    end 
                    if bLoaded then 
                        engineReplaceModel ( model, elm[2] ); 
                    end 
                end 
            end 
        end 
    end 
      
    function MONSTER_DEINIT() 
        for i,elm in pairs(aSkinList) do 
            local texture = engineRestoreModel ( elm[2] ); 
        end 
    end 
      
    

    Sowas?

    Übrigens:

    function pj_sultan1( commandName )

    txd1 = engineLoadTXD ( "Sultan1.txt" )

    engineImportTXD (txd1,560)

    end

    function pj_sultan2( commandName )

    txd2 = engineLoadTXD ( "Sultan2.txt" )

    engineImportTXD (txd2,560)

    end

    function pj_sultan3( commandName )

    txd3 = engineLoadTXD ( "Sultan3.txt" )

    engineImportTXD (txd3,560)

    end

×
×
  • Create New...