Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Removing redundant ByVals (part 4)

  • Loading branch information...
commit 38ae200a32dfd4089fc5391d8eca199dd6722522 1 parent 1bbeaca
@Strilanc authored
Showing with 598 additions and 598 deletions.
  1. +9 −9 Plugins/Plugin Interfaces.vb
  2. +6 −6 Plugins/Plugin Manager.vb
  3. +4 −4 Plugins/Plugin Socket.vb
  4. +8 −8 Warcraft3/Download/Download Client.vb
  5. +20 −20 Warcraft3/Download/Download Manager.vb
  6. +6 −6 Warcraft3/Download/Download Transfer.vb
  7. +8 −8 Warcraft3/Download/IPlayerDownloadAspect.vb
  8. +23 −23 Warcraft3/Game/Game Commands.vb
  9. +6 −6 Warcraft3/Game/Game Kernel.vb
  10. +7 −7 Warcraft3/Game/Game Load Screen.vb
  11. +63 −63 Warcraft3/Game/Game Lobby.vb
  12. +23 −23 Warcraft3/Game/Game Motor.vb
  13. +4 −4 Warcraft3/Game/GameLoggerControl.vb
  14. +84 −84 Warcraft3/Game/W3Game.vb
  15. +4 −4 Warcraft3/Game/W3GameControl.vb
  16. +8 −8 Warcraft3/Game/WC3GameManager.vb
  17. +5 −5 Warcraft3/Pinger.vb
  18. +8 −8 Warcraft3/Player/PlayerId.vb
  19. +52 −52 Warcraft3/Player/W3Player.vb
  20. +15 −15 Warcraft3/Protocol/Game Action Protocol.vb
  21. +9 −9 Warcraft3/Protocol/GameAction.vb
  22. +3 −3 Warcraft3/Protocol/GameObjectIdJar.vb
  23. +8 −8 Warcraft3/Protocol/GameStatsJar.vb
  24. +4 −4 Warcraft3/Protocol/ObjectTypeJar.vb
  25. +4 −4 Warcraft3/Protocol/OrderIdJar.vb
  26. +8 −8 Warcraft3/Protocol/PlayerActionSet.vb
  27. +2 −2 Warcraft3/Protocol/SlotJar.vb
  28. +4 −4 Warcraft3/Protocol/WC3 Packet.vb
  29. +72 −72 Warcraft3/Protocol/WC3 Protocol Packers.vb
  30. +14 −14 Warcraft3/Protocol/WC3 Protocol Values.vb
  31. +9 −9 Warcraft3/Protocol/WC3 Protocol.vb
  32. +29 −29 Warcraft3/Replay/Replay Entry Packers.vb
  33. +8 −8 Warcraft3/Replay/Replay Format.vb
  34. +16 −16 Warcraft3/Replay/ReplayDataReader.vb
  35. +9 −9 Warcraft3/Replay/ReplayEntry.vb
  36. +17 −17 Warcraft3/Replay/ReplayManager.vb
  37. +11 −11 Warcraft3/Replay/ReplayReader.vb
  38. +8 −8 Warcraft3/Replay/ReplayWriter.vb
