mirror of
https://github.com/Earu/EasyChat.git
synced 2025-03-04 03:13:20 -05:00
This reverts commit 4118edb928
.
This commit is contained in:
parent
4118edb928
commit
2605fdcdda
@ -124,11 +124,10 @@ if SERVER then
|
|||||||
net.Start(NET_BROADCAST_MSG)
|
net.Start(NET_BROADCAST_MSG)
|
||||||
net.WriteUInt(ply:UserID(), 16)
|
net.WriteUInt(ply:UserID(), 16)
|
||||||
net.WriteString(ply:RichNick())
|
net.WriteString(ply:RichNick())
|
||||||
|
net.WriteString(msg)
|
||||||
net.WriteBool(is_dead)
|
net.WriteBool(is_dead)
|
||||||
net.WriteBool(is_team)
|
net.WriteBool(is_team)
|
||||||
net.WriteBool(is_local)
|
net.WriteBool(is_local)
|
||||||
net.WriteData(util.Compress(msg))
|
|
||||||
net.Send(filter)
|
net.Send(filter)
|
||||||
|
|
||||||
if game.IsDedicated() and not is_local then
|
if game.IsDedicated() and not is_local then
|
||||||
@ -230,9 +229,9 @@ if SERVER then
|
|||||||
end
|
end
|
||||||
|
|
||||||
net.Receive(NET_SEND_MSG, function(_, ply)
|
net.Receive(NET_SEND_MSG, function(_, ply)
|
||||||
|
local msg = net.ReadString()
|
||||||
local is_team = net.ReadBool()
|
local is_team = net.ReadBool()
|
||||||
local is_local = net.ReadBool()
|
local is_local = net.ReadBool()
|
||||||
local msg = util.Decompress(net.ReadData(net.BytesLeft()))
|
|
||||||
|
|
||||||
EasyChat.ReceiveGlobalMessage(ply, msg, is_team, is_local)
|
EasyChat.ReceiveGlobalMessage(ply, msg, is_team, is_local)
|
||||||
end)
|
end)
|
||||||
@ -439,10 +438,10 @@ if CLIENT then
|
|||||||
net.Receive(NET_BROADCAST_MSG, function()
|
net.Receive(NET_BROADCAST_MSG, function()
|
||||||
local user_id = net.ReadUInt(16)
|
local user_id = net.ReadUInt(16)
|
||||||
local user_name = net.ReadString()
|
local user_name = net.ReadString()
|
||||||
|
local msg = net.ReadString()
|
||||||
local is_dead = net.ReadBool()
|
local is_dead = net.ReadBool()
|
||||||
local is_team = net.ReadBool()
|
local is_team = net.ReadBool()
|
||||||
local is_local = net.ReadBool()
|
local is_local = net.ReadBool()
|
||||||
local msg = util.Decompress(net.ReadData(net.BytesLeft()))
|
|
||||||
|
|
||||||
local function receive(retries)
|
local function receive(retries)
|
||||||
retries = retries or 0
|
retries = retries or 0
|
||||||
@ -527,16 +526,16 @@ if CLIENT then
|
|||||||
if not no_translate and EC_TRANSLATE_OUT_MSG:GetBool() and source_lang ~= target_lang then
|
if not no_translate and EC_TRANSLATE_OUT_MSG:GetBool() and source_lang ~= target_lang then
|
||||||
EasyChat.Translator:Translate(msg, source_lang, target_lang, function(success, _, translation)
|
EasyChat.Translator:Translate(msg, source_lang, target_lang, function(success, _, translation)
|
||||||
net.Start(NET_SEND_MSG)
|
net.Start(NET_SEND_MSG)
|
||||||
|
net.WriteString(success and translation or msg)
|
||||||
net.WriteBool(is_team)
|
net.WriteBool(is_team)
|
||||||
net.WriteBool(is_local)
|
net.WriteBool(is_local)
|
||||||
net.WriteData(util.Compress(success and translation or msg))
|
|
||||||
net.SendToServer()
|
net.SendToServer()
|
||||||
end)
|
end)
|
||||||
else
|
else
|
||||||
net.Start(NET_SEND_MSG)
|
net.Start(NET_SEND_MSG)
|
||||||
|
net.WriteString(msg)
|
||||||
net.WriteBool(is_team)
|
net.WriteBool(is_team)
|
||||||
net.WriteBool(is_local)
|
net.WriteBool(is_local)
|
||||||
net.WriteData(util.Compress(msg))
|
|
||||||
net.SendToServer()
|
net.SendToServer()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user