mirror of
https://github.com/mumble-voip/grumble.git
synced 2025-12-19 21:59:59 -08:00
Rename all Udp and Tcp to UDP and TCP to follow Golang coding standards
This commit is contained in:
parent
c7c9cedd38
commit
6fae18a9cd
4 changed files with 74 additions and 74 deletions
|
|
@ -49,12 +49,12 @@ type Client struct {
|
|||
voiceTargets map[uint32]*VoiceTarget
|
||||
|
||||
// Ping stats
|
||||
UdpPingAvg float32
|
||||
UdpPingVar float32
|
||||
UdpPackets uint32
|
||||
TcpPingAvg float32
|
||||
TcpPingVar float32
|
||||
TcpPackets uint32
|
||||
UDPPingAvg float32
|
||||
UDPPingVar float32
|
||||
UDPPackets uint32
|
||||
TCPPingAvg float32
|
||||
TCPPingVar float32
|
||||
TCPPackets uint32
|
||||
|
||||
// If the client is a registered user on the server,
|
||||
// the user field will point to the registration record.
|
||||
|
|
|
|||
|
|
@ -87,24 +87,24 @@ func (server *Server) handlePingMessage(client *Client, msg *Message) {
|
|||
client.crypt.RemoteResync = *ping.Resync
|
||||
}
|
||||
|
||||
if ping.UdpPingAvg != nil {
|
||||
client.UdpPingAvg = *ping.UdpPingAvg
|
||||
if ping.UDPPingAvg != nil {
|
||||
client.UDPPingAvg = *ping.UDPPingAvg
|
||||
}
|
||||
if ping.UdpPingVar != nil {
|
||||
client.UdpPingVar = *ping.UdpPingVar
|
||||
if ping.UDPPingVar != nil {
|
||||
client.UDPPingVar = *ping.UDPPingVar
|
||||
}
|
||||
if ping.UdpPackets != nil {
|
||||
client.UdpPackets = *ping.UdpPackets
|
||||
if ping.UDPPackets != nil {
|
||||
client.UDPPackets = *ping.UDPPackets
|
||||
}
|
||||
|
||||
if ping.TcpPingAvg != nil {
|
||||
client.TcpPingAvg = *ping.TcpPingAvg
|
||||
if ping.TCPPingAvg != nil {
|
||||
client.TCPPingAvg = *ping.TCPPingAvg
|
||||
}
|
||||
if ping.TcpPingVar != nil {
|
||||
client.TcpPingVar = *ping.TcpPingVar
|
||||
if ping.TCPPingVar != nil {
|
||||
client.TCPPingVar = *ping.TCPPingVar
|
||||
}
|
||||
if ping.TcpPackets != nil {
|
||||
client.TcpPackets = *ping.TcpPackets
|
||||
if ping.TCPPackets != nil {
|
||||
client.TCPPackets = *ping.TCPPackets
|
||||
}
|
||||
|
||||
client.sendMessage(&mumbleproto.Ping{
|
||||
|
|
@ -1358,12 +1358,12 @@ func (server *Server) handleUserStatsMessage(client *Client, msg *Message) {
|
|||
stats.FromServer = fromServer
|
||||
}
|
||||
|
||||
stats.UdpPackets = proto.Uint32(target.UdpPackets)
|
||||
stats.TcpPackets = proto.Uint32(target.TcpPackets)
|
||||
stats.UdpPingAvg = proto.Float32(target.UdpPingAvg)
|
||||
stats.UdpPingVar = proto.Float32(target.UdpPingVar)
|
||||
stats.TcpPingAvg = proto.Float32(target.TcpPingAvg)
|
||||
stats.TcpPingVar = proto.Float32(target.TcpPingVar)
|
||||
stats.UDPPackets = proto.Uint32(target.UDPPackets)
|
||||
stats.TCPPackets = proto.Uint32(target.TCPPackets)
|
||||
stats.UDPPingAvg = proto.Float32(target.UDPPingAvg)
|
||||
stats.UDPPingVar = proto.Float32(target.UDPPingVar)
|
||||
stats.TCPPingAvg = proto.Float32(target.TCPPingAvg)
|
||||
stats.TCPPingVar = proto.Float32(target.TCPPingVar)
|
||||
|
||||
if details {
|
||||
version := &mumbleproto.Version{}
|
||||
|
|
|
|||
|
|
@ -1002,12 +1002,12 @@ func (server *Server) udpListenLoop() {
|
|||
}
|
||||
|
||||
} else {
|
||||
server.handleUdpPacket(udpaddr, buf[0:nread])
|
||||
server.handleUDPPacket(udpaddr, buf[0:nread])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func (server *Server) handleUdpPacket(udpaddr *net.UDPAddr, buf []byte) {
|
||||
func (server *Server) handleUDPPacket(udpaddr *net.UDPAddr, buf []byte) {
|
||||
var match *Client
|
||||
plain := make([]byte, len(buf))
|
||||
|
||||
|
|
|
|||
|
|
@ -410,17 +410,17 @@ type Ping struct {
|
|||
// The amount of nonce resyncs.
|
||||
Resync *uint32 `protobuf:"varint,5,opt,name=resync" json:"resync,omitempty"`
|
||||
// The total amount of UDP packets received.
|
||||
UdpPackets *uint32 `protobuf:"varint,6,opt,name=udp_packets,json=udpPackets" json:"udp_packets,omitempty"`
|
||||
UDPPackets *uint32 `protobuf:"varint,6,opt,name=udp_packets,json=udpPackets" json:"udp_packets,omitempty"`
|
||||
// The total amount of TCP packets received.
|
||||
TcpPackets *uint32 `protobuf:"varint,7,opt,name=tcp_packets,json=tcpPackets" json:"tcp_packets,omitempty"`
|
||||
TCPPackets *uint32 `protobuf:"varint,7,opt,name=tcp_packets,json=tcpPackets" json:"tcp_packets,omitempty"`
|
||||
// UDP ping average.
|
||||
UdpPingAvg *float32 `protobuf:"fixed32,8,opt,name=udp_ping_avg,json=udpPingAvg" json:"udp_ping_avg,omitempty"`
|
||||
UDPPingAvg *float32 `protobuf:"fixed32,8,opt,name=udp_ping_avg,json=udpPingAvg" json:"udp_ping_avg,omitempty"`
|
||||
// UDP ping variance.
|
||||
UdpPingVar *float32 `protobuf:"fixed32,9,opt,name=udp_ping_var,json=udpPingVar" json:"udp_ping_var,omitempty"`
|
||||
UDPPingVar *float32 `protobuf:"fixed32,9,opt,name=udp_ping_var,json=udpPingVar" json:"udp_ping_var,omitempty"`
|
||||
// TCP ping average.
|
||||
TcpPingAvg *float32 `protobuf:"fixed32,10,opt,name=tcp_ping_avg,json=tcpPingAvg" json:"tcp_ping_avg,omitempty"`
|
||||
TCPPingAvg *float32 `protobuf:"fixed32,10,opt,name=tcp_ping_avg,json=tcpPingAvg" json:"tcp_ping_avg,omitempty"`
|
||||
// TCP ping variance.
|
||||
TcpPingVar *float32 `protobuf:"fixed32,11,opt,name=tcp_ping_var,json=tcpPingVar" json:"tcp_ping_var,omitempty"`
|
||||
TCPPingVar *float32 `protobuf:"fixed32,11,opt,name=tcp_ping_var,json=tcpPingVar" json:"tcp_ping_var,omitempty"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
}
|
||||
|
||||
|
|
@ -464,44 +464,44 @@ func (m *Ping) GetResync() uint32 {
|
|||
return 0
|
||||
}
|
||||
|
||||
func (m *Ping) GetUdpPackets() uint32 {
|
||||
if m != nil && m.UdpPackets != nil {
|
||||
return *m.UdpPackets
|
||||
func (m *Ping) GetUDPPackets() uint32 {
|
||||
if m != nil && m.UDPPackets != nil {
|
||||
return *m.UDPPackets
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *Ping) GetTcpPackets() uint32 {
|
||||
if m != nil && m.TcpPackets != nil {
|
||||
return *m.TcpPackets
|
||||
func (m *Ping) GetTCPPackets() uint32 {
|
||||
if m != nil && m.TCPPackets != nil {
|
||||
return *m.TCPPackets
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *Ping) GetUdpPingAvg() float32 {
|
||||
if m != nil && m.UdpPingAvg != nil {
|
||||
return *m.UdpPingAvg
|
||||
func (m *Ping) GetUDPPingAvg() float32 {
|
||||
if m != nil && m.UDPPingAvg != nil {
|
||||
return *m.UDPPingAvg
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *Ping) GetUdpPingVar() float32 {
|
||||
if m != nil && m.UdpPingVar != nil {
|
||||
return *m.UdpPingVar
|
||||
func (m *Ping) GetUDPPingVar() float32 {
|
||||
if m != nil && m.UDPPingVar != nil {
|
||||
return *m.UDPPingVar
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *Ping) GetTcpPingAvg() float32 {
|
||||
if m != nil && m.TcpPingAvg != nil {
|
||||
return *m.TcpPingAvg
|
||||
func (m *Ping) GetTCPPingAvg() float32 {
|
||||
if m != nil && m.TCPPingAvg != nil {
|
||||
return *m.TCPPingAvg
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *Ping) GetTcpPingVar() float32 {
|
||||
if m != nil && m.TcpPingVar != nil {
|
||||
return *m.TcpPingVar
|
||||
func (m *Ping) GetTCPPingVar() float32 {
|
||||
if m != nil && m.TCPPingVar != nil {
|
||||
return *m.TCPPingVar
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
|
@ -1795,17 +1795,17 @@ type UserStats struct {
|
|||
// Packet statistics for packets sent by the server.
|
||||
FromServer *UserStats_Stats `protobuf:"bytes,5,opt,name=from_server,json=fromServer" json:"from_server,omitempty"`
|
||||
// Amount of UDP packets sent.
|
||||
UdpPackets *uint32 `protobuf:"varint,6,opt,name=udp_packets,json=udpPackets" json:"udp_packets,omitempty"`
|
||||
UDPPackets *uint32 `protobuf:"varint,6,opt,name=udp_packets,json=udpPackets" json:"udp_packets,omitempty"`
|
||||
// Amount of TCP packets sent.
|
||||
TcpPackets *uint32 `protobuf:"varint,7,opt,name=tcp_packets,json=tcpPackets" json:"tcp_packets,omitempty"`
|
||||
TCPPackets *uint32 `protobuf:"varint,7,opt,name=tcp_packets,json=tcpPackets" json:"tcp_packets,omitempty"`
|
||||
// UDP ping average.
|
||||
UdpPingAvg *float32 `protobuf:"fixed32,8,opt,name=udp_ping_avg,json=udpPingAvg" json:"udp_ping_avg,omitempty"`
|
||||
UDPPingAvg *float32 `protobuf:"fixed32,8,opt,name=udp_ping_avg,json=udpPingAvg" json:"udp_ping_avg,omitempty"`
|
||||
// UDP ping variance.
|
||||
UdpPingVar *float32 `protobuf:"fixed32,9,opt,name=udp_ping_var,json=udpPingVar" json:"udp_ping_var,omitempty"`
|
||||
UDPPingVar *float32 `protobuf:"fixed32,9,opt,name=udp_ping_var,json=udpPingVar" json:"udp_ping_var,omitempty"`
|
||||
// TCP ping average.
|
||||
TcpPingAvg *float32 `protobuf:"fixed32,10,opt,name=tcp_ping_avg,json=tcpPingAvg" json:"tcp_ping_avg,omitempty"`
|
||||
TCPPingAvg *float32 `protobuf:"fixed32,10,opt,name=tcp_ping_avg,json=tcpPingAvg" json:"tcp_ping_avg,omitempty"`
|
||||
// TCP ping variance.
|
||||
TcpPingVar *float32 `protobuf:"fixed32,11,opt,name=tcp_ping_var,json=tcpPingVar" json:"tcp_ping_var,omitempty"`
|
||||
TCPPingVar *float32 `protobuf:"fixed32,11,opt,name=tcp_ping_var,json=tcpPingVar" json:"tcp_ping_var,omitempty"`
|
||||
// Client version.
|
||||
Version *Version `protobuf:"bytes,12,opt,name=version" json:"version,omitempty"`
|
||||
// A list of CELT bitstream version constants supported by the client of this
|
||||
|
|
@ -1869,44 +1869,44 @@ func (m *UserStats) GetFromServer() *UserStats_Stats {
|
|||
return nil
|
||||
}
|
||||
|
||||
func (m *UserStats) GetUdpPackets() uint32 {
|
||||
if m != nil && m.UdpPackets != nil {
|
||||
return *m.UdpPackets
|
||||
func (m *UserStats) GetUDPPackets() uint32 {
|
||||
if m != nil && m.UDPPackets != nil {
|
||||
return *m.UDPPackets
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *UserStats) GetTcpPackets() uint32 {
|
||||
if m != nil && m.TcpPackets != nil {
|
||||
return *m.TcpPackets
|
||||
func (m *UserStats) GetTCPPackets() uint32 {
|
||||
if m != nil && m.TCPPackets != nil {
|
||||
return *m.TCPPackets
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *UserStats) GetUdpPingAvg() float32 {
|
||||
if m != nil && m.UdpPingAvg != nil {
|
||||
return *m.UdpPingAvg
|
||||
func (m *UserStats) GetUDPPingAvg() float32 {
|
||||
if m != nil && m.UDPPingAvg != nil {
|
||||
return *m.UDPPingAvg
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *UserStats) GetUdpPingVar() float32 {
|
||||
if m != nil && m.UdpPingVar != nil {
|
||||
return *m.UdpPingVar
|
||||
func (m *UserStats) GetUDPPingVar() float32 {
|
||||
if m != nil && m.UDPPingVar != nil {
|
||||
return *m.UDPPingVar
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *UserStats) GetTcpPingAvg() float32 {
|
||||
if m != nil && m.TcpPingAvg != nil {
|
||||
return *m.TcpPingAvg
|
||||
func (m *UserStats) GetTCPPingAvg() float32 {
|
||||
if m != nil && m.TCPPingAvg != nil {
|
||||
return *m.TCPPingAvg
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *UserStats) GetTcpPingVar() float32 {
|
||||
if m != nil && m.TcpPingVar != nil {
|
||||
return *m.TcpPingVar
|
||||
func (m *UserStats) GetTCPPingVar() float32 {
|
||||
if m != nil && m.TCPPingVar != nil {
|
||||
return *m.TCPPingVar
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue