-
Notifications
You must be signed in to change notification settings - Fork 0
/
Main.vb
52 lines (42 loc) · 1.55 KB
/
Main.vb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
Imports System.IO
Imports System.Reflection
Imports TaleWorlds.CampaignSystem
Imports TaleWorlds.Core
Imports TaleWorlds.MountAndBlade
Namespace Global.VBWebsocketServer
Public Class Main
Inherits MBSubModuleBase
Dim webServer As Webserver
Dim webSocket As Websocket
Protected Overrides Sub OnSubModuleLoad()
MyBase.OnSubModuleLoad()
webServer = New Webserver()
webSocket = New Websocket()
End Sub
Protected Overrides Sub OnGameStart(game As Game, gameStarterObject As IGameStarter)
Dim campaign = game.GameType
If (campaign Is Nothing) Then
Debug.WriteLine("oops!")
Exit Sub
End If
Dim campaignStarter = CType(gameStarterObject, CampaignGameStarter)
AddBehaviour(campaignStarter)
webSocket.Start()
End Sub
Public Overrides Sub OnGameEnd(game As Game)
MyBase.OnGameEnd(game)
webSocket.Stop()
End Sub
Private Sub AddBehaviour(gameInit As CampaignGameStarter)
'gameInit.AddBehavior(New SimpleDayCounter)
End Sub
Protected Overrides Sub OnApplicationTick(dt As Single)
MyBase.OnApplicationTick(dt)
End Sub
Protected Overrides Sub OnBeforeInitialModuleScreenSetAsRoot()
MyBase.OnBeforeInitialModuleScreenSetAsRoot()
Dim location = GetMyLocation()
MessageBox("my dll is located at", location)
End Sub
End Class
End Namespace