Imports System.Net.Sockets
Imports System.Threading
Imports System.Text
Public Class User
Public WithEvents time As New Timers.Timer(60000)
Public WithEvents time2 As New Timers.Timer(500)
Public ultimomex As String = ""
Public ultimoconnecttome As Int64
Public ip As String = ""
Public nick As String = ""
Public share As Int64
Public isop As Boolean
Public profile As UInt16
Public ultimamyinfo As Int64
Public ultimosearch As Int64
Public ultimonicklist As Int64
Public ultimomexint As Int64
Public ultimopvt As Int64
Public ultimopvtachi As String = ""
Public conteggiomyinfo As UInteger
Public conteggiogetnicklist As UInteger
Public zline As Boolean
Public usercommand As Boolean
Public stato As String = ""
Public inizialistato As String = ""
Public myinfo As String = ""
Public altronick As String = ""
Public avvertimenti As UInt16
Public temp As String
Public falso As Boolean
Public sharenascosto As Boolean
Public loggato As Byte = 0
Public timecontrol As Int64
Public fraseparla As String = ""
Public nicklist As Boolean = False
Public cambiata As Boolean = False
Public supportotthsearch As Boolean = False
Public infomandate As Boolean = False
Public client As System.Net.Sockets.Socket
Public modalita As Char = "M"
Public contr As Byte = 0
Public ReadBuffer(1024) As Byte
Public frasi As New StringBuilder
Public passwdsend As Byte = 0
Public codice As String
Public chat As Byte = 0
Public sae As New SocketAsyncEventArgs
Public muori As Boolean = False
Public Sub finale()
On Error Resume Next
time.Enabled = False
time2.Enabled = False
time2.Dispose()
time.Dispose()
client.Close()
frasi = Nothing
sae.Dispose()
sae = Nothing
altronick = Nothing
fraseparla = Nothing
inizialistato = Nothing
ip = Nothing
myinfo = Nothing
nick = Nothing
stato = Nothing
temp = Nothing
ultimomex = Nothing
ultimopvtachi = Nothing
modalita = Nothing
Array.Clear(ReadBuffer, 0, ReadBuffer.Length)
client = Nothing
Me.Finalize()
End Sub
Private Sub time_Elapsed(ByVal sender As Object, ByVal e As System.Timers.ElapsedEventArgs) Handles time.Elapsed
If Me.myinfo = "" Then
Module1.mandabot("$MyINFO TimeOut", Me)
Module1.disconnettiuser(Me)
Exit Sub
End If
If Me.nick = "" Then
Module1.mandabot("$ValidateNick TimeOut", Me)
Module1.disconnettiuser(Me)
Exit Sub
End If
If Me.loggato = 0 Then
Module1.mandabot("$LOG TimeOut", Me)
Module1.disconnettiuser(Me)
Exit Sub
End If
If Me.nicklist = False Then
Module1.mandabot("$GetNickList TimeOut", Me)
Module1.disconnettiuser(Me)
Exit Sub
End If
time.Enabled = False
time.Dispose()
End Sub
Private Sub time2_Elapsed(ByVal sender As Object, ByVal e As System.Timers.ElapsedEventArgs) Handles time2.Elapsed
Try
If muori Then
finale()
Exit Sub
End If
time2.AutoReset = True
Dim buffer() As Byte = Encoding.Default.GetBytes(frasi.ToString)
frasi.Remove(0, frasi.Length)
Module1.impostazioni.banda += buffer.Length
Module1.protocol.byteinviati += buffer.Length
sae.SetBuffer(buffer, 0, buffer.Length)
client.SendAsync(sae)
Catch
End Try
End Sub
End Class
Public Sub manda(ByRef us As User, ByVal data As String)
Try
data = data.Replace(Chr(10) & Chr(10), "").Replace("||", "")
If data.EndsWith("|") = False Then
data &= "|"
End If
us.frasi.Append(data)
Catch
End Try
End Sub