1. If you have a problem and need help, create a new thread with a title that briefly describes the problem.
    Do not use titles like 'Help!' or 'I have a problem!'
    Dismiss Notice
  2. Hey Guest, is it this your first time on the forums?

    Visit the Beginner's Box

    Introduce yourself, read some of the ins and outs of the community, access to useful links and information.

    Dismiss Notice

How to set up a server.

Discussion in 'Server Help' started by MCrypa, May 31, 2012.

  1. MCrypa

    MCrypa Haxor

    Messages:
    562
    How to set up a server, for dummies!
    I know this thread is pretty unnessecary because we already have a wikipage, but lately I've been seeing more and more posts about the issue. To visit the page, go to: http://kagwiki.com/wiki/Server

    Windows
    Step 1: Download the server software from: http://kag2d.com/en/download
    It says it is for Linux, but it works on other platforms as well.

    Step 2: Extract all the files in the .zip you just downloaded into your KAG directory.
    If you have a shortcut, you can rightclick the shortcut and click "Open file location" or anything similar to get to your KAG directory.

    If you want to find it manually:
    1. Click "My Computer"
    2. Click your disk - most likely (C: )
    3. Click "KAG"

    Step 3: Configure your server

    dedicated_autoconfigs.gm
    global sv_maxplayers = 16; // Maximum number of players allowed ingame.
    global sv_ip = ``; // Leave it blank for ease.
    global sv_port = 50301; // Server communication port, this is where it listens for incoming clients. Remember to open this port in your firewall.
    global cl_port = 50328; // Client communication port.
    global sv_port = 50301; // Server communication port, this is where it listens for incoming clients.
    global sv_password = ``; // Sets the server password.
    global sv_rconpassword = ``; // Sets the server remote console password. This is important if you want to have control over your server.
    global sv_gold_only = 0; // If set to 1 only premium account players can join.
    global sv_allow_globals_mods = 1; // If set to 1 global KAG moderators and admins can kick/ban players on server.
    global sv_maxping = 450; // Max ping allowed on server after which player is kicked. Large ping players will slow down server.
    global sv_maxping_warnings = 200; // Because of ping spikes, warnings are issued if a player has ping over max number.
    global sv_maxhack_warnings = 25; // Maximum amount of warnings where server thinks player is hacking.
    global sv_alloweditor = 1; // If set to 1 players that have RCON can start map editor on server
    global sv_name = `KAG game`; // Sets the server name displayed in server browser.
    global sv_info = ``; // Sets the server info displayed in server browser. If you want it multi-line simply move text to new line with enter.
    dedicated_autostart.gm
    // autostart on dedicated server launch
    //set autostartswitch to:
    // 0 for CTF
    // 1 for TDM
    // 2 for Sandbox
    // 3 for Zombies
    // 4 for RTDM
    // 10 for TEST

    global autostartswitch = 0; - This is where you choose what gamemode you want.

    newWorld( "" );
    switchGameState(0);

    startServer();

    if (autostartswitch == 0) //ctf
    {
    LoadRules("Rules/CTF/gamemode.cfg"); - This is where the gamemode gets its rules
    LoadMapCycle( "Scripts/mapcycle.cfg" ); - This is what maps the gamemode will have.
    LoadMap( "" );
    print(`Loaded CTF default config`);
    }
    else if (autostartswitch == 1) //tdm
    {
    LoadRules("Rules/TDM/gamemode.cfg");
    LoadMapCycle( "Scripts/mapcycle.cfg" );
    LoadMap( "" );
    print(`Loaded TDM default config`);
    }
    else if (autostartswitch == 2) //sandbox
    {
    LoadRules("Rules/Sandbox/gamemode.cfg");
    LoadMapCycle( "Scripts/mapcycle.cfg" );
    LoadMap( "" );
    print(`Loaded TDM default config`);
    }
    else if (autostartswitch == 3) //zombies (GOLD ONLY)
    {
    LoadRules("Rules/Zombie_Survival/gamemode.cfg");
    LoadMapCycle( "Rules/Zombie_Survival/ZombieMapCycle.cfg" );
    LoadMap( "" );

    print(`Loaded zombies default config : server now in GOLD MODE`);
    } else if (autostartswitch == 4) //rtdm
    {
    LoadRules("Rules/RTDM/gamemode.cfg");
    LoadMapCycle( "Rules/RTDM/RTDMMapCycle.cfg" );
    LoadMap( "" );
    print(`Loaded RTDM default config`);
    }else
    if (autostartswitch == 10) //test
    {
    LoadRules("Rules/TEST/gamemode.cfg");
    LoadMapCycle( "Scripts/mapcycle.cfg" );
    LoadMap( "" );
    print(`Loaded TEST default config`);
    }

    print(`Config finished loading from Scripts/Server/dedicated_autostart.gm`);
    If you are lazy, simply visit this page: https://forum.kag2d.com/threads/server-configuration-tool-with-a-gui.3336/

    Step 4: Forward/Open this port)
    (Remember to make exceptions for antivirus softwares)
    UDP
    50301 - Used to listen for connections.

    Try to find your router here: http://portforward.com/english/routers/port_forwarding/routerindex.htm
    If you can't find it there, try visiting your provider's homepage.
    Example of my portforwarding.
    [​IMG]
    Note: I forwarded all three ports, although only 50301 is needed.


    Step 5: Start the server with: "Dedicatedserver.bat"

    You and people sharing your network have to join via "Connect to"
    Others can find it from the server browser.

    Mac/Linux
    This guide is written for 32-bit Debian Linux. To run on 64-bit Debian Linux, the ia32-libs package must be installed.
    First, download the server:
    wget http://kag2d.com/en/download/kag_linux.tar.gz
    Next, decompress the archive.
    tar -zxf kag_linux.tar.gz
    Change to the new directory:
    cd kag_linux
    Configure your server.
    Run your server:
    ./KAGdedi

    Note: The instructions for Linux/Mac are taken straight from the wikipage:
    https://wiki.kag2d.com/wiki/Server#Linux
    Any help would be apprectiated!

    Static IP



    Modding
    Here are some links to some fun gamemodes for you to play around with!

    Frequently asked questions:
    Q: Please check the address again and make sure the server is running.
    A: You probably have failed to open your ports. Remember to make exceptions in your firewall.

    Q: Server not updated.
    A: Delete version.txt or reinstall server.

    Q: An error occured while trying to create an ENet server host [IP]:50301
    A: You either have another instance of the server running, or try setting "global sv_ip" to blank.
    Will add more questions.

    Q: Can't play singleplayer while hosting a server!
    A: Go to "autoconfigs.gm" and change the svport to a value between 1024 and 65535.
    Note: Not in "dedicated_autoconfigs.gm"

    Q: I tried joining my server via the browser, but it failed!
    A: Everyone sharing internet with the person hosting, has to join via "Connect to" and put in IPv4 + 50301
    Ex: 192.168.10.112:50301


    Feel free to ask any questions or point out any mistakes!
    1.1 Added minor additions + picture.
    1.2 More detailed portforwarding guide + added new ports.

    //fixed. Spoilers don't like having BB code around them - Thank you whoever did that ::):


    NOTE: Currently on vacation, so I might not answer your request. I am participating at a summercamp in China.
    # On break
     
    Last edited: Aug 8, 2014
  2. flipperz

    flipperz Shopkeep Stealer

    Messages:
    167
    mind putting up a guide on port forewarding. id like to see how its done, rather than read a text. :(
     
  3. MCrypa

    MCrypa Haxor

    Messages:
    562
    The problem with guides for portforwarding is that every router has a different way to do it.
    Thats why I posted a link ;)

    Although, if you want personal help, you may as well PM me - I'll help you as much as I can.
     
  4. MCrypa

    MCrypa Haxor

    Messages:
    562
    What link?
    All the links were "found" by myself.
     
  5. Awesomec

    Awesomec Shark Slayer

    Messages:
    69
    Never mind; thanks anyway for the guide! It has some good links in it for new server owners!
     
    MCrypa likes this.
  6. NightCaster

    NightCaster Catapult Fodder

    Messages:
    2
    Do you know why I can't host a zombie server?

    I can make it and join it but zombies don't spawn.

    Does there have to be multiple people joined before zombies will spawn?
     
  7. GamePlay

    GamePlay Shipwright

    Messages:
    23
    Hello I was helped by your article to start a server but cant connect to him on ip and through a menu do for all open did exceptions to even on a few times help. by the way I want to start a game on the my coumputer but not on playing game hosting.
     
  8. Mazey

    Mazey Haxor Global Moderator Forum Moderator Staff Alumni Donator Official Server Admin

    Messages:
    1,914
    My server is in the list, but when i want to join "check the address and check if the server is running" or somthing like that

    HELP
     
  9. GamePlay

    GamePlay Shipwright

    Messages:
    23
  10. Mazey

    Mazey Haxor Global Moderator Forum Moderator Staff Alumni Donator Official Server Admin

    Messages:
    1,914
  11. GamePlay

    GamePlay Shipwright

    Messages:
    23
    hmm I almost do not know anything asked around and you can help to open ports
     
  12. MCrypa

    MCrypa Haxor

    Messages:
    562
    Make sure you leave the map line untouched. Currently, zombies only spawn on maps that are generated by the zombie generator.

    LoadRules("Rules/Zombie_Survival/gamemode.cfg");
    LoadMapCycle( "Rules/Zombie_Survival/ZombieMapCycle.cfg" );
    LoadMap( "" );
    </br>--- merged: Jul 20, 2012 8:43 AM ---</br>
    Send me a PM and I'll try to help you.
    However, I am currently on vacation so it might take a while for me to respond, but I'll try.
     
  13. zcrystalz

    zcrystalz Catapult Fodder

    Messages:
    3
    i'm so retarded :bird::eek::bird:
     
  14. -SWiTCH-

    -SWiTCH- Builder Stabber

    Messages:
    9
    I used the kag server, cheat sheet ti config my server, but when I run it it says theyer is a script error, I opened my ports using windows firewall so I dont think that that is the problem.

    I am very confused and could use some help!
     
  15. xXflamehawkXx

    xXflamehawkXx Catapult Fodder

    Messages:
    3
    When I launch the server it doesn't do what the autoconfig says.

    So if I tried to make a TTH it would automatically be a CTF.

    Please help.
     
  16. Galen

    Galen Haxor Staff Alumni Donator

    Messages:
    1,262
    You're in the wrong section. This is for classic (alpha) servers. TTH doesn't exist in classic.
    This is the correct place to go to: https://forum.kag2d.com/forums/server-help.98/