Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DavidJRobertson/54ec3b3474979eebd46b6b6cd8f2da20 to your computer and use it in GitHub Desktop.
Save DavidJRobertson/54ec3b3474979eebd46b6b6cd8f2da20 to your computer and use it in GitHub Desktop.
'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