Jake-TD / Clocky

An addon for Garry's Mod to keep track of how long users have played on your server(s)
3 stars 0 forks source link

Error when i use the MySQL #7

Open UnDeadClank opened 10 years ago

UnDeadClank commented 10 years ago

I get this ERROR when i use MySQL

[ERROR] addons/clocky/lua/meta.lua:136: attempt to perform arithmetic on field 'ClockyCurrentTime' (a nil value)
  1. GetClocky - addons/clocky/lua/meta.lua:136
   2. SendClocky - addons/clocky/lua/meta.lua:149
    3. fn - addons/clocky/lua/autorun/server/init.lua:229
     4. unknown - addons/ulib/lua/ulib/shared/hook.lua:183

Thats my CONFIG

Clocky.MenuCommand = "!clocky" --What to say in chat to open the menu?

Clocky.Save.Type    = "file" --'PData', 'file' or 'both'
Clocky.Save.Folder  = "clocky" --What folder in DATA to save to, if savetype is file
Clocky.Save.Autosave    = false --Enable autosave?
Clocky.Save.Interval    = 300 --How often to autosave

Clocky.Admin.Enabled = false --Enable the admin menu?
Clocky.Admin.Ranks = {'admin', 'superadmin'} --What ranks can use the admin panel? These will not have access to config
Clocky.Admin.HighRanks = {'superadmin'} --These ranks will also have access to config

Clocky.SQL.Enabled  = true --Change this to true to enable SQL, fill in the required stuff below if true!
Clocky.SQL.Module   = "mysqloo" --Choose between "mysqloo" and "tmysql"
Clocky.SQL.Standalone   = true --Do you want it to save only to MySQL or still use PData/file alongside MySQL?
Clocky.SQL.Servername   = "TTT#1" --This is how Clocky will keep track of how long players have played on this specific server, for example 'TTT#1'

Clocky.SQL.Host         = "127.0.0.1" --IP
Clocky.SQL.Port         = 3306 --Port
Clocky.SQL.Database     = "gmod_clocky" --Name of the database
Clocky.SQL.Username     = "USER" --The username used to connect to the database
Clocky.SQL.Password     = "PASSWORD" --Password of the above user
Clocky.SQL.Socket   = "" --Database socketing; leave blank unless you are not using default

Thats a backup.sql of my MySQL DATABASE

-- MySQL dump 10.14  Distrib 5.5.33-MariaDB, for Linux (x86_64)
--
-- Host: localhost    Database: gmod_clocky
-- ------------------------------------------------------
-- Server version   5.5.33-MariaDB

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;

--
-- Table structure for table `clocky_userinfo`
--

DROP TABLE IF EXISTS `clocky_userinfo`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `clocky_userinfo` (
  `steamid` text,
  `timeplayed` text
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `clocky_userinfo`
--

LOCK TABLES `clocky_userinfo` WRITE;
/*!40000 ALTER TABLE `clocky_userinfo` DISABLE KEYS */;
INSERT INTO `clocky_userinfo` VALUES ('STEAM_0:1:22009581','~\"TTT#1v\":n0;'),('STEAM_0:0:53880449','~\"TTT#1v\":n0;'),('STEAM_0:1:49125626','~\"TTT#1v\":n0;'),('STEAM_0:0:82580991','~\"TTT#1v\":n0;'),('STEAM_0:1:61355079','~\"TTT#1v\":n0;'),('STEAM_0:1:52982197','~\"TTT#1v\":n0;'),('STEAM_0:0:8945482','~\"TTT#1v\":n0;');
/*!40000 ALTER TABLE `clocky_userinfo` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Dumping events for database 'gmod_clocky'
--

--
-- Dumping routines for database 'gmod_clocky'
--
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;

-- Dump completed on 2014-09-28 13:25:42
Kefta commented 9 years ago

This should be fixed now