Tutorial on how to run a server (Windows)

Discussion in 'Help' started by Steve, Apr 22, 2010.

Moderators: E.T., Zoroark
  1. lucasthe

    lucasthe New Member

    Joined:
    Sep 11, 2011
    Messages:
    1
    Likes Received:
    0
    this doesnt help
     
  2. HoopyCaro42

    HoopyCaro42 French Maid

    Joined:
    Sep 6, 2011
    Messages:
    29
    Likes Received:
    0
    There must be something wrong with your router..., or you don't have enough RAM to host a server so it just screws up, but that would be very surprising...
    Or maybe... hm... did you try to connect using Advanced Connection with 127.0.0.1 ?
    On my server I have to do that cause it doesn't let me connect normally... And can other people connect to your server?
     
  3. GREENBUSTER900

    GREENBUSTER900 DADDYLIKESME

    Joined:
    Sep 17, 2011
    Messages:
    1
    Likes Received:
    0
    help

    my server says when i log onto to it Error while connected to server -- Received error n�0: Connection refused
    does any know what this means??if so please respond quickly:
     
  4. zeroality

    zeroality Artificial Insanity

    Joined:
    Apr 22, 2010
    Messages:
    1,378
    Likes Received:
    1
    Use localhost in advanced connection. If that doesn't work, ask if others can get on your server. If not then you may need to unblock it on your router/firewall.

    For connecting to your own server, you must always use localhost.
     
  5. Im_The_Devil

    Im_The_Devil I liek cookiez x3

    Joined:
    Jul 27, 2011
    Messages:
    93
    Likes Received:
    0
    n�0 error normally means that your router is blocking the ports that your server needs go online.
    Do what Zero suggested, if it doesn't connect.

    You need to port forward.
    http://portforward.com/ <--- provides guides and a auto port forwarding via downloading their software.... The guide was useful but it won't allow me to port forward. Look for your router make (brand) and model on that list.

    Doing it manually: Go to start (Flag) > Search "cmd" > Right click on cmd and run as admin > Type in "ipconfig /all" without the quotes > Find and copy your default gateway code > Enter that in the URL of a browser.

    That should open up your router config. You need a login... refer to this site ----> http://www.routerpasswords.com/

    Once logged in, scroll down http://portforward.com/ and find your router. Which then leads to a guide.
    If you can't, try to google "how to port forward (router brand)"

    For this part i can't help, because every ISP (internet service provider) has a different way to allow you to port forward.
    The best way is to find a guide. Good luck~~~
     
  6. Wanderer M

    Wanderer M Dancer

    Joined:
    Sep 14, 2011
    Messages:
    36
    Likes Received:
    0
    PO Trainer Name:
    Wanderer M
    I'm running a PO server on another server (which is using Linux, so I am using Putty).

    Everything works out fine, I can join, and a friend can join, so it's working.
    However, once a script line is too long, it will automatically break into two pieces, which then won't be recognized.
    So I'm unable to load up my script (which I really want). Is there anyway to stop the line from breaking in two?


    Example:
    It should be:

    sys.sendHtmlAll("<timestamp/><b> The server (...) and has deleted the first 500 entries.</b>", 0);

    However, it becomes:

    sys.sendHtmlAll("<timestamp/><b> The server has detected the IP-Last Alias list to be too large and has
    deleted the first 500 entries.</b>", 0);
     
  7. SupaSayiaJin

    SupaSayiaJin Member

    Joined:
    Jul 15, 2011
    Messages:
    71
    Likes Received:
    0
    Help i am getting this error Error while connected to server -- Received error n°0: Connection refused
    what shoul i do?
     
  8. supertrunks8

    supertrunks8 Pwnage

    Joined:
    Jun 20, 2011
    Messages:
    350
    Likes Received:
    0
    You haven't port forwarded yet. Use http://www.portforward.com to port your server. the default port is 5080 or you can use 4080. doesn't matter.

    If you don't know your IP Address hit "start" then "run" and type "cmd" and a black box should come up. In the box type "ipconfig" or "ipconfig/all" and find where is says "IP Address: " and the LAST number is the number you use to port. Then you can exit teh box and port your IP Address. Open your Server and it should work fine ._.
     
  9. Kalashnikov

    Kalashnikov Despite the code quality

    Joined:
    Apr 4, 2011
    Messages:
    434
    Likes Received:
    0
    How exactly do you edit you scripts? It seems this is the problem of your editor (or Putty), try using nano, it's pretty user-friendly, or editing the file on your pc and uploading it on the server with ftp or whatever else.
     
  10. Wanderer M

    Wanderer M Dancer

    Joined:
    Sep 14, 2011
    Messages:
    36
    Likes Received:
    0
    PO Trainer Name:
    Wanderer M
    I am using nano.
    I edit the file using Notepad++ on my pc, select everything, copy it and then place it in nano.
     
  11. Lamperi

    Lamperi I see what you did there

    Joined:
    Apr 25, 2010
    Messages:
    2,647
    Likes Received:
    11
    Copypasting :X

    Learn SCP/SFTP. Get Winscp or FileZilla if you are using Windows, Linux and Mac have buildin scp-tool. It will allow you to transfer files without copypasting.
     
  12. Wanderer M

    Wanderer M Dancer

    Joined:
    Sep 14, 2011
    Messages:
    36
    Likes Received:
    0
    PO Trainer Name:
    Wanderer M
    Is it possible to run the server on Unix in Daemon mode?
    FYI: I've tried "./start-server --headless --daemon", but it doesn't work.

    And what you said above worked, thanks for that.
     
    Last edited: Sep 25, 2011
  13. Kalashnikov

    Kalashnikov Despite the code quality

    Joined:
    Apr 4, 2011
    Messages:
    434
    Likes Received:
    0
    You can add an ampersand (&) at the end of your command - this will make the server run in the background so it won't shut down after you close your shell.
    The right way to make it a daemon is to write a script for that, see daemon_opensuse as a reference.
     
  14. Wanderer M

    Wanderer M Dancer

    Joined:
    Sep 14, 2011
    Messages:
    36
    Likes Received:
    0
    PO Trainer Name:
    Wanderer M
    The ampersand didn't work.
    My brother is currently writing a script for daemon.
     
  15. Wanderer M

    Wanderer M Dancer

    Joined:
    Sep 14, 2011
    Messages:
    36
    Likes Received:
    0
    PO Trainer Name:
    Wanderer M
    #! /bin/bash
    NAME=Server
    PID=/var/run/pokemon.pid
    DAEMON=/home/wander/pokemon-online/bin/start-server
    ARGS="--headless 2>/var/log/pokemon.log 1>/var/log/pokemon.log"
    USER=wander

    case "$1" in
    start)
    echo 'Starting server ...'
    /sbin/start-stop-daemon -Sbq --name $NAME --pidfile $PID --startas $DAEMON --chuid $USER -- $ARGS
    sleep 1
    echo $?
    ;;
    stop)
    echo 'Stopping server ...'
    /sbin/start-stop-daemon --stop --user $USER --name $NAME
    sleep 1
    echo $?
    ;;
    *)
    echo "Usage: /etc/init.d/pokemon2 {start|stop}"
    esac[/HIDE]

    My brother wrote this.
    Everything works now.

    This script was written for Debian.
     
  16. supertrunks8

    supertrunks8 Pwnage

    Joined:
    Jun 20, 2011
    Messages:
    350
    Likes Received:
    0
    @rougestellar, you port forwarded wrong then. Make sure to port it to "PO Server" and use "5080" for default port or you can use others like "4080", doesn't matter..

    @supermoose it doesn't show because you choose "zbattle.net" not Pokemon Online.
     
  17. Wanderer M

    Wanderer M Dancer

    Joined:
    Sep 14, 2011
    Messages:
    36
    Likes Received:
    0
    PO Trainer Name:
    Wanderer M
    I have another problem and a question;

    The 'step' function in my script doesn't work on my Linux server.
    It does, however, work on my Windows laptop.
    Is this a common problem, or am I the only one with it?

    And, is there a directory where there is some kind of JavaScript logging file?
     
  18. Kalashnikov

    Kalashnikov Despite the code quality

    Joined:
    Apr 4, 2011
    Messages:
    434
    Likes Received:
    0
    Debian/squeeze 2.6.32, step works fine. Are you sure you don't have an error in your scripts?

    And js errors are logged in the server's log file.
     
  19. Wanderer M

    Wanderer M Dancer

    Joined:
    Sep 14, 2011
    Messages:
    36
    Likes Received:
    0
    PO Trainer Name:
    Wanderer M
    My scripts are fine, since the step function does work on my Windows laptop.

    And where can I find this server's log file?
     
  20. zeroality

    zeroality Artificial Insanity

    Joined:
    Apr 22, 2010
    Messages:
    1,378
    Likes Received:
    1
    Server logs should be saved in same directory as the server application.
     
  21. SupaSayiaJin

    SupaSayiaJin Member

    Joined:
    Jul 15, 2011
    Messages:
    71
    Likes Received:
    0
    Error while connected to server -- Received error n°7: Connection timed out
    I can connect to my server while others are getting this error,how can i correct this?
     
  22. Lamperi

    Lamperi I see what you did there

    Joined:
    Apr 25, 2010
    Messages:
    2,647
    Likes Received:
    11
    Forwards the ports if you are behind a NAT / allow it through your computer's personal firewall.

    Use www.portforward.com
     
  23. supertrunks8

    supertrunks8 Pwnage

    Joined:
    Jun 20, 2011
    Messages:
    350
    Likes Received:
    0
    Also guys make sure you port your I.P Address correctly and port it to "PO Server". Also if you ported right but still doesn't work go in to Options then Config and where it says Port make sure those 4 numbers are the same ones you ported. So if you ported 4080 then type 4080 , then restart your server >_<
     
  24. C0dy

    C0dy New Member

    Joined:
    Oct 27, 2011
    Messages:
    1
    Likes Received:
    0
    Ok so I was wondering...the internet I use is shared from my phone is there a way i can run a server through it
     
  25. supertrunks8

    supertrunks8 Pwnage

    Joined:
    Jun 20, 2011
    Messages:
    350
    Likes Received:
    0
    You mean like run your Server.exe with your Phone? Their is not a way currently. Pokemon Online Android Dev. Team might make it possible with ONLY an Android Phone. But their is no current way to run a Server with your Phone. Sorry !
     
  26. zeroality

    zeroality Artificial Insanity

    Joined:
    Apr 22, 2010
    Messages:
    1,378
    Likes Received:
    1
    If you have a computer that is using the phone to connect to the internet, you can run the server on the computer.

    Connection probably isn't suitable for hosting a server though, because even if you get good speeds you will still likely have high latency.
     
  27. Lamperi

    Lamperi I see what you did there

    Joined:
    Apr 25, 2010
    Messages:
    2,647
    Likes Received:
    11
    Depends on your mobile internet.

    They started recently NATing 3G-connections here... which means that hosting a server behind a NAT wall is impossible.
     
  28. Arceus

    Arceus Member

    Joined:
    May 20, 2010
    Messages:
    238
    Likes Received:
    0
    Is it just me, or is the file for the Windows Server now a .7z file? I thought it used to be .rar file.
     
  29. Lamperi

    Lamperi I see what you did there

    Joined:
    Apr 25, 2010
    Messages:
    2,647
    Likes Received:
    11
  30. T-RaT

    T-RaT New Member

    Joined:
    Jan 17, 2012
    Messages:
    1
    Likes Received:
    0
    is there anyway I can get this to work with my university internet, it's classed as a LAN connection in my network and sharing centre, and it's a wired connection. I have no router so all steps of port forwarding are unhelpful. I can make and connect to my own server, but nobody can join.

    Much appreciated
     
  31. Lamperi

    Lamperi I see what you did there

    Joined:
    Apr 25, 2010
    Messages:
    2,647
    Likes Received:
    11
    That is something you need to ask from your university's network administrators. They are able (if the policy allows) to open ports for others to connect to your server.
     
  32. Zororak

    Zororak New Member

    Joined:
    Jan 22, 2012
    Messages:
    1
    Likes Received:
    0
    OMG U are awesome for making this guide.Just one question-How can someone else connect on my server? If i connect using 127.0.0.1 (local) wouldn't that mean that if someone else typed that it would take them to their own server?
     
    Last edited: Jan 22, 2012
  33. NewDay

    NewDay Member

    Joined:
    Dec 16, 2011
    Messages:
    69
    Likes Received:
    0
    Can I register name of my server on registry to prevent it from using by anyone else
     
  34. Lamperi

    Lamperi I see what you did there

    Joined:
    Apr 25, 2010
    Messages:
    2,647
    Likes Received:
    11
    No, you can't.
     
  35. Yttrium

    Yttrium Well-Known Member Developer Developer

    Joined:
    Sep 29, 2010
    Messages:
    619
    Likes Received:
    283
    PO Trainer Name:
    Yttrium
    What would "Error while connected to server -- Received error n°7: Connection timed out" indicate? Sorry if someone already asked this, but I didn't see an answer for it...
     
  36. DarkWhisperer

    DarkWhisperer New Member

    Joined:
    Sep 28, 2012
    Messages:
    5
    Likes Received:
    0
    I did everything to make a server but for everyone that wants to connect it doesnt work
     
  37. Arceus

    Arceus Member

    Joined:
    May 20, 2010
    Messages:
    238
    Likes Received:
    0
    Make sure you have port forwarded correctly. Also, are you able to connect to your server using 127.0.0.1:5080 in advanced connection?
     
  38. DarkWhisperer

    DarkWhisperer New Member

    Joined:
    Sep 28, 2012
    Messages:
    5
    Likes Received:
    0
    yea i can connect using that

    ok it works now how can i keep it up 24/7
     
    Last edited by a moderator: Sep 29, 2012
  39. Ethan

    Ethan Member

    Joined:
    Nov 6, 2011
    Messages:
    238
    Likes Received:
    0
    Just keep the server application up. If you want to you could keep it in the tray so it's not in your way.
     
  40. DarkWhisperer

    DarkWhisperer New Member

    Joined:
    Sep 28, 2012
    Messages:
    5
    Likes Received:
    0
    but i cant have my PC on all night n stuff is there a way to keep it running with pc in sleep mode
     
Moderators: E.T., Zoroark