Created
March 15, 2017 02:14
-
-
Save anonymous/087e990ba1acd9baed3dccfb1d4dc9f7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'NATASHA'S (TASHOLOGY) MYSQL SAVING SYSTEM! | |
'CHANGE THIS TO YOUR SETTINGS | |
Dim conn As String = "Server=epsilon.davidr.me;Database=tashdb;Uid=tashdb;Pwd=nLEYmTSYEQZzN483;" | |
Dim connect As MySqlConnection | |
Try | |
'Create the connector | |
connect = New MySqlConnection(conn) | |
'Open the database | |
connect.Open() | |
'Create the command | |
Dim cmd As MySqlCommand = New MySqlCommand() | |
Dim Command As MySqlCommand | |
Command = connect.CreateCommand() | |
cmd.Connection = connect | |
'Set the variables (to save space on the DB the inventory etc is saved comma-separated) | |
'Create inventory concat | |
Dim inventoryTemp As String | |
inventoryTemp = "" | |
For i = 0 To MAX_INV | |
If Player(Index).Character(CharNum).Inv(i).Num <> 0 Then | |
inventoryTemp = inventoryTemp + Player(Index).Character(CharNum).Inv(i).Num + "," | |
inventoryTemp = inventoryTemp + Player(Index).Character(CharNum).Inv(i).Value + "," | |
End If | |
' example inventory string when it's concatenated: 1,2,3,4,5 | |
Next | |
'Create equipment concat | |
Dim equipmentTemp As String | |
equipmentTemp = "" | |
For i = 1 To EquipmentType.Count - 1 | |
equipmentTemp = equipmentTemp + Player(Index).Character(CharNum).Equipment(i) + "," | |
^^^GETS THIS FAR BEFORE CLIENT DECIDES THE SERVER MUST BE DEAD |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment