From 7cf2013a825dab50208cb559baf952203dc67045 Mon Sep 17 00:00:00 2001 From: temitchell Date: Mon, 6 Dec 2004 04:42:58 +0000 Subject: [PATCH] - remove python path bootstrapping - init script not appends module path for us. - add guild functions to init and remove scripts git-svn-id: svn://svn.code.sf.net/p/crossfire/code/trunk/maps@3001 282e977c-c81d-0410-88c4-b93c2d0d6712 --- python/events/python_born.py | 3 --- python/events/python_init.py | 5 +++++ python/events/python_kick.py | 4 +--- python/events/python_login.py | 6 +++--- python/events/python_muzzle.py | 3 --- python/events/python_remove.py | 8 +++++--- 6 files changed, 14 insertions(+), 15 deletions(-) diff --git a/python/events/python_born.py b/python/events/python_born.py index 7b37dcf52..5fe2b7ab5 100644 --- a/python/events/python_born.py +++ b/python/events/python_born.py @@ -21,9 +21,6 @@ #Updated to use new path functions in CFPython -Todd Mitchell import CFPython -import sys -import os.path -sys.path.append(os.path.join(CFPython.GetDataDirectory(),CFPython.GetMapDirectory(),'python')) import CFLog activator = CFPython.WhoIsActivator() diff --git a/python/events/python_init.py b/python/events/python_init.py index 28e0a2a4f..925c549a7 100644 --- a/python/events/python_init.py +++ b/python/events/python_init.py @@ -2,4 +2,9 @@ import CFPython; import os.path import sys +print "Running python initialize script." sys.path.insert(0, os.path.join(CFPython.GetDataDirectory(), CFPython.GetMapDirectory(), 'python')) + +import CFGuilds +print "Updating Guilds" +CFGuilds.GuildUpdate() diff --git a/python/events/python_kick.py b/python/events/python_kick.py index ddc5d920a..1003c980f 100644 --- a/python/events/python_kick.py +++ b/python/events/python_kick.py @@ -18,9 +18,6 @@ # import CFPython -import sys -import os.path -sys.path.append(os.path.join(CFPython.GetDataDirectory(),CFPython.GetMapDirectory(),'python')) import CFLog activator = CFPython.WhoIsActivator() @@ -28,3 +25,4 @@ name = CFPython.GetName(activator) log = CFLog.CFLog() log.kick_update(name) + diff --git a/python/events/python_login.py b/python/events/python_login.py index ab677d290..089810916 100644 --- a/python/events/python_login.py +++ b/python/events/python_login.py @@ -21,9 +21,6 @@ #Updated to use new path functions in CFPython -Todd Mitchell import CFPython -import sys -import os.path -sys.path.append(os.path.join(CFPython.GetDataDirectory(),CFPython.GetMapDirectory(),'python')) import CFMail import CFLog @@ -33,6 +30,8 @@ ip = CFPython.WhatIsMessage() mail = CFMail.CFMail() log = CFLog.CFLog() + + total = mail.countmail(name) if log.info(name): log.login_update(name, ip) @@ -43,3 +42,4 @@ if total > 0: CFPython.Write('You have some mail waiting for you', activator) else: CFPython.Write('No mail...', activator) + diff --git a/python/events/python_muzzle.py b/python/events/python_muzzle.py index 5626863c9..9113a3096 100644 --- a/python/events/python_muzzle.py +++ b/python/events/python_muzzle.py @@ -18,9 +18,6 @@ # import CFPython -import sys -import os.path -sys.path.append(os.path.join(CFPython.GetDataDirectory(),CFPython.GetMapDirectory(),'python')) import CFLog activator = CFPython.WhoIsActivator() diff --git a/python/events/python_remove.py b/python/events/python_remove.py index 45517ec17..371f69854 100644 --- a/python/events/python_remove.py +++ b/python/events/python_remove.py @@ -22,11 +22,9 @@ # acount cleanup - Todd Mitchell import CFPython -import sys -import os.path -sys.path.append(os.path.join(CFPython.GetDataDirectory(),CFPython.GetMapDirectory(),'python')) import CFLog import CFBank +import CFGuilds activator = CFPython.WhoIsActivator() name = CFPython.GetName(activator) @@ -38,3 +36,7 @@ log.remove(name) #when the player quits bank = CFBank.CFBank('ImperialBank_DB') bank.remove_account(name) + +in_guild = CFGuilds.SearchGuilds(name) +if in_guild: + CFGuilds.CFGuild(in_guild).remove_member(name)