NiclasOlofsson / MiNET

A (not so) basic Minecraft Pocket Edition server written in C#
Other
871 stars 199 forks source link

By pressing "Enter" server have to stop. After server stops it start itself again automatically #20

Closed vvzar closed 9 years ago

vvzar commented 9 years ago

I tried do this Several times

and there is a log:

minecraft@mpe:~/minet$ mono MiNET.Service.exe INFO [NetService] - Starting MiNET INFO [iNetServer] - Initializing... WARN [nfigParser] - Error configuring parser System.UriFormatException: Invalid URI: The Authority/Host could not be parsed. at System.Uri.Parse (UriKind kind, System.String uriString) [0x00000] in :0 at System.Uri.ParseUri (UriKind kind) [0x00000] in :0 at System.Uri..ctor (System.String uriString, Boolean dontEscape) [0x00000] in :0 at System.Uri..ctor (System.String uriString) [0x00000] in :0 at MiNET.Utils.ConfigParser..cctor () [0x00000] in :0 INFO [iNetServer] - Loading settings... INFO [iNetServer] - Loading plugins... INFO [iNetServer] - Plugins loaded! INFO [iNetServer] - Server open for business... MiNET runing. Press to stop service.. INFO [rlds.Level] - World pre-cache of chunks complete.

INFO [NetService] - Stopping MiNET INFO [iNetServer] - Saving chunks... INFO [iNetServer] - Saving player data... INFO [iNetServer] - Disabling plugins... INFO [iNetServer] - Shutting down... WARN [iNetServer] - System.ObjectDisposedException: The object was used after being disposed. at System.Net.Sockets.UdpClient.CheckDisposed () [0x00000] in :0 at System.Net.Sockets.UdpClient.EndReceive (IAsyncResult asyncResult, System.Net.IPEndPoint& remoteEP) [0x00000] in :0 at MiNET.MiNetServer.ReceiveCallback (IAsyncResult ar) [0x00000] in :0 WARN [iNetServer] - System.ObjectDisposedException: The object was used after being disposed. at System.Net.Sockets.UdpClient.CheckDisposed () [0x00000] in :0 at System.Net.Sockets.UdpClient.BeginReceive (System.AsyncCallback requestCallback, System.Object state) [0x00000] in :0 at MiNET.MiNetServer.ReceiveCallback (IAsyncResult ar) [0x00000] in :0 Configuration Result: [Success] Name MiNET [Success] DisplayName MiNET Service [Success] Description MiNET MineCraft Pocket Edition server. [Success] ServiceName MiNET Topshelf v3.1.135.0, .NET Framework v4.0.30319.17020 Default Error: 0 : Unable to get parent process (ignored) System.EntryPointNotFoundException: CreateToolhelp32Snapshot at (wrapper managed-to-native) Topshelf.Runtime.Windows.Kernel32:CreateToolhelp32Snapshot (uint,uint) at Topshelf.Runtime.Windows.WindowsHostEnvironment.GetParent (System.Diagnostics.Process child) [0x00000] in :0 INFO [NetService] - Starting MiNET INFO [iNetServer] - Initializing... INFO [iNetServer] - Loading settings... INFO [iNetServer] - Loading plugins... INFO [iNetServer] - Plugins loaded! INFO [iNetServer] - Server open for business... The MiNET service is now running, press Control+C to exit. INFO [rlds.Level] - World pre-cache of chunks complete.

NiclasOlofsson commented 9 years ago

Are you running this on linux, in that case, are you running it as a service of some sort. Did you configure a watchdog for that service?

MiNET in itself (running under mono) doesn't actually act as a service, it's just a regular console app so this should be a local issue.

kennyvv commented 9 years ago

It seems you are running this on Linux / Mac indeed. For some reason MiNET tries to run it self as a service. seems like the detection failed.

If you could tell me what Linux Distrobution you are on i can try it on that specific Distro with their specific repository's.

You can find you Linux distro & version using this command 'cat /etc/*-release' if this command doesn't return anything please try 'lsb_release -a'

Thank you!

kennyvv commented 9 years ago

Hi, i just looked at it. Tried this on CentOS. It also starts in service mode for me. I'll check what happend later on! Got to go and sleep now haha.

kennyvv commented 9 years ago

Please try again now :)

vvzar commented 9 years ago

Thank You :) All works like a charm.

There is another exception after server starts and stops: INFO [iNetServer] - Shutting down... WARN [iNetServer] - System.ObjectDisposedException: The obj ect was used after being disposed. at System.Net.Sockets.UdpClient.CheckDisposed () [0x00000] in :0 at System.Net.Sockets.UdpClient.EndReceive (IAsyncResult a syncResult, System.Net.IPEndPoint& remoteEP) [0x00000] in <f ilename unknown>:0 at MiNET.MiNetServer.ReceiveCallback (IAsyncResult ar) [0x 00000] in :0 WARN [iNetServer] - System.ObjectDisposedException: The obj ect was used after being disposed. at System.Net.Sockets.UdpClient.CheckDisposed () [0x00000] in :0 at System.Net.Sockets.UdpClient.BeginReceive (System.Async Callback requestCallback, System.Object state) [0x00000] in

:0 at MiNET.MiNetServer.ReceiveCallback (IAsyncResult ar) [0x 00000] in :0 minecraft@mpe:~/minet$
kennyvv commented 9 years ago

No problem :)

That exception really isn't a big problem. It is just telling you that the object is disposed and cannot be used. This is just because the server shut down and it is probably still trying to receive / send data. I guess we could fix this tho :)