matpow2 / cuwo

Open server and utilities for Cube World
GNU General Public License v3.0
171 stars 49 forks source link

cuwo does not catch Ctrl + C on Linux #190

Closed anth64 closed 2 months ago

anth64 commented 7 years ago

So I used method 2 in the wiki to install the server, and upon running the server I get this.

anthony@~/Servers/cuwo$ sh run_server.sh
run_server.sh: 6: run_server.sh: source: not found
Traceback (most recent call last):
  File "/usr/lib/python2.7/runpy.py", line 163, in _run_module_as_main
    mod_name, _Error)
  File "/usr/lib/python2.7/runpy.py", line 119, in _get_module_details
    code = loader.get_code(mod_name)
  File "/usr/lib/python2.7/pkgutil.py", line 283, in get_code
    self.code = compile(source, self.filename, 'exec')
  File "/home/anthony/Servers/cuwo/cuwo/server.py", line 685
    def create_datagram_endpoint(self, *arg, port=0, **kw):
                                                ^
SyntaxError: invalid syntax
anthony@~/Servers/cuwo$

Anybody sure as to what the issue is?

EDIT: This is on Linux btw.

matpow2 commented 7 years ago

Try

. run_pyenv.sh
python -m cuwo.server

Does that fix your issue?

anth64 commented 7 years ago

No unfortunately, these are the results

anthony@~/Servers/cuwo$ . run_pyenv.sh
anthony@~/Servers/cuwo$ python -m cuwo.server
Traceback (most recent call last):
  File "/home/anthony/.pyenv/versions/3.6.1/lib/python3.6/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/home/anthony/.pyenv/versions/3.6.1/lib/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/home/anthony/Servers/cuwo/cuwo/server.py", line 736, in <module>
    main()
  File "/home/anthony/Servers/cuwo/cuwo/server.py", line 721, in main
    server = CubeWorldServer(loop, config)
  File "/home/anthony/Servers/cuwo/cuwo/server.py", line 473, in __init__
    base.use_entities)
  File "/home/anthony/Servers/cuwo/cuwo/server.py", line 111, in __init__
    super().__init__(*arg, **kw)
  File "/home/anthony/Servers/cuwo/cuwo/world.py", line 240, in __init__
    raise FileNotFoundError('Missing asset file %r' % path)
FileNotFoundError: Missing asset file '/home/anthony/Servers/cuwo/data/data1.db'
anthony@~/Servers/cuwo$
matpow2 commented 7 years ago

You need to put the data1.db and data4.db files in the data folder. In a future version, this will probably be downloaded automatically.

anth64 commented 7 years ago

Where can I find these files?

anth64 commented 7 years ago

Nevermind, found them. Just one more question. How can I safely exit the server, pressing Ctrl+C seems to screw things up. I type quit and exit when I try to exit the server but that does nothing.

matpow2 commented 7 years ago

Does typing /stop work? cuwo should catch Ctrl + C commands, but maybe this a regression?

anth64 commented 7 years ago

The program recognizes the the /stop command however, it gets stuck while saying Stopping.... Here is an example of output.

anthony@~/Servers/cuwo$ ./run_server.sh 
cuwo server started on Fri Jul 14 12:03:27 2017
Loaded script 'log'
Loaded script 'ddos'
Loaded script 'commands'
Loaded script 'welcome'
Loaded script 'ban'
Loaded script 'console'
Loaded script 'master'
Loaded script 'anticheat'
cuwo running on port 12345
Received response from master server
/stop
Stopping...

Now when I do press ctrl+C to end the program, I have to press the keyboard shortcut several times before it will actually close the server. Here is an example output of me just pressing ctrl+C once.

cuwo server started on Fri Jul 14 12:08:24 2017
Loaded script 'log'
Loaded script 'ddos'
Loaded script 'commands'
Loaded script 'welcome'
Loaded script 'ban'
Loaded script 'console'
Loaded script 'master'
Loaded script 'anticheat'
cuwo running on port 12345
Received response from master server
^CStopping...
Exception in callback CubeWorldServer.stop()
handle: <Handle CubeWorldServer.stop()>
Traceback (most recent call last):
  File "/home/anthony/.pyenv/versions/3.6.1/lib/python3.6/asyncio/events.py", line 127, in _run
    self._callback(*self._args)
  File "/home/anthony/Servers/cuwo/cuwo/server.py", line 677, in stop
    self.scripts.unload()
  File "/home/anthony/Servers/cuwo/cuwo/script.py", line 195, in unload
    for script in self.items.values():
RuntimeError: OrderedDict mutated during iteration

It prints out the same as posted above every time ctrl+C is pressed. EDIT: By that, I mean it spits out the same error message every time ctrl+C is pressed.

Hopefully this helps in debugging, and sorry for the late reply. Also if you would like to know the distro of Linux I am using, it is "Linux Mint 18.2 Sonya".

matpow2 commented 7 years ago

Is this on the latest revision? Some of these bugs should have been fixed.

anth64 commented 7 years ago

How can I check which revision I am using? I downloaded this using the second method (bootstrap.sh) on the wiki. So I would assume the latest?