PhlexPlexico / G5API

An express API for CS2 Servers using MatchZy and PugSharp to record and manage matches.
MIT License
96 stars 31 forks source link

[BUG] `SyntaxError: Unexpected token U in JSON at position 0` #121

Closed kdev closed 3 years ago

kdev commented 3 years ago

Describe the bug SyntaxError: Unexpected token U in JSON at position 0 but still creating the match. The map is wrong and the server crashed when I tried to join a team but being listed as Spec.

To Reproduce Use the following config:

Expected behavior Create the match without errors

Desktop (please complete the following information):

PhlexPlexico commented 3 years ago

If you try it on the public panel it may work, or a different server. I've seen this various amounts of times and it's 98% that sm-json isn't installed on the server, or there's an extension missing on the game server.

kdev commented 3 years ago

2 questions:

  1. public panel? Do you mean G5V?
  2. sm-json is required? Where do I find it and how can I find out if I already installed it?
PhlexPlexico commented 3 years ago

Well I think it's just required at build time - but make sure you have SteamWorks extension installed. And yeah, the public panel being https://phlex.avidgamers.me :)

kdev commented 3 years ago

I have everything installed as described but I'm still getting the error when creating a match

PhlexPlexico commented 3 years ago

I'm still not able to reproduce. Can you provide me the following?

I noticed if I didn't have SteamWorks and Rest in Pawn installed it would fail. Using a base installation of Sourcemod with the latest build of get5 and latest release of get5_apistats from my repo.

kdev commented 3 years ago

sm exts list gave me this:

"Automatic Updater" (1.10.0.6510) by AlliedModders LLC: Updates SourceMod gamedata files
 "Webternet" (1.10.0.6510) by AlliedModders LLC: Extension for interacting with URLs
 "CS Tools" (1.10.0.6510) by AlliedModders LLC: CS extended functionality
 "BinTools" (1.10.0.6510) by AlliedModders LLC: Low-level C/C++ Calling API
 "SDK Tools" (1.10.0.6510) by AlliedModders LLC: Source SDK Tools
 "Top Menus" (1.10.0.6510) by AlliedModders: Creates sorted nested menus
 "SteamWorks Extension" (1.2.3) by Kyle Sanderson: Exposes SteamWorks functions to Developers
 "REST in Pawn" (1.3.1) by Tsunami: Provides HTTP and JSON natives for plugins
 "Client Preferences" (1.10.0.6510) by AlliedModders: Saves client preference settings
 "SQLite" (1.10.0.6510) by AlliedModders LLC: SQLite Driver

sm plugins list gave me this:

] sm plugins list
 "Basic Votes" (1.10.0.6510) by AlliedModders LLC
 "Admin Menu" (1.10.0.6510) by AlliedModders LLC
 "Anti-Flood" (1.10.0.6510) by AlliedModders LLC
 "Get5" (0.7.3-dev) by splewis
 "Basic Info Triggers" (1.10.0.6510) by AlliedModders LLC
 "Fun Commands" (1.10.0.6510) by AlliedModders LLC
 "Fun Votes" (1.10.0.6510) by AlliedModders LLC
 "Basic Chat" (1.10.0.6510) by AlliedModders LLC
 "Nextmap" (1.10.0.6510) by AlliedModders LLC
 "Basic Ban Commands" (1.10.0.6510) by AlliedModders LLC
To see more, type "sm plugins 11"

] sm plugins 11
 "Get5 API Integration - RIPEXT" (2.0.2) by splewis/phlexplexico
 "Basic Comm Control" (1.10.0.6510) by AlliedModders LLC
 "Client Preferences" (1.10.0.6510) by AlliedModders LLC
 "Sound Commands" (1.10.0.6510) by AlliedModders LLC
 "Admin Help" (1.10.0.6510) by AlliedModders LLC
 "Basic Commands" (1.10.0.6510) by AlliedModders LLC
 "Reserved Slots" (1.10.0.6510) by AlliedModders LLC
 "Admin File Reader" (1.10.0.6510) by AlliedModders LLC
 "Player Commands" (1.10.0.6510) by AlliedModders LLC
kdev commented 3 years ago

aaand it worked! I think not having REST in Pawn and SteamWorks Extension installed was the problem

PhlexPlexico commented 3 years ago

Yeah, sadly SteamWorks is needed by Get5, but I chose REST In Pawn due to the JSON library and being able to send over octet-streams of data so demos can upload. Glad to see it worked!

kdev commented 3 years ago

I also installed the windows version of Metamod on a Linux machine but we are not gonna talk about that 😅