Deathknife / sourcemod-discord

Discord API for Sourcemod
61 stars 35 forks source link

Json error #1

Closed vem882 closed 7 years ago

vem882 commented 7 years ago

L 01/10/2017 - 00:22:36: [SMJSON] Error in line 1, col 106: end of file expected near 'tion' L 01/10/2017 - 00:22:36: [SM] Exception reported: Invalid handle 0 (error 4) L 01/10/2017 - 00:22:36: [SM] Blaming: discord_api.smx() L 01/10/2017 - 00:22:36: [SM] Call stack trace: L 01/10/2017 - 00:22:36: [SM] [0] json_array_size L 01/10/2017 - 00:22:36: [SM] [1] Line 76, discord/GetGuilds.sp::GetGuildsData_Data() L 01/10/2017 - 00:22:36: [SM] [3] SteamWorks_GetHTTPResponseBodyCallback L 01/10/2017 - 00:22:36: [SM] [4] Line 31, discord/GetGuilds.sp::GetGuildsData() L 01/10/2017 - 00:23:33: [SMJSON] Error in line 1, col 104: end of file expected near 'ti' L 01/10/2017 - 00:23:33: [SM] Exception reported: Invalid handle 0 (error 4) L 01/10/2017 - 00:23:33: [SM] Blaming: discord_api.smx() L 01/10/2017 - 00:23:33: [SM] Call stack trace: L 01/10/2017 - 00:23:33: [SM] [0] json_array_size L 01/10/2017 - 00:23:33: [SM] [1] Line 76, discord/GetGuilds.sp::GetGuildsData_Data() L 01/10/2017 - 00:23:33: [SM] [3] SteamWorks_GetHTTPResponseBodyCallback L 01/10/2017 - 00:23:33: [SM] [4] Line 31, discord/GetGuilds.sp::GetGuildsData()

Deathknife commented 7 years ago

What plugin is trying to get guilds? If it's one from the examples, did you change the in .sp and compiled it yourself?

vem882 commented 7 years ago

Discord_test and i changet only token. Calladmin function works fine.

Deathknife commented 7 years ago

If Call Admin works then there shouldn't be any reason discord_test would not. I cannot replicate this issue.

I have attached a modified discord_api plugin. It will log raw string it receives for listing Get Guilds(which is where the error is caused). It will log it into sourcemod logs and should print to console as well. Could you please put the discord_api.smx (or compile yourself from source) on server, then do sm_getguilds and reply here with the message? It should start with something like:

[DISCORD] GETTING CHANNELS: DATA RETRIEVED:

test.zip

vem882 commented 7 years ago

Server Console log: serverlog.txt

Tf2 console: ] sm_getguilds Trying! Sourcemod errorlog: sourcemoderrorlog.txt

Deathknife commented 7 years ago

Use triple ` instead of single so it keeps line breaks.

[{"owner": false, "permissions": 2146958463, "icon": null, "id": "268100550195675136", "name": "D54"}]role", "id":

This seems wrong, can you ensure SteamWorks is up to date?

Also, try sending HTTP request (i.e requestmaker.com ) to: https://discordapp.com/api/users/@me/guilds Method: GET Headers: Content-Type = application/json Authorization = Bot (insert bot token)

and reply with response. Want to see if somehow it's discord or just something on server like steamworks or plugin.

vem882 commented 7 years ago

Hahah.. yes! the problems was been in SteamWorks. I updated SteamWorks and now all works! Thank you so much!

SteamWorks: http://users.alliedmods.net/~kyles/builds/SteamWorks/