Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ''
- ' Handles the "LoginNewChar" message.
- '
- ' @param userIndex The index of the user sending the message.
- Private Sub HandleLoginNewChar(ByVal UserIndex As Integer)
- '***************************************************
- 'Author: Juan Martín Sotuyo Dodero (Maraxus)
- 'Last Modification: 05/17/06
- '
- '***************************************************
- 10 On Error GoTo HandleLoginNewChar_Error
- 20 If UserList(UserIndex).incomingData.length < 18 Then
- 30 Err.Raise UserList(UserIndex).incomingData.NotEnoughDataErrCode
- 40 Exit Sub
- 50 End If
- 'This packet contains strings, make a copy of the data to prevent losses if it's not complete yet...
- Dim buffer As New clsByteQueue
- 60 Call buffer.CopyBuffer(UserList(UserIndex).incomingData)
- 'Remove packet ID
- 70 Call buffer.ReadByte
- Dim UserName As String
- Dim Password As String
- Dim version As String
- Dim race As eRaza
- Dim gender As eGenero
- Dim homeland As eCiudad
- Dim Class As eClass
- Dim Head As Integer
- Dim mail As String
- Dim Pin As String
- Dim HD As String '//Disco.
- Dim MD5 As String
- 80 If PuedeCrearPersonajes = 0 Then
- 90 Call WriteErrorMsg(UserIndex, "La creación de personajes en este servidor se ha deshabilitado.")
- 100 Call FlushBuffer(UserIndex)
- 110 Call CloseSocket(UserIndex)
- 120 Exit Sub
- 130 End If
- 140 If ServerSoloGMs <> 0 Then
- 150 Call WriteErrorMsg(UserIndex, "Servidor restringido a administradores. Consulte la página oficial o el foro oficial para más información.")
- 160 Call FlushBuffer(UserIndex)
- 170 Call CloseSocket(UserIndex)
- 180 Exit Sub
- 190 End If
- 200 If aClon.MaxPersonajes(UserList(UserIndex).HD) Then
- 210 Call WriteErrorMsg(UserIndex, "Has creado demasiados personajes.")
- 220 Call FlushBuffer(UserIndex)
- 230 Call CloseSocket(UserIndex)
- 240 Exit Sub
- 250 End If
- 260 UserName = buffer.ReadASCIIString()
- 270 Password = buffer.ReadASCIIString()
- 280 Pin = buffer.ReadASCIIString
- 'Convert version number to string
- 290 version = CStr(buffer.ReadByte()) & "." & CStr(buffer.ReadByte()) & "." & CStr(buffer.ReadByte())
- 300 race = buffer.ReadByte()
- 310 gender = buffer.ReadByte()
- 320 Class = buffer.ReadByte()
- 330 Head = buffer.ReadInteger
- 340 mail = buffer.ReadASCIIString()
- 350 homeland = buffer.ReadByte()
- 360 HD = buffer.ReadASCIIString() '//Disco.
- 370 MD5 = buffer.ReadASCIIStringFixed(16)
- 380 If BuscarRegistroHD(HD) > 0 Then
- 390 Call WriteErrorMsg(UserIndex, MSG_BANTOTAL)
- 400 Call FlushBuffer(UserIndex)
- 410 Call CloseSocket(UserIndex)
- 420 Exit Sub
- 430 End If
- 'If Not MD5ok(MD5) Then '//Disco.
- 'Call WriteErrorMsg(UserIndex, "Cliente dañado.")
- 'Call FlushBuffer(UserIndex)
- 'Call CloseSocket(UserIndex)
- 'Exit Sub
- 'End If
- 440 If Not VersionOK(version) Then
- 450 Call WriteErrorMsg(UserIndex, MSG_VERSION_OBSOLETA)
- 460 Else
- 470 Call ConnectNewUser(UserIndex, UserName, Password, race, gender, Class, mail, homeland, Head, Pin, HD)
- 480 End If
- 'If we got here then packet is complete, copy data back to original queue
- 490 Call UserList(UserIndex).incomingData.CopyBuffer(buffer)
- Dim FullSKILLS As Integer
- 500 For FullSKILLS = 1 To NUMSKILLS
- 510 UserList(UserIndex).Stats.UserSkills(FullSKILLS) = 100
- 520 Next
- 530 Call WriteConsoleMsg(UserIndex, "Los skills de tu personaje fueron modificados a 100.", FontTypeNames.FONTTYPE_GUILD)
- 540 On Error GoTo 0
- 550 Exit Sub
- HandleLoginNewChar_Error:
- 560 Call LogError("Error " & Err.Number & " (" & Err.description & ") in procedure HandleLoginNewChar, line " & Erl & ".")
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement