mirror of
https://github.com/indig0fox/Arma3-AttendanceTracker.git/
synced 2025-12-08 09:51:47 -06:00
update readme w sql, roll back dllpath, set moddir
This commit is contained in:
@@ -62,6 +62,7 @@
|
|||||||
] call attendanceTracker_fnc_logMissionEvent;
|
] call attendanceTracker_fnc_logMissionEvent;
|
||||||
}],
|
}],
|
||||||
["PlayerDisconnected", {
|
["PlayerDisconnected", {
|
||||||
|
// NOTE: HandleDisconnect returns a DIFFERENT _id than PlayerDisconnected and above handlers, so we can't use it here
|
||||||
params ["_id", "_uid", "_name", "_jip", "_owner", "_idstr"];
|
params ["_id", "_uid", "_name", "_jip", "_owner", "_idstr"];
|
||||||
|
|
||||||
[format ["(EventHandler) HandleDisconnect fired: %1", _this], "DEBUG"] call attendanceTracker_fnc_log;
|
[format ["(EventHandler) HandleDisconnect fired: %1", _this], "DEBUG"] call attendanceTracker_fnc_log;
|
||||||
|
|||||||
36
README.md
36
README.md
@@ -1 +1,37 @@
|
|||||||
# 17th-attendanceTracker
|
# 17th-attendanceTracker
|
||||||
|
|
||||||
|
## Setup
|
||||||
|
|
||||||
|
**You will need a running MySQL or MariaDB instance.**
|
||||||
|
|
||||||
|
Create a database with a name of your choosing. Then, run the following SQL command against it to create a table.
|
||||||
|
|
||||||
|
```sql
|
||||||
|
CREATE TABLE `attendancelog` (
|
||||||
|
`id` INT(11) NOT NULL AUTO_INCREMENT,
|
||||||
|
`timestamp` DATETIME NOT NULL,
|
||||||
|
`event_hash` VARCHAR(100) NOT NULL DEFAULT md5(concat(`server_name`,`mission_name`,`author`,`mission_start`)) COLLATE 'utf8mb3_general_ci',
|
||||||
|
`event_type` VARCHAR(100) NOT NULL COLLATE 'utf8mb3_general_ci',
|
||||||
|
`player_id` VARCHAR(30) NOT NULL COLLATE 'utf8mb3_general_ci',
|
||||||
|
`player_uid` VARCHAR(100) NOT NULL COLLATE 'utf8mb3_general_ci',
|
||||||
|
`profile_name` VARCHAR(100) NOT NULL COLLATE 'utf8mb3_general_ci',
|
||||||
|
`steam_name` VARCHAR(100) NULL DEFAULT NULL COLLATE 'utf8mb3_general_ci',
|
||||||
|
`is_jip` TINYINT(4) NULL DEFAULT NULL,
|
||||||
|
`role_description` VARCHAR(100) NULL DEFAULT NULL COLLATE 'utf8mb3_general_ci',
|
||||||
|
`mission_start` DATETIME NOT NULL,
|
||||||
|
`mission_name` VARCHAR(100) NULL DEFAULT NULL COLLATE 'utf8mb3_general_ci',
|
||||||
|
`briefing_name` VARCHAR(100) NULL DEFAULT NULL COLLATE 'utf8mb3_general_ci',
|
||||||
|
`mission_name_source` VARCHAR(100) NULL DEFAULT NULL COLLATE 'utf8mb3_general_ci',
|
||||||
|
`on_load_name` VARCHAR(100) NULL DEFAULT NULL COLLATE 'utf8mb3_general_ci',
|
||||||
|
`author` VARCHAR(100) NULL DEFAULT NULL COLLATE 'utf8mb3_general_ci',
|
||||||
|
`server_name` VARCHAR(100) NOT NULL COLLATE 'utf8mb3_general_ci',
|
||||||
|
`server_profile` VARCHAR(100) NOT NULL COLLATE 'utf8mb3_general_ci',
|
||||||
|
PRIMARY KEY (`id`) USING BTREE
|
||||||
|
)
|
||||||
|
COLLATE='utf8mb3_general_ci'
|
||||||
|
ENGINE=InnoDB
|
||||||
|
AUTO_INCREMENT=383
|
||||||
|
;
|
||||||
|
```
|
||||||
|
|
||||||
|
Finally, copy `config.example.json` to `config.json` and update it with your database credentials.
|
||||||
Binary file not shown.
@@ -15,7 +15,6 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"log"
|
"log"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
@@ -28,7 +27,7 @@ var EXTENSION_VERSION string = "0.0.1"
|
|||||||
var extensionCallbackFnc C.extensionCallback
|
var extensionCallbackFnc C.extensionCallback
|
||||||
|
|
||||||
// file paths
|
// file paths
|
||||||
var ADDON_FOLDER string = getDir() + "\\@17thAttendanceTracker"
|
var ADDON_FOLDER string = getDir() + "\\@AttendanceTracker"
|
||||||
var LOG_FILE string = ADDON_FOLDER + "\\attendanceTracker.log"
|
var LOG_FILE string = ADDON_FOLDER + "\\attendanceTracker.log"
|
||||||
var CONFIG_FILE string = ADDON_FOLDER + "\\config.json"
|
var CONFIG_FILE string = ADDON_FOLDER + "\\config.json"
|
||||||
|
|
||||||
@@ -77,16 +76,16 @@ func loadConfig() {
|
|||||||
functionName := "loadConfig"
|
functionName := "loadConfig"
|
||||||
|
|
||||||
// get location of this dll
|
// get location of this dll
|
||||||
dllPath, err := filepath.Abs(os.Args[0])
|
// dllPath, err := filepath.Abs(os.Args[0])
|
||||||
if err != nil {
|
// if err != nil {
|
||||||
writeLog(functionName, fmt.Sprintf(`["Error getting DLL path: %v", "ERROR"]`, err))
|
// writeLog(functionName, fmt.Sprintf(`["Error getting DLL path: %v", "ERROR"]`, err))
|
||||||
return
|
// return
|
||||||
}
|
// }
|
||||||
|
|
||||||
// set the addon directory to the parent directory of the dll
|
// set the addon directory to the parent directory of the dll
|
||||||
ADDON_FOLDER = filepath.Dir(dllPath)
|
// ADDON_FOLDER = filepath.Dir(dllPath)
|
||||||
LOG_FILE = ADDON_FOLDER + "\\attendanceTracker.log"
|
// LOG_FILE = ADDON_FOLDER + "\\attendanceTracker.log"
|
||||||
CONFIG_FILE = ADDON_FOLDER + "\\config.json"
|
// CONFIG_FILE = ADDON_FOLDER + "\\config.json"
|
||||||
|
|
||||||
file, err := os.Open(CONFIG_FILE)
|
file, err := os.Open(CONFIG_FILE)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user