NiGHT757 / AFKManager

A simple AFK Manager plugin for CS2.
58 stars 10 forks source link

System.InvalidOperationException #9

Closed szogun1910 closed 11 months ago

szogun1910 commented 11 months ago

After uploading, the plugin throws errors

System.InvalidOperationException: Operations that change non-concurrent collections must have exclusive access. A concurrent update was performed on this collection and corrupted its state. The collection's state is no longer correct.
   at System.ThrowHelper.ThrowInvalidOperationException_ConcurrentOperationsNotSupported()
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
 ---> System.InvalidOperationException: Operations that change non-concurrent collections must have exclusive access. A concurrent update was performed on this collection and corrupted its state. The collection's state is no longer correct.
   at System.Collections.Generic.Dictionary`2.FindValue(TKey key)
   at CounterStrikeSharp.API.Modules.Memory.Schema.GetSchemaOffset(String className, String propertyName) in /home/runner/work/CounterStrikeSharp/CounterStrikeSharp/managed/CounterStrikeSharp.API/Modules/Memory/Schema.cs:line 57
   at CounterStrikeSharp.API.Modules.Memory.Schema.GetPointer[T](IntPtr pointer, String className, String memberName) in /home/runner/work/CounterStrikeSharp/CounterStrikeSharp/managed/CounterStrikeSharp.API/Modules/Memory/Schema.cs:line 114
   at CounterStrikeSharp.API.Core.CEntityIdentity.get_Next() in /home/runner/work/CounterStrikeSharp/CounterStrikeSharp/managed/CounterStrikeSharp.API/Core/Objects.g.cs:line 9413
   at CounterStrikeSharp.API.Utilities.FindAllEntitiesByDesignerName[T](String designerName)+MoveNext() in /home/runner/work/CounterStrikeSharp/CounterStrikeSharp/managed/CounterStrikeSharp.API/Utilities.cs:line 64
   at System.Linq.Enumerable.TryGetFirst[TSource](IEnumerable`1 source, Boolean& found)
   at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable`1 source)
   at AFKManager.AFKManager.AfkTimer_Callback() in D:\servers\lua\AFKManager\AFKManager\AFKManager.cs:line 168
   at InvokeStub_Action.Invoke(Object, Object, IntPtr*)
   at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)
   --- End of inner exception stack trace ---
NiGHT757 commented 11 months ago

After uploading, the plugin throws errors

System.InvalidOperationException: Operations that change non-concurrent collections must have exclusive access. A concurrent update was performed on this collection and corrupted its state. The collection's state is no longer correct.
   at System.ThrowHelper.ThrowInvalidOperationException_ConcurrentOperationsNotSupported()
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
 ---> System.InvalidOperationException: Operations that change non-concurrent collections must have exclusive access. A concurrent update was performed on this collection and corrupted its state. The collection's state is no longer correct.
   at System.Collections.Generic.Dictionary`2.FindValue(TKey key)
   at CounterStrikeSharp.API.Modules.Memory.Schema.GetSchemaOffset(String className, String propertyName) in /home/runner/work/CounterStrikeSharp/CounterStrikeSharp/managed/CounterStrikeSharp.API/Modules/Memory/Schema.cs:line 57
   at CounterStrikeSharp.API.Modules.Memory.Schema.GetPointer[T](IntPtr pointer, String className, String memberName) in /home/runner/work/CounterStrikeSharp/CounterStrikeSharp/managed/CounterStrikeSharp.API/Modules/Memory/Schema.cs:line 114
   at CounterStrikeSharp.API.Core.CEntityIdentity.get_Next() in /home/runner/work/CounterStrikeSharp/CounterStrikeSharp/managed/CounterStrikeSharp.API/Core/Objects.g.cs:line 9413
   at CounterStrikeSharp.API.Utilities.FindAllEntitiesByDesignerName[T](String designerName)+MoveNext() in /home/runner/work/CounterStrikeSharp/CounterStrikeSharp/managed/CounterStrikeSharp.API/Utilities.cs:line 64
   at System.Linq.Enumerable.TryGetFirst[TSource](IEnumerable`1 source, Boolean& found)
   at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable`1 source)
   at AFKManager.AFKManager.AfkTimer_Callback() in D:\servers\lua\AFKManager\AFKManager\AFKManager.cs:line 168
   at InvokeStub_Action.Invoke(Object, Object, IntPtr*)
   at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)
   --- End of inner exception stack trace ---

What version of CSS do you have?

szogun1910 commented 11 months ago

v57

NiGHT757 commented 11 months ago

v57

Sorry for late reply, i never had this error in these days. Do you still have this error?

mayersgamer commented 11 months ago

hey bro did you fix why the plugin ignoring the timmer ? sometimes the players wont get kicked to spec and timer not working

NiGHT757 commented 11 months ago

hey bro did you fix why the plugin ignoring the timmer ? sometimes the players wont get kicked to spec and timer not working

