Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Python27 #5

Closed
wants to merge 18 commits into from

5 participants

Dragos Serban Branan Purvine-Riley diafero Darryl Pogue Adam Johnson
Dragos Serban

Fix for KI being busted when /p doesn't get any args, Bevin replaced with Hood for every instance, puzzle mode toggle, cleaner handling of Ahnonay and Er'cana age display names.

Branan Purvine-Riley
Owner
branan commented

Wow, that's a lot of fixes! this might take a while for us all to work though...

Branan Purvine-Riley
Owner
branan commented

OK, I think that's all my feedback

diafero
Collaborator

IMHO all the age instance names should be managed by one global system. Everything else is maintenance and consistency hell. See H-uru/moul-scripts#2

Dragos Serban

Regarding the "a lot of fixes," it shouldn't have happened. I remember issuing a pull request for most of the changes here which got merged. Looking at the graph, I'm wondering whatever happened to that!

Darryl Pogue
Owner
dpogue commented

I think you based all of your changes on the python27 branch, and when they were merged we cherrypicked them onto master. However, that means that the original pull request was never "merged" (as far as github is concerned).

It's probably best to do fixes on master (against python 2.3), and then merge them to python27; rather than developing on python27 and trying to backport (which might result in problems with missing features).

Dragos Serban

Guess I'll have to build myself a new CWE client :)

I'll merge those into master as soon as I test them. Then if you think they're good you can pull them.

Branan Purvine-Riley
Owner
branan commented

Also, even if you're basing fixes on master, you should still make your own branch for fixes. That way if we do a rebase or cherry-pick on merge you can still blow away that branch and get an updated master that matches ours. It'll avoid situations like this one where old versions of old commits show up in a pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 18 unique commits by 1 author.

Apr 17, 2011
Dragos Serban dragossh Get GPS coodrinates in xCheat dcfba88
Apr 18, 2011
Dragos Serban dragossh Location name fixes
No more duplicate Age folders
Fixed Spy Room invite glitch
c88c4cc
May 10, 2011
Dragos Serban dragossh Merge git://github.com/H-uru/moul-scripts into python27
Conflicts:
	Python/xKI.py
7e226a9
May 15, 2011
Dragos Serban dragossh Merge branch 'python27' of https://github.com/H-uru/moul-scripts into…
… python27
69f4c6f
Dragos Serban dragossh /sendageinvite command. Should work with IDs and user names. da6ef89
Dragos Serban dragossh Don't clear the chat when switching between big and mini KI 8473d9c
Dragos Serban dragossh Throw error if /p doesn't have any arguments. 4b0ab1b
Dragos Serban dragossh Add Myst to the Ages that don't allow invites 33eb6b1
Dragos Serban dragossh "Puzzle mode" -- sends back a "I'm doing a puzzle" message so people …
…know you're busy and not ignoring them. /puzzlemode toggle.
714344c
Jun 04, 2011
Dragos Serban dragossh Cleaner handling for Ercana + Ahnonay Cathedral display names 0826177
Dragos Serban dragossh Fixed Bevin naming for EVERY hood. e0712fd
Dragos Serban dragossh BigKI: Bevin -> Hood at the bottom 2a71d03
Jun 05, 2011
Dragos Serban dragossh Moved getting hood display name to IGetAgeDisplayName where it also r…
…eplaces Bevin with Hood
2fe2ffd
Dragos Serban dragossh Replacing Bevin happens before localization now da832bb
Dragos Serban dragossh C:/Program Files/Git/sendageinfo can now get Age name as a parameter ed9a2ce
Dragos Serban dragossh Lower the message to catch all combinations of Age names 6c8b6ca
Dragos Serban dragossh Guess we should also lower the player names faaf147
Dragos Serban dragossh Fixed array indexes in /sendageinvite 7f1386f
This page is out of date. Refresh to see the latest.
2  Python/nb01Easel.py
@@ -84,7 +84,7 @@ def IWriteHoodName(self):
84 84 ageVault = ptAgeVault()
85 85 try:
86 86 ageInfoNode = ageVault.getAgeInfo()
87   - hoodName = "%s %s" % (ageInfoNode.getAgeUserDefinedName(), ageInfoNode.getAgeInstanceName())
  87 + hoodName = "%s %s" % (ageInfoNode.getAgeUserDefinedName(), ageInfoNode.getAgeInstanceName().replace("Bevin", "Hood"))
