Fixed minor visual bug related to lead picking in PVPLobbyScreen. Fixed players with different versions able to PvP.

This commit is contained in:
CaptainSegis 2017-08-28 14:53:03 -05:00
parent 8f78d7c359
commit b5f4bd1218
2 changed files with 25 additions and 7 deletions

View File

@ -30,6 +30,9 @@
Dim menuItems As New List(Of String) Dim menuItems As New List(Of String)
Dim texture As Texture2D = Nothing Dim texture As Texture2D = Nothing
Private Shared _oppGameVersion As String = ""
Private _startNow As Boolean = False
Public Sub New(ByVal currentScreen As Screen, ByVal connectPlayerID As Integer, ByVal isHost As Boolean) Public Sub New(ByVal currentScreen As Screen, ByVal connectPlayerID As Integer, ByVal isHost As Boolean)
Me.PreScreen = currentScreen Me.PreScreen = currentScreen
Me.Identification = Identifications.PVPLobbyScreen Me.Identification = Identifications.PVPLobbyScreen
@ -98,9 +101,15 @@
Case ScreenStates.BattleResults Case ScreenStates.BattleResults
Me.DrawBattleResults() Me.DrawBattleResults()
End Select End Select
TextBox.Draw()
End Sub End Sub
Public Overrides Sub Update() Public Overrides Sub Update()
If TextBox.Showing Then
TextBox.Update()
Exit Sub
End If
If ScreenState = ScreenStates.Idle Then If ScreenState = ScreenStates.Idle Then
If ConnectScreen.Connected = True Then If ConnectScreen.Connected = True Then
Dim partnerOnServer As Boolean = False Dim partnerOnServer As Boolean = False
@ -234,6 +243,9 @@
If StartBattleRemote = True Then If StartBattleRemote = True Then
StartBattleRemote = False StartBattleRemote = False
InitializeBattle() InitializeBattle()
ElseIf _startNow Then
_startNow = False
InitializeBattle()
Else Else
If Controls.Up(True, True, True, True, True, True) = True Then If Controls.Up(True, True, True, True, True, True) = True Then
Me.Cursor -= 1 Me.Cursor -= 1
@ -300,9 +312,13 @@
Private Sub LeadPickedStart(ByVal index As Integer) Private Sub LeadPickedStart(ByVal index As Integer)
BattleSystem.BattleScreen.OwnLeadIndex = index BattleSystem.BattleScreen.OwnLeadIndex = index
Core.ServersManager.ServerConnection.SendPackage(New Servers.Package(Servers.Package.PackageTypes.BattleOffer, Core.ServersManager.ServerConnection.SendPackage(New Servers.Package(Servers.Package.PackageTypes.BattleOffer,
Core.ServersManager.ID, Servers.Package.ProtocolTypes.TCP, {PartnerNetworkID.ToString(), CStr(index)}.ToList())) Core.ServersManager.ID, Servers.Package.ProtocolTypes.TCP, {PartnerNetworkID.ToString(), CStr(index) & "," & GameController.RELEASEVERSION}.ToList()))
If ReceivedBattleOffer = True Then If ReceivedBattleOffer = True Then
InitializeBattle() If GameController.RELEASEVERSION = _oppGameVersion Then
_startNow = True
Else
TextBox.Show("Game versions don't match.")
End If
Else Else
SentBattleOffer = True SentBattleOffer = True
End If End If
@ -503,8 +519,10 @@
End If End If
End Sub End Sub
Public Shared Sub ReceiveBattleStart(ByVal index As Integer) Public Shared Sub ReceiveBattleStart(ByVal data As String)
BattleSystem.BattleScreen.OppLeadIndex = index Dim cData As String() = data.Split(",")
BattleSystem.BattleScreen.OppLeadIndex = CInt(cData(0))
_oppGameVersion = cData(1)
If IsLobbyScreen() = True Then If IsLobbyScreen() = True Then
If SentBattleOffer = True Then If SentBattleOffer = True Then
StartBattleRemote = True StartBattleRemote = True

View File

@ -204,8 +204,8 @@
Private Shared Sub HandleBattleOffer(ByVal p As Package) Private Shared Sub HandleBattleOffer(ByVal p As Package)
'Remove the whole "if" when server API is updated. 'Remove the whole "if" when server API is updated.
If p.DataItems(0).Length = 1 Then If (p.DataItems(0).Split(","))(0).Length = 1 Then
PVPLobbyScreen.ReceiveBattleStart(CInt(p.DataItems(0))) PVPLobbyScreen.ReceiveBattleStart(p.DataItems(0))
Else Else
PVPLobbyScreen.ReceiveOppTeam(p.DataItems(0)) PVPLobbyScreen.ReceiveOppTeam(p.DataItems(0))
End If End If
@ -237,7 +237,7 @@
End Sub End Sub
Private Shared Sub HandleBattleStart(ByVal p As Package) Private Shared Sub HandleBattleStart(ByVal p As Package)
PVPLobbyScreen.ReceiveBattleStart(CInt(p.DataItems(0))) PVPLobbyScreen.ReceiveBattleStart(p.DataItems(0))
End Sub End Sub
Private Shared Sub HandleBattleHostData(ByVal p As Package) Private Shared Sub HandleBattleHostData(ByVal p As Package)