Skip to content

Commit

Permalink
Get rid of unnecessary Network Strings
Browse files Browse the repository at this point in the history
  • Loading branch information
robotboy655 committed May 31, 2015
1 parent c9cba19 commit c1bfbd1
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions garrysmod/lua/includes/modules/properties.lua
Expand Up @@ -5,7 +5,7 @@ local meta = {
MsgStart = function( self )

net.Start( "properties" )
net.WriteUInt( util.NetworkStringToID( self.InternalName ), 32 )
net.WriteString( self.InternalName )

end,

Expand Down Expand Up @@ -33,10 +33,6 @@ function Add( name, tab )

List[ name ] = tab

if ( SERVER ) then
util.AddNetworkString( name )
end

end

local function AddToggleOption( data, menu, ent, ply, tr )
Expand Down Expand Up @@ -129,8 +125,7 @@ if ( SERVER ) then

net.Receive( "properties", function( len, client )

local i = net.ReadUInt( 32 )
local name = util.NetworkIDToString( i )
local name = net.ReadString()

if ( !name ) then return end
if ( !IsValid( client ) ) then return end
Expand Down

2 comments on commit c1bfbd1

@Bo98
Copy link
Contributor

@Bo98 Bo98 commented on c1bfbd1 May 31, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

player_manager uses a similar system.

@robotboy655
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

player_manager doesn't create a bunch of network strings by default or with mods, so it's not that big of a deal.

Please sign in to comment.