88 88 PtDebugPrint("nb01Easel:\tinscribing %s" % hoodName)
89 89 except:
90 90 PtDebugPrint("nb01Easel:\tERROR age vault or hood node failure")
6 Python/nxusBookMachine.py
@@ -495,6 +495,9 @@ def gotPublicAgeList(self,ages):
495 495 # if the current population and number of owners is zero then don't display it
496 496 if age[2] == 0 and age[1] == 0:
497 497 continue
  498 + # Fix for "Bevin" naming
  499 + hoodInstanceName = age[0].getAgeInstanceName()
  500 + age[0].setAgeInstanceName(hoodInstanceName.replace("Bevin", "Hood"))
498 501 publicHoods.append(age[0])
499 502 publicHoodsPop.append(age[1])
500 503 self.ISortPublicHoods()
@@ -1358,7 +1361,8 @@ def IUpdateLinks(self):
1358 1361 if not hoodLink.getVolatile():
1359 1362 # if the hood link is not volatile, then they can go
1360 1363 untranslatedNeighborhoodName = Uni(info.getDisplayName())
1361   - stringHoodName = xLocTools.LocalizeAgeName(info.getDisplayName())
  1364 + # Fix for Bevin naming
  1365 + stringHoodName = xLocTools.LocalizeAgeName(info.getDisplayName().replace("Bevin", "Hood"))
1362 1366 fullNeighborhoodName = stringHoodName
1363 1367 if len(stringHoodName) > kMaxDisplayableChars:
1364 1368 stringHoodName = stringHoodName[:kMaxDisplayableChars] + U"..."
10 Python/xCheat.py
@@ -362,6 +362,16 @@ def GZGiveMeFullAccess(args):
362 362 # Finally, update the KI display
363 363 Plasma.PtSendKIMessage(PlasmaKITypes.kGZUpdated,0)
364 364
  365 +
  366 +def GZGiveMeGPS(args):
  367 + import Plasma
  368 + import PlasmaKITypes
  369 + vault = Plasma.ptVault()
  370 + psnlSDL = vault.getPsnlAgeSDL()
  371 + if psnlSDL:
  372 + GPSVar = psnlSDL.findVar('GPSEnabled')
  373 + GPSVar.setBool(1)
  374 + vault.updatePsnlAgeSDL(psnlSDL)
365 375
366 376 def GZGiveMeGPS(args):
367 377 import Plasma
180 Python/xKI.py
@@ -60,7 +60,7 @@
60 60 import string
61 61 import xCensor
62 62 import xLinkingBookDefs
63   -import xBookGUIs
  63 +import xBookGUIs
64 64 import re #used for CoD Fix
65 65 import os #used for saving pictures locally
66 66 import glob #used for saving pictures locally
@@ -759,6 +759,12 @@
759 759 }
760 760
761 761
  762 +#=======================================
  763 +# OpenUru KI improvements globabls
  764 +kPuzzleModeOff = 0
  765 +kPuzzleModeOn = 1
  766 +PuzzleMode = kPuzzleModeOff
  767 +
762 768 def CMPplayerOnline(playerA,playerB):
763 769 elPlayerA = playerA.getChild()
764 770 elPlayerB = playerB.getChild()
@@ -4182,7 +4188,7 @@ def OnRTChat(self,player,message,flags):
4182 4188
4183 4189 #Everything's okay, send message....
4184 4190 self.IAddRTChat(player,message,cflags,forceKI=not ISawTheKIAtleastOnce)
4185   -
  4191 +
4186 4192 # see if they are AFK and the message was directly to them, send back they're state to sender
4187 4193 try:
4188 4194 if IKIDisabled or PtGetLocalAvatar().avatar.getCurrentMode() == PtBrainModes.kAFK and cflags.private and not cflags.toSelf:
@@ -4190,8 +4196,17 @@ def OnRTChat(self,player,message,flags):
4190 4196 myself = PtGetLocalPlayer()
4191 4197 afkself = ptPlayer(myself.getPlayerName()+str(PtGetLocalizedString("KI.Chat.AFK")),myself.getPlayerID())
4192 4198 PtSendRTChat(afkself, plist, " ",cflags.flags)
  4199 + return
4193 4200 except NameError:
4194   - pass
  4201 + return
  4202 +
  4203 + # If in puzzle mode, send a "don't bother" message to the sender
  4204 + if PuzzleMode == kPuzzleModeOn:
  4205 + plist = [player]
  4206 + myself = PtGetLocalPlayer()
  4207 + puzzself = ptPlayer(myself.getPlayerName()+" (I'm doing a puzzle right now)", myself.getPlayerID())
  4208 + PtSendRTChat(puzzself, plist, "", cflags.flags)
  4209 + return
4195 4210
4196 4211 def OnTimer(self,id):
4197 4212 "Timer event, for the fade stuff"
@@ -4977,6 +4992,8 @@ def IGetAgeDisplayName(self,ageInfo=None):
4977 4992 subAges = agevault.getSubAgesFolder()
4978 4993 if subAges and subAges.getChildNodeCount() > 0:
4979 4994 isSubAge = 1
  4995 + elif ageInfo.getAgeFilename() == "Neighborhood":
  4996 + return ageInfo.getDisplayName().replace("Bevin", "Hood")
4980 4997
4981 4998 if ageInfo.getAgeFilename() == "BahroCave":
4982 4999 # see if it can stay this name
@@ -5024,10 +5041,17 @@ def IGetAgeDisplayName(self,ageInfo=None):
5024 5041
5025 5042 if ageInfo.getAgeFilename() == "Descent":
5026 5043 return "D'ni-Tiwah"
5027   -
  5044 +
  5045 + if ageInfo.getAgeFilename() == "Ercana":
  5046 + return ageInfo.getDisplayName()
  5047 +
5028 5048 if ageInfo.getAgeFilename() == "ErcanaCitySilo":
5029 5049 return "D'ni-Ashem'en"
5030 5050
  5051 + if ageInfo.getAgeFilename() == "AhnonayCathedral":
  5052 + name = ageInfo.getDisplayName().replace("AhnonayCathedral", "Ahnonay Cathedral")
  5053 + return name
  5054 +
5031 5055 if ageInfo.getAgeFilename() in kHideAgesHackList:
5032 5056 return "Unknown"
5033 5057
@@ -5036,10 +5060,7 @@ def IGetAgeDisplayName(self,ageInfo=None):
5036 5060 if iname.startswith("D'ni"):
5037 5061 return iname
5038 5062
5039   - # For some reason it thinks Er'cana and Ahnonay are
5040   - # sub ages. Get the display name for them.
5041   - if (isChildAge or isSubAge) and \
5042   - not (ageInfo.getAgeFilename() == "Ercana" or ageInfo.getAgeFilename()[:7] == "Ahnonay"):
  5063 + if (isChildAge or isSubAge):
5043 5064 localizeName = ageInfo.getAgeInstanceName()
5044 5065 if isChildAge:
5045 5066 localizeName += "'"
@@ -5122,7 +5143,7 @@ def IFilterAgeName(self,ageName):
5122 5143
5123 5144 if ageName.find("(null)") != -1:
5124 5145 ageName = ageName.replace("(null)", "").strip()
5125   - #print "AgeName output as %s" % (ageName)
  5146 + # print "AgeName output as %s" % (ageName)
5126 5147 return ageName
5127 5148
5128 5149
@@ -6022,8 +6043,11 @@ def ISendRTChat(self,message):
6022 6043 # then parse for sending private message
6023 6044 pwords = message.split()
6024 6045 foundBuddy = 0
  6046 + if len(pwords) < 2:
  6047 + self.IAddRTChat(None, "(Need a name or ID.)", kChatSystemMessage)
  6048 + return
6025 6049 # make sure its still just a /p
6026   - if len(pwords) > 1 and pwords[0] == str(PtGetLocalizedString("KI.Commands.ChatPrivate")):
  6050 + elif len(pwords) > 1 and pwords[0] == str(PtGetLocalizedString("KI.Commands.ChatPrivate")):
6027 6051 # try to find their buddy in the DPL online lists
6028 6052 for daPlayer in BKPlayerList:
6029 6053 if isinstance(daPlayer, ptPlayer):
@@ -6079,7 +6103,7 @@ def ISendRTChat(self,message):
6079 6103 self.IAddPlayerToRecents(eplyr.playerGetID())
6080 6104 break
6081 6105 if not foundBuddy:
6082   - PtDebugPrint("xKI:SendRTChat: /p command can't find player %s"%(pwords[1]),level=kDebugDumpLevel)
  6106 + PtDebugPrint("xKI:SendRTChat: /p codmand can't find player %s"%(pwords[1]),level=kDebugDumpLevel)
