Page 1 of 1

SendNetMsg Error

Posted: Thu Oct 08, 2015 10:57 pm
by Predz
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

Posted: Sat Oct 10, 2015 9:34 am
by MrMalina
Aso when this mistake appear in console, messages output through SayText2 command doesn't work.

Posted: Sun Oct 11, 2015 4:35 pm
by Ayuto
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?

Posted: Sun Feb 07, 2016 6:36 pm
by Ayuto
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.

Posted: Sun Feb 07, 2016 7:51 pm
by iPlayer
Wow, that's great news! I thought it was unfixable.

Posted: Sun Feb 14, 2016 11:49 am
by MrMalina
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

Posted: Sun Feb 14, 2016 12:32 pm
by Ayuto
I'm unable to reproduce the error. Is anyone else getting this error?

Posted: Sun Feb 14, 2016 12:47 pm
by iPlayer
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.

Posted: Sun Feb 14, 2016 1:02 pm
by Ayuto
This error can only happen in CS:GO, because that's the only game that uses protobuf.

Posted: Sun Feb 14, 2016 1:10 pm
by iPlayer
-- --

Posted: Sun Feb 14, 2016 1:14 pm
by iPlayer
Nevermind, I forgot to update SP on CS:GO SRCDS. Now it doesn't happen.

Posted: Sun Feb 14, 2016 2:28 pm
by satoon101
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.

Posted: Sun Feb 14, 2016 3:05 pm
by Ayuto
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.

Posted: Sun Feb 14, 2016 9:04 pm
by satoon101
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.