Skip to content

Commit 06c7d7b

Browse files
committed
Merge branch 'master' of https://github.com/stealthbot/StealthBot.git into RenameProfile
2 parents c5775da + 68ffacb commit 06c7d7b

20 files changed

Lines changed: 243 additions & 266 deletions

Installer/StealthbotInstaller.wip

128 KB
Binary file not shown.

trunk/Bot.vbp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ Description="StealthBot"
127127
CompatibleMode="0"
128128
MajorVer=2
129129
MinorVer=7
130-
RevisionVer=492
130+
RevisionVer=493
131131
AutoIncrementVer=0
132132
ServerSupportFiles=0
133133
VersionCompanyName="Andy T (Stealth@USEast)"

trunk/Warden.dll

4.5 KB
Binary file not shown.

trunk/clsChannelObj.cls

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ Private m_NumKicks As Long
3333
Private m_JoinDate As Date
3434
Private m_Users As Collection
3535
Private m_Banlist As Collection
36+
Private m_HasPhantoms As Boolean ' TRUE if a phantom user has been seen in the channel.
3637

3738
Public Property Get sType() As String
3839

@@ -181,6 +182,15 @@ Public Property Let KickCount(ByVal lng As Long)
181182

182183
End Property
183184

185+
Public Property Get HasPhantomUsers() As Boolean
186+
HasPhantomUsers = m_HasPhantoms
187+
End Property
188+
189+
Public Property Let HasPhantomUsers(ByVal bln As Boolean)
190+
m_HasPhantoms = bln
191+
End Property
192+
193+
184194
Public Property Get Users() As Collection
185195

186196
Set Users = m_Users
@@ -240,7 +250,7 @@ Public Property Get Self() As clsUserObj
240250
Set Self = New clsUserObj
241251