I still have a test version on my server. Now the timer is created OnMapStart instead of Load, but I think it’s the same problem. If I give you my test version, can you test it also ?

mayersgamer commented 11 months ago

yes

NiGHT757 commented 11 months ago

Wrong zip

yes

mayersgamer commented 11 months ago

serisouly bro server is crashing every time it loads

mayersgamer commented 11 months ago

the server start good but if a player tries to join the server rip :

Receiving C2S_CONNECT [protocol 13973 0 auth 3] from 105.111.0.74:15213 CNetworkGameServerBase::ConnectClient( name='MaYeRs', remote='105.111.0.74:15213' ) Creating NetChan for user 0 'MaYeRs' @ 105.111.0.74:15213 Associating NetChan MaYeRs 105.111.0.74:15213[1] (105.111.0.74:15213) with Steam Net Connection handle #4008896367 (userdata 0) CServerSideClientBase::Connect( name='MaYeRs', userid=0, fake=0, chan->addr=105.111.0.74:15213 ) Client 0 'MaYeRs' signon state SIGNONSTATE_NONE -> SIGNONSTATE_CONNECTED Sending S2C_CONNECTION to 105.111.0.74:15213 [addons:'3070247085'] Client #0 "MaYeRs" connected @ 105.111.0.74:15213 Receiving C2S_CONNECT [protocol 13973 0 auth 3] from 105.111.0.74:15213 CNetworkGameServerBase::ConnectClient( name='MaYeRs', remote='105.111.0.74:15213' ) Sending S2C_CONNECTION to 105.111.0.74:15213 [addons:'3070247085'] Sending S2C_CONNECTION to 105.111.0.74:15213 [addons:'3070247085'] ClientPutInServer create new player controller [MaYeRs] Client 0 'MaYeRs' setting rate to 327680 CRecipientFilter::AddAllPlayers - no recipients for this message, but 1 player in process of connecting was not included. Client 0 'MaYeRs' signon state SIGNONSTATE_CONNECTED -> SIGNONSTATE_NEW CRecipientFilter::AddAllPlayers - no recipients for this message, but 1 player in process of connecting was not included. CRecipientFilter::AddAllPlayers - no recipients for this message, but 1 player in process of connecting was not included. CRecipientFilter::AddAllPlayers - no recipients for this message, but 1 player in process of connecting was not included. CRecipientFilter::AddAllPlayers - no recipients for this message, but 1 player in process of connecting was not included. CRecipientFilter::AddAllPlayers - no recipients for this message, but 1 player in process of connecting was not included. CRecipientFilter::AddAllPlayers - no recipients for this message, but 1 player in process of connecting was not included. CRecipientFilter::AddAllPlayers - no recipients for this message, but 1 player in process of connecting was not included. CRecipientFilter::AddAllPlayers - no recipients for this message, but 1 player in process of connecting was not included. CRecipientFilter::AddAllPlayers - no recipients for this message, but 1 player in process of connecting was not included. Client 0 'MaYeRs' signon state SIGNONSTATE_NEW -> SIGNONSTATE_PRESPAWN Client 0 'MaYeRs' signon state SIGNONSTATE_PRESPAWN -> SIGNONSTATE_SPAWN SV: "MaYeRs<0><[U:1:137241315]><>" STEAM USERID validated Fatal error. System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt. at AFKManager.AFKManager.AfkTimer_Callback() at DynamicClass.InvokeStub_Action.Invoke(System.Object, System.Object, IntPtr) at System.Reflection.MethodInvoker.Invoke(System.Object, IntPtr, System.Reflection.BindingFlags) at System.Reflection.RuntimeMethodInfo.Invoke(System.Object, System.Reflection.BindingFlags, System.Reflection.Binder, System.Object[], System.Globalization.CultureInfo) at System.Delegate.DynamicInvokeImpl(System.Object[]) at CounterStrikeSharp.API.Core.FunctionReference+<>c__DisplayClass3_0.<.ctor>b__0(CounterStrikeSharp.API.Core.fxScriptContext*) ./game/cs2.sh: line 118: 40 Aborted (core dumped) ${STEAM_RUNTIME_PREFIX} ${GAME_DEBUGGER} "${GAMEROOT}"/${GAMEEXE} "$@" [Panel]: Server marked as offline... [Panel]: ---------- Detected server process in a crashed state! ---------- [Panel]: Exit code: 134 [Panel]: Out of memory: false [Panel]: Aborting automatic restart, last crash occurred less than 60 seconds ago.

NiGHT757 commented 11 months ago

Please add me on discord

7.night

szogun1910 commented 11 months ago

@NiGHT757 You can send me also, I will check if it works properly

mayersgamer commented 11 months ago

the more players are joining the ignoring start , if i was only alone on the server or with another player it kicks me to spec , but the more they join the random it becames

NiGHT757 commented 11 months ago

These problems should be fixed in v0.0.9.