go fmt whole project.
This commit is contained in:
parent
c7a178e5a4
commit
f85d4d312f
@ -127,7 +127,7 @@ func (session *Session) SignalCandidate(data string) error {
|
|||||||
return session.socket.Send(&message.SignalCandidate{
|
return session.socket.Send(&message.SignalCandidate{
|
||||||
Event: event.SIGNAL_CANDIDATE,
|
Event: event.SIGNAL_CANDIDATE,
|
||||||
Data: data,
|
Data: data,
|
||||||
});
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
func (session *Session) destroy() error {
|
func (session *Session) destroy() error {
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
package config
|
package config
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"encoding/json"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
"encoding/json"
|
|
||||||
|
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
"github.com/spf13/viper"
|
"github.com/spf13/viper"
|
||||||
@ -46,16 +46,15 @@ func (WebRTC) Init(cmd *cobra.Command) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *WebRTC) Set() {
|
func (s *WebRTC) Set() {
|
||||||
s.ICELite = viper.GetBool("icelite")
|
s.ICELite = viper.GetBool("icelite")
|
||||||
s.ICEServers = []webrtc.ICEServer{{URLs: viper.GetStringSlice("iceserver")}}
|
s.ICEServers = []webrtc.ICEServer{{URLs: viper.GetStringSlice("iceserver")}}
|
||||||
if (viper.GetString("iceservers") != "") {
|
if viper.GetString("iceservers") != "" {
|
||||||
err := json.Unmarshal([]byte(viper.GetString("iceservers")), &s.ICEServers)
|
err := json.Unmarshal([]byte(viper.GetString("iceservers")), &s.ICEServers)
|
||||||
if (err != nil) {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -95,7 +95,7 @@ func (manager *WebRTCManager) CreatePeer(id string, session types.Session) (stri
|
|||||||
|
|
||||||
settings.SetEphemeralUDPPortRange(manager.config.EphemeralMin, manager.config.EphemeralMax)
|
settings.SetEphemeralUDPPortRange(manager.config.EphemeralMin, manager.config.EphemeralMax)
|
||||||
settings.SetNAT1To1IPs(manager.config.NAT1To1IPs, webrtc.ICECandidateTypeHost)
|
settings.SetNAT1To1IPs(manager.config.NAT1To1IPs, webrtc.ICECandidateTypeHost)
|
||||||
settings.SetICETimeouts(6 * time.Second, 6 * time.Second, 3 * time.Second)
|
settings.SetICETimeouts(6*time.Second, 6*time.Second, 3*time.Second)
|
||||||
settings.SetSRTPReplayProtectionWindow(512)
|
settings.SetSRTPReplayProtectionWindow(512)
|
||||||
|
|
||||||
// Create MediaEngine based off sdp
|
// Create MediaEngine based off sdp
|
||||||
@ -142,12 +142,12 @@ func (manager *WebRTCManager) CreatePeer(id string, session types.Session) (stri
|
|||||||
Msg("connection state has changed")
|
Msg("connection state has changed")
|
||||||
})
|
})
|
||||||
|
|
||||||
rtpVideo, err := connection.AddTrack(manager.videoTrack);
|
rtpVideo, err := connection.AddTrack(manager.videoTrack)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", manager.config.ICELite, manager.config.ICEServers, err
|
return "", manager.config.ICELite, manager.config.ICEServers, err
|
||||||
}
|
}
|
||||||
|
|
||||||
rtpAudio, err := connection.AddTrack(manager.audioTrack);
|
rtpAudio, err := connection.AddTrack(manager.audioTrack)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", manager.config.ICELite, manager.config.ICEServers, err
|
return "", manager.config.ICELite, manager.config.ICEServers, err
|
||||||
}
|
}
|
||||||
@ -230,7 +230,6 @@ func (manager *WebRTCManager) CreatePeer(id string, session types.Session) (stri
|
|||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
|
||||||
|
|
||||||
return description.SDP, manager.config.ICELite, manager.config.ICEServers, nil
|
return description.SDP, manager.config.ICELite, manager.config.ICEServers, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -90,7 +90,6 @@ func (h *MessageHandler) Message(id string, raw []byte) error {
|
|||||||
return h.controlKeyboard(id, session, payload)
|
return h.controlKeyboard(id, session, payload)
|
||||||
}), "%s failed", header.Event)
|
}), "%s failed", header.Event)
|
||||||
|
|
||||||
|
|
||||||
// Chat Events
|
// Chat Events
|
||||||
case event.CHAT_MESSAGE:
|
case event.CHAT_MESSAGE:
|
||||||
payload := &message.ChatReceive{}
|
payload := &message.ChatReceive{}
|
||||||
|
@ -10,10 +10,10 @@ import "C"
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"regexp"
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
"unsafe"
|
"unsafe"
|
||||||
"regexp"
|
|
||||||
|
|
||||||
"n.eko.moe/neko/internal/types"
|
"n.eko.moe/neko/internal/types"
|
||||||
)
|
)
|
||||||
|
Reference in New Issue
Block a user