242252
For i = Users.Count To 1 Step -1
243-
If (StrComp(Users(i).Name, CleanUsername(CurrentUsername), vbTextCompare) = 0) And (Users(i).IsPhantom = False) Then
253+
If (StrComp(Users(i).Name, CleanUsername(CurrentUsername), vbTextCompare) = 0) Then
244254
Set Self = Users(i)
245255
Exit Property
246256
End If
@@ -279,7 +289,7 @@ Public Function GetUserIndexEx(ByVal AccountName As String, Optional ByVal Searc
279289
End If
280290
End If
281291

282-
If (StrComp(Users(i).Name, AccountName, vbTextCompare) = 0) And (Users(i).IsPhantom = False) Then
292+
If (StrComp(Users(i).Name, AccountName, vbTextCompare) = 0) Then
283293
GetUserIndexEx = i
284294
Exit Function
285295
End If
@@ -321,7 +331,7 @@ Public Function GetUserIndex(ByVal Username As String, Optional ByVal SearchLimi
321331
End If
322332
End If
323333

324-
If (StrComp(m_Users(i).DisplayName, Username, vbTextCompare) = 0) And (Users(i).IsPhantom = False) Then
334+
If (StrComp(m_Users(i).DisplayName, Username, vbTextCompare) = 0) Then
325335
GetUserIndex = i
326336
Exit Function
327337
End If
@@ -348,7 +358,7 @@ Public Function GetUserIndexByPriority(ByVal Username As String, Optional ByVal
348358
End If
349359
End If
350360

351-
If (StrComp(PUser.Name, Username, vbTextCompare) = 0) And (PUser.IsPhantom = False) Then
361+
If (StrComp(PUser.Name, Username, vbTextCompare) = 0) Then
352362
GetUserIndexByPriority = pos
353363
Exit Function
354364
End If
@@ -661,7 +671,7 @@ Public Function CheckUsers() As Integer
661671
For i = Users.Count To 1 Step -1
662672
Set CurrentUser = Users(i)
663673

664-
If (CurrentUser.IsOperator = False) And (CurrentUser.IsPhantom = False) Then
674+
If (CurrentUser.IsOperator = False) Then
665675
DBEntry = _
666676
Database.GetUserAccess(CurrentUser.DisplayName)
667677

@@ -683,7 +693,7 @@ Public Function CheckUsers() As Integer
683693
For i = Users.Count To 1 Step -1
684694
Set CurrentUser = Users(i)
685695

686-
If (CurrentUser.IsOperator = False) And (CurrentUser.IsPhantom = False) Then
696+
If (CurrentUser.IsOperator = False) Then
687697
If (CheckUser(CurrentUser.DisplayName, CurrentUser)) Then
688698
Count = (Count + 1)
689699
End If
@@ -702,7 +712,7 @@ Public Function CheckQueue(ByVal Username As String) As Boolean
702712

703713
For i = Users.Count To 1 Step -1
704714
Set CurrentUser = Users(i)
705-
If (StrComp(CurrentUser.DisplayName, Username, vbTextCompare) = 0) And (CurrentUser.IsPhantom = False) Then
715+
If (StrComp(CurrentUser.DisplayName, Username, vbTextCompare) = 0) Then
706716
If (CurrentUser.Queue.Count) Then
707717
CheckQueue = True
708718
End If
@@ -725,6 +735,7 @@ Public Function Clone() As clsChannelObj
725735
Clone.KickCount = KickCount
726736
Clone.JoinCount = JoinCount
727737
Clone.OperatorHeir = OperatorHeir
738+
Clone.HasPhantomUsers = HasPhantomUsers
728739

729740
For i = 1 To Users.Count
730741
Clone.Users.Add Users(i).Clone()

trunk/clsClanObj.cls

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,12 @@ Public Function Clone() As clsClanObj
290290
Set Clone = New clsClanObj
291291

292292
Clone.Name = Name
293+
Clone.FullName = FullName
293294
Clone.MOTD = MOTD
295+
Clone.InClan = InClan
296+
Clone.PendingInvitation = PendingInvitation
297+
Clone.PendingInvitationCookie = PendingInvitationCookie
298+
Clone.PendingClanMOTD = PendingClanMOTD
294299

295300
For i = 1 To Members.Count
296301
Clone.Members.Add Members(i).Clone()

trunk/clsClanPacketHandler.cls

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -300,9 +300,6 @@ Public Sub RequestClanList(Optional ByVal eType As enuServerRequestHandlerType =
300300

301301
Cookie = SaveServerRequest(oRequest)
302302

303-
g_Clan.Clear
304-
frmChat.lvClanList.ListItems.Clear
305-
306303
Set pBuf = New clsDataBuffer
307304
With pBuf
308305
.InsertDWord Cookie

trunk/clsConfig.cls

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1975,7 +1975,7 @@ Private Sub LoadDefaults()
19751975
m_EXPKey = vbNullString
19761976
m_UseSpawn = False
19771977
m_Game = PRODUCT_STAR
1978-
m_Server = "USEast"
1978+
m_Server = "useast.battle.net"
19791979
m_HomeChannel = vbNullString
19801980
m_AutoConnect = False
19811981
m_UseD2Realms = False
@@ -2526,6 +2526,12 @@ Private Sub ConformValues()
25262526

25272527
m_Game = GetProductInfo(m_Game).Code
25282528

2529+
' Fix server values from a dumb patch.
2530+
If m_Server = "USEast" Then m_Server = "useast.battle.net"
2531+
If m_Server = "USWest" Then m_Server = "uswest.battle.net"
2532+
If m_Server = "Europe" Then m_Server = "europe.battle.net"
2533+
If m_Server = "Asia" Then m_Server = "asia.battle.net"
2534+
25292535
If m_AutoSafelistLevel < 1 Or m_AutoSafelistLevel > 200 Then m_AutoSafelistLevel = 20
25302536
If m_NamespaceConvention < 0 Or m_NamespaceConvention > 3 Then m_NamespaceConvention = 0
25312537
If m_SecondsToIdle > 1000000 Then m_SecondsToIdle = 600

trunk/clsDatabase.cls

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1024,7 +1024,7 @@ End Function
10241024
' Determines the operation indicated by the specified string.
10251025
' This parses the +/- from flags and group arguments.
10261026
' Updates the provided string with the indicator removed.
1027-
Private Function CheckOperation(ByVal sOpString As String) As enuDatabaseOperation
1027+
Private Function CheckOperation(ByRef sOpString As String) As enuDatabaseOperation
10281028
If Len(sOpString) = 0 Then
10291029
CheckOperation = dbopNothing
10301030
Exit Function

trunk/clsScriptSupportClass.cls

Lines changed: 35 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -545,7 +545,7 @@ End Function
545545

546546
'// GETPOSITIONBYNAME
547547
'// Returns the channel list position of a user by their username
548-
'// Returns 0 if the user is not present or the only ones present are marked a duplicate/phantom user
548+
'// Returns 0 if the user is not present.
549549
Public Function GetPositionByName(ByVal sUser As String) As Integer
550550
GetPositionByName = g_Channel.GetUserIndexByPriority(sUser, , True)
551551
End Function
@@ -990,6 +990,12 @@ Public Function UtcNow() As Date
990990
UtcNow = modDateTime.UtcNow
991991
End Function
992992

993+
'// UTCTOLOCAL
994+
'// Converts a UTC time and date to local time.
995+
Public Function UtcToLocal(ByVal UtcDate As Date) As Date
996+
UtcToLocal = modDateTime.UtcToLocal(UtcDate)
997+
End Function
998+
993999
'// LOGGER
9941000
'// Returns the logger object
9951001
Public Function Logger() As clsLogger
@@ -1446,14 +1452,16 @@ Public Function GetSettingsEntry(ByVal sEntryName As String, ByVal ScriptName As
14461452
On Error Resume Next
14471453

14481454
Dim Path As String
1455+
Dim iFile As Integer
14491456

14501457
If ScriptName = vbNullString Then ScriptName = modScripting.GetScriptName
14511458

14521459
Path = GetFilePath(FILE_SCRIPT_INI, GetFolderPath("Scripts"))
14531460

14541461
If (LenB(Dir(Path)) = 0) Then
1455-
Open Path For Output As #1
1456-
Close #1
1462+
iFile = FreeFile
1463+
Open Path For Output As #iFile
1464+
Close #iFile
14571465
End If
14581466

14591467
GetSettingsEntry = ReadINI(ScriptName, sEntryName, Path)
@@ -1479,14 +1487,16 @@ Public Sub WriteSettingsEntry(ByVal sEntryName As String, ByVal sValue As String
14791487
On Error GoTo ERROR_HANDLER
14801488

14811489
Dim Path As String
1490+
Dim iFile As Integer
14821491

14831492
If ScriptName = vbNullString Then ScriptName = modScripting.GetScriptName
14841493

14851494
Path = GetFilePath(FILE_SCRIPT_INI, GetFolderPath("Scripts"))
14861495

14871496
If (LenB(Dir(Path)) = 0) Then
1488-
Open Path For Output As #1
1489-
Close #1
1497+
iFile = FreeFile
1498+
Open Path For Output As #iFile
1499+
Close #iFile
14901500
End If
14911501

14921502
WriteINI ScriptName, sEntryName, sValue & _
@@ -1608,6 +1618,26 @@ Public Sub ForcePacketParse(ByVal PacketData As String, ByVal Protocol As String
16081618
Set pBuff = Nothing
16091619
End Sub
16101620

1621+
'// CHECKCHATFILTER
1622+
'// Checks if a message or user is filtered.
1623+
'// Returns True even if filtering is disabled.
1624+
Public Function CheckChatFilter(ByVal sMessage As String, Optional ByVal sUser As String = vbNullString) As Boolean
1625+
CheckChatFilter = False
1626+
1627+
If Len(sUser) > 0 Then
1628+
If modOtherCode.CheckBlock(sUser) Then
1629+
CheckChatFilter = True
1630+
Exit Function
1631+
End If
1632+
End If
1633+
1634+
If modOtherCode.CheckMsg(sMessage, sUser, -5) Then
1635+
CheckChatFilter = True
1636+
Exit Function
1637+
End If
1638+
End Function
1639+
1640+
16111641
'// GETUSERDATABASE
16121642
'// Gets a collection of users in the database
16131643
'// 10/10/2009 B#003 52 - Changed code to destroy the temp object after each use

0 commit comments

Comments
 (0)