Attribute VB_Name = "StartUp"
Option Explicit

Public Sub Main()
    Randomize Timer

    'Fill some arrays with useful indices

    ShipTypes(0) = "Warbird"
    ShipTypes(1) = "Javelin"
    ShipTypes(2) = "Spider"
    ShipTypes(3) = "Leviathan"
    ShipTypes(4) = "Terrier"
    ShipTypes(5) = "Weasel"
    ShipTypes(6) = "Lancaster"
    ShipTypes(7) = "Shark"
    ShipTypes(8) = "Spectator"

    'Load winsock library

    StartWinsock
    UDPMySock = UDPMakeSocket(0)

    'Pass control to MainFrm

    MainFrm.Show: SetState LOGIN_WINDOW
End Sub

Public Sub ShutDown()
    'Close virtual server connection

    If Connected = True Then
        LeaveArena
        LeaveServer
    End If

    'Close server connection

    Call UDPDestroySocket(UDPMySock)
    Call EndWinsock

    End
End Sub
