Prefix all network messages consistently.

pull/2/head
Icedream 2017-04-17 20:11:35 +02:00
parent e3d2cde7b0
commit 02bd0a8ee6
Signed by: icedream
GPG Key ID: 1573F6D8EFE4D0CF
2 changed files with 7 additions and 7 deletions

View File

@ -2,7 +2,7 @@
local sortedTaunts = {} local sortedTaunts = {}
local lastMenu = nil local lastMenu = nil
net.Receive("TauntList_Update", function() net.Receive("PH_TauntList_Update", function()
local tauntsTable = net.ReadTable() local tauntsTable = net.ReadTable()
@ -44,7 +44,7 @@ local windowColor = Color(128, 128, 128, 192)
local textColor = Color(255, 255, 255) local textColor = Color(255, 255, 255)
local function PlayTaunt(sound) local function PlayTaunt(sound)
net.Start("TauntMenu_Play") net.Start("PH_TauntMenu_Play")
net.WriteString(sound) net.WriteString(sound)
net.SendToServer() net.SendToServer()
end end

View File

@ -112,8 +112,8 @@ local fixedNames = {
} }
hook.Add("Initialize", "PH_TauntMenu_StringPooling", function() hook.Add("Initialize", "PH_TauntMenu_StringPooling", function()
util.AddNetworkString("TauntList_Update") util.AddNetworkString("PH_TauntMenu_Update")
util.AddNetworkString("TauntMenu_Play") util.AddNetworkString("PH_TauntMenu_Play")
end) end)
local function FixName(name) local function FixName(name)
@ -137,13 +137,13 @@ local function PlayTaunt(pl, sound)
end end
local function BroadcastUpdate() local function BroadcastUpdate()
net.Start("TauntList_Update") net.Start("PH_TauntList_Update")
net.WriteTable(tauntsFixedTable) net.WriteTable(tauntsFixedTable)
net.Broadcast() net.Broadcast()
end end
local function SendUpdate(pl) local function SendUpdate(pl)
net.Start("TauntList_Update") net.Start("PH_TauntList_Update")
net.WriteTable(tauntsFixedTable) net.WriteTable(tauntsFixedTable)
net.Send(pl) net.Send(pl)
end end
@ -232,7 +232,7 @@ hook.Add("PlayerInitialSpawn", "PH_TauntMenu_UpdateFirst", function(pl)
end) end)
-- Sent by the client to play a custom taunt -- Sent by the client to play a custom taunt
net.Receive("TauntMenu_Play", function(len, pl) net.Receive("PH_TauntMenu_Play", function(len, pl)
local path = net.ReadString() local path = net.ReadString()
PlayTaunt(pl, path) PlayTaunt(pl, path)