[Cs:s] Server crashes at newest build of source.python

Please post any questions about developing your plugin here. Please use the search function before posting!
cssbestrpg
Senior Member
Posts: 287
Joined: Sun May 17, 2020 7:56 am
Location: Finland
Contact:

[Cs:s] Server crashes at newest build of source.python

Postby cssbestrpg » Thu Nov 12, 2020 8:26 pm

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
User avatar
L'In20Cible
Project Leader
Posts: 1533
Joined: Sat Jul 14, 2012 9:29 pm
Location: Québec

Re: [Cs:s] Server crashes at newest build of source.python

Postby L'In20Cible » Fri Nov 13, 2020 4:52 pm

Works fine for me on CS:S.
cssbestrpg
Senior Member
Posts: 287
Joined: Sun May 17, 2020 7:56 am
Location: Finland
Contact:

Re: [Cs:s] Server crashes at newest build of source.python

Postby cssbestrpg » Fri Nov 13, 2020 5:46 pm

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?
User avatar
L'In20Cible
Project Leader
Posts: 1533
Joined: Sat Jul 14, 2012 9:29 pm
Location: Québec

Re: [Cs:s] Server crashes at newest build of source.python

Postby L'In20Cible » Sun Nov 15, 2020 12:52 am

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.).
cssbestrpg
Senior Member
Posts: 287
Joined: Sun May 17, 2020 7:56 am
Location: Finland
Contact:

Re: [Cs:s] Server crashes at newest build of source.python

Postby cssbestrpg » Sun Nov 15, 2020 2:58 pm

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.

Return to “Plugin Development Support”

Who is online

Users browsing this forum: No registered users and 10 guests