Raised This Month: $ Target: $400
 0% 

Question about execution when script is called quickly and repeatedly


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
joe782322
New Member
Join Date: Apr 2018
Old 04-02-2018 , 18:05   Question about execution when script is called quickly and repeatedly
Reply With Quote #1

I've been working on a sourcemod script for Left 4 Dead which basically gets a players versus stats (or at least attempts to depending on their profile privacy) when they join the server.

My question has to do with how scripts themselves get executed when they are called via events, and if they are run concurrently and independently of each instance..

My script basically does the following; there are no loops or anything so my script gets 'run' whenever somebody connects to the server
  • OnClientAuthorized, it checks if the person who joined is a real person (not a bot)
  • If they are, it uses system2 to check their versus stats and output them to the server

The script seems to work perfectly a lot of the time; it works 100% of the time when somebody joins in the middle of a game. The problem is that if 5 or 6 people connect at the same time (such as when a map loads), it messes up and mixes up stats between people, or gives the same stat for multiple people (for example, says Player 1 and Player 2 both have 200 matches won even though Player 2 might have 400 matches won)

So I'm trying to figure out why the values seem to get mixed up in this case; I would have thought each time the script is called and run in memory that it would only be working with the steamID of the player it was called with, so is it possible sourcemod isn't fully executing the script if it's called again before it's done?
joe782322 is offline
Relaxing
AlliedModders Donor
Join Date: Jun 2016
Location: White Plains
Old 04-02-2018 , 18:31   Re: Question about execution when script is called quickly and repeatedly
Reply With Quote #2

You've been working on a SRC project and you post on AMXMODX. It's a lie.
__________________
Relaxing is offline
joe782322
New Member
Join Date: Apr 2018
Old 04-02-2018 , 18:40   Re: Question about execution when script is called quickly and repeatedly
Reply With Quote #3

Quote:
Originally Posted by Relaxing View Post
You've been working on a SRC project and you post on AMXMODX. It's a lie.
Oops
I will try to see if it can be moved
joe782322 is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 22:35.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode