There is an extension that lets you resolve client side file here it is.
So is there anyway to request file from client using sourcepython plugin ?
Resolve file using sourcepython
-
- Junior Member
- Posts: 20
- Joined: Tue Mar 03, 2020 6:39 am
Re: Resolve file using sourcepython
Currently, you can only send files, but not request them. And you can listen to file "events" using hooks. But since we have exposed the function info, you can easily create the hooks to listen to those events.
https://github.com/Source-Python-Dev-Te ... p#L73-L106
In a few days I can provide an example or even update SP to do that stuff easily.
https://github.com/Source-Python-Dev-Te ... p#L73-L106
In a few days I can provide an example or even update SP to do that stuff easily.
Re: Resolve file using sourcepython
Here is the promised example:
Syntax: Select all
from players.entity import Player
from entities.hooks import EntityPreHook
from entities.hooks import EntityCondition
from memory import get_virtual_function
def netchannel_hook(func):
def init_hook(base_entity):
player = Player(base_entity.index)
return get_virtual_function(player.client.net_channel.msg_handler, func)
return init_hook
@EntityPreHook(
EntityCondition.is_human_player,
netchannel_hook('FileRequested'))
def pre_file_requested(args):
print('FileRequested', tuple(args))
@EntityPreHook(
EntityCondition.is_human_player,
netchannel_hook('FileReceived'))
def pre_file_rceived(args):
print('FileReceived', tuple(args))
@EntityPreHook(
EntityCondition.is_human_player,
netchannel_hook('FileDenied'))
def pre_file_denied(args):
print('FileDenied', tuple(args))
@EntityPreHook(
EntityCondition.is_human_player,
netchannel_hook('FileSent'))
def pre_file_sent(args):
print('FileSent', tuple(args))
Return to “General Discussion”
Who is online
Users browsing this forum: No registered users and 54 guests