Page 1 of 1
[Cs:s] Server crashes at newest build of source.python
Posted: Thu Nov 12, 2020 8:26 pm
by cssbestrpg
Hi, at newest build server crashes when try use this code.
Syntax: Select all
def damage(vic_index, dmg_amount, atk_index=None, wpn_index=None, dmg_type=32, dmg_hitgroup=3):
try:
Entity(vic_index).take_damage(
damage=float(dmg_amount),
damage_type=int(dmg_type),
attacker_index=atk_index,
weapon_index=wpn_index,
hitgroup=int(dmg_hitgroup)
)
except ValueError:
__error__('Damage: Invalid argument (%s)' % dmg_amount)
When uses the function of that server just crashes. At older build the code worked fine
Re: [Cs:s] Server crashes at newest build of source.python
Posted: Fri Nov 13, 2020 4:52 pm
by L'In20Cible
Works fine for me on CS:S.
Re: [Cs:s] Server crashes at newest build of source.python
Posted: Fri Nov 13, 2020 5:46 pm
by cssbestrpg
L'In20Cible wrote:Works fine for me on CS:S.
In the rpgmod i use the damage code as skill part, it crashes the server immeadily when suppose to do damage.
The server crashes is linux, could that effect?
Re: [Cs:s] Server crashes at newest build of source.python
Posted: Sun Nov 15, 2020 12:52 am
by L'In20Cible
cssbestrpg wrote:L'In20Cible wrote:Works fine for me on CS:S.
In the rpgmod i use the damage code as skill part, it crashes the server immeadily when suppose to do damage.
The server crashes is linux, could that effect?
Just test it yourself and you will see:
Syntax: Select all
from entities.entity import Entity
from events import Event
from players.helpers import index_from_userid
def damage(vic_index, dmg_amount, atk_index=None, wpn_index=None, dmg_type=32, dmg_hitgroup=3):
try:
Entity(vic_index).take_damage(
damage=float(dmg_amount),
damage_type=int(dmg_type),
attacker_index=atk_index,
weapon_index=wpn_index,
hitgroup=int(dmg_hitgroup)
)
except ValueError:
__error__('Damage: Invalid argument (%s)' % dmg_amount)
@Event('player_say')
def player_say(game_event):
damage(index_from_userid(game_event['userid']), 1)
My first guess would be an infinite recursion (like applying damage into a
player_hurt callback while also giving more health, etc.).
Re: [Cs:s] Server crashes at newest build of source.python
Posted: Sun Nov 15, 2020 2:58 pm
by cssbestrpg
I have tested the code in rpgmod in windows server and it works fine when use the damage code, but when i try it use in same rpgmod at linux, it crashes the whole server, when it should do damage. At September build the damage code works fine in linux. When i try to use the newest build it crashes server for me. Only when use linux server.