6083 6107 self.IAddRTChat(None,PtGetLocalizedString("KI.Chat.CannotFindBuddy", [pwords[1]]),kChatSystemMessage)
6084 6108 return
6085 6109 elif message.startswith(str(PtGetLocalizedString("KI.Commands.ChatNeighbors"))):
@@ -6707,6 +6731,134 @@ def ICheckChatCommands(self,chatmessage):
6707 6731 v = "is"
6708 6732 self.IAddRTChat(None,"The %s %s too heavy to lift. Maybe you should stick to feathers." % (chatmessage[len("/get "):],v),0)
6709 6733 return None
  6734 + if string.lower(chatmessage).startswith("/sendageinvite"):
  6735 + dontAllow = ["Myst", "city", "ErcanaCitySilo", "Personal", "Cleft", "Nexus", "BahroCave", "PelletBahroCave"]
  6736 + ageInfo = ptAgeVault().getAgeInfo()
  6737 + chatmessage = chatmessage.lower()
  6738 + pwords = chatmessage.split()
  6739 + playerID = 0
  6740 + foundBuddy = 0
  6741 + foundAge = 0
  6742 +
  6743 + # Check if there are parameters
  6744 + if len(pwords) < 2:
  6745 + self.IAddRTChat(None, "(Usage: /sendageinvite playername/playerid [agename])", kChatSystemMessage)
  6746 + return
  6747 + else:
  6748 + # Do we have an Age name?
  6749 + if len(pwords) > 2:
  6750 + ageNames = { "bevin": "neighborhood",
  6751 + "hood": "neighborhood",
  6752 + "gahreesen": "garrison",
  6753 + "kadish tolesa": "kadish",
  6754 + "eder gira": "gira",
  6755 + "kemo": "garden",
  6756 + "eder kemo": "garden",
  6757 + "er'cana": "ercana",
  6758 + "ahnonay cathedral": "ahnonaycathedral",
  6759 + "ahnonay": "ahnonaycathedral",
  6760 + "jalak dador": "jalak" }
  6761 + # Replace the human-friendly name with the filename
  6762 + for age,filename in ageNames.items():
  6763 + if chatmessage.find(age) != -1:
  6764 + pwords = chatmessage.replace(age, filename).split()
  6765 + break
  6766 +
  6767 + # Find the Age in our owned Ages folder
  6768 + agesIOwn = ptVault().getAgesIOwnFolder().getChildNodeRefList()
  6769 + for ageLinkRef in agesIOwn:
  6770 + ageLinkInfo = ageLinkRef.getChild().upcastToAgeLinkNode().getAgeInfo().upcastToAgeInfoNode()
  6771 + if len(pwords) == 2 and ageLinkInfo.getAgeInstanceGuid() == ageInfo.getAgeInstanceGuid():
  6772 + foundAge = 1
  6773 + break
  6774 + elif len(pwords) == 3:
  6775 + ageFilename = ageLinkInfo.getAgeFilename().lower()
  6776 + if ageFilename == pwords[2]:
  6777 + ageInfo = ageLinkInfo
  6778 + foundAge = 1
  6779 + break
  6780 +
  6781 + # Send only if we're allowed to send invites to that Age
  6782 + if foundAge and not ageInfo.getAgeFilename() in dontAllow:
  6783 + # If node ID send the invite directly
  6784 + if pwords[1].isdigit():
  6785 + playerID = pwords[1]
  6786 + foundBuddy = 1
  6787 + else:
  6788 + # Try to find player in the KI list
  6789 + for player in BKPlayerList:
  6790 + if isinstance(player, ptPlayer):
  6791 + playerName = player.getPlayerName().lower()
  6792 + # Found if they have the same name
  6793 + if playerName == pwords[1]:
  6794 + playerID = player.getPlayerID()
  6795 + foundBuddy = 1
  6796 + break
  6797 + # Or if they start the same (name might have spaces)
  6798 + if playerName.startswith(pwords[1]):
  6799 + if len(pwords) == 2:
  6800 + mrest = chatmessage[len("/sendageinvite "):]
  6801 + else:
  6802 + mrest = chatmessage[len("/sendageinvite "):].replace(pwords[2], "")
  6803 +
  6804 + if mrest == playerName:
  6805 + playerID = player.getPlayerID()
  6806 + foundBuddy = 1
  6807 + break
  6808 + elif isinstance(player, ptVaultNodeRef):
  6809 + # Player might be in another age
  6810 + plyr = player.getChild()
  6811 + plyr = plyr.upcastToPlayerInfoNode()
  6812 + if type(plyr) != type(None):
  6813 + playerName = plyr.playerGetName().lower()
  6814 + # Found if they have the same name
  6815 + if playerName == pwords[1]:
  6816 + playerID = plyr.playerGetID()
  6817 + foundBuddy = 1
  6818 + break
  6819 + # Or if they start the same (name might have spaces)
  6820 + if playerName.startswith(pwords[1]):
  6821 + if len(pwords) == 2:
  6822 + mrest = chatmessage[len("/sendageinvite "):]
  6823 + else:
  6824 + mrest = chatmessage[len("/sendageinvite "):].replace(pwords[2], "")
  6825 +
  6826 + if mrest == playerName:
  6827 + playerID = player.playerGetID()
  6828 + foundBuddy = 1
  6829 + break
  6830 +
  6831 + if foundBuddy:
  6832 + # Send invite
  6833 + whereToLink = ptAgeLinkStruct()
  6834 + whereToLink.setAgeInfo(ageInfo.asAgeInfoStruct())
  6835 + ptVault().invitePlayerToAge(whereToLink,int(playerID))
  6836 + self.ISendInviteRevoke(long(playerID),ageInfo.getDisplayName(),"KI.Invitation.VisitTitle","KI.Invitation.VisitBody")
  6837 + self.IDoStatusChatMessage("Invite sent.", netPropagate=0)
  6838 + # Add to recent
  6839 + self.IAddPlayerToRecents(long(playerID))
  6840 + else:
  6841 + self.IAddRTChat(None, "(Could not find explorer.)", kChatSystemMessage)
  6842 + else:
  6843 + # Woops, we don't own that age!
  6844 + ageName = self.IGetAgeDisplayName(ageInfo)
  6845 + if len(pwords) == 3 and pwords[2].isalpha() and not foundAge:
  6846 + # Use the parameter as the age name, in case we don't yet own the specified age
  6847 + # the message should not display the age we're currently in
  6848 + ageName = pwords[2].capitalize()
  6849 + self.IAddRTChat(None, "(Cannot send an invite to %s.)" % ageName, kChatSystemMessage)
  6850 + return
  6851 + return None
  6852 +
  6853 + elif string.lower(chatmessage) == "/puzzlemode":
  6854 + global PuzzleMode
  6855 +
  6856 + PuzzleMode = not PuzzleMode
  6857 + puzzleModeString = "on" if PuzzleMode == kPuzzleModeOn else "off"
  6858 + self.IAddRTChat(None, "[Puzzle mode %s]" % puzzleModeString, kChatSelfMsg)
  6859 +
  6860 + return None
  6861 +
