⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 modsettings.vb.svn-base

📁 MirUnleashed vb.net Module modMainServer Public WithEvents Socket As New WinsockServer Pub
💻 SVN-BASE
字号:
Module modSettings
    Public Class Settings
        Public ServerName As String = "Test"

        Public GameIP As String = "127.0.0.1"
        Public GamePort As Integer = 7200

        Public SQLLogin As String
        Public SQLPass As String
        Public SQLIP As String

        Public EnableLogging As Boolean
        Public LogDir As String
        Public ClientVersion As Long

        Public MapFolder As String = "Maps\"
        Public NpcFolder As String = "Npcs\"
        Public DropItemsFolder As String = "Drops\"
        Public GuildFolder As String = "Guilds\"

        Public StartMap As String = "0"
        Public StartX As Short = 332
        Public StartY As Short = 268

        Public StartGold As Long = 0

        Public StartItem1 As String = "Wooden Sword"
        Public StartItem2 As String = "Base Dress (M)"
        Public StartItem3 As String = "Base Dress (F)"
        Public StartItem4 As String = "Small Health Potion"
        Public StartItem5 As String = "Candle"

        Public ShoutLevel As Integer = 8

        Public ConfigFile As String = "GameServer.ini"

        Public Sub New()
            Dim DataStream As System.IO.TextReader
            Dim Data, FullData As String
            Dim I As Integer
            If IO.File.Exists(ConfigFile) = False Then
                MsgBox("Error: Configuration file missing", MsgBoxStyle.OKOnly, "Error")
                Exit Sub
            End If
            DataStream = System.IO.File.OpenText(ConfigFile)
            Data = DataStream.ReadLine()
            On Error GoTo CloseStream
            Do While Data <> "sajfahfoaso"
                If Data.IndexOf("=") = -1 Then
                    GoTo NextPart
                End If
                Dim Line() As String = Data.Split("=")
                Select Case Line(0)
                    Case "ServerName"
                        ServerName = Line(1)
                    Case "GameServerIP"
                        GameIP = Line(1)
                    Case "GameServerPort"
                        GamePort = Line(1)

                    Case "ClientVersion"
                        ClientVersion = Line(1)

                    Case "StartGold"
                        StartGold = Line(1)
                    Case "StartMap"
                        StartMap = Line(1)
                    Case "StartX"
                        StartX = Line(1)
                    Case "StartY"
                        StartY = Line(1)

                    Case "StartItem1"
                        StartItem1 = Line(1)
                    Case "StartItem2"
                        StartItem2 = Line(1)
                    Case "StartItem3"
                        StartItem3 = Line(1)
                    Case "StartItem4"
                        StartItem4 = Line(1)
                    Case "StartItem5"
                        StartItem5 = Line(1)

                    Case "ShoutLevel"
                        ShoutLevel = Line(1)

                    Case "EnableLogging"
                        EnableLogging = Line(1)
                    Case "LogDir"
                        LogDir = Line(1)
                    Case "MapDir"
                        MapFolder = Line(1)
                    Case "NpcDir"
                        NpcFolder = Line(1)
                    Case "DropItemsDir"
                        DropItemsFolder = Line(1)
                    Case "GuildDir"
                        GuildFolder = Line(1)

                    Case "SqlLogin"
                        SQLLogin = Line(1)
                    Case "SqlPass"
                        SQLPass = Line(1)
                    Case "SqlIp"
                        SQLIP = Line(1)
                End Select
NextPart:
                Data = DataStream.ReadLine()
            Loop
CloseStream:
            DataStream.Close()

            CheckDirs()

        End Sub

#Region "CheckDirs"

        Private Sub CheckDirs()
            If LogDir = "" Then EnableLogging = False

            If Not LogDir.EndsWith("\") Then
                LogDir = LogDir & "\"
            End If

            If Not System.IO.Directory.Exists(LogDir) Then
                System.IO.Directory.CreateDirectory(LogDir)
            End If

            If Not MapFolder.EndsWith("\") Then
                MapFolder = MapFolder & "\"
            End If

            If Not System.IO.Directory.Exists(MapFolder) Then
                System.IO.Directory.CreateDirectory(MapFolder)
            End If

            If Not NpcFolder.EndsWith("\") Then
                NpcFolder = NpcFolder & "\"
            End If

            If Not System.IO.Directory.Exists(NpcFolder) Then
                System.IO.Directory.CreateDirectory(NpcFolder)
            End If

            If Not DropItemsFolder.EndsWith("\") Then
                DropItemsFolder = DropItemsFolder & "\"
            End If

            If Not System.IO.Directory.Exists(DropItemsFolder) Then
                System.IO.Directory.CreateDirectory(DropItemsFolder)
            End If

            If Not GuildFolder.EndsWith("\") Then
                GuildFolder = GuildFolder & "\"
            End If

            If Not System.IO.Directory.Exists(GuildFolder) Then
                System.IO.Directory.CreateDirectory(GuildFolder)
            End If
        End Sub

#End Region
    End Class

End Module

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -