i would like a fix very quick, if possible

more accurate, crashes in _send_message method, after GameEngine.MessageEnd()
Syntax: Select all
from messages import SayText2
from events import Event
from players.helpers import index_from_userid
class Player(object):
def __init__(self, index):
self.index = index
def send_message(self, message, index=None):
"""Sends a message to the player
@param str message A message to send
"""
message = SayText2(message, index if index is not None else self.index,
self.index)
message.send()
#### Events
@Event
def player_spawn(GameEvent):
userid = GameEvent.GetInt("userid")
index = index_from_userid(userid)
Player(index).send_message("Hello there")
Syntax: Select all
from Source import Player
from messages import SayText2
from events import Event
@Event
def player_say(GameEvent):
userid = GameEvent.GetInt('userid')
if int(userid or 0) > 0:
index = Player.IndexOfUserid(userid)
obj = SayText2('Testing 123', index, index)
obj.send()
freddukes wrote:Hmm I can't remember whether I'm running debug or release; I think I'm running debug. It could be an issue; usually debug does things like automatically initialise variables to 0 or some other value (sometimes a memory fill pattern like 0xCDCDCDCD) whereas release will usually just fill it with whatever exists at that address at that time. It can lead to random issues which won't replicate unless in release. Release also does things like function inlining, loop unrolling, code reordering etc which can also mess up flow and cause other issues which can be difficult to debug.
I'll run your code under a release build to see if I can replicate the crash.
-freddukes
freddukes wrote:Heh... L'In20Cible and I were working on a fix; seems like release does some weird code removal on the destructor of MRecipientFilter... It seems it won't properly call the dtor unless there's a definition of it in the CPP (will not work if placed in the header :S).
I will do some more testing and check in a fix later on.
-freddukes
Omega_K2 wrote:Seems like it crashes again, though not insantly. Few seconds after a message sent srcds crashes.
Return to “Plugin Development Support”
Users browsing this forum: No registered users and 87 guests