-
Notifications
You must be signed in to change notification settings - Fork 36
Closed
Description
RecipientFilter.add_all_players() crashes when used on a filter provided by the game
Code to reproduce:
from engines.server import engine_server
from filters.recipients import RecipientFilter
from memory import Convention, DataType, get_object_pointer, make_object
from memory.hooks import PreHook
send_user_message = get_object_pointer(engine_server).make_virtual_function(
45, # Linux offset is 45 as well (at least before)
Convention.THISCALL,
[DataType.POINTER, DataType.POINTER, DataType.INT, DataType.POINTER],
DataType.VOID
)
@PreHook(send_user_message)
def pre_send_user_message(args):
recipients = make_object(RecipientFilter, args[1])
recipients.add_all_players()
Note: add_all_players
has to actually do something, i.e. you there must be somebody playing on the server.
Tested message types: ProcessSpottedEntityUpdate, SayText2.
This code, however, doesn't crash:
from filters.recipients import RecipientFilter
recipients = RecipientFilter()
recipients.add_all_players()
I didn't test other methods like RecipientFilter.update
. Also I didn't test Linux SRCDS.