Closed gOOvER closed 4 years ago
a.) fun
b.) use the ini
parser for an ini
file. The file
parser is a last ditch effort to support random file formats.
From what I am seeing though it's just missing a \n
at the end of lines.
Have the same issue using the @parkervcp FiveM egg.
@parkervcp could you explain what we need to do? adding \n results in this:
Thank you
This is a bug in the daemon. It's not something just putting something in the egg.
This is a bug in the daemon. It's not something just putting something in the egg.
Yeah I understand but just tried your suggestion: :)
From what I am seeing though it's just missing a \n at the end of lines.
Thanks for clearing it up
This is a bug in the daemon. It's not something just putting something in the egg.
Yeah I understand but just tried your suggestion: :)
This was not a suggetion for fixing this Bug ;)
I just have build wings myself so I had the lastest updates but this still doesnt fix the issue @DaneEveritt
So it looks like it was taking the /n
off every line before not just ones it replaced.
In my Eye's should the whole Parsing Part should be reviewed. "Ini" also don't work as it should
Please open parser specific bugs as a new issue unless there is direct overlap between an issue across multiple parsers. Comments inside bug reports will not be noticed (or remembered) and will not end up getting fixed.
ini uses =
this does not. @gOOvER fyi
ini uses
=
this does not. @gOOvER fyi
i know :)
I'm not familiar with golang but this fixed it for me. Please beautify it x) @DaneEveritt
func (f *ConfigurationFile) parseTextFile(path string) error {
file, err := os.OpenFile(path, os.O_CREATE|os.O_RDWR, 0644)
if err != nil {
return err
}
defer file.Close()
scanner := bufio.NewScanner(file)
var lines []string
for scanner.Scan() {
t := scanner.Text()
// Iterate over the potential replacements for the line and check if there are
// any matches.
var hasreplaced = false;
for _, replace := range f.Replace {
if !strings.HasPrefix(t, replace.Match) {
continue;
}
hasreplaced = true
lines = append(lines, replace.ReplaceWith.String() + "\n");
}
if !hasreplaced {
lines = append(lines, t + "\n");
}
}
if err := scanner.Err(); err != nil {
return err
}
var x = []byte{}
for i:=0; i<len(lines); i++{
b := []byte(lines[i])
for j:=0; j<len(b); j++{
x = append(x,b[j])
}
}
return ioutil.WriteFile(path, x, 0644)
}
This is still an issue
This
https://raw.githubusercontent.com/parkervcp/eggs/master/gta/fivem/server.cfg
Becomes
https://hastebin.com/ibulavisuw.properties
This is the parser config
{
"server.cfg": {
"parser": "file",
"find": {
"endpoint_add_tcp": "endpoint_add_tcp \"0.0.0.0:{{server.build.default.port}}\"",
"endpoint_add_udp": "endpoint_add_udp \"0.0.0.0:{{server.build.default.port}}\"",
"sv_hostname": "sv_hostname \"{{server.build.env.SERVER_HOSTNAME}}\"",
"set sv_licenseKey": "set sv_licenseKey {{server.build.env.FIVEM_LICENSE}}",
"set steam_webApiKey": "set steam_webApiKey {{server.build.env.STEAM_WEBAPIKEY}}",
"sv_maxclients": "sv_maxclients {{server.build.env.MAX_PLAYERS}}"
}
}
}
This is still an issue
This https://raw.githubusercontent.com/parkervcp/eggs/master/gta/fivem/server.cfg
Becomes https://hastebin.com/ibulavisuw.properties
This is the parser config
{ "server.cfg": { "parser": "file", "find": { "endpoint_add_tcp": "endpoint_add_tcp \"0.0.0.0:{{server.build.default.port}}\"", "endpoint_add_udp": "endpoint_add_udp \"0.0.0.0:{{server.build.default.port}}\"", "sv_hostname": "sv_hostname \"{{server.build.env.SERVER_HOSTNAME}}\"", "set sv_licenseKey": "set sv_licenseKey {{server.build.env.FIVEM_LICENSE}}", "set steam_webApiKey": "set steam_webApiKey {{server.build.env.STEAM_WEBAPIKEY}}", "sv_maxclients": "sv_maxclients {{server.build.env.MAX_PLAYERS}}" } } }
Did you try my fix that I posted in my previous comment?
DO NOT REPORT ISSUES CONFIGURING: SSL, PHP, APACHE, NGINX, YOUR MACHINE, SSH, SFTP, ETC. ON THIS GITHUB TRACKER.
For assistance installating this software, as well as debugging issues with dependencies, please use our discord server: https://discord.gg/pterodactyl
You MUST complete all of the below information when reporting a bug, failure to do so will result in closure of your issue. PLEASE stop spamming our tracker with "bugs" that are not related to this project.
STOP: READ FIRST, AND THEN DELETE THE ABOVE LINES
Background (please complete the following information):
Describe the bug A clear and concise description of what the bug is. Please provide additional information too, depending on what you have issues with: Panel:
php -v
(the php version in use). Daemon:uname -a
anddocker info
(your kernel version and information regarding docker)To Reproduce Steps to reproduce the behavior:
Expected behavior A clear and concise description of what you expected to happen. If applicable, add screenshots or a recording to help explain your problem.
The Parser "file" is broken.
Configuration is after Server install
Configuration should be:
Configuration in the Egg