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

JSON won't load, for some reason. #31

Closed
RazSofer opened this issue Jun 15, 2016 · 14 comments
Closed

JSON won't load, for some reason. #31

RazSofer opened this issue Jun 15, 2016 · 14 comments

Comments

@RazSofer
Copy link

RazSofer commented Jun 15, 2016

Hey Sean.
I have this weird problem - the JSON file won't load from an url, but if I load it from the game directory, it will load perfectly.

It didn't do it before until my developer added some features to match my needs (we are working on an automated pug system, like FACEIT / PopFlash, but only local for our country.), but he didn't add / touch anything JSON-related things (I'm not a developer in your / his level, but I think it should break if we didn't touch it.)

What he did basically:

  1. If 10 players are not connected, the match won't start and the player(s) who didn't join will get banned in a mysql table at the website, which contains all the bans and prevents from banned players to start a queue. He checks which players didn't connect from the lobby table in our database.
  2. If a player gets disconnected after a live match, he will get banned after 5 minutes.
    He didn't touch any JSON features.

Here are some examples:
screen shot 2016-06-15 at 11 11 12 am
screen shot 2016-06-15 at 11 16 09 am

Steps to reproduce

  • Plugin version: lastest
  • Sourcemod version: 1.8
@dechristopher
Copy link

If I can see past your first redaction correctly, it looks like you added http:// to the URL. Don't do that. I had the same issue with loading a match from a URL with my PUG system. Hope this helps, and if that's not the issue then God help you.

@RazSofer
Copy link
Author

@dechristopher
Already done, same thing.

@dechristopher
Copy link

In that case, check you root directory for the json file that the plugin downloads. The way get5 works is it takes the JSON from the URL and downloads it locally to the server's root directory. I don't recall what it names it but it shouldn't be that difficult to find. If the JSON file is filled with HTML and other bullshit, then it's an issue with actually grabbing the JSON file from the URL. The only other thing I can think of is making sure your JSON is formatted properly. Mind pasting it here?

@RazSofer
Copy link
Author

@dechristopher
It worked before with the same JSON file, only after we updated the plugin & added some features it started to happen.
Anyway:
http://pastebin.com/raw/4gm0Y20i

@dechristopher
Copy link

In that case I've got no idea. I've done plenty of additions to the plugin as well but none have broken JSON formatting. I hate to say it, but you've probably messed something up in the code somewhere. I'd run a diff on your code and the latest dev build to try to see where you could've gone wrong. I hope to god you've kept track of your changes in version control somewhere. If not then I can't really help you without looking at your codebase myself.

Also, just FYI, in the maplist, you have de_nuke written as de_Nuke. You should make sure CS map names are all lowercase.

@RazSofer
Copy link
Author

@dechristopher
It doesn't matter, it's not working with or without lowercase (and it worked with lowercase characters before)
I also updated the plugin this moment to the latest version and it won't work as well.

@dechristopher
Copy link

If Sean's builds aren't working for you, then it's either something with the DNS on the box your CS server is on or it's just user error altogether. I can't really go any deeper without looking at the system myself. Again, check the root directory for the JSON file the server downloads. It's contents can help diagnose the issue more.

@RazSofer
Copy link
Author

@dechristopher
An earlier build is working, that's what's weird..

@splewis
Copy link
Owner

splewis commented Jun 15, 2016

Can you give exact build numbers / commits that work and don't work? Additionally, can you post the output of sm exts list?

The behavior of the config fetching changes slightly based on whether system2 or steamworks is being used. If both are available, it defaults to using system2.

@RazSofer
Copy link
Author

RazSofer commented Jun 15, 2016

@splewis

sm exts list:

[01] Automatic Updater (1.8.0.5912): Updates SourceMod gamedata files
[02] Webternet (1.8.0.5912): Extension for interacting with URLs
[03] CS Tools (1.8.0.5912): CS extended functionality
[04] BinTools (1.8.0.5912): Low-level C/C++ Calling API
[05] SDK Tools (1.8.0.5912): Source SDK Tools
[06] SteamWorks Extension (1.2.1): Exposes SteamWorks functions to Developers
[07] SMJansson (2.6.0/1): JSON parser/writer
[08] System2 (2.32): System Commands and Information

The commit ID we were using to edit is:
b43869d
The latest commit to work:
2be5326

@splewis
Copy link
Owner

splewis commented Jun 15, 2016

I was able to successfully run get_loadmatch_url dl.splewis.net/test.json from b43869d.

@dechristopher
Copy link

If the build is working on Sean's JSON, it may be a problem with the server you're downloading from.

@RazSofer
Copy link
Author

@splewis
Successfully loaded, I guess it's a problem with the directory.
@dechristopher
The game servers and the website are on the same box, I guess the problem is coming from a lack of access to the JSON files. Hope that what I'm planning to do gonna fix it.

Thanks!

@dechristopher
Copy link

Make sure you can visit the URL in your browser, and additionally chmod the directory recursively as 755.

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

3 participants