6710 6862 #
6711 6863 # The check for emote commands should be last
6712 6864 # search message for emote commmand (could embedd into message)
@@ -7714,7 +7866,7 @@ def IminiToggleKISize(self):
7714 7866 # hide the big KI part
7715 7867 self.IBigKIHideBigKI()
7716 7868 # can't be in chatting mode
7717   - self.IEnterChatMode(0)
  7869 + # self.IEnterChatMode(0) # Yes we can
7718 7870 KIBlackbar.dialog.show()
7719 7871 if type(LastminiKICenter) != type(None):
7720 7872 dragbar = ptGUIControlDragBar(KIMini.dialog.getControlFromTag(kminiDragBar))
@@ -7736,7 +7888,7 @@ def IminiToggleKISize(self):
7736 7888 # hide the miniKI so that it is shown on top of the bigKI
7737 7889 KIMini.dialog.hide()
7738 7890 # can't be in chatting mode
7739   - self.IEnterChatMode(0)
  7891 + # self.IEnterChatMode(0) # Yes we can
7740 7892 # show the big stuff
7741 7893 BigKI.dialog.show()
7742 7894 # save current location and snap back to original
@@ -8273,7 +8425,7 @@ def IBigKIRefreshHoodStatics(self,neighborhood=None):
8273 8425 if not neighborhood:
8274 8426 neighborhood = self.IGetNeighborhood()
8275 8427 if type(neighborhood) != type(None):
8276   - neighborName = xLocTools.LocalizeAgeName(neighborhood.getDisplayName())
  8428 + neighborName = xLocTools.LocalizeAgeName(self.IGetAgeDisplayName(neighborhood))
8277 8429 if neighborName == U"":
8278 8430 neighborName = PtGetLocalizedString("KI.Neighborhood.NoName")
8279 8431 neighbortext.setStringW(PtGetLocalizedString("KI.Neighborhood.BottomLine", [xLocTools.MemberStatusString(),neighborName]))

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.