ikkentim / SampSharp

A framework for writing game modes for SA-MP in C#. SA-MP is a free Massively Multiplayer Online game mod for the PC version of Rockstar Games Grand Theft Auto: San Andreas.
https://sampsharp.net
Apache License 2.0
210 stars 41 forks source link

The server does not respond #375

Closed MrDave1999 closed 3 years ago

MrDave1999 commented 3 years ago

The server is not responding, any idea why? image It hangs and is never seen online. The host uses Ubuntu 18.04 as the operating system.

ikkentim commented 3 years ago

Have you tried adding some logging? Also please note that server log is showing the logs from server_log.txt. By default SampSharp does not log to the server_log.txt file. You could enable this using RedirectConsoleOutput() on your GameModeBuilder in your Program.cs.

MrDave1999 commented 3 years ago

I already put the RedirectConsoleOutput() but it still doesn't show any logs. The only thing that appears on the panel is that the server is running but not responding. This problem has happened to me in several hosting companies such as Ultra-Host and freesamp.ga (Both offer GNU/Linux hosts).

ikkentim commented 3 years ago

Could you show me your code in your Program.Main method?

MrDave1999 commented 3 years ago

main code:

using SampSharp.Core;
using System.IO;
using System.Reflection;

namespace CaptureTheFlag
{
    public class Program
    {
        public static void Main(string[] args)
        {
            new GameModeBuilder()
                .RedirectConsoleOutput()
                .UseEncoding(Path.Combine(Path.GetDirectoryName(Assembly.GetEntryAssembly().Location), "codepages"+ Path.DirectorySeparatorChar + "cp1252.txt"))
                .Use<GameMode>()
                .Run();
        }
    }
}
ikkentim commented 3 years ago

I've added a little more logging in this plugin build:

https://github.com/ikkentim/SampSharp/suites/1656544896/artifacts/30779327

could you try using this build of the plugin?

It is also a possibility that it gets stuck because the specified path to the codepages file does not exist. you could try commenting out that line (.UseEncoding(...)) and see if it at least runs on the server.

MrDave1999 commented 3 years ago

I tested the plugin you sent and the following came out:

SA-MP Dedicated Server
----------------------
v0.3.7-R2, (C)2005-2015 SA-MP Team

[00:27:53] filterscripts = ""  (string)
[00:27:53] 
[00:27:53] Server Plugins
[00:27:53] --------------
[00:27:53]  Loading plugin: libSampSharp.so
[00:27:53]   Loaded.
[00:27:53]  Loaded 1 plugins.

[00:27:54] 
[00:27:54] Filterscripts
[00:27:54] ---------------
[00:27:54]   Loaded 0 filterscripts.

[00:27:54]   Filterscript 'empty.amx' loaded.
[00:27:54] 
[00:27:54] SampSharp Plugin
[00:27:54] ----------------
[00:27:54] v0.10.0, (C)2014-2020 Tim Potze
[00:27:54] 
[00:27:54] [SampSharp:INFO] Initializing .NET runtime...
[00:27:54] [SampSharp:INFO] Starting game mode host...

It hangs, only that comes out. Therefore, the server is not responding.. PD: I did the test with an empty gamemode (with nothing).

MrCreepTon commented 3 years ago

Did you find a solution?

MrDave1999 commented 3 years ago

@MrCreepTon I did not find a solution. Apparently the problem is the hosting provider. Because I have a friend who works perfectly for him on Ubuntu.

MrDave1999 commented 3 years ago

It's been a long time and I have come to this conclusion: The server is not responding because possibly the provider has not installed some dependencies (like libicu and libssl) to run the gamemode successfully. I say this because I just bought an Ubuntu 18.04 VPS and it worked great.

As far as I see the "simplest" solution is to buy your own Linux VPS and manage it manually, unless you tell your provider to install the libicu and libssl dependencies.