hotfix: move save data to DB (#2)
* start reading save data from DB * finish migration code * remove leftover dir creation * fix import cycle * remove more dir creation * update gitignore * fix pk * better table creation * use REPLACE INTO * fix typo
This commit is contained in:
10 files changed
+253
-134
No files matched your search
@@ -20,8 +20,6 @@ package account
|
||||
import (
|
||||
"crypto/rand"
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/pagefaultgames/rogueserver/db"
|
||||
)
|
||||
|
||||
@@ -52,10 +50,5 @@ func Register(username, password string) error {
|
||||
return fmt.Errorf("failed to add account record: %s", err)
|
||||
}
|
||||
|
||||
err = os.MkdirAll(fmt.Sprintf("userdata/%x", uuid), 0755)
|
||||
if err != nil && !os.IsExist(err) {
|
||||
return fmt.Errorf(fmt.Sprintf("failed to create userdata folder: %s", err))
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
Reference in new issue
Block a user