Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

where is run.sh or how do you build this? #5

Open
SSzretter opened this issue May 30, 2021 · 13 comments
Open

where is run.sh or how do you build this? #5

SSzretter opened this issue May 30, 2021 · 13 comments
Assignees

Comments

@SSzretter
Copy link

The readme.md states "run build.sh to build docker image" but there is no build.sh at least for the bot / docker image.

I tried docker-compose and it outputs this:

=> CANCELED [openttddiscord_bot internal] load metadata for mcr.microsoft.com/dotnet/core/runtime:3.1 0.0s
=> CANCELED [openttddiscord_bot internal] load metadata for mcr.microsoft.com/dotnet/core/sdk:3.1 0.0s
failed to solve: rpc error: code = Unknown desc = failed to solve with frontend dockerfile.v0: failed to create LLB definition: failed to parse stage name ":latest": invalid reference format

@shoter
Copy link
Owner

shoter commented May 31, 2021

Hello,

I need to update readme indeed. Instead of using single docker image (as I was doing that in the past) I changed recently this repository to use docker compose.

Could you run ./run.sh on normal linux and ./run.pi.sh if you are using raspbian?
I am going to check if it works 100% on the weekend.

@iTKerry
Copy link

iTKerry commented May 31, 2021

Hello @shoter
Can I provide some help to you? I believe it would be nice to hold your ideas with GitHub Issues, so people could see whats in progress and where is help needed.

@shoter
Copy link
Owner

shoter commented Jun 2, 2021

@iTKerry I am glad to hear that! :)

Currently I want to accomplish some changes by myself but there is an repository that is going to host Admin Port C# client which is going to be used by this repo. It has some tasks which require some attention.
https://github.com/shoter/OpenTTDAdminPort/projects/1

For example usage of ILogger is very scarce and it's hard to analyze errors and behavior of AdminPortClient. If it could have more logs then it would be perfect. I only put some logigng last time when I was debugging weird behavior on docker tests.

My future plan is to bring this repo in par with OpenTTDAdminPort repo. I have few objectives I want to accomplish:

  • Create modular structure of the OpenTTDDisocrd behaviors. With that it should be easy to extend it's functionalities.
  • Increase amount of tests
  • Create automatic tests in github actions pipeline
  • attach codecov tool to this repo.

I am going to create issues from few of those items though.

@Tintinfan
Copy link

Tintinfan commented Jun 16, 2021

Been having a go at trying to get this version to work, since the last version doesn't seem to work anymore on the latest server versions. ;(

All I keep getting is this...

Step 6/14 : RUN dotnet publish -c release -o /app --no-restore
 ---> Running in 5d5019d6380f
Microsoft (R) Build Engine version 16.7.2+b60ddb6f4 for .NET
Copyright (C) Microsoft Corporation. All rights reserved.

/usr/share/dotnet/sdk/3.1.410/Microsoft.Common.CurrentVersion.targets(1177,5): error MSB3971: The reference assemblies for ".NETFramework,Version=v5.0" were not found. You might be using an older .NET SDK to target .NET 5.0 or higher. Update Visual Studio and/or your .NET SDK. [/source/OpenttdDiscord/OpenttdDiscord.csproj]
ERROR: Service 'bot' failed to build: The command '/bin/sh -c dotnet publish -c release -o /app --no-restore' returned a non-zero code: 1

@shoter
Copy link
Owner

shoter commented Jun 16, 2021

I updated documentation on how to run bot.

@Tintinfan Are u using master branch? There is also 1 feature branch which I am using to port OpenTTD discord to NET5 and new standalone admin port client and it looks like you are using this branch. Master does not use NET5.

I also checked on my raspberry pi and bot builds fine.

@Tintinfan
Copy link

@shoter Aha! I was on the feature/portClientNew branch. Just moved to master now and re-checked. It has built and run. Thanks for updated docs. Docker-compose looking to be preforming better too.

@Tintinfan
Copy link

@shoter Do you use JGRs Patchpack? I have an issue where chat messages from the server to discord are delayed by up to 5 minutes, or don't get sent to Discord at all. It works fine from Discord to the server and also works fine for the vanilla version of OpenTTD.

@shoter
Copy link
Owner

shoter commented Jun 17, 2021

We use vanilla OpenTTD with some NewGRF - nothing special.

Usually when I see big delay I just restart the bot. I am working on new version and I planned new features for future so I hope that experience is going to get better and better.

Could you also try to send some rcon commands through this bot? Create channel just for you and bot and:

@BotMention register_admin_channel ServerName prefix

For example you could use ! as a prefix and then you could execute some simple commands to see how long it takes for bot to execute them. For example you could type:

!clients

and it should return list of clients.

@Tintinfan
Copy link

Tintinfan commented Jun 17, 2021

Hey,

Thanks for the reply and all your help. I had setup the admin_channel and passing commands like !pause and !clients also take a long time to respond. Everything works perfect with vanilla OpenTTD however. To be honest, I feel it is an issue with JGR patchpack - given it was working fine with versions prior to v0.41.1 which broke his multiplayer.

How does the bot work with server admin port?

@shoter
Copy link
Owner

shoter commented Jun 17, 2021

It works like this:

  1. Bot establishes TCP connection with the server.
  2. Bot sends AdminJoinMessage
  3. Bot waits for incoming packages to initialize himself for given server. ConnectingState
  4. Bot can now normally communicate with the server based on what functionalities you unlocked. Communication is based on official documentation and some reverse engineering to know what the hell is happening.

(I took some source code from my upcoming new admin port client library, however currently OpenttdDiscord bot works in the same way as AdminPortClient was based on OpenttdDiscord).

It is weird that admin port behaves in such a way for JGRP. Do not know what to say though :. I am going to investigate that - I updated my bot to be up2date with master branch. I did not notice that my own bot is outdated.

@shoter
Copy link
Owner

shoter commented Jun 17, 2021

I updated my own bot and it seems very responsive.

@Tintinfan
Copy link

I updated my own bot and it seems very responsive.

Very responsive with JGRP?

@shoter
Copy link
Owner

shoter commented Jun 19, 2021

I updated my own bot and it seems very responsive.

Very responsive with JGRP?

I only tested with Vanilla.

@shoter shoter self-assigned this Mar 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants