SendNetMsg Error

All other Source.Python topics and issues.
Predz
Senior Member
Posts: 158
Joined: Wed Aug 08, 2012 9:05 pm
Location: Bristol, United Kingdom

SendNetMsg Error

Postby Predz » Thu Oct 08, 2015 10:57 pm

Hey, currently trying to make a Hero Wars server. Am trying to keep console clean for debugging and managing database related issues. Come across this whilst trying to perform a lot of things at the same time.

Code: Select all

SendNetMsg <Insert IP Address>: stream[netchan_t::unreliabledata] buffer overflow (maxsize = 4000)!


Running the code below to cause this issue.

Syntax: Select all

class I8(Item):
name = 'Bouncy Bullets'
description = 'When bullets impact a wall they will ricochet, changing direction and velocity.'
cost = 2000
permanent = False
limit = 1
category = 'Offensive'

damages = {
'weapon_hkp2000': 21,
'weapon_p250': 26,
'weapon_glock': 13,
'weapon_fiveseven': 35,
'weapon_elite': 19,
'weapon_deagle': 58,
'weapon_tec9': 35,
'weapon_bizon': 15,
'weapon_mac10': 16,
'weapon_mp7': 22,
'weapon_mp9': 19,
'weapon_p90': 21,
'weapon_ump45': 22,
'weapon_ssg08': 93,
'weapon_awp': 121,
'weapon_g3sg1': 82,
'weapon_scar20': 65,
'weapon_ak47': 34,
'weapon_galilar': 23,
'weapon_aug': 26,
'weapon_famas': 20,
'weapon_m4a1': 48,
'weapon_sg556': 47,
'weapon_m249': 26,
'weapon_negev': 32
}

def weapon_fire(self, player, weapon, **eargs):
weapon = 'weapon_'+weapon
if weapon not in ('weapon_knife', 'weapon_hegrenade',
'weapon_c4', 'weapon_smokegrenade', 'weapon_flashbang',
'weapon_molotov', 'weapon_incendiary'):
origin = player.origin
angle = player.view_angle
velocity = player.view_vector
line = player.get_trace_ray()

## MANIPULATION FOR VECTORS
normal = line.plane.normal
wall = line.end_position
product = normal.dot(velocity)
normal *= product*2
ricochet = velocity-normal
end = wall+ricochet*1000

## TRACE OF NEW LINE
trace = GameTrace()
engine_trace.trace_ray(Ray(wall, end), ContentMasks.ALL,
TraceFilterSimple((player.index,)), trace)

## DETECTION OF PLAYER
if trace.did_hit() and not trace.did_hit_world() and not player.view_player:
target = Entity(trace.get_entity_index())
target.take_damage(self.damages[weapon], attacker_index=player.index)

## EFFECTS
loc = target.origin
loc.z += 40
temp_entities.beam_points(RecipientFilter(),
0, wall, loc,
beam_model.index, beam_model.index, 0, 255, 1, 1,
1, 3, 0, 255, 255, 255, 50, 1)

## DEBUGGING
self.message(player.index, ' TEST 2')
self.message(player.index, ' TEST')


Sorry the coding is quite messy, and only seems to fire when the detection statement is satisfied.

Also, everything works fine. Just get the error for some reason. :D
MrMalina
Member
Posts: 53
Joined: Mon Apr 08, 2013 2:40 pm
Location: Russian Federation

Postby MrMalina » Sat Oct 10, 2015 9:34 am

Aso when this mistake appear in console, messages output through SayText2 command doesn't work.
User avatar
Ayuto
Project Leader
Posts: 2193
Joined: Sat Jul 07, 2012 8:17 am
Location: Germany

Postby Ayuto » Sun Oct 11, 2015 4:35 pm

When do you get this error? Everytime you fire your weapon? Even if you are the only one on the server and you fire just a single bullet?

Did you try to disable unnecessary lines like the effect and/or damage line?
User avatar
Ayuto
Project Leader
Posts: 2193
Joined: Sat Jul 07, 2012 8:17 am
Location: Germany

Postby Ayuto » Sun Feb 07, 2016 6:36 pm

I fixed the issue with this commit. :)
https://github.com/Source-Python-Dev-Team/Source.Python/commit/f7547538610f41ff19e23e3fa96b311cceb039be

You only need to update your core.dll/so.
User avatar
iPlayer
Developer
Posts: 590
Joined: Sat Nov 14, 2015 8:37 am
Location: Moscow
Contact:

Postby iPlayer » Sun Feb 07, 2016 7:51 pm

Wow, that's great news! I thought it was unfixable.
Image /id/its_iPlayer
My plugins: Map Cycle • Killstreaker • DeadChat • Infinite Jumping • TripMines • AdPurge • Bot Damage • PLRBots • Entity AntiSpam

Hail, Companion. [...] Hands to yourself, sneak thief. Image
MrMalina
Member
Posts: 53
Joined: Mon Apr 08, 2013 2:40 pm
Location: Russian Federation

Postby MrMalina » Sun Feb 14, 2016 11:49 am

Good afternoon, I have wrote this code:

Syntax: Select all

# ======================================================================
# >> IMPORTS
# ======================================================================

# Source Python
from commands import CommandReturn
from messages import SayText2

from commands.client import ClientCommand
from commands.say import SayCommand


# ======================================================================
# >> FUNCTIONS
# ======================================================================
@ClientCommand("test")
@SayCommand("test")
def test(command, index, team_only=False):
SayText2(message="test test test test test").send(index)
SayText2(message="test test test test test").send(index)
SayText2(message="test test test test test").send(index)
SayText2(message="test test test test test").send(index)
SayText2(message="test test test test test").send(index)

return CommandReturn.BLOCK


After i starded constantly using test (bind v "test;test;test;test;test;test;test;test;test;test;test") comand, console started to generate this error

Image
User avatar
Ayuto
Project Leader
Posts: 2193
Joined: Sat Jul 07, 2012 8:17 am
Location: Germany

Postby Ayuto » Sun Feb 14, 2016 12:32 pm

I'm unable to reproduce the error. Is anyone else getting this error?
User avatar
iPlayer
Developer
Posts: 590
Joined: Sat Nov 14, 2015 8:37 am
Location: Moscow
Contact:

Postby iPlayer » Sun Feb 14, 2016 12:47 pm

I can't. The worst I could get is
Netchannel: failed reading message svc_UserMessage from 192.168.1.2:27015.

on client. Nothing in server's console. Build 251, CS:S/Windows.
Image /id/its_iPlayer
My plugins: Map Cycle • Killstreaker • DeadChat • Infinite Jumping • TripMines • AdPurge • Bot Damage • PLRBots • Entity AntiSpam

Hail, Companion. [...] Hands to yourself, sneak thief. Image
User avatar
Ayuto
Project Leader
Posts: 2193
Joined: Sat Jul 07, 2012 8:17 am
Location: Germany

Postby Ayuto » Sun Feb 14, 2016 1:02 pm

This error can only happen in CS:GO, because that's the only game that uses protobuf.
User avatar
iPlayer
Developer
Posts: 590
Joined: Sat Nov 14, 2015 8:37 am
Location: Moscow
Contact:

Postby iPlayer » Sun Feb 14, 2016 1:10 pm

-- --
Image /id/its_iPlayer
My plugins: Map Cycle • Killstreaker • DeadChat • Infinite Jumping • TripMines • AdPurge • Bot Damage • PLRBots • Entity AntiSpam

Hail, Companion. [...] Hands to yourself, sneak thief. Image
User avatar
iPlayer
Developer
Posts: 590
Joined: Sat Nov 14, 2015 8:37 am
Location: Moscow
Contact:

Postby iPlayer » Sun Feb 14, 2016 1:14 pm

Nevermind, I forgot to update SP on CS:GO SRCDS. Now it doesn't happen.
Image /id/its_iPlayer
My plugins: Map Cycle • Killstreaker • DeadChat • Infinite Jumping • TripMines • AdPurge • Bot Damage • PLRBots • Entity AntiSpam

Hail, Companion. [...] Hands to yourself, sneak thief. Image
User avatar
satoon101
Project Leader
Posts: 2697
Joined: Sat Jul 07, 2012 1:59 am

Postby satoon101 » Sun Feb 14, 2016 2:28 pm

If I add 7 more test calls when binding v, I can replicate the error with the same SayText2 calls.

Code: Select all

bind v "test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test;test"


If I use the original bind but increase the number of SayText2 calls to 8 instead of 5, I can also replicate the error.
Image
User avatar
Ayuto
Project Leader
Posts: 2193
Joined: Sat Jul 07, 2012 8:17 am
Location: Germany

Postby Ayuto » Sun Feb 14, 2016 3:05 pm

Ah, yes. Now, I'm also able to reproduce the error, but I don't believe this time it's SP's fault. You are just sending too much data. Adding a queue helps to get rid of the error. However, I'm not really sure if that's something SP should take account for.
User avatar
satoon101
Project Leader
Posts: 2697
Joined: Sat Jul 07, 2012 1:59 am

Postby satoon101 » Sun Feb 14, 2016 9:04 pm

I don't think so either. Judging by the number of SendNetMsg errors in the console, any more than 86 messages sent at one time to a player will cause this to happen. That's a lot of messages all at once.
Image

Return to “General Discussion”

Who is online

Users browsing this forum: No registered users and 20 guests