tBKwtWS vor 8 Jahren
Ursprung
Commit
972640c19c
3 geänderte Dateien mit 14 neuen und 4 gelöschten Zeilen
  1. 1 1
      irc/commands/common.py
  2. 7 1
      irc/commands/games.py
  3. 6 2
      webgui/webgui/settings.py

+ 1 - 1
irc/commands/common.py

@@ -159,7 +159,7 @@ class GameHelpers():
         xp_spent = userrecord[0]
         level = userrecord[1]
         coin = userrecord[2]
-        total_xp = ((level + joins + (given * received) + messages + (messages_words / 4) + (messages_characters / 10) + ((actions + (actions_words / 4) + (actions_characters / 10)) * 2) + ((notices + (notices_words / 4) + (notices_characters / 10)) / 2)) / 140) - (level / 25)
+        total_xp = ((level + joins + (given * received) + messages + (messages_words / 4) + (messages_characters / 10) + ((actions + (actions_words / 4) + (actions_characters / 10)) * 2) + ((notices + (notices_words / 4) + (notices_characters / 10)) / 2)) / 120) - (level / 25)
         xp = total_xp - xp_spent
         total_messages = messages + actions + notices
         total_words = messages_words + actions_words + notices_words

+ 7 - 1
irc/commands/games.py

@@ -196,8 +196,14 @@ def do_command(self, connection, event):
             elif len(command.split()) > 3:
                 connection.privmsg(replyto, "Too many arguments. For help type " + blue + self.helpchar + "givecoin" + reset + ".")
                 return
+            elif command.split()[1] == event.source.nick.lower():
+                connection.privmsg(replyto, "You already have your own coin. For help type " + blue + self.helpchar + "givecoin" + reset + ".")
+                return
             level, xp, xpspent, karma, coin = GameHelpers.get_info(self, event.source.nick)
-            if coin < 1:
+            if level < 0:
+                connection.privmsg(replyto, "You need to " + blue + self.cmdchar + "levelup " + reset + "to be able to give coin.")
+                return
+            elif coin < 1:
                 connection.privmsg(replyto, "You have no coin to give.")
                 return
             elif not self.db.one("SELECT id FROM users WHERE LOWER(name)=%s AND network='" + self.network + "'", (command.split()[1], )):

+ 6 - 2
webgui/webgui/settings.py

@@ -75,8 +75,12 @@ WSGI_APPLICATION = 'webgui.wsgi.application'
 
 DATABASES = {
     'default': {
-        'ENGINE': 'django.db.backends.sqlite3',
-        'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
+        'ENGINE': 'django.db.backends.postgresql',
+        'NAME': 'pyRotsite',
+        'USER': 'pyRotSite',
+        'PASSWORD': '4h8q(.',
+        'HOST': '127.0.0.1',
+        'PORT': '5432',
     }
 }