View
18 Plugins/Plugin Interfaces.vb
@@ -2,7 +2,7 @@ Namespace Plugins
<Serializable()>
Public NotInheritable Class PluginException
Inherits Exception
- Public Sub New(ByVal message As String, Optional ByVal innerException As Exception = Nothing)
+ Public Sub New(message As String, Optional innerException As Exception = Nothing)
MyBase.New(message, innerException)
End Sub
End Class
@@ -14,9 +14,9 @@ Namespace Plugins
ReadOnly Property Logger As Logger
ReadOnly Property HasControl As Boolean
ReadOnly Property Control() As Control
- Function InvokeCommand(ByVal user As BotUser, ByVal argument As String) As Task(Of String)
- Function IsArgumentPrivate(ByVal argument As String) As Boolean
- Function IncludeCommand(ByVal command As Commands.ICommand(Of IPlugin)) As Task(Of IDisposable)
+ Function InvokeCommand(user As BotUser, argument As String) As Task(Of String)
+ Function IsArgumentPrivate(argument As String) As Boolean
+ Function IncludeCommand(command As Commands.ICommand(Of IPlugin)) As Task(Of IDisposable)
<ContractClassFor(GetType(IPlugin))>
MustInherit Shadows Class ContractClass
@@ -47,12 +47,12 @@ Namespace Plugins
Throw New NotSupportedException
End Get
End Property
- Public Function InvokeCommand(ByVal user As BotUser, ByVal argument As String) As Task(Of String) Implements IPlugin.InvokeCommand
+ Public Function InvokeCommand(user As BotUser, argument As String) As Task(Of String) Implements IPlugin.InvokeCommand
Contract.Requires(argument IsNot Nothing)
Contract.Ensures(Contract.Result(Of Task(Of String))() IsNot Nothing)
Throw New NotSupportedException
End Function
- Public Function IsArgumentPrivate(ByVal argument As String) As Boolean Implements IPlugin.IsArgumentPrivate
+ Public Function IsArgumentPrivate(argument As String) As Boolean Implements IPlugin.IsArgumentPrivate
Contract.Requires(argument IsNot Nothing)
Throw New NotSupportedException
End Function
@@ -61,7 +61,7 @@ Namespace Plugins
Throw New NotSupportedException
End Get
End Property
- Public Function IncludeCommand(ByVal command As Commands.ICommand(Of IPlugin)) As Task(Of IDisposable) Implements IPlugin.IncludeCommand
+ Public Function IncludeCommand(command As Commands.ICommand(Of IPlugin)) As Task(Of IDisposable) Implements IPlugin.IncludeCommand
Contract.Requires(command IsNot Nothing)
Contract.Ensures(Contract.Result(Of Task(Of IDisposable))() IsNot Nothing)
Throw New NotSupportedException
@@ -71,13 +71,13 @@ Namespace Plugins
<ContractClass(GetType(IPluginFactory.ContractClass))>
Public Interface IPluginFactory
- Function CreatePlugin(ByVal bot As Bot.MainBot) As IPlugin
+ Function CreatePlugin(bot As Bot.MainBot) As IPlugin
<ContractClassFor(GetType(IPluginFactory))>
MustInherit Class ContractClass
Implements IPluginFactory
- Public Function CreatePlugin(ByVal bot As Bot.MainBot) As IPlugin Implements IPluginFactory.CreatePlugin
+ Public Function CreatePlugin(bot As Bot.MainBot) As IPlugin Implements IPluginFactory.CreatePlugin
Contract.Requires(bot IsNot Nothing)
Contract.Ensures(Contract.Result(Of IPlugin)() IsNot Nothing)
Throw New NotSupportedException()
View
12 Plugins/Plugin Manager.vb
@@ -16,7 +16,7 @@ Namespace Plugins
Contract.Invariant(_hooks IsNot Nothing)
End Sub
- Public Sub New(ByVal socket As Plugins.Socket)
+ Public Sub New(socket As Plugins.Socket)
Contract.Requires(socket IsNot Nothing)
Me._socket = socket
End Sub
@@ -42,14 +42,14 @@ Namespace Plugins
Return _socket.Plugin.HasControl
End Get
End Property
- Public Function IsArgumentPrivate(ByVal argument As String) As Boolean Implements IBotComponent.IsArgumentPrivate
+ Public Function IsArgumentPrivate(argument As String) As Boolean Implements IBotComponent.IsArgumentPrivate
Return _socket.Plugin.IsArgumentPrivate(argument)
End Function
- Public Function InvokeCommand(ByVal user As BotUser, ByVal argument As String) As Task(Of String) Implements IBotComponent.InvokeCommand
+ Public Function InvokeCommand(user As BotUser, argument As String) As Task(Of String) Implements IBotComponent.InvokeCommand
Return _socket.Plugin.InvokeCommand(user, argument)
End Function
- Protected Overrides Function PerformDispose(ByVal finalizing As Boolean) As Task
+ Protected Overrides Function PerformDispose(finalizing As Boolean) As Task
_socket.Dispose()
Return _hooks.DisposeAllAsync()
End Function
@@ -60,7 +60,7 @@ Namespace Plugins
End Get
End Property
- Private Function IncludeCommandImpl(ByVal command As ICommand(Of IBotComponent)) As Task(Of IDisposable) Implements IBotComponent.IncludeCommand
+ Private Function IncludeCommandImpl(command As ICommand(Of IBotComponent)) As Task(Of IDisposable) Implements IBotComponent.IncludeCommand
Dim converter = Function(plugin As IPlugin)
If plugin IsNot Me._socket.Plugin Then
Throw New NotSupportedException("Command mapped from manager to plugin used on different plugin.")
@@ -69,7 +69,7 @@ Namespace Plugins
End Function
Return IncludeCommand(command.ProjectedFrom(converter))
End Function
- Public Function IncludeCommand(ByVal command As ICommand(Of IPlugin)) As Task(Of IDisposable)
+ Public Function IncludeCommand(command As ICommand(Of IPlugin)) As Task(Of IDisposable)
Contract.Requires(command IsNot Nothing)
Contract.Ensures(Contract.Result(Of Task(Of IDisposable))() IsNot Nothing)
Return _socket.Plugin.IncludeCommand(command)
View
8 Plugins/Plugin Socket.vb
@@ -12,9 +12,9 @@ Namespace Plugins
End Sub
<CodeAnalysis.SuppressMessage("Microsoft.Reliability", "CA2001:AvoidCallingProblematicMethods", MessageId:="System.Reflection.Assembly.LoadFrom")>
- Public Sub New(ByVal name As InvariantString,
- ByVal bot As Bot.MainBot,
- ByVal assemblyPath As String)
+ Public Sub New(name As InvariantString,
+ bot As Bot.MainBot,
+ assemblyPath As String)
Contract.Requires(bot IsNot Nothing)
Contract.Requires(assemblyPath IsNot Nothing)
Me._name = name
@@ -42,7 +42,7 @@ Namespace Plugins
End Get
End Property
- Protected Overrides Function PerformDispose(ByVal finalizing As Boolean) As Task
+ Protected Overrides Function PerformDispose(finalizing As Boolean) As Task
_plugin.Dispose()
Return Nothing
End Function
View
16 Warcraft3/Download/Download Client.vb
@@ -35,10 +35,10 @@ Namespace WC3.Download
Contract.Invariant(_reportedPosition <= _map.FileSize)
End Sub
- Public Sub New(ByVal player As IPlayerDownloadAspect,
- ByVal map As Map,
- ByVal clock As IClock,
- ByVal hooks As IEnumerable(Of Task(Of IDisposable)))
+ Public Sub New(player As IPlayerDownloadAspect,
+ map As Map,
+ clock As IClock,
+ hooks As IEnumerable(Of Task(Of IDisposable)))
Contract.Requires(map IsNot Nothing)
Contract.Requires(clock IsNot Nothing)
Contract.Requires(hooks IsNot Nothing)
@@ -123,7 +123,7 @@ Namespace WC3.Download
Contract.Requires(HasReported)
Return _reportedState
End Get
- Set(ByVal value As Protocol.MapTransferState)
+ Set(value As Protocol.MapTransferState)
Contract.Requires(HasReported)
_reportedState = value
End Set
@@ -135,7 +135,7 @@ Namespace WC3.Download
Contract.Assume(_reportedPosition <= Map.FileSize)
Return _reportedPosition
End Get
- Set(ByVal value As UInt32)
+ Set(value As UInt32)
Contract.Requires(HasReported)
Contract.Requires(value <= Map.FileSize)
Contract.Assume(value <= _map.FileSize)
@@ -184,7 +184,7 @@ Namespace WC3.Download
Where sign <> 0).FirstOrDefault)
End Function
- Public Shared Function StartTransfer(ByVal downloader As TransferClient, ByVal uploader As TransferClient) As Transfer
+ Public Shared Function StartTransfer(downloader As TransferClient, uploader As TransferClient) As Transfer
Contract.Requires(downloader IsNot Nothing)
Contract.Requires(uploader IsNot Nothing)
Contract.Requires(downloader.HasReported)
@@ -234,7 +234,7 @@ Namespace WC3.Download
_hasReported = True
End Sub
- Protected Overrides Function PerformDispose(ByVal finalizing As Boolean) As Task
+ Protected Overrides Function PerformDispose(finalizing As Boolean) As Task
If _transfer IsNot Nothing Then
_transfer.Dispose()
_transfer = Nothing
View
40 Warcraft3/Download/Download Manager.vb
@@ -36,11 +36,11 @@ Namespace WC3.Download
'Contract.Invariant((_started.State = OnetimeLockState.Acquired) = (_mapPieceSender IsNot Nothing))
End Sub
- Public Sub New(ByVal clock As IClock,
- ByVal map As Map,
- ByVal logger As Logger,
- ByVal allowDownloads As Boolean,
- ByVal allowUploads As Boolean)
+ Public Sub New(clock As IClock,
+ map As Map,
+ logger As Logger,
+ allowDownloads As Boolean,
+ allowUploads As Boolean)
Contract.Requires(map IsNot Nothing)
Contract.Requires(logger IsNot Nothing)
Contract.Requires(clock IsNot Nothing)
@@ -51,8 +51,8 @@ Namespace WC3.Download
Me._allowUploads = allowUploads
End Sub
- Public Sub Start(ByVal startPlayerHoldPoint As IHoldPoint(Of IPlayerDownloadAspect),
- ByVal mapPieceSender As Action(Of IPlayerDownloadAspect, UInt32))
+ Public Sub Start(startPlayerHoldPoint As IHoldPoint(Of IPlayerDownloadAspect),
+ mapPieceSender As Action(Of IPlayerDownloadAspect, UInt32))
Contract.Requires(startPlayerHoldPoint IsNot Nothing)
Contract.Requires(mapPieceSender IsNot Nothing)
If Me.IsDisposed Then Throw New ObjectDisposedException(Me.GetType.Name)
@@ -80,7 +80,7 @@ Namespace WC3.Download
End Get
End Property
- Private Sub SendMapFileData(ByVal client As TransferClient, ByVal reportedPosition As UInt32)
+ Private Sub SendMapFileData(client As TransferClient, reportedPosition As UInt32)
Contract.Requires(client IsNot Nothing)
Contract.Requires(client.Transfer IsNot Nothing)
Contract.Requires(client.Transfer.Uploader Is _defaultClient)
@@ -94,7 +94,7 @@ Namespace WC3.Download
End Sub
#Region "Public View"
- Private ReadOnly Property ClientLatencyDescription(ByVal player As IPlayerDownloadAspect, ByVal latencyDescription As String) As String
+ Private ReadOnly Property ClientLatencyDescription(player As IPlayerDownloadAspect, latencyDescription As String) As String
Get
Contract.Requires(player IsNot Nothing)
Contract.Requires(latencyDescription IsNot Nothing)
@@ -119,14 +119,14 @@ Namespace WC3.Download
End If
End Get
End Property
- Public Function QueueGetClientLatencyDescription(ByVal player As IPlayerDownloadAspect, ByVal latencyDescription As String) As Task(Of String)
+ Public Function QueueGetClientLatencyDescription(player As IPlayerDownloadAspect, latencyDescription As String) As Task(Of String)
Contract.Requires(player IsNot Nothing)
Contract.Requires(latencyDescription IsNot Nothing)
Contract.Ensures(Contract.Result(Of Task(Of String))() IsNot Nothing)
Return inQueue.QueueFunc(Function() ClientLatencyDescription(player, latencyDescription))
End Function
- Private ReadOnly Property ClientBandwidthDescription(ByVal player As IPlayerDownloadAspect) As String
+ Private ReadOnly Property ClientBandwidthDescription(player As IPlayerDownloadAspect) As String
Get
Contract.Requires(player IsNot Nothing)
Contract.Ensures(Contract.Result(Of String)() IsNot Nothing)
@@ -147,7 +147,7 @@ Namespace WC3.Download
Return ">HiB/s" '... What? It could happen...
End Get
End Property
- Public Function QueueGetClientBandwidthDescription(ByVal player As IPlayerDownloadAspect) As Task(Of String)
+ Public Function QueueGetClientBandwidthDescription(player As IPlayerDownloadAspect) As Task(Of String)
Contract.Requires(player IsNot Nothing)
Contract.Ensures(Contract.Result(Of Task(Of String))() IsNot Nothing)
Return inQueue.QueueFunc(Function() ClientBandwidthDescription(player))
@@ -161,7 +161,7 @@ Namespace WC3.Download
#End Region
#Region "Game-Triggered"
- Private Function OnGameStartPlayerHold(ByVal player As IPlayerDownloadAspect) As Task
+ Private Function OnGameStartPlayerHold(player As IPlayerDownloadAspect) As Task
Contract.Requires(player IsNot Nothing)
Dim playerHooks = New List(Of Task(Of IDisposable))() From {
@@ -187,7 +187,7 @@ Namespace WC3.Download
#End Region
#Region "Communication-Triggered"
- Private Function QueueOnReceiveClientMapInfo(ByVal player As IPlayerDownloadAspect, ByVal vals As NamedValueMap) As Task
+ Private Function QueueOnReceiveClientMapInfo(player As IPlayerDownloadAspect, vals As NamedValueMap) As Task
Contract.Requires(player IsNot Nothing)
Contract.Requires(vals IsNot Nothing)
Contract.Ensures(Contract.Result(Of Task)() IsNot Nothing)
@@ -195,14 +195,14 @@ Namespace WC3.Download
state:=vals.ItemAs(Of Protocol.MapTransferState)("transfer state"),
position:=vals.ItemAs(Of UInt32)("total downloaded")))
End Function
- Private Function QueueOnReceivePeerConnectionInfo(ByVal player As IPlayerDownloadAspect, ByVal flags As UInt16) As Task
+ Private Function QueueOnReceivePeerConnectionInfo(player As IPlayerDownloadAspect, flags As UInt16) As Task
Contract.Requires(player IsNot Nothing)
Contract.Ensures(Contract.Result(Of Task)() IsNot Nothing)
Return inQueue.QueueAction(Sub() OnReceivePeerConnectionInfo(player:=player,
flags:=flags))
End Function
- Private Sub OnReceivePeerConnectionInfo(ByVal player As IPlayerDownloadAspect, ByVal flags As UInt32)
+ Private Sub OnReceivePeerConnectionInfo(player As IPlayerDownloadAspect, flags As UInt32)
Contract.Requires(player IsNot Nothing)
If Not _playerClients.ContainsKey(player) Then Return
@@ -216,7 +216,7 @@ Namespace WC3.Download
Select peer)
End Sub
- Private Sub OnReceiveClientMapInfo(ByVal player As IPlayerDownloadAspect, ByVal state As Protocol.MapTransferState, ByVal position As UInt32)
+ Private Sub OnReceiveClientMapInfo(player As IPlayerDownloadAspect, state As Protocol.MapTransferState, position As UInt32)
Contract.Requires(player IsNot Nothing)
If Not _playerClients.ContainsKey(player) Then Return
@@ -243,7 +243,7 @@ Namespace WC3.Download
SendMapFileData(client, position)
End If
End Sub
- Private Sub OnFirstMapInfo(ByVal client As TransferClient, ByVal state As Protocol.MapTransferState, ByVal position As UInt32)
+ Private Sub OnFirstMapInfo(client As TransferClient, state As Protocol.MapTransferState, position As UInt32)
Contract.Requires(client IsNot Nothing)
Contract.Requires(client.Player IsNot Nothing)
Contract.Requires(Not client.HasReported)
@@ -258,7 +258,7 @@ Namespace WC3.Download
reasonDescription:="Downloads not allowed.")
End If
End Sub
- Private Sub OnTypicalMapInfo(ByVal client As TransferClient, ByVal state As Protocol.MapTransferState, ByVal position As UInt32)
+ Private Sub OnTypicalMapInfo(client As TransferClient, state As Protocol.MapTransferState, position As UInt32)
Contract.Requires(client IsNot Nothing)
Contract.Requires(client.Player IsNot Nothing)
Contract.Requires(client.HasReported)
@@ -391,7 +391,7 @@ Namespace WC3.Download
End Sub
#End Region
- Protected Overrides Function PerformDispose(ByVal finalizing As Boolean) As Task
+ Protected Overrides Function PerformDispose(finalizing As Boolean) As Task
If finalizing Then Return Nothing
Return inQueue.QueueFunc(
Function()
View
12 Warcraft3/Download/Download Transfer.vb
@@ -20,11 +20,11 @@ Namespace WC3.Download
Contract.Invariant(_startingPosition <= _fileSize)
End Sub
- Public Sub New(ByVal downloader As TransferClient,
- ByVal uploader As TransferClient,
- ByVal startingPosition As UInt32,
- ByVal filesize As UInt32,
- ByVal clock As IClock)
+ Public Sub New(downloader As TransferClient,
+ uploader As TransferClient,
+ startingPosition As UInt32,
+ filesize As UInt32,
+ clock As IClock)
Contract.Requires(downloader IsNot Nothing)
Contract.Requires(uploader IsNot Nothing)
Contract.Requires(clock IsNot Nothing)
@@ -95,7 +95,7 @@ Namespace WC3.Download
End Get
End Property
- Public Sub Advance(ByVal progress As UInt32)
+ Public Sub Advance(progress As UInt32)
_totalProgress += progress
_lastActivityClock = _lastActivityClock.Restarted()
End Sub
View
16 Warcraft3/Download/IPlayerDownloadAspect.vb
@@ -4,11 +4,11 @@
Inherits IDisposableWithTask
ReadOnly Property Name As InvariantString
ReadOnly Property Id As PlayerId
- Function QueueAddPacketHandler(Of T)(ByVal packetDefinition As Protocol.Packets.Definition(Of T),
- ByVal handler As Func(Of T, Task)) As Task(Of IDisposable)
+ Function QueueAddPacketHandler(Of T)(packetDefinition As Protocol.Packets.Definition(Of T),
+ handler As Func(Of T, Task)) As Task(Of IDisposable)
Function MakePacketOtherPlayerJoined() As Protocol.Packet
- Function QueueSendPacket(ByVal packet As Protocol.Packet) As Task
- Function QueueDisconnect(ByVal expected As Boolean, ByVal reportedReason As Protocol.PlayerLeaveReason, ByVal reasonDescription As String) As Task
+ Function QueueSendPacket(packet As Protocol.Packet) As Task
+ Function QueueDisconnect(expected As Boolean, reportedReason As Protocol.PlayerLeaveReason, reasonDescription As String) As Task
<ContractClassFor(GetType(IPlayerDownloadAspect))>
MustInherit Shadows Class ContractClass
@@ -27,20 +27,20 @@
Throw New NotSupportedException
End Get
End Property
- Public Function QueueAddPacketHandler(Of T)(ByVal packetDefinition As Protocol.Packets.Definition(Of T),
- ByVal handler As Func(Of T, Task)) As Task(Of IDisposable) _
+ Public Function QueueAddPacketHandler(Of T)(packetDefinition As Protocol.Packets.Definition(Of T),
+ handler As Func(Of T, Task)) As Task(Of IDisposable) _
Implements IPlayerDownloadAspect.QueueAddPacketHandler
Contract.Requires(packetDefinition IsNot Nothing)
Contract.Requires(handler IsNot Nothing)
Contract.Ensures(Contract.Result(Of Task(Of IDisposable))() IsNot Nothing)
Throw New NotSupportedException
End Function
- Public Function QueueSendPacket(ByVal packet As Protocol.Packet) As Task Implements IPlayerDownloadAspect.QueueSendPacket
+ Public Function QueueSendPacket(packet As Protocol.Packet) As Task Implements IPlayerDownloadAspect.QueueSendPacket
Contract.Requires(packet IsNot Nothing)
Contract.Ensures(Contract.Result(Of Task)() IsNot Nothing)
Throw New NotSupportedException
End Function
- Public Function QueueDisconnect(ByVal expected As Boolean, ByVal reportedReason As Protocol.PlayerLeaveReason, ByVal reasonDescription As String) As Task Implements IPlayerDownloadAspect.QueueDisconnect
+ Public Function QueueDisconnect(expected As Boolean, reportedReason As Protocol.PlayerLeaveReason, reasonDescription As String) As Task Implements IPlayerDownloadAspect.QueueDisconnect
Contract.Requires(reasonDescription IsNot Nothing)
Contract.Ensures(Contract.Result(Of Task)() IsNot Nothing)
Throw New NotSupportedException
View
46 Warcraft3/Game/Game Commands.vb
@@ -5,7 +5,7 @@ Namespace WC3
Private Sub New()
End Sub
- Private Shared Function Conv(ByVal command As ICommand(Of Game)) As ICommand(Of GameManager)
+ Private Shared Function Conv(command As ICommand(Of Game)) As ICommand(Of GameManager)
Contract.Requires(command IsNot Nothing)
Contract.Ensures(Contract.Result(Of ICommand(Of GameManager))() IsNot Nothing)
Return command.ProjectedFrom(Function(x As GameManager) x.Game)
@@ -88,7 +88,7 @@ Namespace WC3
Description:="Kicks a player from the game. Closes their slot if -close is specified.")
End Sub
<SuppressMessage("Microsoft.Contracts", "Ensures-40-81")>
- Protected Overloads Overrides Async Function PerformInvoke(ByVal target As Game, ByVal user As BotUser, ByVal argument As CommandArgument) As Task(Of String)
+ Protected Overloads Overrides Async Function PerformInvoke(target As Game, user As BotUser, argument As CommandArgument) As Task(Of String)
Dim slotQuery = argument.RawValue(0)
Dim shouldClose = argument.HasOptionalSwitch("close")
Await target.QueueBoot(slotQuery, shouldClose)
@@ -105,7 +105,7 @@ Namespace WC3
Description:="Forwards commands to the bot.")
End Sub
<SuppressMessage("Microsoft.Contracts", "Ensures-40-81")>
- Protected Overrides Async Function PerformInvoke(ByVal target As GameManager, ByVal user As BotUser, ByVal argument As String) As Task(Of String)
+ Protected Overrides Async Function PerformInvoke(target As GameManager, user As BotUser, argument As String) As Task(Of String)
Dim botManagers = (Await target.Bot.Components.QueueGetAllComponents()).OfType(Of Bot.MainBotManager)()
Return Await botManagers.Single().InvokeCommand(user, argument)
End Function
@@ -119,7 +119,7 @@ Namespace WC3
Description:="Closes this game instance.")
End Sub
<SuppressMessage("Microsoft.Contracts", "Ensures-40-81")>
- Protected Overloads Overrides Async Function PerformInvoke(ByVal target As Game, ByVal user As BotUser, ByVal argument As CommandArgument) As Task(Of String)
+ Protected Overloads Overrides Async Function PerformInvoke(target As Game, user As BotUser, argument As CommandArgument) As Task(Of String)
target.Dispose()
Await target.DisposalTask
Return "Cancelled"
@@ -134,7 +134,7 @@ Namespace WC3
Description:="Closes a slot.")
End Sub
<SuppressMessage("Microsoft.Contracts", "Ensures-40-81")>
- Protected Overloads Overrides Async Function PerformInvoke(ByVal target As Game, ByVal user As BotUser, ByVal argument As CommandArgument) As Task(Of String)
+ Protected Overloads Overrides Async Function PerformInvoke(target As Game, user As BotUser, argument As CommandArgument) As Task(Of String)
Await target.QueueCloseSlot(argument.RawValue(0))
Return "Closed"
End Function
@@ -148,7 +148,7 @@ Namespace WC3
Description:="Sets the color of a slot. Not allowed when the map uses Fixed Player Settings.")
End Sub
<SuppressMessage("Microsoft.Contracts", "Ensures-40-81")>
- Protected Overloads Overrides Async Function PerformInvoke(ByVal target As Game, ByVal user As BotUser, ByVal argument As CommandArgument) As Task(Of String)
+ Protected Overloads Overrides Async Function PerformInvoke(target As Game, user As BotUser, argument As CommandArgument) As Task(Of String)
Dim argSlot = argument.RawValue(0)
Dim argColor = argument.RawValue(1)
Dim color = argColor.EnumTryParse(Of Protocol.PlayerColor)(ignoreCase:=True)
@@ -166,7 +166,7 @@ Namespace WC3
Description:="Places a computer in a slot, unless it contains a player.")
End Sub
<SuppressMessage("Microsoft.Contracts", "Ensures-40-81")>
- Protected Overloads Overrides Async Function PerformInvoke(ByVal target As Game, ByVal user As BotUser, ByVal argument As CommandArgument) As Task(Of String)
+ Protected Overloads Overrides Async Function PerformInvoke(target As Game, user As BotUser, argument As CommandArgument) As Task(Of String)
Dim argSlot = argument.RawValue(0)
Dim argDifficulty = If(argument.RawValueCount >= 2, argument.RawValue(1), WC3.Protocol.ComputerLevel.Normal.ToString)
Dim difficulty = argDifficulty.EnumTryParse(Of Protocol.ComputerLevel)(ignoreCase:=True)
@@ -184,7 +184,7 @@ Namespace WC3
Description:="Causes the bot to disconnect from the game. The game might continue if one of the players can host.")
End Sub
<SuppressMessage("Microsoft.Contracts", "Ensures-40-81")>
- Protected Overloads Overrides Async Function PerformInvoke(ByVal target As Game, ByVal user As BotUser, ByVal argument As CommandArgument) As Task(Of String)
+ Protected Overloads Overrides Async Function PerformInvoke(target As Game, user As BotUser, argument As CommandArgument) As Task(Of String)
target.Dispose()
Await target.DisposalTask
Return "Disconnected"
@@ -199,7 +199,7 @@ Namespace WC3
Description:="Gives access to admin or host commands.")
End Sub
<SuppressMessage("Microsoft.Contracts", "Ensures-40-81")>
- Protected Overloads Overrides Async Function PerformInvoke(ByVal target As Game, ByVal user As BotUser, ByVal argument As CommandArgument) As Task(Of String)
+ Protected Overloads Overrides Async Function PerformInvoke(target As Game, user As BotUser, argument As CommandArgument) As Task(Of String)
If user Is Nothing Then Throw New InvalidOperationException("User not specified.")
Await target.QueueElevatePlayer(user.Name, argument.RawValue(0))
Return "Elevated"
@@ -213,7 +213,7 @@ Namespace WC3
template:="setting",
Description:="Returns the current value of a game setting {tickperiod, laglimit, gamerate}.")
End Sub
- Protected Overloads Overrides Function PerformInvoke(ByVal target As Game, ByVal user As BotUser, ByVal argument As CommandArgument) As Task(Of String)
+ Protected Overloads Overrides Function PerformInvoke(target As Game, user As BotUser, argument As CommandArgument) As Task(Of String)
Contract.Assume(target IsNot Nothing)
Dim val As Task(Of Double)
Dim argSetting = argument.RawValue(0).ToInvariant
@@ -236,7 +236,7 @@ Namespace WC3
Description:="Sets the handicap of a slot.")
End Sub
<SuppressMessage("Microsoft.Contracts", "Ensures-40-81")>
- Protected Overloads Overrides Async Function PerformInvoke(ByVal target As Game, ByVal user As BotUser, ByVal argument As CommandArgument) As Task(Of String)
+ Protected Overloads Overrides Async Function PerformInvoke(target As Game, user As BotUser, argument As CommandArgument) As Task(Of String)
Dim argSlot = argument.RawValue(0)
Dim argHandicap = argument.RawValue(1)
Dim newHandicap As Byte
@@ -259,7 +259,7 @@ Namespace WC3
Description:="Prevents players from leaving a slot or from changing slot properties (if -full). Omit the slot argument to affect all slots.")
End Sub
<SuppressMessage("Microsoft.Contracts", "Ensures-40-81")>
- Protected Overloads Overrides Async Function PerformInvoke(ByVal target As Game, ByVal user As BotUser, ByVal argument As CommandArgument) As Task(Of String)
+ Protected Overloads Overrides Async Function PerformInvoke(target As Game, user As BotUser, argument As CommandArgument) As Task(Of String)
Dim lockType = If(argument.HasOptionalSwitch("full"), WC3.Slot.LockState.Frozen, WC3.Slot.LockState.Sticky)
If argument.RawValueCount = 0 Then
Await target.QueueSetAllSlotsLocked(lockType)
@@ -279,7 +279,7 @@ Namespace WC3
Description:="Opens a slot.")
End Sub
<SuppressMessage("Microsoft.Contracts", "Ensures-40-81")>
- Protected Overloads Overrides Async Function PerformInvoke(ByVal target As Game, ByVal user As BotUser, ByVal argument As CommandArgument) As Task(Of String)
+ Protected Overloads Overrides Async Function PerformInvoke(target As Game, user As BotUser, argument As CommandArgument) As Task(Of String)
Await target.QueueOpenSlot(argument.RawValue(0))
Return "Opened"
End Function
@@ -292,7 +292,7 @@ Namespace WC3
template:="",
Description:="Returns estimated network round trip times for each player.")
End Sub
- Protected Overloads Overrides Function PerformInvoke(ByVal target As Game, ByVal user As BotUser, ByVal argument As CommandArgument) As Task(Of String)
+ Protected Overloads Overrides Function PerformInvoke(target As Game, user As BotUser, argument As CommandArgument) As Task(Of String)
Contract.Assume(target IsNot Nothing)
Return From players In target.QueueGetPlayers()
From latencies In (From player In players Select player.QueueGetLatencyDescription).Cache.AsAggregateTask
@@ -311,7 +311,7 @@ Namespace WC3
Description:="Sets the race of a slot. Not allowed when the map uses Fixed Player Settings and the slot race is not Selectable.")
End Sub
<SuppressMessage("Microsoft.Contracts", "Ensures-40-81")>
- Protected Overloads Overrides Async Function PerformInvoke(ByVal target As Game, ByVal user As BotUser, ByVal argument As CommandArgument) As Task(Of String)
+ Protected Overloads Overrides Async Function PerformInvoke(target As Game, user As BotUser, argument As CommandArgument) As Task(Of String)
Dim argSlot = argument.RawValue(0)
Dim argRace = argument.RawValue(1)
Dim race = argRace.EnumTryParse(Of Protocol.Races)(ignoreCase:=True)
@@ -329,7 +329,7 @@ Namespace WC3
Description:="Reserves a slot for a player.")
End Sub
<SuppressMessage("Microsoft.Contracts", "Ensures-40-81")>
- Protected Overloads Overrides Async Function PerformInvoke(ByVal target As Game, ByVal user As BotUser, ByVal argument As CommandArgument) As Task(Of String)
+ Protected Overloads Overrides Async Function PerformInvoke(target As Game, user As BotUser, argument As CommandArgument) As Task(Of String)
Dim name = argument.RawValue(0)
Dim slotQueryString = argument.TryGetOptionalNamedValue("slot")
Dim slotQuery = If(slotQueryString Is Nothing, Nothing, New InvariantString?(slotQueryString))
@@ -346,7 +346,7 @@ Namespace WC3
template:="setting value",
Description:="Sets the value of a game setting {tickperiod, laglimit, gamerate}.")
End Sub
- Protected Overloads Overrides Function PerformInvoke(ByVal target As Game, ByVal user As BotUser, ByVal argument As CommandArgument) As Task(Of String)
+ Protected Overloads Overrides Function PerformInvoke(target As Game, user As BotUser, argument As CommandArgument) As Task(Of String)
Contract.Assume(target IsNot Nothing)
Dim val_us As UShort
Dim vald As Double
@@ -381,7 +381,7 @@ Namespace WC3
Description:="Sets a slot's team. Only works in melee games.")
End Sub
<SuppressMessage("Microsoft.Contracts", "Ensures-40-81")>
- Protected Overloads Overrides Async Function PerformInvoke(ByVal target As Game, ByVal user As BotUser, ByVal argument As CommandArgument) As Task(Of String)
+ Protected Overloads Overrides Async Function PerformInvoke(target As Game, user As BotUser, argument As CommandArgument) As Task(Of String)
Dim argSlot = argument.RawValue(0)
Dim argTeam = argument.RawValue(1)
Dim team As Byte
@@ -402,7 +402,7 @@ Namespace WC3
Description:="Sets up the number of slots on each team (eg. 'SetupTeams 2v2' will leave two open slots on each team).")
End Sub
<SuppressMessage("Microsoft.Contracts", "Ensures-40-81")>
- Protected Overloads Overrides Async Function PerformInvoke(ByVal target As Game, ByVal user As BotUser, ByVal argument As CommandArgument) As Task(Of String)
+ Protected Overloads Overrides Async Function PerformInvoke(target As Game, user As BotUser, argument As CommandArgument) As Task(Of String)
Await target.QueueTrySetTeamSizes(TeamVersusStringToTeamSizes(argument.RawValue(0)))
Return "Set Teams"
End Function
@@ -416,7 +416,7 @@ Namespace WC3
Description:="Starts the launch countdown.")
End Sub
<SuppressMessage("Microsoft.Contracts", "Ensures-40-81")>
- Protected Overloads Overrides Async Function PerformInvoke(ByVal target As Game, ByVal user As BotUser, ByVal argument As CommandArgument) As Task(Of String)
+ Protected Overloads Overrides Async Function PerformInvoke(target As Game, user As BotUser, argument As CommandArgument) As Task(Of String)
Await target.QueueStartCountdown()
Return "Started Countdown"
End Function
@@ -430,7 +430,7 @@ Namespace WC3
Description:="Swaps the contents of two slots.")
End Sub
<SuppressMessage("Microsoft.Contracts", "Ensures-40-81")>
- Protected Overloads Overrides Async Function PerformInvoke(ByVal target As Game, ByVal user As BotUser, ByVal argument As CommandArgument) As Task(Of String)
+ Protected Overloads Overrides Async Function PerformInvoke(target As Game, user As BotUser, argument As CommandArgument) As Task(Of String)
Await target.QueueSwapSlotContents(argument.RawValue(0), argument.RawValue(1))
Return "Swapped Slots"
End Function
@@ -444,7 +444,7 @@ Namespace WC3
Description:="Allows players to move from a slot and change its properties. Omit the slot argument to affect all slots.")
End Sub
<SuppressMessage("Microsoft.Contracts", "Ensures-40-81")>
- Protected Overloads Overrides Async Function PerformInvoke(ByVal target As Game, ByVal user As BotUser, ByVal argument As CommandArgument) As Task(Of String)
+ Protected Overloads Overrides Async Function PerformInvoke(target As Game, user As BotUser, argument As CommandArgument) As Task(Of String)
Dim lockType = WC3.Slot.LockState.Unlocked
If argument.RawValueCount = 0 Then
Await target.QueueSetAllSlotsLocked(lockType)
@@ -464,7 +464,7 @@ Namespace WC3
Description:="Places or cancels a vote to prematurely start an autostarted game. Requires at least 2 players and at least a 2/3 majority.")
End Sub
<SuppressMessage("Microsoft.Contracts", "Ensures-40-81")>
- Protected Overloads Overrides Async Function PerformInvoke(ByVal target As Game, ByVal user As BotUser, ByVal argument As CommandArgument) As Task(Of String)
+ Protected Overloads Overrides Async Function PerformInvoke(target As Game, user As BotUser, argument As CommandArgument) As Task(Of String)
If user Is Nothing Then Throw New InvalidOperationException("User not specified.")
Await target.QueueSetPlayerVoteToStart(user.Name, wantsToStart:=Not argument.HasOptionalSwitch("cancel"))
Return "Voted to start"
View
12 Warcraft3/Game/Game Kernel.vb
@@ -33,7 +33,7 @@ Namespace WC3
Private ReadOnly _players As New ObservableCollection(Of Player)
Private _state As GameState = GameState.AcceptingPlayers
- Public Event ChangedState(ByVal sender As GameKernel, ByVal oldState As GameState, ByVal newState As GameState)
+ Public Event ChangedState(sender As GameKernel, oldState As GameState, newState As GameState)
<ContractInvariantMethod()> Private Sub ObjectInvariant()
Contract.Invariant(_clock IsNot Nothing)
@@ -43,10 +43,10 @@ Namespace WC3
Contract.Invariant(_logger IsNot Nothing)
End Sub
- Public Sub New(ByVal clock As IClock,
- ByVal inQueue As CallQueue,
- ByVal outQueue As CallQueue,
- ByVal logger As Logger)
+ Public Sub New(clock As IClock,
+ inQueue As CallQueue,
+ outQueue As CallQueue,
+ logger As Logger)
Contract.Assume(clock IsNot Nothing)
Contract.Assume(inQueue IsNot Nothing)
Contract.Assume(outQueue IsNot Nothing)
@@ -90,7 +90,7 @@ Namespace WC3
Get
Return _state
End Get
- Set(ByVal value As GameState)
+ Set(value As GameState)
Dim oldState = State
_state = value
RaiseEvent ChangedState(Me, oldState, value)
View
14 Warcraft3/Game/Game Load Screen.vb
@@ -11,9 +11,9 @@
Private _loadInGameTickCount As Integer
Private _loadInGameTicker As IDisposable
- Public Event RecordGameStarted(ByVal sender As GameLoadScreen)
- Public Event EmptyTick(ByVal sender As GameLoadScreen)
- Public Event Finished(ByVal sender As GameLoadScreen)
+ Public Event RecordGameStarted(sender As GameLoadScreen)
+ Public Event EmptyTick(sender As GameLoadScreen)
+ Public Event Finished(sender As GameLoadScreen)
<ContractInvariantMethod()> Private Sub ObjectInvariant()
Contract.Invariant(_settings IsNot Nothing)
@@ -25,9 +25,9 @@
Contract.Invariant(_loadInGameTickCount >= 0)
End Sub
- Public Sub New(ByVal kernel As GameKernel,
- ByVal lobby As GameLobby,
- ByVal settings As GameSettings)
+ Public Sub New(kernel As GameKernel,
+ lobby As GameLobby,
+ settings As GameSettings)
Contract.Assume(kernel IsNot Nothing)
Contract.Assume(lobby IsNot Nothing)
Contract.Assume(settings IsNot Nothing)
@@ -115,7 +115,7 @@
End If
End Sub
- Private Sub OnReceiveReady(ByVal sendingPlayer As Player)
+ Private Sub OnReceiveReady(sendingPlayer As Player)
Contract.Requires(sendingPlayer IsNot Nothing)
If Not unreadyPlayers.Contains(sendingPlayer) Then Return
View
126 Warcraft3/Game/Game Lobby.vb
@@ -11,8 +11,8 @@
Private _fakeHostPlayer As Player
Private _slots As SlotSet
- Public Event ChangedPublicState(ByVal sender As GameLobby)
- Public Event RemovePlayer(ByVal sender As GameLobby, ByVal player As Player, ByVal wasExpected As Boolean, ByVal reportedReason As Protocol.PlayerLeaveReason, ByVal reasonDescription As String)
+ Public Event ChangedPublicState(sender As GameLobby)
+ Public Event RemovePlayer(sender As GameLobby, player As Player, wasExpected As Boolean, reportedReason As Protocol.PlayerLeaveReason, reasonDescription As String)
<ContractInvariantMethod()> Private Sub ObjectInvariant()
Contract.Invariant(_downloadManager IsNot Nothing)
@@ -24,10 +24,10 @@
Contract.Invariant(_settings IsNot Nothing)
End Sub
- Public Sub New(ByVal startPlayerHoldPoint As HoldPoint(Of Player),
- ByVal downloadManager As Download.Manager,
- ByVal kernel As GameKernel,
- ByVal settings As GameSettings)
+ Public Sub New(startPlayerHoldPoint As HoldPoint(Of Player),
+ downloadManager As Download.Manager,
+ kernel As GameKernel,
+ settings As GameSettings)
Contract.Assume(startPlayerHoldPoint IsNot Nothing)
Contract.Assume(downloadManager IsNot Nothing)
Contract.Assume(settings IsNot Nothing)
@@ -77,7 +77,7 @@
Next remainingObsSlot
End If
End Sub
- Private Shared Function InitCreateSlots(ByVal settings As GameSettings) As IRist(Of Slot)
+ Private Shared Function InitCreateSlots(settings As GameSettings) As IRist(Of Slot)
Contract.Requires(settings IsNot Nothing)
Contract.Ensures(Contract.Result(Of IRist(Of Slot))() IsNot Nothing)
Dim result = New List(Of Slot)
@@ -111,7 +111,7 @@
Contract.Ensures(Contract.Result(Of SlotSet)() IsNot Nothing)
Return _slots
End Get
- Set(ByVal value As SlotSet)
+ Set(value As SlotSet)
Contract.Requires(value IsNot Nothing)
_slots = value
End Set
@@ -134,8 +134,8 @@
End Get
End Property
- Public Sub LobbyCatchRemovedPlayer(ByVal player As Player,
- ByVal slot As Slot?)
+ Public Sub LobbyCatchRemovedPlayer(player As Player,
+ slot As Slot?)
Contract.Requires(player IsNot Nothing)
If slot Is Nothing OrElse slot.Value.Contents.PlayerIndex Is Nothing Then
@@ -163,8 +163,8 @@
End Try
End Function
- Public Function AddFakePlayer(ByVal name As InvariantString,
- Optional ByVal slot As Slot? = Nothing) As Player
+ Public Function AddFakePlayer(name As InvariantString,
+ Optional slot As Slot? = Nothing) As Player
Contract.Ensures(Contract.Result(Of Player)() IsNot Nothing)
If Not AcceptingPlayers Then
@@ -207,7 +207,7 @@
RaiseEvent ChangedPublicState(Me)
End Sub
- Private Function AllocateSpaceForNewPlayer(ByVal name As InvariantString) As Tuple(Of Slot, PlayerId)
+ Private Function AllocateSpaceForNewPlayer(name As InvariantString) As Tuple(Of Slot, PlayerId)
Contract.Ensures(Not _freeIndexes.Contains(Contract.Result(Of Tuple(Of Slot, PlayerId))().Item2))
'Choose Slot
@@ -248,9 +248,9 @@
Contract.Assume(Not _freeIndexes.Contains(r.Item2))
Return r
End Function
- Private Function AddPlayer(ByVal newPlayer As Player,
- ByVal slot As Slot,
- ByVal socketRemoteEndPoint As Net.IPEndPoint) As Player
+ Private Function AddPlayer(newPlayer As Player,
+ slot As Slot,
+ socketRemoteEndPoint As Net.IPEndPoint) As Player
Contract.Requires(newPlayer IsNot Nothing)
Contract.Requires(socketRemoteEndPoint IsNot Nothing)
Contract.Requires(socketRemoteEndPoint.Address IsNot Nothing)
@@ -286,8 +286,8 @@
Return newPlayer
End Function
- Public Function AddPlayer(ByVal knockData As Protocol.KnockData,
- ByVal socket As W3Socket) As Player
+ Public Function AddPlayer(knockData As Protocol.KnockData,
+ socket As W3Socket) As Player
Contract.Requires(knockData IsNot Nothing)
Contract.Requires(socket IsNot Nothing)
Contract.Ensures(Contract.Result(Of Player)() IsNot Nothing)
@@ -303,19 +303,19 @@
Return AddPlayer(newPlayer, space.Item1, socket.RemoteEndPoint)
End Function
- Protected Overrides Function PerformDispose(ByVal finalizing As Boolean) As Task
+ Protected Overrides Function PerformDispose(finalizing As Boolean) As Task
If finalizing Then Return Nothing
_downloadManager.Dispose()
Return Nothing
End Function
<Pure()>
- Public Function IsPlayerVisible(ByVal player As Player) As Boolean
+ Public Function IsPlayerVisible(player As Player) As Boolean
Contract.Requires(player IsNot Nothing)
Return _pidVisiblityMap(player.Id) = player.Id
End Function
<Pure()>
- Public Function GetVisiblePlayer(ByVal player As Player) As Player
+ Public Function GetVisiblePlayer(player As Player) As Player
Contract.Requires(player IsNot Nothing)
Contract.Ensures(Contract.Result(Of Player)() IsNot Nothing)
If IsPlayerVisible(player) Then Return player
@@ -324,10 +324,10 @@
Contract.Assume(visiblePlayer IsNot Nothing)
Return visiblePlayer
End Function
- Public Shared Function SetupCoveredSlot(ByVal slots As SlotSet,
- ByVal coveringSlot As Slot,
- ByVal coveredSlot As Slot,
- ByVal coveredPlayersId As PlayerId) As SlotSet
+ Public Shared Function SetupCoveredSlot(slots As SlotSet,
+ coveringSlot As Slot,
+ coveredSlot As Slot,
+ coveredPlayersId As PlayerId) As SlotSet
Contract.Requires(slots IsNot Nothing)
Contract.Requires(coveringSlot.Contents.EnumPlayers.None)
Contract.Requires(coveringSlot.Contents.EnumPlayers.Count = 1)
@@ -339,8 +339,8 @@
coveredSlot.With(contents:=New SlotContentsCovered(coveringSlot.MatchableId, coveredPlayersId, {})))
End Function
- Public Function SendMapPiece(ByVal receiver As Download.IPlayerDownloadAspect,
- ByVal position As UInt32) As Task
+ Public Function SendMapPiece(receiver As Download.IPlayerDownloadAspect,
+ position As UInt32) As Task
Contract.Requires(receiver IsNot Nothing)
Contract.Ensures(Contract.Result(Of Task)() IsNot Nothing)
@@ -357,7 +357,7 @@
'''<summary>Returns any slot matching a string. Checks index, color and player name.</summary>
<Pure()>
- Public Function FindMatchingSlot(ByVal query As InvariantString) As Slot
+ Public Function FindMatchingSlot(query As InvariantString) As Slot
Dim best = (From slot In _slots
Let match = slot.Matches(query)
Let content = slot.Contents.ContentType
@@ -367,7 +367,7 @@
Return best.slot
End Function
- Public Sub OnPlayerSetColor(ByVal sender As Player, ByVal newColor As Protocol.PlayerColor)
+ Public Sub OnPlayerSetColor(sender As Player, newColor As Protocol.PlayerColor)
Contract.Requires(sender IsNot Nothing)
Dim trySlot = _slots.TryFindPlayerSlot(sender)
If Not trySlot.HasValue Then Return
@@ -392,7 +392,7 @@
_slots = _slots.WithSlotsUpdatedByIndex(slot.With(color:=newColor))
RaiseEvent ChangedPublicState(Me)
End Sub
- Public Sub OnPlayerSetRace(ByVal sender As Player, ByVal newRace As Protocol.Races)
+ Public Sub OnPlayerSetRace(sender As Player, newRace As Protocol.Races)
Contract.Requires(sender IsNot Nothing)
Dim trySlot = _slots.TryFindPlayerSlot(sender)
If trySlot Is Nothing Then Return
@@ -408,7 +408,7 @@
_slots = _slots.WithSlotsUpdatedByIndex(slot.With(race:=newRace))
RaiseEvent ChangedPublicState(Me)
End Sub
- Public Sub OnPlayerSetHandicap(ByVal sender As Player, ByVal newHandicap As Byte)
+ Public Sub OnPlayerSetHandicap(sender As Player, newHandicap As Byte)
Contract.Requires(sender IsNot Nothing)
Dim trySlot = _slots.TryFindPlayerSlot(sender)
If trySlot Is Nothing Then Return
@@ -429,7 +429,7 @@
RaiseEvent ChangedPublicState(Me)
End Sub
- Public Sub OnPlayerSetTeam(ByVal sender As Player, ByVal newTeam As Byte)
+ Public Sub OnPlayerSetTeam(sender As Player, newTeam As Byte)
Contract.Requires(sender IsNot Nothing)
Dim trySlot = _slots.TryFindPlayerSlot(sender)
If trySlot Is Nothing Then Return
@@ -480,8 +480,8 @@
End Sub
'''<summary>Reserves a slot for a player.</summary>
- Public Function ReserveSlot(ByVal userName As InvariantString,
- Optional ByVal slotQuery As InvariantString? = Nothing) As Player
+ Public Function ReserveSlot(userName As InvariantString,
+ Optional slotQuery As InvariantString? = Nothing) As Player
Contract.Ensures(Contract.Result(Of Player)() IsNot Nothing)
If Not AcceptingPlayers Then Throw New InvalidOperationException("Can't reserve slots after launch.")
Dim slot As Slot
@@ -498,9 +498,9 @@
Return AddFakePlayer(userName, slot:=slot)
End Function
- Private Sub ModifySlot(ByVal slotQuery As InvariantString,
- ByVal projection As Func(Of Slot, Slot),
- Optional ByVal avoidPlayers As Boolean = False)
+ Private Sub ModifySlot(slotQuery As InvariantString,
+ projection As Func(Of Slot, Slot),
+ Optional avoidPlayers As Boolean = False)
Contract.Requires(projection IsNot Nothing)
If Not AcceptingPlayers Then Throw New InvalidOperationException("Can't modify slots during launch.")
@@ -515,28 +515,28 @@
End Sub
'''<summary>Opens the slot with the given index, unless the slot contains a player.</summary>
- Public Sub OpenSlot(ByVal slotQuery As InvariantString)
+ Public Sub OpenSlot(slotQuery As InvariantString)
ModifySlot(slotQuery,
Function(slot) slot.With(contents:=New SlotContentsOpen),
avoidPlayers:=True)
End Sub
'''<summary>Places a computer with the given difficulty in the slot with the given index, unless the slot contains a player.</summary>
- Public Sub ComputerizeSlot(ByVal slotQuery As InvariantString, ByVal cpu As Protocol.ComputerLevel)
+ Public Sub ComputerizeSlot(slotQuery As InvariantString, cpu As Protocol.ComputerLevel)
ModifySlot(slotQuery,
Function(slot) slot.With(contents:=New SlotContentsComputer(cpu)),
avoidPlayers:=True)
End Sub
'''<summary>Closes the slot with the given index, unless the slot contains a player.</summary>
- Public Sub CloseSlot(ByVal slotQuery As InvariantString)
+ Public Sub CloseSlot(slotQuery As InvariantString)
ModifySlot(slotQuery,
Function(slot) slot.With(contents:=New SlotContentsClosed),
avoidPlayers:=True)
End Sub
- Public Sub SwapSlotContents(ByVal slotQuery1 As InvariantString,
- ByVal slotQuery2 As InvariantString)
+ Public Sub SwapSlotContents(slotQuery1 As InvariantString,
+ slotQuery2 As InvariantString)
If Not AcceptingPlayers Then Throw New InvalidOperationException("Can't swap slots after launch.")
Dim slot1 = FindMatchingSlot(slotQuery1)
Dim slot2 = FindMatchingSlot(slotQuery2)
@@ -544,13 +544,13 @@
SwapSlotContents(slot1, slot2)
RaiseEvent ChangedPublicState(Me)
End Sub
- Public Sub SwapSlotContents(ByVal slot1 As Slot, ByVal slot2 As Slot)
+ Public Sub SwapSlotContents(slot1 As Slot, slot2 As Slot)
_slots = _slots.WithSlotsUpdatedByIndex(slot1.With(contents:=slot2.Contents),
slot2.With(contents:=slot1.Contents))
RaiseEvent ChangedPublicState(Me)
End Sub
- Public Sub SetSlotColor(ByVal slotQuery As InvariantString, ByVal color As Protocol.PlayerColor)
+ Public Sub SetSlotColor(slotQuery As InvariantString, color As Protocol.PlayerColor)
If _settings.Map.UsesFixedPlayerSettings Then
Throw New InvalidOperationException("The map says that slot's color is locked.")
ElseIf Not AcceptingPlayers Then
@@ -567,14 +567,14 @@
RaiseEvent ChangedPublicState(Me)
End Sub
- Public Sub SetSlotRace(ByVal slotQuery As InvariantString, ByVal race As Protocol.Races)
+ Public Sub SetSlotRace(slotQuery As InvariantString, race As Protocol.Races)
ModifySlot(slotQuery, Function(slot)
If Not slot.RaceUnlocked Then Throw New InvalidOperationException("The map says that slot's race is locked.")
Return slot.With(race:=race)
End Function)
End Sub
- Public Sub SetSlotTeam(ByVal slotQuery As InvariantString, ByVal team As Byte)
+ Public Sub SetSlotTeam(slotQuery As InvariantString, team As Byte)
If _settings.Map.UsesCustomForces Then Throw New InvalidOperationException("The map says that all teams are locked.")
ModifySlot(slotQuery, Function(slot)
If slot.Team <> team AndAlso slot.Team = WC3.Slot.ObserverTeamIndex Then
@@ -586,15 +586,15 @@
End Function)
End Sub
- Public Sub SetSlotHandicap(ByVal slotQuery As InvariantString, ByVal handicap As Byte)
+ Public Sub SetSlotHandicap(slotQuery As InvariantString, handicap As Byte)
ModifySlot(slotQuery, Function(slot) slot.With(handicap:=handicap))
End Sub
- Public Sub SetSlotLocked(ByVal slotQuery As InvariantString, ByVal locked As Slot.LockState)
+ Public Sub SetSlotLocked(slotQuery As InvariantString, locked As Slot.LockState)
ModifySlot(slotQuery, Function(slot) slot.With(locked:=locked))
End Sub
- Public Sub SetAllSlotsLocked(ByVal locked As Slot.LockState)
+ Public Sub SetAllSlotsLocked(locked As Slot.LockState)
_slots = _slots.WithSlotsReplaced(From slot In _slots Select slot.With(locked:=locked))
End Sub
@@ -607,7 +607,7 @@
End Function
'''<summary>Opens slots, closes slots and moves players around to try to match the desired team sizes.</summary>
- Public Sub TrySetTeamSizes(ByVal desiredTeamSizes As IEnumerable(Of Integer))
+ Public Sub TrySetTeamSizes(desiredTeamSizes As IEnumerable(Of Integer))
Contract.Requires(desiredTeamSizes IsNot Nothing)
If Not AcceptingPlayers Then
Throw New InvalidOperationException("Can't change team sizes after launch.")
@@ -623,9 +623,9 @@
End Sub
<Pure()>
- Public Shared Function SetupTeamSizesMeleeForces(ByVal slotSet As SlotSet,
- ByVal desiredTeamSizes As IEnumerable(Of Integer),
- ByVal maxNonObserverSlots As Integer) As SlotSet
+ Public Shared Function SetupTeamSizesMeleeForces(slotSet As SlotSet,
+ desiredTeamSizes As IEnumerable(Of Integer),
+ maxNonObserverSlots As Integer) As SlotSet
Contract.Requires(slotSet IsNot Nothing)
Contract.Requires(desiredTeamSizes IsNot Nothing)
Contract.Requires(maxNonObserverSlots > 0)
@@ -659,8 +659,8 @@
Return slotSet.WithSlotsReplaced(assignedSlots).WithSlotsReplaced(closedSlots)
End Function
<Pure()>
- Public Shared Function SetupTeamSizesCustomForces(ByVal slotSet As SlotSet,
- ByVal desiredTeamSizes As IEnumerable(Of Integer)) As SlotSet
+ Public Shared Function SetupTeamSizesCustomForces(slotSet As SlotSet,
+ desiredTeamSizes As IEnumerable(Of Integer)) As SlotSet
Contract.Requires(slotSet IsNot Nothing)
Contract.Requires(desiredTeamSizes IsNot Nothing)
Contract.Ensures(Contract.Result(Of SlotSet)() IsNot Nothing)
@@ -713,8 +713,8 @@
End Function
'''<summary>Broadcasts a packet to all players. Requires a packer for the packet, and values matching the packer.</summary>
- Public Sub BroadcastPacket(ByVal packet As Protocol.Packet,
- Optional ByVal source As Player = Nothing)
+ Public Sub BroadcastPacket(packet As Protocol.Packet,
+ Optional source As Player = Nothing)
Contract.Requires(packet IsNot Nothing)
For Each player In From p In _kernel.Players
Where p IsNot source
@@ -724,9 +724,9 @@
End Sub
'''<summary>Sends text to all players. Uses spoof chat if necessary.</summary>
- Public Sub BroadcastMessage(ByVal message As String,
- Optional ByVal playerToAvoid As Player = Nothing,
- Optional ByVal messageType As LogMessageType = LogMessageType.Typical)
+ Public Sub BroadcastMessage(message As String,
+ Optional playerToAvoid As Player = Nothing,
+ Optional messageType As LogMessageType = LogMessageType.Typical)
Contract.Requires(message IsNot Nothing)
For Each player In From p In _kernel.Players
Where p IsNot playerToAvoid
@@ -736,9 +736,9 @@
End Sub
'''<summary>Sends text to the target player. Uses spoof chat if necessary.</summary>
- Public Sub SendMessageTo(ByVal message As String,
- ByVal player As Player,
- Optional ByVal display As Boolean = True)
+ Public Sub SendMessageTo(message As String,
+ player As Player,
+ Optional display As Boolean = True)
Contract.Requires(message IsNot Nothing)
Contract.Requires(player IsNot Nothing)
View
46 Warcraft3/Game/Game Motor.vb
@@ -8,7 +8,7 @@
End Get
End Property
- Public Sub New(ByVal length As UShort, ByVal startTime As Integer)
+ Public Sub New(length As UShort, startTime As Integer)
Me.length = length
Me.startTime = startTime
End Sub
@@ -31,12 +31,12 @@
Private _lagClock As RelativeClock
Private ReadOnly _init As New OnetimeLock
- Public Event ReceivedPlayerActions(ByVal sender As GameMotor, ByVal player As Player, ByVal actions As IRist(Of Protocol.GameAction))
- Public Event Tick(ByVal sender As GameMotor,
- ByVal timeSpan As UShort,
- ByVal actualActionStreaks As IRist(Of IRist(Of Protocol.SpecificPlayerActionSet)),
- ByVal visibleActionStreaks As IRist(Of IRist(Of Protocol.PlayerActionSet)))
- Public Event RemovePlayer(ByVal sender As GameMotor, ByVal player As Player, ByVal wasExpected As Boolean, ByVal reportedReason As Protocol.PlayerLeaveReason, ByVal reasonDescription As String)
+ Public Event ReceivedPlayerActions(sender As GameMotor, player As Player, actions As IRist(Of Protocol.GameAction))
+ Public Event Tick(sender As GameMotor,
+ timeSpan As UShort,
+ actualActionStreaks As IRist(Of IRist(Of Protocol.SpecificPlayerActionSet)),
+ visibleActionStreaks As IRist(Of IRist(Of Protocol.PlayerActionSet)))
+ Public Event RemovePlayer(sender As GameMotor, player As Player, wasExpected As Boolean, reportedReason As Protocol.PlayerLeaveReason, reasonDescription As String)
<ContractInvariantMethod()> Private Sub ObjectInvariant()
Contract.Invariant(_laggingPlayers IsNot Nothing)
@@ -50,11 +50,11 @@
Contract.Invariant(_actionsForNextTick IsNot Nothing)
End Sub
- Public Sub New(ByVal defaultSpeedFactor As Double,
- ByVal defaultTickPeriod As TimeSpan,
- ByVal defaultLagLimit As TimeSpan,
- ByVal kernel As GameKernel,
- ByVal lobby As GameLobby)
+ Public Sub New(defaultSpeedFactor As Double,
+ defaultTickPeriod As TimeSpan,
+ defaultLagLimit As TimeSpan,
+ kernel As GameKernel,
+ lobby As GameLobby)
Contract.Assume(defaultSpeedFactor > 0)
Contract.Assume(defaultTickPeriod.Ticks > 0)
Contract.Assume(defaultLagLimit.Ticks >= 0)
@@ -90,13 +90,13 @@
Public Function QueueStart() As Task
Return _kernel.InQueue.QueueAction(AddressOf Start)
End Function
- Protected Overrides Function PerformDispose(ByVal finalizing As Boolean) As Task
+ Protected Overrides Function PerformDispose(finalizing As Boolean) As Task
If finalizing Then Return Nothing
Return _kernel.InQueue.QueueAction(Sub() _tickClock = Nothing)
End Function
Private _asyncWaitTriggered As Boolean
- Private Sub OnReceiveGameActions(ByVal sender As Player, ByVal actions As IRist(Of Protocol.GameAction))
+ Private Sub OnReceiveGameActions(sender As Player, actions As IRist(Of Protocol.GameAction))
Contract.Requires(sender IsNot Nothing)
Contract.Requires(actions IsNot Nothing)
_actionsForNextTick.Add(New Protocol.SpecificPlayerActionSet(sender, actions))
@@ -111,7 +111,7 @@
End Sub
<CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId:="sender")>
- Private Sub OnReceiveRequestDropLagger(ByVal sender As Player)
+ Private Sub OnReceiveRequestDropLagger(sender As Player)
Contract.Requires(sender IsNot Nothing)
For Each player In _laggingPlayers
Contract.Assume(player IsNot Nothing)
@@ -119,7 +119,7 @@
Next player
End Sub
- Private Function BroadcastPacket(ByVal packet As Protocol.Packet) As Task
+ Private Function BroadcastPacket(packet As Protocol.Packet) As Task
Contract.Requires(packet IsNot Nothing)
Contract.Ensures(Contract.Result(Of Task)() IsNot Nothing)
Return (From player In _kernel.Players Select player.QueueSendPacket(packet)).AsAggregateTask
@@ -185,9 +185,9 @@
End Sub
<CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2208:InstantiateArgumentExceptionsCorrectly", justification:="The analyzer doesn't see the maxDataSize parameter from within the lambda.")>
- Private Function SplitSequenceByDataSize(Of TValue)(ByVal sequence As IEnumerable(Of TValue),
- ByVal measure As Func(Of TValue, Int32),
- ByVal maxDataSize As Int32) As IRist(Of IRist(Of TValue))
+ Private Function SplitSequenceByDataSize(Of TValue)(sequence As IEnumerable(Of TValue),
+ measure As Func(Of TValue, Int32),
+ maxDataSize As Int32) As IRist(Of IRist(Of TValue))
Contract.Requires(sequence IsNot Nothing)
Contract.Requires(maxDataSize > 0)
Contract.Requires(measure IsNot Nothing)
@@ -215,7 +215,7 @@
Select subSequence.ToRist
).ToRist
End Function
- Private Sub SendQueuedGameData(ByVal record As TickRecord)
+ Private Sub SendQueuedGameData(record As TickRecord)
Contract.Requires(record IsNot Nothing)
'Include all the data we can fit in a packet
Dim totalDataLength = 0
@@ -256,17 +256,17 @@
Return _kernel.InQueue.QueueFunc(Function() _lagLimit)
End Function
- Public Function QueueSetTickPeriod(ByVal value As TimeSpan) As Task
+ Public Function QueueSetTickPeriod(value As TimeSpan) As Task
Contract.Requires(value.Ticks > 0)
Contract.Ensures(Contract.Result(Of Task)() IsNot Nothing)
Return _kernel.InQueue.QueueAction(Sub() _tickPeriod = value)
End Function
- Public Function QueueSetSpeedFactor(ByVal value As Double) As Task
+ Public Function QueueSetSpeedFactor(value As Double) As Task
Contract.Requires(value > 0)
Contract.Ensures(Contract.Result(Of Task)() IsNot Nothing)
Return _kernel.InQueue.QueueAction(Sub() _speedFactor = value)
End Function
- Public Function QueueSetLagLimit(ByVal value As TimeSpan) As Task
+ Public Function QueueSetLagLimit(value As TimeSpan) As Task
Contract.Requires(value.Ticks >= 0)
Contract.Ensures(Contract.Result(Of Task)() IsNot Nothing)
Return _kernel.InQueue.QueueAction(Sub() _lagLimit = value)
View
8 Warcraft3/Game/GameLoggerControl.vb
@@ -6,7 +6,7 @@ Namespace WC3
Public Class GameLoggerControl
Private WithEvents game As WC3.Game
Private actionMode As CallbackMode = CallbackMode.Off
- Public Sub SetGame(ByVal game As WC3.Game)
+ Public Sub SetGame(game As WC3.Game)
SyncLock lock
If Me.game Is game Then Return
Me.game = game
@@ -24,9 +24,9 @@ Namespace WC3
End Select
End Sub
- Private Sub OnPlayerAction(ByVal sender As WC3.Game,
- ByVal player As WC3.Player,
- ByVal actions As IRist(Of WC3.Protocol.GameAction)) Handles game.ReceivedPlayerActions
+ Private Sub OnPlayerAction(sender As WC3.Game,
+ player As WC3.Player,
+ actions As IRist(Of WC3.Protocol.GameAction)) Handles game.ReceivedPlayerActions
Dim mode = actionMode
If mode = CallbackMode.Off Then Return
For Each action In actions
View
168 Warcraft3/Game/W3Game.vb
@@ -39,28 +39,28 @@ Namespace WC3
Private _adminPlayer As Player
Private _flagHasPlayerLeft As Boolean
- Public Event Tick(ByVal sender As Game,
- ByVal timeSpan As UShort,
- ByVal actualActionStreaks As IRist(Of IRist(Of Protocol.SpecificPlayerActionSet)),
- ByVal visibleActionStreaks As IRist(Of IRist(Of Protocol.PlayerActionSet)))
- Public Event Updated(ByVal sender As Game,
- ByVal slots As SlotSet)
- Public Event PlayerLeft(ByVal sender As Game,
- ByVal state As GameState,
- ByVal leaver As Player,
- ByVal reportedReason As Protocol.PlayerLeaveReason,
- ByVal reasonDescription As String)
- Public Event ChangedState(ByVal sender As Game,
- ByVal oldState As GameState,
- ByVal newState As GameState)
- Public Event PlayerTalked(ByVal sender As Game,
- ByVal speaker As Player,
- ByVal text As String,
- ByVal receivingGroup As Protocol.ChatGroup?)
- Public Event RecordGameStarted(ByVal sender As Game)
- Public Event ReceivedPlayerActions(ByVal sender As Game,
- ByVal player As Player,
- ByVal actions As IRist(Of Protocol.GameAction))
+ Public Event Tick(sender As Game,
+ timeSpan As UShort,
+ actualActionStreaks As IRist(Of IRist(Of Protocol.SpecificPlayerActionSet)),
+ visibleActionStreaks As IRist(Of IRist(Of Protocol.PlayerActionSet)))
+ Public Event Updated(sender As Game,
+ slots As SlotSet)
+ Public Event PlayerLeft(sender As Game,
+ state As GameState,
+ leaver As Player,
+ reportedReason As Protocol.PlayerLeaveReason,
+ reasonDescription As String)
+ Public Event ChangedState(sender As Game,
+ oldState As GameState,
+ newState As GameState)
+ Public Event PlayerTalked(sender As Game,
+ speaker As Player,
+ text As String,
+ receivingGroup As Protocol.ChatGroup?)
+ Public Event RecordGameStarted(sender As Game)
+ Public Event ReceivedPlayerActions(sender As Game,
+ player As Player,
+ actions As IRist(Of Protocol.GameAction))
<ContractInvariantMethod()> Private Sub ObjectInvariant()
Contract.Invariant(_kernel IsNot Nothing)
@@ -73,12 +73,12 @@ Namespace WC3
Contract.Invariant(_slotStateUpdateThrottle IsNot Nothing)
End Sub
- Public Sub New(ByVal name As InvariantString,
- ByVal settings As GameSettings,
- ByVal lobby As GameLobby,
- ByVal motor As GameMotor,
- ByVal loadScreen As GameLoadScreen,
- ByVal kernel As GameKernel)
+ Public Sub New(name As InvariantString,
+ settings As GameSettings,
+ lobby As GameLobby,
+ motor As GameMotor,
+ loadScreen As GameLoadScreen,
+ kernel As GameKernel)
Contract.Assume(settings IsNot Nothing)
Contract.Assume(lobby IsNot Nothing)
Contract.Assume(motor IsNot Nothing)
@@ -92,10 +92,10 @@ Namespace WC3
Me._loadScreen = loadScreen
End Sub
- Public Shared Function FromSettings(ByVal settings As GameSettings,
- ByVal name As InvariantString,
- ByVal clock As IClock,
- ByVal logger As Logger) As Game
+ Public Shared Function FromSettings(settings As GameSettings,
+ name As InvariantString,
+ clock As IClock,
+ logger As Logger) As Game
Contract.Requires(clock IsNot Nothing)
Contract.Requires(settings IsNot Nothing)
Contract.Requires(logger IsNot Nothing)
@@ -199,7 +199,7 @@ Namespace WC3
AddHandler _motor.ReceivedPlayerActions, Sub(sender, player, actions) _kernel.OutQueue.QueueAction(Sub() RaiseEvent ReceivedPlayerActions(Me, player, actions))
End Sub
- Protected Overrides Function PerformDispose(ByVal finalizing As Boolean) As Task
+ Protected Overrides Function PerformDispose(finalizing As Boolean) As Task
If finalizing Then Return Nothing
Return _kernel.OutQueue.QueueAction(Sub() _kernel.InQueue.QueueAction(
Sub()
@@ -245,9 +245,9 @@ Namespace WC3
Return _kernel.InQueue.QueueAction(AddressOf ThrowUpdated)
End Function
- Private Function CommandProcessText(ByVal manager As GameManager,
- ByVal player As Player,
- ByVal argument As String) As Task(Of String)
+ Private Function CommandProcessText(manager As GameManager,
+ player As Player,
+ argument As String) As Task(Of String)
Contract.Requires(manager IsNot Nothing)
Contract.Requires(argument IsNot Nothing)
@@ -275,9 +275,9 @@ Namespace WC3
Dim user = If(player Is Nothing, Nothing, New BotUser(player.Name))
Return commands.Invoke(manager, user, argument)
End Function
- Public Function QueueCommandProcessText(ByVal manager As GameManager,
- ByVal player As Player,
- ByVal argument As String) As Task(Of String)
+ Public Function QueueCommandProcessText(manager As GameManager,
+ player As Player,
+ argument As String) As Task(Of String)
Contract.Requires(manager IsNot Nothing)
Contract.Requires(argument IsNot Nothing)
Contract.Ensures(Contract.Result(Of Task(Of String))() IsNot Nothing)
@@ -301,24 +301,24 @@ Namespace WC3
Return _kernel.InQueue.QueueFunc(Function() _kernel.State)
End Function
- Public Function QueueBroadcastMessage(ByVal message As String) As Task
+ Public Function QueueBroadcastMessage(message As String) As Task
Contract.Requires(message IsNot Nothing)
Contract.Ensures(Contract.Result(Of Task)() IsNot Nothing)
Return _kernel.InQueue.QueueAction(Sub() _lobby.BroadcastMessage(message))
End Function
- Public Function QueueSendMessageTo(ByVal message As String, ByVal player As Player) As Task
+ Public Function QueueSendMessageTo(message As String, player As Player) As Task
Contract.Requires(message IsNot Nothing)
Contract.Requires(player IsNot Nothing)
Contract.Ensures(Contract.Result(Of Task)() IsNot Nothing)
Return _kernel.InQueue.QueueAction(Sub() _lobby.SendMessageTo(message, player))
End Function
- Private Sub OnReceiveChat(ByVal sender As Player,
- ByVal text As String,
- ByVal type As Protocol.ChatType,
- ByVal receivingGroup As Protocol.ChatGroup?,
- ByVal requestedReceivers As IRist(Of PlayerId))
+ Private Sub OnReceiveChat(sender As Player,
+ text As String,
+ type As Protocol.ChatType,
+ receivingGroup As Protocol.ChatGroup?,
+ requestedReceivers As IRist(Of PlayerId))
Contract.Requires(sender IsNot Nothing)
Contract.Requires(text IsNot Nothing)
Contract.Requires(requestedReceivers IsNot Nothing)
@@ -346,7 +346,7 @@ Namespace WC3
End If
Next receiver
End Sub
- Private Sub OnReceiveNonGameAction(ByVal sender As Player, ByVal vals As NamedValueMap)
+ Private Sub OnReceiveNonGameAction(sender As Player, vals As NamedValueMap)
Contract.Requires(sender IsNot Nothing)
Contract.Requires(vals IsNot Nothing)
@@ -388,10 +388,10 @@ Namespace WC3
#Region "Players"
'''<summary>Removes the given player from the instance</summary>
- Private Sub RemovePlayer(ByVal player As Player,
- ByVal wasExpected As Boolean,
- ByVal reportedReason As Protocol.PlayerLeaveReason,
- ByVal reasonDescription As String)
+ Private Sub RemovePlayer(player As Player,
+ wasExpected As Boolean,
+ reportedReason As Protocol.PlayerLeaveReason,
+ reasonDescription As String)
Contract.Requires(player IsNot Nothing)
Contract.Requires(reasonDescription IsNot Nothing)
If Not _kernel.Players.Contains(player) Then
@@ -445,8 +445,8 @@ Namespace WC3
End If
End Sub
- Private Sub ElevatePlayer(ByVal name As InvariantString,
- Optional ByVal password As String = Nothing)
+ Private Sub ElevatePlayer(name As InvariantString,
+ Optional password As String = Nothing)
Dim player = TryFindPlayer(name)
If player Is Nothing Then Throw New InvalidOperationException("No player found with the name '{0}'.".Frmt(name))
If _adminPlayer IsNot Nothing Then Throw New InvalidOperationException("A player is already the admin.")
@@ -461,25 +461,25 @@ Namespace WC3
_adminPlayer = player
_lobby.SendMessageTo("You are now the admin.", player)
End Sub
- Public Function QueueElevatePlayer(ByVal name As InvariantString,
- Optional ByVal password As String = Nothing) As Task
+ Public Function QueueElevatePlayer(name As InvariantString,
+ Optional password As String = Nothing) As Task
Contract.Ensures(Contract.Result(Of Task)() IsNot Nothing)
Return _kernel.InQueue.QueueAction(Sub() ElevatePlayer(name, password))
End Function
- Private Function TryFindPlayer(ByVal id As PlayerId) As Player
+ Private Function TryFindPlayer(id As PlayerId) As Player
Return (From player In _kernel.Players Where player.Id = id).FirstOrDefault
End Function
- Private Function TryFindPlayer(ByVal userName As InvariantString) As Player
+ Private Function TryFindPlayer(userName As InvariantString) As Player
Return (From player In _kernel.Players Where player.Name = userName).FirstOrDefault
End Function
- Public Function QueueTryFindPlayer(ByVal userName As InvariantString) As Task(Of Player)
+ Public Function QueueTryFindPlayer(userName As InvariantString) As Task(Of Player)
Contract.Ensures(Contract.Result(Of Task(Of Player))() IsNot Nothing)
Return _kernel.InQueue.QueueFunc(Function() TryFindPlayer(userName))
End Function
'''<summary>Boots players in the slot with the given index.</summary>
- Private Sub Boot(ByVal slotQuery As InvariantString, ByVal shouldCloseEmptiedSlot As Boolean)
+ Private Sub Boot(slotQuery As InvariantString, shouldCloseEmptiedSlot As Boolean)
Dim slot = _lobby.FindMatchingSlot(slotQuery)
If Not slot.Contents.EnumPlayers.Any Then
Throw New InvalidOperationException("There is no player to boot in slot '{0}'.".Frmt(slotQuery))
@@ -502,14 +502,14 @@ Namespace WC3
_lobby.ThrowChangedPublicState()
End If
End Sub
- Public Function QueueBoot(ByVal slotQuery As InvariantString, ByVal shouldCloseEmptiedSlot As Boolean) As Task
+ Public Function QueueBoot(slotQuery As InvariantString, shouldCloseEmptiedSlot As Boolean) As Task
Contract.Ensures(Contract.Result(Of Task)() IsNot Nothing)
Return _kernel.InQueue.QueueAction(Sub() Boot(slotQuery, shouldCloseEmptiedSlot))
End Function
#End Region
- Public Function ObservePlayers(ByVal adder As Action(Of Player),
- ByVal remover As Action(Of Player)) As Task(Of IDisposable)
+ Public Function ObservePlayers(adder As Action(Of Player),
+ remover As Action(Of Player)) As Task(Of IDisposable)
Contract.Requires(adder IsNot Nothing)
Contract.Requires(remover IsNot Nothing)
Contract.Ensures(Contract.Result(Of Task(Of IDisposable))() IsNot Nothing)
@@ -612,7 +612,7 @@ Namespace WC3
#End Region
#Region "Lobby"
- Private Sub SetPlayerVoteToStart(ByVal name As InvariantString, ByVal val As Boolean)
+ Private Sub SetPlayerVoteToStart(name As InvariantString, val As Boolean)
If Not Settings.IsAutoStarted Then Throw New InvalidOperationException("Game is not set to start automatically.")
Dim p = TryFindPlayer(name)
If p Is Nothing Then Throw New InvalidOperationException("No player found with the name '{0}'.".Frmt(name))
@@ -625,8 +625,8 @@ Namespace WC3
TryStartCountdown()
End If
End Sub
- Public Function QueueSetPlayerVoteToStart(ByVal name As InvariantString,
- ByVal wantsToStart As Boolean) As Task
+ Public Function QueueSetPlayerVoteToStart(name As InvariantString,
+ wantsToStart As Boolean) As Task
Contract.Ensures(Contract.Result(Of Task)() IsNot Nothing)
Return _kernel.InQueue.QueueAction(Sub() SetPlayerVoteToStart(name, wantsToStart))
End Function
@@ -636,20 +636,20 @@ Namespace WC3
Return _lobby.StartPlayerHoldPoint
End Get
End Property
- Public Function QueueAddPlayer(ByVal knockData As Protocol.KnockData,
- ByVal socket As W3Socket) As Task(Of Player)
+ Public Function QueueAddPlayer(knockData As Protocol.KnockData,
+ socket As W3Socket) As Task(Of Player)
Contract.Requires(knockData IsNot Nothing)
Contract.Requires(socket IsNot Nothing)
Contract.Ensures(Contract.Result(Of Task(Of Player))() IsNot Nothing)
Return _kernel.InQueue.QueueFunc(Function() _lobby.AddPlayer(knockData, socket))
End Function
- Public Function QueueSendMapPiece(ByVal player As Download.IPlayerDownloadAspect,
- ByVal position As UInt32) As Task
+ Public Function QueueSendMapPiece(player As Download.IPlayerDownloadAspect,
+ position As UInt32) As Task
Return _kernel.InQueue.QueueFunc(Function() _lobby.SendMapPiece(player, position)).Unwrap
End Function
'''<summary>Broadcasts new game state to players, and throws the updated event.</summary>
- Private Sub SendLobbyState(ByVal randomSeed As UInt32)
+ Private Sub SendLobbyState(randomSeed As UInt32)
If _kernel.State >= GameState.Loading Then Return
For Each player In _kernel.Players
@@ -663,55 +663,55 @@ Namespace WC3
TryBeginAutoStart()
End Sub
- Public Function QueueTrySetTeamSizes(ByVal sizes As IRist(Of Integer)) As Task
+ Public Function QueueTrySetTeamSizes(sizes As IRist(Of Integer)) As Task
Contract.Requires(sizes IsNot Nothing)
Contract.Ensures(Contract.Result(Of Task)() IsNot Nothing)
Return _kernel.InQueue.QueueAction(Sub() _lobby.TrySetTeamSizes(sizes))
End Function
- Public Function QueueOpenSlot(ByVal slotQuery As InvariantString) As Task
+ Public Function QueueOpenSlot(slotQuery As InvariantString) As Task
Contract.Ensures(Contract.Result(Of Task)() IsNot Nothing)
Return _kernel.InQueue.QueueAction(Sub() _lobby.OpenSlot(slotQuery))
End Function
- Public Function QueueSetSlotCpu(ByVal slotQuery As InvariantString, ByVal newCpuLevel As Protocol.ComputerLevel) As Task
+ Public Function QueueSetSlotCpu(slotQuery As InvariantString, newCpuLevel As Protocol.ComputerLevel) As Task
Contract.Ensures(Contract.Result(Of Task)() IsNot Nothing)
Return _kernel.InQueue.QueueAction(Sub() _lobby.ComputerizeSlot(slotQuery, newCpuLevel))
End Function
- Public Function QueueCloseSlot(ByVal slotQuery As InvariantString) As Task
+ Public Function QueueCloseSlot(slotQuery As InvariantString) As Task
Contract.Ensures(Contract.Result(Of Task)() IsNot Nothing)
Return _kernel.InQueue.QueueAction(Sub() _lobby.CloseSlot(slotQuery))
End Function
- Public Function QueueReserveSlot(ByVal userName As InvariantString,
- Optional ByVal slotQuery As InvariantString? = Nothing) As Task
+ Public Function QueueReserveSlot(userName As InvariantString,
+ Optional slotQuery As InvariantString? = Nothing) As Task
Contract.Ensures(Contract.Result(Of Task)() IsNot Nothing)
Return _kernel.InQueue.QueueAction(Sub() _lobby.ReserveSlot(userName, slotQuery))
End Function
- Public Function QueueSwapSlotContents(ByVal slotQuery1 As InvariantString,
- ByVal slotQuery2 As InvariantString) As Task
+ Public Function QueueSwapSlotContents(slotQuery1 As InvariantString,
+ slotQuery2 As InvariantString) As Task
Contract.Ensures(Contract.Result(Of Task)() IsNot Nothing)
Return _kernel.InQueue.QueueAction(Sub() _lobby.SwapSlotContents(slotQuery1, slotQuery2))
End Function
- Public Function QueueSetSlotColor(ByVal slotQuery As InvariantString, ByVal newColor As Protocol.PlayerColor) As Task
+ Public Function QueueSetSlotColor(slotQuery As InvariantString, newColor As Protocol.PlayerColor) As Task
Contract.Ensures(Contract.Result(Of Task)() IsNot Nothing)
Return _kernel.InQueue.QueueAction(Sub() _lobby.SetSlotColor(slotQuery, newColor))
End Function
- Public Function QueueSetSlotRace(ByVal slotQuery As InvariantString, ByVal newRace As Protocol.Races) As Task
+ Public Function QueueSetSlotRace(slotQuery As InvariantString, newRace As Protocol.Races) As Task
Contract.Ensures(Contract.Result(Of Task)() IsNot Nothing)
Return _kernel.InQueue.QueueAction(Sub() _lobby.SetSlotRace(slotQuery, newRace))
End Function
- Public Function QueueSetSlotTeam(ByVal slotQuery As InvariantString, ByVal newTeam As Byte) As Task
+ Public Function QueueSetSlotTeam(slotQuery As InvariantString, newTeam As Byte) As Task
Contract.Ensures(Contract.Result(Of Task)() IsNot Nothing)
Return _kernel.InQueue.QueueAction(Sub() _lobby.SetSlotTeam(slotQuery, newTeam))
End Function
- Public Function QueueSetSlotHandicap(ByVal slotQuery As InvariantString, ByVal newHandicap As Byte) As Task
+ Public Function QueueSetSlotHandicap(slotQuery As InvariantString, newHandicap As Byte) As Task
Contract.Ensures(Contract.Result(Of Task)() IsNot Nothing)
Return _kernel.InQueue.QueueAction(Sub() _lobby.SetSlotHandicap(slotQuery, newHandicap))
End Function
- Public Function QueueSetSlotLocked(ByVal slotQuery As InvariantString, ByVal newLockState As Slot.LockState) As Task
+ Public Function QueueSetSlotLocked(slotQuery As InvariantString, newLockState As Slot.LockState) As Task
Contract.Ensures(Contract.Result(Of Task)() IsNot Nothing)
Return _kernel.InQueue.QueueAction(Sub() _lobby.SetSlotLocked(slotQuery, newLockState))
End Function
- Public Function QueueSetAllSlotsLocked(ByVal newLockState As Slot.LockState) As Task
+ Public Function QueueSetAllSlotsLocked(newLockState As Slot.LockState) As Task
Contract.Ensures(Contract.Result(Of Task)() IsNot Nothing)
Return _kernel.InQueue.QueueAction(Sub() _lobby.SetAllSlotsLocked(newLockState))
End Function
View
8 Warcraft3/Game/W3GameControl.vb
@@ -20,12 +20,12 @@ Namespace WC3
hook.Dispose()
Next hook
End Sub
- Private Sub OnCommand(ByVal sender As CommandControl, ByVal argument As String) Handles comGame.IssuedCommand
+ Private Sub OnCommand(sender As CommandControl, argument As String) Handles comGame.IssuedCommand
Contract.Requires(argument IsNot Nothing)
Tinker.Components.UIInvokeCommand(_manager, argument)
End Sub
- Public Sub New(ByVal manager As WC3.GameManager)
+ Public Sub New(manager As WC3.GameManager)
Contract.Assert(manager IsNot Nothing)
InitializeComponent()
@@ -39,7 +39,7 @@ Namespace WC3
_game.QueueThrowUpdated()
End Sub
- Private Sub txtInput_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtInput.KeyPress
+ Private Sub txtInput_KeyPress(sender As Object, e As System.Windows.Forms.KeyPressEventArgs) Handles txtInput.KeyPress
If e.KeyChar <> Microsoft.VisualBasic.ChrW(Keys.Enter) Then Return
If txtInput.Text = "" Then Return
_game.QueueBroadcastMessage(txtInput.Text)
@@ -47,7 +47,7 @@ Namespace WC3
e.Handled = True
End Sub
- Private Sub OnGameUpdated(ByVal sender As WC3.Game, ByVal slots As SlotSet)
+ Private Sub OnGameUpdated(sender As WC3.Game, slots As SlotSet)
Contract.Requires(sender IsNot Nothing)
Contract.Requires(slots IsNot Nothing)
Dim descriptions = (From slot In slots Select slot.AsyncGenerateDescription).ToArray
View
16 Warcraft3/Game/WC3GameManager.vb
@@ -19,9 +19,9 @@ Namespace WC3
Contract.Invariant(_control IsNot Nothing)
End Sub
- Public Sub New(ByVal name As InvariantString,
- ByVal bot As Bot.MainBot,
- ByVal game As WC3.Game)
+ Public Sub New(name As InvariantString,
+ bot As Bot.MainBot,
+ game As WC3.Game)
Contract.Requires(bot IsNot Nothing)
Contract.Requires(game IsNot Nothing)
@@ -35,7 +35,7 @@ Namespace WC3
game.ChainEventualDisposalTo(Me)
End Sub
- Private Async Sub HandleText(ByVal player As WC3.Player, ByVal text As String)
+ Private Async Sub HandleText(player As WC3.Player, text As String)
Contract.Assume(player IsNot Nothing)
Contract.Assume(text IsNot Nothing)
@@ -99,7 +99,7 @@ Namespace WC3
Return True
End Get
End Property
- Public Function IsArgumentPrivate(ByVal argument As String) As Boolean Implements IBotComponent.IsArgumentPrivate
+ Public Function IsArgumentPrivate(argument As String) As Boolean Implements IBotComponent.IsArgumentPrivate
Return False
End Function
Public ReadOnly Property Control As Control Implements IBotComponent.Control
@@ -108,17 +108,17 @@ Namespace WC3
End Get
End Property
- Public Function InvokeCommand(ByVal user As BotUser, ByVal argument As String) As Task(Of String) Implements IBotComponent.InvokeCommand
+ Public Function InvokeCommand(user As BotUser, argument As String) As Task(Of String) Implements IBotComponent.InvokeCommand
Return Game.QueueCommandProcessText(Me, Nothing, argument)
End Function
- Protected Overrides Function PerformDispose(ByVal finalizing As Boolean) As Task
+ Protected Overrides Function PerformDispose(finalizing As Boolean) As Task
_game.Dispose()
_control.DisposeControlAsync()
Return _hooks.DisposeAllAsync()
End Function
- Private Function IncludeCommandImpl(ByVal command As ICommand(Of IBotComponent)) As Task(Of IDisposable) Implements IBotComponent.IncludeCommand
+ Private Function IncludeCommandImpl(command As ICommand(Of IBotComponent)) As Task(Of IDisposable) Implements IBotComponent.IncludeCommand
Throw New NotImplementedException("Game commands are admin/lobby/loading/etc specific.")
End Function
End Class
View
10 Warcraft3/Pinger.vb
@@ -9,8 +9,8 @@
Private ReadOnly _clock As IClock
Private ReadOnly _ticker As IDisposable
- Public Event SendPing(ByVal sender As Pinger, ByVal salt As UInteger)
- Public Event Timeout(ByVal sender As Pinger)
+ Public Event SendPing(sender As Pinger, salt As UInteger)
+ Public Event Timeout(sender As Pinger)
<ContractInvariantMethod()>
Private Sub ObjectInvariant()
@@ -23,7 +23,7 @@
Contract.Invariant(_timeoutCount > 0)
End Sub
- Public Sub New(ByVal period As TimeSpan, ByVal timeoutCount As Integer, ByVal clock As IClock)
+ Public Sub New(period As TimeSpan, timeoutCount As Integer, clock As IClock)
Contract.Assume(period.Ticks > 0)
Contract.Assume(timeoutCount > 0)
Contract.Assume(clock IsNot Nothing)
@@ -47,7 +47,7 @@
End If
End Sub
- Private Sub ReceivedPong(ByVal salt As UInteger)
+ Private Sub ReceivedPong(salt As UInteger)
If _pingQueue.Count <= 0 Then
Throw New InvalidOperationException("Pong received before ping sent.")
End If
@@ -65,7 +65,7 @@
_latency += lambda * stored.Item2.ElapsedTime.TotalMilliseconds
If _latency <= 0 Then _latency = Double.Epsilon
End Sub
- Public Function QueueReceivedPong(ByVal salt As UInteger) As Task
+ Public Function QueueReceivedPong(salt As UInteger) As Task
Contract.Ensures(Contract.Result(Of Task)() IsNot Nothing)
Return inQueue.QueueAction(Sub() ReceivedPong(salt))
End Function
View
16 Warcraft3/Player/PlayerId.vb
@@ -14,7 +14,7 @@ Namespace WC3
End Sub
<CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2233:OperationsShouldNotOverflow", MessageId:="index-1")>
- Public Sub New(ByVal index As Byte)
+ Public Sub New(index As Byte)
Contract.Requires(index > 0)
Contract.Requires(index <= 12)
Me._index = index - CByte(1)
@@ -28,21 +28,21 @@ Namespace WC3
End Get
End Property
- Public Shared Operator =(ByVal value1 As PlayerId, ByVal value2 As PlayerId) As Boolean
+ Public Shared Operator =(value1 As PlayerId, value2 As PlayerId) As Boolean
Return value1._index = value2._index
End Operator
- Public Shared Operator <>(ByVal value1 As PlayerId, ByVal value2 As PlayerId) As Boolean
+ Public Shared Operator <>(value1 As PlayerId, value2 As PlayerId) As Boolean
Return Not value1 = value2
End Operator
Public Overrides Function GetHashCode() As Integer
Return _index.GetHashCode
End Function
- Public Overrides Function Equals(ByVal obj As Object) As Boolean
+ Public Overrides Function Equals(obj As Object) As Boolean
If Not TypeOf obj Is PlayerId Then Return False
Return Me = DirectCast(obj, PlayerId)
End Function
- Public Overloads Function Equals(ByVal other As PlayerId) As Boolean Implements IEquatable(Of PlayerId).Equals
+ Public Overloads Function Equals(other As PlayerId) As Boolean Implements IEquatable(Of PlayerId).Equals
Return Me = other
End Function
@@ -54,17 +54,17 @@ Namespace WC3
Public Class PlayerIdJar
Inherits BaseJar(Of PlayerId)
- Public Overrides Function Pack(ByVal value As PlayerId) As IRist(Of Byte)
+ Public Overrides Function Pack(value As PlayerId) As IRist(Of Byte)
Return MakeRist(value.Index)
End Function
- Public Overrides Function Parse(ByVal data As IRist(Of Byte)) As ParsedValue(Of PlayerId)
+ Public Overrides Function Parse(data As IRist(Of Byte)) As ParsedValue(Of PlayerId)
If data.Count < 1 Then Throw New PicklingNotEnoughDataException("A PlayerId requires 1 byte.")
If data.First < 1 OrElse data.First > 12 Then Throw New PicklingException("Invalid player id: {0}".Frmt(data.First))
Return New PlayerId(data.First).ParsedWithDataCount(1)
End Function
<SuppressMessage("Microsoft.Contracts", "Ensures-28-100")>
- Public Overrides Function Parse(ByVal text As String) As PlayerId
+ Public Overrides Function Parse(text As String) As PlayerId
Dim index As Byte
If text.StartsWith("pid", StringComparison.Ordinal) Then
index = Byte.Parse(text.Substring(3), NumberStyles.Integer, CultureInfo.InvariantCulture)
View
104 Warcraft3/Player/W3Player.vb
@@ -45,9 +45,9 @@ Namespace WC3
Public Property HasVotedToStart As Boolean
Public Property AdminAttemptCount As Integer
- Public Event SuperficialStateUpdated(ByVal sender As Player)
- Public Event StateUpdated(ByVal sender As Player)
- Public Event Disconnected(ByVal sender As Player, ByVal expected As Boolean, ByVal reportedReason As Protocol.PlayerLeaveReason, ByVal reasonDescription As String)
+ Public Event SuperficialStateUpdated(sender As Player)
+ Public Event StateUpdated(sender As Player)
+ Public Event Disconnected(sender As Player, expected As Boolean, reportedReason As Protocol.PlayerLeaveReason, reasonDescription As String)
<ContractInvariantMethod()> Private Sub ObjectInvariant()
Contract.Invariant(_logger IsNot Nothing)
@@ -68,21 +68,21 @@ Namespace WC3
Contract.Invariant(_numPeerConnections <= 12)
End Sub
- Public Sub New(ByVal id As PlayerId,
- ByVal name As InvariantString,
- ByVal isFake As Boolean,
- ByVal logger As Logger,
- ByVal peerKey As UInt32,
- ByVal peerData As IRist(Of Byte),
- ByVal packetHandlerLogger As PacketHandlerLogger(Of Protocol.PacketId),
- ByVal listenEndPoint As Net.IPEndPoint,
- ByVal taskTestCanHost As Task,
- Optional ByVal pinger As Pinger = Nothing,
- Optional ByVal socket As W3Socket = Nothing,
- Optional ByVal initialState As PlayerState = PlayerState.Lobby,
- Optional ByVal downloadManager As Download.Manager = Nothing,
- Optional ByVal inQueue As CallQueue = Nothing,
- Optional ByVal outQueue As CallQueue = Nothing)
+ Public Sub New(id As PlayerId,
+ name As InvariantString,
+ isFake As Boolean,
+ logger As Logger,
+ peerKey As UInt32,
+ peerData As IRist(Of Byte),
+ packetHandlerLogger As PacketHandlerLogger(Of Protocol.PacketId),
+ listenEndPoint As Net.IPEndPoint,
+ taskTestCanHost As Task,
+ Optional pinger As Pinger = Nothing,
+ Optional socket As W3Socket = Nothing,
+ Optional initialState As PlayerState = PlayerState.Lobby,
+ Optional downloadManager As Download.Manager = Nothing,
+ Optional inQueue As CallQueue = Nothing,
+ Optional outQueue As CallQueue = Nothing)
Contract.Requires(packetHandlerLogger IsNot Nothing)
Contract.Requires(peerData IsNot Nothing)
Contract.Requires(listenEndPoint IsNot Nothing)
@@ -108,9 +108,9 @@ Namespace WC3
Me._outQueue = If(outQueue, MakeTaskedCallQueue)
End Sub
- Public Shared Function MakeFake(ByVal id As PlayerId,
- ByVal name As InvariantString,
- ByVal logger As Logger) As Player
+ Public Shared Function MakeFake(id As PlayerId,
+ name As InvariantString,
+ logger As Logger) As Player
Contract.Requires(logger IsNot Nothing)
Contract.Ensures(Contract.Result(Of Player)() IsNot Nothing)
@@ -132,12 +132,12 @@ Namespace WC3
Return player
End Function