user message size limit is 255 bytes

I’m making a NextBot - and am getting this error:

“DLL_MessageEnd: Refusing to send user message TextMsg of 256 bytes to client, user message size limit is 255 bytes”

I guess I understand what it means, but am unsure where a umessage is coming into this.

The Gamemode File Server-side



-- This gets called first, which actives Step 2 of the NPC (if Step_Complete = true on the nextbot, RunBehaviour doesn't run it again, so I can have one time actions)
function GAME.Match.ActivateStep_GameZoneIntroduction( session_id )
	print( "Game Zone - Introduction Step Activated" )
	GAME.Match.GetMarshal( session_id ):SetStep(2)
	-- Marshal talks / talks / talks
	GAME.Match.ActivateStep_GameZoneGetReady( session_id )
end


The nextbot shared.lua file




--Nextbot shared.lua - a function in a table for Step 2 runs
	[2] = function( marshal )
		marshal:Speak( "game_manager", 2 )
		marshal.Step_Complete = true
	end,

--Nextbot shared.lua ENT:Speak function
function ENT:Speak( role, id )
	local phrases = self.VoiceLines[self:GetVoicePack()][role][id]
	for _, ply in pairs( player.GetAll() ) do
		if self:GetPos():Distance( ply:GetPos() ) <= 300 then
			ply:ChatPrint( phrases[1].text )
		end
	end
end

--marshal:Speak( "game_manager", 2 ) message is equal to:
			[2] = {
				[1] = {
					file = "",
					text = "Welcome to Castle Defence. Defenders start in the castle, attackers on the other side of the trees. The aim of this game-mode is for the attackers to either eliminate all castle defenders, or to raise the flag on the side of the castle. Defenders win if the flag is still unraised when the timer runs out."
				}
			},


My question is, if ( which I assume is right it’s the [2][1].text = “Welcome to Castle Defence…” which is being sent in a umessage, why is it? When ChatPrint is server-side and I’ve never asked it to be sent.

Thanks.

If I had to guess, ChatPrint is just a convenience function that still sends a usermessage, like SendLua. You could just make a new function and send stuff to player chat using net messages instead.

So what we’re saying is ChatPrint although server-side is actually a function that sends a umessage with the content and places it in the users chat box clientside?

Yes, that’s how server-client networking works.

[editline]8th January 2017[/editline]

I added a note to wiki for this function.

Thanks a lot for confirming - I’ve made my own function to use net messages instead now.