partiusfabaa / cs2-MiniAdmin

Adds basic administrator functions
44 stars 5 forks source link

error #5

Closed chycken closed 8 months ago

chycken commented 8 months ago

Failed to load plugin /home/container/game/csgo/addons/counterstrikesharp/plugins/MiniAdmin/MiniAdmin.dll with error System.Text.Json.JsonException: 'm' is invalid after a single JSON value. Expected end of data. Path: $ | LineNumber: 9 | BytePositionInLine: 0.

Whats the method?

partiusfabaa commented 8 months ago

you can provide your database.json file by deleting the database data

chycken commented 8 months ago

Deleted, and the error gone. Is that a problem if I leave the created database.json file as it was? Dont have mysql database

partiusfabaa commented 8 months ago

A database is required to use this plugin

chycken commented 8 months ago

Yes I see because I cant add any admin. Created a mysql database from hosting webadmin, and still got error messages that mini admin plugin cant connect to mysql. This is my file:

{ "Connection": { "Host": "mysql8.srkhost.eu:3306", "Database": "s42680_admin", "User": "myusername", "Password": "my password" } }

Is it correct like this?

partiusfabaa commented 8 months ago

try replacing mysql8.srkhost.eu:3306 by mysql8.srkhost.eu

chycken commented 8 months ago

Its working, connected to the database. Thanks. When I add someone to the admin list, I got this: css_addadmin "Csirke" "STEAM0:1:84806540" "0" System.Data.DataException: Error parsing column 4 (EndTime=11/7/2023 10:59:53PM - DateTime) ---> System.InvalidCastException: Unable to convert MySQL date/time to System.DateTime, set AllowZeroDateTime=True or ConvertZeroDateTime=True in the connection string. See https://mysqlconnector.net/connection-options/ at MySqlConnector.ColumnReaders.TextDateTimeColumnReader.ParseDateTime(ReadOnlySpan`1 data, Boolean convertZeroDateTime, Boolean allowZeroDateTime, DateTimeKind dateTimeKind) in //src/MySqlConnector/ColumnReaders/TextDateTimeColumnReader.cs:line 40 at MySqlConnector.Core.Row.GetValue(Int32 ordinal) in //src/MySqlConnector/Core/Row.cs:line 95 at Deserialize444e693b-baaf-4ab7-ac9e-c6be0c5a312f(DbDataReader) --- End of inner exception stack trace --- at Dapper.SqlMapper.ThrowDataException(Exception ex, Int32 index, IDataReader reader, Object value) in //Dapper/SqlMapper.cs:line 3911 at Deserialize444e693b-baaf-4ab7-ac9e-c6be0c5a312f(DbDataReader) at Dapper.SqlMapper.QueryRowImpl[T](IDbConnection cnn, Row row, CommandDefinition& command, Type effectiveType) in /_/Dapper/SqlMapper.cs:line 1288 at MiniAdmin.MiniAdmin.IsAdminExist(String steamId) at MiniAdmin.MiniAdmin.AddAdmin(Admins admin)

And !slay !admin ect. commands are not working ingame.

partiusfabaa commented 8 months ago

try installing the latest version

You'll just have to delete the old database

chycken commented 8 months ago

When I add an admin with time "0" (permanently) than it doesnt work. Maybe should I change something in my mysql database?

partiusfabaa commented 8 months ago

Sorry, I made a mistake in the code and it just deletes you immediately. I'll fix it.

partiusfabaa commented 8 months ago

Try this version

chycken commented 8 months ago

still got this: css_addadmin "csirke" "STEAM_0:1:84806540" "100" System.Data.DataException: Error parsing column 3 (StartTime=STEAM0:1:84806540 - String) ---> System.InvalidCastException: Unable to convert MySQL date/time to System.DateTime, set AllowZeroDateTime=True or ConvertZeroDateTime=True in the connection string. See https://mysqlconnector.net/connection-options/ at MySqlConnector.ColumnReaders.TextDateTimeColumnReader.ParseDateTime(ReadOnlySpan`1 data, Boolean convertZeroDateTime, Boolean allowZeroDateTime, DateTimeKind dateTimeKind) in //src/MySqlConnector/ColumnReaders/TextDateTimeColumnReader.cs:line 40 at MySqlConnector.Core.Row.GetValue(Int32 ordinal) in //src/MySqlConnector/Core/Row.cs:line 95 at Deserialize1d629c68-a576-4eea-a4e5-1999814aa010(DbDataReader) --- End of inner exception stack trace --- at Dapper.SqlMapper.ThrowDataException(Exception ex, Int32 index, IDataReader reader, Object value) in //Dapper/SqlMapper.cs:line 3911 at Deserialize1d629c68-a576-4eea-a4e5-1999814aa010(DbDataReader) at Dapper.SqlMapper.QueryRowImpl[T](IDbConnection cnn, Row row, CommandDefinition& command, Type effectiveType) in /_/Dapper/SqlMapper.cs:line 1288

partiusfabaa commented 8 months ago

and you deleted the old database?

chycken commented 8 months ago

Yes

partiusfabaa commented 8 months ago

It's just that when I checked I didn't get any errors popping up, and I can't figure out what's wrong :(

partiusfabaa commented 8 months ago

Could you send me a screenshot of the database? Something like this: image

chycken commented 8 months ago

Na, Ive deleted the entire database, created a new one, and voala..its working! Thank you very much! One more question: is it possible to create an admin menu above the chat (just like in sourcemod) ?

partiusfabaa commented 8 months ago

Well, as in csgo menu can not be done, you can do in chat, but whether it is convenient) I do not know