mirror of
https://github.com/genxium/DelayNoMore
synced 2025-10-09 08:36:52 +00:00
Updated pb files.
This commit is contained in:
@@ -52,7 +52,7 @@ type Player struct {
|
||||
AckingInputFrameId int32
|
||||
|
||||
UdpAddr *PeerUdpAddr
|
||||
BattleUdpTunnelAddr *PeerUdpAddr
|
||||
BattleUdpTunnelAddr *PeerUdpAddr // This addr is used by backend only, not visible to frontend
|
||||
}
|
||||
|
||||
func ExistPlayerByName(name string) (bool, error) {
|
||||
|
@@ -160,6 +160,7 @@ type Room struct {
|
||||
LastIndividuallyConfirmedInputList []uint64
|
||||
|
||||
BattleUdpTunnelLock sync.Mutex // Guards "startBattleUdpTunnel"
|
||||
BattleUdpTunnelAddr *pb.PeerUdpAddr
|
||||
BattleUdpTunnel *net.UDPConn
|
||||
}
|
||||
|
||||
@@ -829,6 +830,7 @@ func (pR *Room) OnDismissed() {
|
||||
pR.FrameDataLoggingEnabled = false // [WARNING] DON'T ENABLE ON LONG BATTLE DURATION! It consumes A LOT OF MEMORY!
|
||||
pR.BattleUdpTunnelLock.Lock()
|
||||
pR.BattleUdpTunnel = nil
|
||||
pR.BattleUdpTunnelAddr = nil
|
||||
pR.BattleUdpTunnelLock.Unlock()
|
||||
|
||||
pR.ChooseStage()
|
||||
@@ -1696,6 +1698,15 @@ func (pR *Room) startBattleUdpTunnel() {
|
||||
panic(err)
|
||||
}
|
||||
pR.BattleUdpTunnel = conn
|
||||
switch v := conn.LocalAddr().(type) {
|
||||
case (*net.UDPAddr):
|
||||
pR.BattleUdpTunnelAddr = &pb.PeerUdpAddr{
|
||||
Ip: Conf.Sio.UdpHost,
|
||||
Port: int32(v.Port),
|
||||
AuthKey: 0, // To be determined for each specific player upon joining and sent to it by BattleColliderInfo
|
||||
}
|
||||
}
|
||||
|
||||
pR.BattleUdpTunnelLock.Unlock()
|
||||
|
||||
defer func() {
|
||||
|
Reference in New Issue
Block a user