Move git root from Client/ to src/ to track all source code: - Client: Game client source (moved to Client/Client/) - Server: Game server source - GameTools: Development tools - CryptoSource: Encryption utilities - database: Database scripts - Script: Game scripts - rylCoder_16.02.2008_src: Legacy coder tools - GMFont, Game: Additional resources 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1147 lines
43 KiB
VB.net
1147 lines
43 KiB
VB.net
Imports System.Text
|
|
Imports System.Convert
|
|
|
|
Module ProcessPacket
|
|
|
|
Public IRylMDI As RylMDI = Nothing
|
|
Public IAdminInfo As AdminInfo = Nothing
|
|
Public IUserLogin As UserLogin = Nothing
|
|
Public ICharRestraint As CharRestraint = Nothing
|
|
Public ICharRestraintReg As CharRestraintReg = Nothing
|
|
Public ICharInfo As CharInfo = Nothing
|
|
Public ICharItemInfo As CharItemInfo = Nothing
|
|
Public ICharItemInfoDetail2 As CharItemInfoDetail = Nothing
|
|
Public IUserLastLogout As UserLastLogOut = Nothing
|
|
|
|
Public IAdminSetting As AdminSetting = Nothing
|
|
|
|
'구조체 초기화.
|
|
Public IToolAdminRight As New ToolAdminRight()
|
|
|
|
Public Structure ItemInfo
|
|
|
|
Dim m_szItemName As String ' 텍스트로 된 아이템 이름(64)
|
|
Dim m_dwItemUID As UInt64 ' 아이템 UID
|
|
Dim m_usItemProtoTypeID As UInt16 ' 아이템 종류 ID
|
|
Dim m_cItemType As Byte ' 아이템 타입 ( 주석 1 참고 )
|
|
Dim m_cTakeType As Byte ' 아이템 컨테이너 타입
|
|
|
|
Dim m_cXPos As Byte ' 아이템 X위치
|
|
Dim m_cYPos As Byte ' 아이템 Y위치
|
|
Dim m_cZPos As Byte ' 아이템 탭 위치
|
|
Dim m_cNumOrDurability As Byte ' 장비는 내구도, 다른 것은 개수
|
|
|
|
Dim m_cXSize As Byte ' X크기
|
|
Dim m_cYSize As Byte ' Y크기
|
|
Dim m_bEquip As Boolean ' 장비인지 여부
|
|
Dim m_cPadding As Byte ' 무의미.
|
|
|
|
' 장비만 가지고 있는 데이터
|
|
|
|
Dim m_usRuneSocket As UInt16 ' 룬 소켓
|
|
Dim m_cMaxDurability As Byte ' 최대 내구도
|
|
Dim m_cCurrentSocketNum As Byte ' 현재 소켓 개수
|
|
Dim m_cMaxSocketNum As Byte ' 최대 소켓 개수
|
|
Dim m_cMaterialType As Byte ' 업그레이드 단계
|
|
Dim m_cSocket() As Byte ' 박혀 있는 소켓 (최대 8개)
|
|
Dim m_usAttribute() As UInt16 ' 속성값 (34개)
|
|
|
|
End Structure
|
|
|
|
|
|
Public Function Min(ByVal lhs As Int32, ByVal rhs As Int32) As Int32
|
|
|
|
If lhs < rhs Then
|
|
Min = lhs
|
|
Else
|
|
Min = rhs
|
|
End If
|
|
|
|
End Function
|
|
|
|
Public Function Max(ByVal lhs As Int32, ByVal rhs As Int32) As Int32
|
|
|
|
If lhs < rhs Then
|
|
Max = rhs
|
|
Else
|
|
Max = lhs
|
|
End If
|
|
|
|
End Function
|
|
|
|
Public Function GetTakePos(ByVal Pos As Int32) As String
|
|
|
|
Select Case Pos
|
|
|
|
Case 1 : GetTakePos = ITextItemInfo.cboitemwhere_1
|
|
Case 2 : GetTakePos = ITextItemInfo.cboitemwhere_2
|
|
Case 6 : GetTakePos = ITextItemInfo.cboitemwhere_3
|
|
Case 7 : GetTakePos = ITextItemInfo.cboitemwhere_4
|
|
Case 8 : GetTakePos = ITextItemInfo.cboitemwhere_5
|
|
Case 9 : GetTakePos = ITextItemInfo.cboitemwhere_6
|
|
Case Else : GetTakePos = "Nowhere"
|
|
|
|
End Select
|
|
|
|
End Function
|
|
|
|
Public Function GetTakePos(ByVal Pos As String) As Byte
|
|
|
|
Select Case Pos
|
|
|
|
Case ITextItemInfo.cboitemwhere_1 : GetTakePos = 1
|
|
Case ITextItemInfo.cboitemwhere_2 : GetTakePos = 2
|
|
Case ITextItemInfo.cboitemwhere_3 : GetTakePos = 6
|
|
Case ITextItemInfo.cboitemwhere_4 : GetTakePos = 7
|
|
Case ITextItemInfo.cboitemwhere_5 : GetTakePos = 8
|
|
Case ITextItemInfo.cboitemwhere_6 : GetTakePos = 9
|
|
Case Else : GetTakePos = 0
|
|
|
|
End Select
|
|
|
|
End Function
|
|
|
|
'관리자 인증
|
|
Public Sub ProcessLoginAck(ByVal contents() As Byte, ByVal nPacketCMD As Byte, ByVal errorCode As Int16)
|
|
|
|
Dim cRights As Byte = contents(0)
|
|
|
|
'성공한 경우에만 값을 가져온다.
|
|
If errorCode = 0 Then
|
|
'권한을 얻어온다.
|
|
AdminKind = Chr(cRights)
|
|
IRylMDI.ILogin.Hide()
|
|
|
|
'관리자의 권한을 가져온다.
|
|
Dim Pos As Int32 = 1
|
|
|
|
IToolAdminRight.charEdit = BitConverter.ToBoolean(contents, Pos + 1)
|
|
IToolAdminRight.charLocation = BitConverter.ToBoolean(contents, Pos + 2)
|
|
IToolAdminRight.charseeItem = BitConverter.ToBoolean(contents, Pos + 3)
|
|
|
|
IToolAdminRight.ItemCreate = BitConverter.ToBoolean(contents, Pos + 4)
|
|
IToolAdminRight.ItemEdit = BitConverter.ToBoolean(contents, Pos + 5)
|
|
IToolAdminRight.ItemDel = BitConverter.ToBoolean(contents, Pos + 6)
|
|
|
|
IToolAdminRight.RestraintReg = BitConverter.ToBoolean(contents, Pos + 7)
|
|
IToolAdminRight.RestraintRelease = BitConverter.ToBoolean(contents, Pos + 8)
|
|
|
|
IToolAdminRight.currentUserLogin = BitConverter.ToBoolean(contents, Pos + 9)
|
|
IToolAdminRight.lastUserLogin = BitConverter.ToBoolean(contents, Pos + 10)
|
|
IToolAdminRight.DoingLogout = BitConverter.ToBoolean(contents, Pos + 11)
|
|
|
|
|
|
|
|
Else
|
|
|
|
MsgBox(ITextProcessPacket.msg_error_1, MsgBoxStyle.OKOnly, ITextMSG.msg_faild)
|
|
|
|
End If
|
|
|
|
End Sub
|
|
|
|
'관리자 입력하기
|
|
Public Sub ProcessRegAdmin(ByVal contents() As Byte, ByVal nPacketCMD As Byte, ByVal errorCode As Int16)
|
|
|
|
If errorCode = 0 Then
|
|
MsgBox(ITextProcessPacket.msg_success_1, MsgBoxStyle.OKOnly, ITextMSG.msg_success)
|
|
IAdminInfo.RefreshAdmin()
|
|
Else
|
|
MsgBox(ITextProcessPacket.msg_error_2, MsgBoxStyle.OKOnly, ITextMSG.msg_faild)
|
|
End If
|
|
|
|
IAdminInfo.btnAdminReg.Enabled = True
|
|
|
|
End Sub
|
|
|
|
'관리자조회
|
|
Public Sub ProcessSearchAdmin(ByVal contents() As Byte, ByVal nPacketCMD As Byte, ByVal errorCode As Int16)
|
|
|
|
If 0 = contents(0) Then
|
|
|
|
Select Case nPacketCMD
|
|
Case 3
|
|
MsgBox(ITextProcessPacket.msg_error_3, MsgBoxStyle.OKOnly, ITextMSG.msg_faild)
|
|
|
|
Case 4
|
|
MsgBox(ITextProcessPacket.msg_error_4, MsgBoxStyle.OKOnly, ITextMSG.msg_faild)
|
|
|
|
End Select
|
|
|
|
Else
|
|
|
|
'받아오는 패킷을 분리한다.
|
|
Dim encoding As Encoding = encoding.GetEncoding(Code)
|
|
|
|
If False = IAdminInfo.Equals(Nothing) Then
|
|
|
|
Dim myDataRow As DataRow = ds.Tables(AdminTableIndex).NewRow()
|
|
|
|
myDataRow("strAdminID") = encoding.GetString(contents, 0, 16)
|
|
myDataRow("strPasswd") = encoding.GetString(contents, 16, 16)
|
|
myDataRow("strLevel") = Chr(contents(55))
|
|
myDataRow("strName") = encoding.GetString(contents, 48, 7)
|
|
myDataRow("strIp") = encoding.GetString(contents, 32, 16)
|
|
myDataRow("dateRegit") = encoding.GetString(contents, 56, 11)
|
|
|
|
ds.Tables(AdminTableIndex).Rows.Add(myDataRow)
|
|
|
|
End If
|
|
|
|
End If
|
|
|
|
End Sub
|
|
|
|
'관리자 정보변경
|
|
Public Sub ProcessEditAdmin(ByVal contents() As Byte, ByVal nPacketCMD As Byte, ByVal errorCode As Int16)
|
|
If errorCode = 0 Then
|
|
MsgBox(ITextProcessPacket.msg_success_2, MsgBoxStyle.OKOnly, ITextMSG.msg_success)
|
|
IAdminInfo.RefreshAdmin()
|
|
Else
|
|
MsgBox(ITextProcessPacket.msg_error_5, MsgBoxStyle.OKOnly, ITextMSG.msg_faild)
|
|
End If
|
|
|
|
End Sub
|
|
|
|
|
|
'관리자삭제
|
|
Public Sub ProcessDeleteAdmin(ByVal contents() As Byte, ByVal nPacketCMD As Byte, ByVal errorCode As Int16)
|
|
|
|
If errorCode = 0 Then
|
|
MsgBox(ITextProcessPacket.msg_success_3, MsgBoxStyle.OKOnly, ITextMSG.msg_success)
|
|
IAdminInfo.RefreshAdmin()
|
|
Else
|
|
MsgBox(ITextProcessPacket.msg_error_6, MsgBoxStyle.OKOnly, ITextMSG.msg_faild)
|
|
End If
|
|
|
|
End Sub
|
|
|
|
'현재접속중인 사용자 검색
|
|
Public Sub ProcessSelectCurrentUser(ByVal contents() As Byte, ByVal nPacketCMD As Byte, ByVal errorCode As Int16)
|
|
|
|
If 0 = contents(0) Then
|
|
|
|
MsgBox(ITextProcessPacket.msg_error_7, MsgBoxStyle.OKOnly, ITextMSG.msg_faild)
|
|
|
|
Else
|
|
'받아오는 패킷을 분리한다.
|
|
If False = IUserLogin.Equals(Nothing) Then
|
|
|
|
Dim encoding As Encoding = encoding.GetEncoding(Code)
|
|
|
|
Dim myDataRow As DataRow = ds.Tables(CurrentUserIndex).NewRow()
|
|
|
|
myDataRow("strClientID") = encoding.GetString(contents, 0, 16)
|
|
myDataRow("UID") = BitConverter.ToInt32(contents, 16) '4byte
|
|
myDataRow("intCRMIndex") = BitConverter.ToInt32(contents, 20) '4byte
|
|
myDataRow("strIP") = encoding.GetString(contents, 24, 16)
|
|
myDataRow("ServerID") = BitConverter.ToInt32(contents, 40) '4byte
|
|
myDataRow("LoginTime") = encoding.GetString(contents, 44, 20)
|
|
myDataRow("BillType") = Chr(contents(64))
|
|
|
|
ds.Tables(CurrentUserIndex).Rows.Add(myDataRow)
|
|
|
|
End If
|
|
End If
|
|
|
|
End Sub
|
|
|
|
'현재접속중인 사용자 검색
|
|
Public Sub ProcessLogoutUser(ByVal contents() As Byte, ByVal nPacketCMD As Byte, ByVal errorCode As Int16)
|
|
If errorCode = 0 Then
|
|
MsgBox(ITextProcessPacket.msg_success_4, MsgBoxStyle.OKOnly, ITextMSG.msg_success)
|
|
IUserLogin.CurrentUserRefresh()
|
|
Else
|
|
MsgBox(ITextProcessPacket.msg_error_8, MsgBoxStyle.OKOnly, ITextMSG.msg_faild)
|
|
End If
|
|
|
|
End Sub
|
|
|
|
|
|
Public Sub ProcessViewRestraintUser(ByVal contents() As Byte, ByVal nPacketCMD As Byte, ByVal errorCode As Int16)
|
|
|
|
' UID(4) / UserID(16) / CharacterName(16) / BlockType(9) / BlockKind(9) / HasBlock(9) /
|
|
' BlockFinishDate(20) / AdminName(16) / Description(31)
|
|
|
|
|
|
' recv
|
|
|
|
If 0 = errorCode And False = ICharRestraint.Equals(Nothing) And 0 <> BitConverter.ToInt32(contents, 0) Then
|
|
|
|
Dim encoding As Encoding = encoding.GetEncoding(Code)
|
|
|
|
Dim myDataRow As DataRow = ds.Tables(CharRestraintIndex).NewRow()
|
|
|
|
myDataRow("UID") = BitConverter.ToInt32(contents, 0) ' UID(4)
|
|
myDataRow("strClientID") = encoding.GetString(contents, 4, 16) ' UserID(16)
|
|
myDataRow("strCharacterID") = encoding.GetString(contents, 20, 16) ' CharacterName(16)
|
|
myDataRow("BlockType") = encoding.GetString(contents, 36, 9) ' BlockType(9)
|
|
myDataRow("BlockKind") = encoding.GetString(contents, 45, 9) ' BlockKind(9)
|
|
myDataRow("Blocked") = encoding.GetString(contents, 54, 9) ' HasBlock(9)
|
|
myDataRow("EndTime") = encoding.GetString(contents, 63, 20) ' BlockFinishDate(20)
|
|
myDataRow("adminid") = encoding.GetString(contents, 83, 16) ' AdminName(16)
|
|
myDataRow("discription") = encoding.GetString(contents, 99, 31) ' Description(31)
|
|
|
|
ds.Tables(CharRestraintIndex).Rows.Add(myDataRow)
|
|
|
|
End If
|
|
|
|
End Sub
|
|
|
|
Public Sub ProcessAddRestraintUser(ByVal contents() As Byte, ByVal nPacketCMD As Byte, ByVal errorCode As Int16)
|
|
|
|
' errorCode만 보면 됨
|
|
Select Case errorCode
|
|
|
|
Case 0
|
|
MsgBox(ITextProcessPacket.msg_success_5, MsgBoxStyle.OKOnly, ITextMSG.msg_success)
|
|
|
|
Case Else
|
|
MsgBox(ITextProcessPacket.msg_error_9, MsgBoxStyle.OKOnly, ITextMSG.msg_faild)
|
|
|
|
End Select
|
|
|
|
ICharRestraint.ViewRestraintList()
|
|
|
|
End Sub
|
|
|
|
Public Sub ProcessDeleteRestraintUser(ByVal contents() As Byte, ByVal nPacketCMD As Byte, ByVal errorCode As Int16)
|
|
|
|
' errorCode만 보면 됨
|
|
Select Case errorCode
|
|
|
|
Case 0
|
|
MsgBox(ITextProcessPacket.msg_success_6, MsgBoxStyle.OKOnly, ITextMSG.msg_success)
|
|
|
|
Case Else
|
|
MsgBox(ITextProcessPacket.msg_error_10, MsgBoxStyle.OKOnly, ITextMSG.msg_faild)
|
|
|
|
End Select
|
|
|
|
ICharRestraint.ViewRestraintList()
|
|
|
|
End Sub
|
|
|
|
' 캐릭터 제재상황 보기
|
|
Public Sub ProcessCheckRestraintUser(ByVal contents() As Byte, ByVal nPacketCMD As Byte, ByVal errorCode As Int16)
|
|
|
|
Dim encoding As Encoding = encoding.GetEncoding(Code)
|
|
|
|
Dim flag As Byte = contents(0) ' 0 : 제재 없음, 1 : 계정 블럭, 2 : 캐릭터 블럭
|
|
encoding.GetString(contents, 1, 16) ' 제재캐릭 1 이름
|
|
encoding.GetString(contents, 17, 16) ' 제재캐릭 2 이름
|
|
encoding.GetString(contents, 33, 16) ' 제재캐릭 3 이름
|
|
|
|
End Sub
|
|
|
|
'캐릭터리스트만 보여주기
|
|
Public Sub ProcessSelectCharidList(ByVal contents() As Byte, ByVal nPacketCMD As Byte, ByVal errorCode As Int16)
|
|
|
|
Dim encoding As Encoding = encoding.GetEncoding(Code)
|
|
|
|
If False = (ICharInfo Is Nothing) Then
|
|
|
|
If False = ICharInfo.btnIDSearch.Enabled Then
|
|
|
|
If contents(0) = 0 And contents(16) = 0 And contents(32) = 0 Then
|
|
|
|
MsgBox(ITextProcessPacket.msg_error_11, MsgBoxStyle.OKOnly, ITextMSG.msg_faild)
|
|
|
|
Else
|
|
|
|
ICharInfo.lboxCharid.Items.Add(encoding.GetString(contents, 0, 16))
|
|
ICharInfo.lboxCharid.Items.Add(encoding.GetString(contents, 16, 16))
|
|
ICharInfo.lboxCharid.Items.Add(encoding.GetString(contents, 32, 16))
|
|
|
|
End If
|
|
|
|
ICharInfo.btnIDSearch.Enabled = True
|
|
|
|
End If
|
|
|
|
End If
|
|
|
|
If False = (ICharRestraintReg Is Nothing) Then
|
|
|
|
If False = ICharRestraintReg.btnSearch.Enabled Then
|
|
|
|
If contents(0) = 0 And contents(16) = 0 And contents(32) = 0 Then
|
|
|
|
MsgBox(ITextProcessPacket.msg_error_11, MsgBoxStyle.OKOnly, ITextMSG.msg_faild)
|
|
|
|
Else
|
|
|
|
ICharRestraintReg.cboCharID.Items.Add(encoding.GetString(contents, 0, 16))
|
|
ICharRestraintReg.cboCharID.Items.Add(encoding.GetString(contents, 16, 16))
|
|
ICharRestraintReg.cboCharID.Items.Add(encoding.GetString(contents, 32, 16))
|
|
|
|
ICharRestraintReg.cboCharID.SelectedIndex = 0
|
|
ICharRestraintReg.btnCommit.Enabled = True
|
|
|
|
End If
|
|
|
|
ICharRestraintReg.btnSearch.Enabled = True
|
|
|
|
End If
|
|
|
|
End If
|
|
|
|
End Sub
|
|
|
|
'캐릭터 상세 정보 보기
|
|
Public Sub ProcessSelectCharidInfo(ByVal contents() As Byte, ByVal nPacketCMD As Byte, ByVal errorCode As Int16)
|
|
|
|
|
|
' UID(4)/CID(4)/Type(1)
|
|
' 데이터 타입 - 0 : 캐릭 데이터, 1 : 창고 정보, 2 : 아이템 추가 또는 업데이트(위치, UID가 같은 경우만 업데이트)
|
|
If 0 = errorCode Then
|
|
|
|
Select Case contents(8)
|
|
|
|
Case 0
|
|
ParseCharInfo(contents)
|
|
|
|
Case 1
|
|
ParseStoreInfo(contents)
|
|
|
|
Case 2
|
|
ParseItems(contents)
|
|
|
|
Case 3
|
|
'
|
|
ICharInfo.btnCharSearch.Enabled = True
|
|
ICharInfo.btnIDSearch.Enabled = True
|
|
ICharInfo.btnDetailItemInfo.Enabled = True
|
|
|
|
MsgBox(ITextProcessPacket.msg_success_7, MsgBoxStyle.OKOnly, ITextMSG.msg_success)
|
|
|
|
End Select
|
|
|
|
Else
|
|
|
|
ICharInfo.btnCharSearch.Enabled = True
|
|
ICharInfo.btnIDSearch.Enabled = True
|
|
ICharInfo.btnDetailItemInfo.Enabled = False
|
|
|
|
MsgBox(ITextProcessPacket.msg_error_12 + " : ErrorCode" + errorCode.ToString, MsgBoxStyle.OKOnly, "FAILED")
|
|
|
|
End If
|
|
|
|
End Sub
|
|
|
|
Private Sub ParseCharInfo(ByVal contents() As Byte)
|
|
|
|
Dim encoding As Encoding = encoding.GetEncoding(Code)
|
|
|
|
Dim CharDataSize(7) As Int32
|
|
|
|
' TODO : UID 화면에 표시해 줄 것
|
|
Dim dwUID As UInt32 = BitConverter.ToUInt32(contents, 0)
|
|
Dim dwCID As UInt32 = BitConverter.ToUInt32(contents, 4)
|
|
Dim TypeCode As Byte = contents(8)
|
|
|
|
' 처음 1Byte는 타입..
|
|
' 그 다음 16Byte는 unsigned short * 4 - 각 섹션의 데이터 길이.
|
|
|
|
Dim nCount As Int32
|
|
For nCount = 0 To 7
|
|
CharDataSize(nCount) = ToInt32(BitConverter.ToUInt16(contents, nCount * 2 + 9))
|
|
Next
|
|
|
|
Dim Pos As Int32 = 25
|
|
|
|
' CHAR_INFOST CharDataSize(0)
|
|
' CHAR_POS CharDataSize(1)
|
|
' SKILL CharDataSize(2)
|
|
' QUICK CharDataSize(3)
|
|
' EQUIP CharDataSize(4) 무시...
|
|
' INVEN CharDataSize(5) 무시...
|
|
' EXTRA CharDataSize(6) 무시...
|
|
' EXCHANGE CharDataSize(7) 무시...
|
|
|
|
' CHAR_INFOST
|
|
If 72 <= CharDataSize(0) And Pos + CharDataSize(0) <= contents.GetLength(0) Then
|
|
|
|
ICharInfo.txtSearchID.Text = ""
|
|
ICharInfo.txtUID.Text = dwUID.ToString
|
|
ICharInfo.txtCID.Text = BitConverter.ToInt32(contents, Pos).ToString
|
|
ICharInfo.txtName.Text = encoding.GetString(contents, Pos + 4, 16)
|
|
ICharInfo.txtMW.Text = contents(Pos + 20).ToString ' 1 : 남자, 2 : 여자
|
|
ICharInfo.txtHead.Text = contents(Pos + 21).ToString ' Head가 아니라 Hair임
|
|
ICharInfo.txtFace.Text = contents(Pos + 22).ToString ' 얼굴형
|
|
ICharInfo.txtKind.Text = contents(Pos + 23).ToString ' Kind - 캐릭터 종족. 0 : 인간, 1 : 아칸
|
|
ICharInfo.txtClass.Text = BitConverter.ToUInt16(contents, Pos + 24).ToString ' 캐릭터 클래스
|
|
|
|
ICharInfo.txtFame.Text = BitConverter.ToUInt32(contents, Pos + 26).ToString ' 명성
|
|
ICharInfo.txtMi.Text = BitConverter.ToUInt32(contents, Pos + 30).ToString ' 마일리지
|
|
ICharInfo.txtGuild.Text = BitConverter.ToUInt32(contents, Pos + 34).ToString ' 길드
|
|
ICharInfo.txtParty.Text = BitConverter.ToUInt32(contents, Pos + 38).ToString ' 파티
|
|
|
|
ICharInfo.txtLevel.Text = contents(Pos + 42).ToString ' 레벨
|
|
ICharInfo.txtMoney.Text = BitConverter.ToUInt32(contents, Pos + 43).ToString ' 돈
|
|
|
|
ICharInfo.txtIP.Text = BitConverter.ToUInt16(contents, Pos + 47).ToString ' IP (능력치 증가포인트)
|
|
ICharInfo.txtStr.Text = BitConverter.ToUInt16(contents, Pos + 49).ToString ' 힘
|
|
ICharInfo.txtDex.Text = BitConverter.ToUInt16(contents, Pos + 51).ToString ' 민첩성
|
|
ICharInfo.txtCon.Text = BitConverter.ToUInt16(contents, Pos + 53).ToString ' 건강
|
|
ICharInfo.txtIni.Text = BitConverter.ToUInt16(contents, Pos + 55).ToString ' 지력
|
|
ICharInfo.txtWis.Text = BitConverter.ToUInt16(contents, Pos + 57).ToString ' 지혜
|
|
|
|
ICharInfo.txtHp.Text = BitConverter.ToUInt16(contents, Pos + 59).ToString ' HP
|
|
ICharInfo.txtMp.Text = BitConverter.ToUInt16(contents, Pos + 61).ToString ' MP
|
|
ICharInfo.txtExp.Text = BitConverter.ToUInt64(contents, Pos + 63).ToString ' EXP
|
|
|
|
Pos = Pos + CharDataSize(0)
|
|
|
|
End If
|
|
|
|
' CHAR_POS
|
|
If 24 = CharDataSize(1) And Pos + CharDataSize(1) <= contents.GetLength(0) Then
|
|
|
|
ICharInfo.txtX.Text = BitConverter.ToSingle(contents, Pos).ToString
|
|
ICharInfo.txtY.Text = BitConverter.ToSingle(contents, Pos + 4).ToString
|
|
ICharInfo.txtZ.Text = BitConverter.ToSingle(contents, Pos + 8).ToString
|
|
|
|
Dim SaveXPos As String = BitConverter.ToSingle(contents, Pos + 12).ToString
|
|
Dim SaveYPos As String = BitConverter.ToSingle(contents, Pos + 16).ToString
|
|
Dim SaveZPos As String = BitConverter.ToSingle(contents, Pos + 20).ToString
|
|
|
|
End If
|
|
|
|
' 아이템 정보는 무시한다....
|
|
|
|
End Sub
|
|
|
|
|
|
Private Sub ParseStoreInfo(ByVal contents() As Byte)
|
|
|
|
Dim Pos As Int32 = 9
|
|
|
|
Dim Password As String = Chr(contents(Pos)) + Chr(contents(Pos + 1)) + Chr(contents(Pos + 2)) + Chr(contents(Pos + 3))
|
|
Dim Gold As UInt32 = BitConverter.ToUInt32(contents, Pos + 9)
|
|
|
|
End Sub
|
|
|
|
Private Sub ParseItems(ByVal contents() As Byte)
|
|
|
|
'struct(AdminToolItemInfo)
|
|
'{
|
|
' char m_szItemName[64]; 0, 64
|
|
' unsigned __int64 m_ItemUID; 64, 8
|
|
' unsigned short m_usItemProtoTypeID; 72, 2
|
|
' unsigned char m_cItemType; 74, 1
|
|
' unsigned char m_cTakeType; 75, 1
|
|
|
|
' unsigned char m_cXPos;
|
|
' unsigned char m_cYPos;
|
|
' unsigned char m_cZPos;
|
|
' unsigned char m_cNumOrDurability;
|
|
|
|
' unsigned char m_cXSize;
|
|
' unsigned char m_cYSize;
|
|
' bool m_bEquip;
|
|
' unsigned char m_cPadding;
|
|
'};
|
|
|
|
'struct(AdminToolEquipInfo) : Public AdminToolItemInfo
|
|
'{
|
|
' unsigned short m_usRuneSocket;
|
|
' unsigned char m_cMaxDurability;
|
|
' unsigned char m_cCurrentSocketNum;
|
|
|
|
' unsigned char m_cMaxSocketNum;
|
|
' unsigned char m_cMaterialType;
|
|
|
|
' unsigned char m_cSocket[8];
|
|
' short m_usAttribute[34];
|
|
'}
|
|
|
|
Dim encoding As Encoding = encoding.GetEncoding(Code)
|
|
Dim Pos As Int32 = 9
|
|
|
|
Dim itemInfo As ItemInfo = ConvertArrayToItem(contents, Pos)
|
|
ICharInfo.CharItemData.Add(itemInfo)
|
|
|
|
End Sub
|
|
|
|
Public Sub ProcessCommitData(ByVal contents() As Byte, ByVal nPacketCMD As Byte, ByVal errorCode As Int16)
|
|
|
|
Select Case errorCode
|
|
|
|
Case 0
|
|
MsgBox(ITextProcessPacket.msg_success_8, MsgBoxStyle.OKOnly, ITextMSG.msg_success)
|
|
|
|
Case Else
|
|
MsgBox(ITextProcessPacket.msg_error_13 + ". ErrorCode : " + errorCode.ToString, MsgBoxStyle.OKOnly, ITextMSG.msg_faild)
|
|
|
|
End Select
|
|
|
|
End Sub
|
|
|
|
Public Sub ProcessUpdateCharData(ByVal contents() As Byte, ByVal nPacketCMD As Byte, ByVal errorCode As Int16)
|
|
|
|
Select Case errorCode
|
|
|
|
Case 0
|
|
MsgBox(ITextProcessPacket.msg_success_9, MsgBoxStyle.OKOnly, ITextMSG.msg_success)
|
|
|
|
Case Else
|
|
MsgBox(ITextProcessPacket.msg_error_14 + ". ErrorCode : " + errorCode.ToString, MsgBoxStyle.OKOnly, ITextMSG.msg_faild)
|
|
|
|
End Select
|
|
|
|
End Sub
|
|
|
|
Public Sub ProcessUpdateLastPos(ByVal contents() As Byte, ByVal nPacketCMD As Byte, ByVal errorCode As Int16)
|
|
|
|
Select Case errorCode
|
|
|
|
Case 0
|
|
MsgBox(ITextProcessPacket.msg_success_10, MsgBoxStyle.OKOnly, ITextMSG.msg_success)
|
|
|
|
Case Else
|
|
MsgBox(ITextProcessPacket.msg_error_15 + ". ErrorCode : " + errorCode.ToString, MsgBoxStyle.OKOnly, ITextMSG.msg_faild)
|
|
|
|
End Select
|
|
|
|
End Sub
|
|
|
|
Public Sub ProcessCreateItem(ByVal contents() As Byte, ByVal nPacketCMD As Byte, ByVal errorCode As Int16)
|
|
|
|
Select Case errorCode
|
|
|
|
Case 0
|
|
|
|
MsgBox(ITextProcessPacket.msg_success_11, MsgBoxStyle.OKOnly, ITextMSG.msg_success)
|
|
Dim Item As ItemInfo = ConvertArrayToItem(contents, 0)
|
|
|
|
' 아이템 데이터를 로우셋에 추가
|
|
ICharInfo.CharItemData.Add(Item)
|
|
UpdateItemView()
|
|
|
|
Case Else
|
|
MsgBox(ITextProcessPacket.msg_error_16 + ". ErrorCode : " + errorCode.ToString, MsgBoxStyle.OKOnly, ITextMSG.msg_faild)
|
|
|
|
End Select
|
|
|
|
End Sub
|
|
|
|
Public Sub ProcessUpdateItem(ByVal contents() As Byte, ByVal nPacketCMD As Byte, ByVal errorCode As Int16)
|
|
|
|
Select Case errorCode
|
|
|
|
Case 0
|
|
|
|
MsgBox(ITextProcessPacket.msg_success_12, MsgBoxStyle.OKOnly, ITextMSG.msg_success)
|
|
Dim Item As ItemInfo = ConvertArrayToItem(contents, 0)
|
|
|
|
' 아이템 데이터를 로우셋에 추가
|
|
Dim myEnumerator As System.Collections.IEnumerator = _
|
|
ICharInfo.CharItemData.GetEnumerator()
|
|
|
|
While myEnumerator.MoveNext()
|
|
|
|
Dim oldItem As ItemInfo = myEnumerator.Current
|
|
|
|
If Item.m_dwItemUID.Equals(oldItem.m_dwItemUID) And _
|
|
Item.m_usItemProtoTypeID.Equals(oldItem.m_usItemProtoTypeID) And _
|
|
Item.m_cTakeType = oldItem.m_cTakeType And _
|
|
Item.m_cXPos = oldItem.m_cXPos And _
|
|
Item.m_cYPos = oldItem.m_cYPos And _
|
|
Item.m_cZPos = oldItem.m_cZPos Then
|
|
|
|
ICharInfo.CharItemData.Remove(myEnumerator.Current)
|
|
ICharInfo.CharItemData.Add(Item)
|
|
|
|
Exit While
|
|
|
|
End If
|
|
|
|
End While
|
|
|
|
UpdateItemView()
|
|
|
|
Case Else
|
|
MsgBox(ITextProcessPacket.msg_error_17 + ". ErrorCode : " + errorCode.ToString, MsgBoxStyle.OKOnly, ITextMSG.msg_faild)
|
|
|
|
End Select
|
|
|
|
End Sub
|
|
|
|
Public Sub ProcessDeleteItem(ByVal contents() As Byte, ByVal nPacketCMD As Byte, ByVal errorCode As Int16)
|
|
|
|
Select Case errorCode
|
|
|
|
Case 0
|
|
|
|
MsgBox(ITextProcessPacket.msg_success_13, MsgBoxStyle.OKOnly, ITextMSG.msg_success)
|
|
|
|
' 다음 정보를 가지고, RowSet에서 삭제에 성공한 아이템을 제거한다.
|
|
Dim dwItemUID As UInt64 = BitConverter.ToUInt64(contents, 0)
|
|
Dim usProtoTypeID As UInt16 = BitConverter.ToUInt16(contents, 8)
|
|
Dim cTakePos As Byte = contents(10)
|
|
Dim cXPos As Byte = contents(11)
|
|
Dim cYPos As Byte = contents(12)
|
|
Dim cZPos As Byte = contents(13)
|
|
|
|
' 아이템 데이터를 로우셋에 추가
|
|
Dim myEnumerator As System.Collections.IEnumerator = _
|
|
ICharInfo.CharItemData.GetEnumerator()
|
|
|
|
While myEnumerator.MoveNext()
|
|
|
|
Dim oldItem As ItemInfo = myEnumerator.Current
|
|
|
|
If dwItemUID.Equals(oldItem.m_dwItemUID) And _
|
|
usProtoTypeID.Equals(oldItem.m_usItemProtoTypeID) And _
|
|
cTakePos = oldItem.m_cTakeType And _
|
|
cXPos = oldItem.m_cXPos And _
|
|
cYPos = oldItem.m_cYPos And _
|
|
cZPos = oldItem.m_cZPos Then
|
|
|
|
ICharInfo.CharItemData.Remove(myEnumerator.Current)
|
|
|
|
Exit While
|
|
|
|
End If
|
|
|
|
End While
|
|
|
|
UpdateItemView()
|
|
|
|
Case Else
|
|
|
|
MsgBox(ITextProcessPacket.msg_error_18 + ". ErrorCode : " + errorCode.ToString, MsgBoxStyle.OKOnly, ITextMSG.msg_faild)
|
|
|
|
End Select
|
|
|
|
End Sub
|
|
|
|
Public Sub ProcessViewLoginoutLog(ByVal contents() As Byte, ByVal nPacketCMD As Byte, ByVal errorCode As Int16)
|
|
|
|
If IUserLastLogout Is Nothing Then
|
|
|
|
Exit Sub
|
|
|
|
End If
|
|
|
|
|
|
Select Case errorCode
|
|
|
|
Case 0
|
|
|
|
If 0 = contents(0) Then
|
|
|
|
' 데이터 전부 보냄.
|
|
IUserLastLogout.btnSearch.Enabled = True
|
|
IUserLastLogout.grdResult.Refresh()
|
|
|
|
ElseIf 85 <= contents.GetLength(0) Then
|
|
|
|
' 데이터 받았음.
|
|
Dim encoding As Encoding = encoding.GetEncoding(Code)
|
|
|
|
Dim data As DataRow = DBConn.ds.Tables(LastUserIndex).NewRow()
|
|
|
|
data("strClientID") = encoding.GetString(contents, 0, 16)
|
|
data("strIP") = encoding.GetString(contents, 16, 16)
|
|
data("intCRMIndex") = BitConverter.ToUInt32(contents, 76).ToString
|
|
data("UID") = BitConverter.ToUInt32(contents, 72).ToString
|
|
data("LoginTime") = encoding.GetString(contents, 32, 20)
|
|
data("LogOutTime") = encoding.GetString(contents, 52, 20)
|
|
data("ServerID") = BitConverter.ToUInt32(contents, 80).ToString
|
|
data("BillType") = Chr(contents(84))
|
|
|
|
DBConn.ds.Tables(LastUserIndex).Rows.Add(data)
|
|
|
|
End If
|
|
|
|
|
|
Case Else
|
|
|
|
IUserLastLogout.btnSearch.Enabled = True
|
|
IUserLastLogout.grdResult.Refresh()
|
|
|
|
End Select
|
|
|
|
End Sub
|
|
|
|
Public Sub ProcessAdminRightsAck(ByVal contents() As Byte, ByVal nPacketCMD As Byte, ByVal errorCode As Int16)
|
|
|
|
If 0 = errorCode Then
|
|
|
|
Dim cRights As Byte = contents(0)
|
|
|
|
Dim Pos As Int32 = 1
|
|
|
|
IAdminSetting.chkCharedit.Checked = BitConverter.ToBoolean(contents, Pos + 1)
|
|
IAdminSetting.chkCharlocation.Checked = BitConverter.ToBoolean(contents, Pos + 2)
|
|
IAdminSetting.chkCharSeeItem.Checked = BitConverter.ToBoolean(contents, Pos + 3)
|
|
IAdminSetting.chkItemReg.Checked = BitConverter.ToBoolean(contents, Pos + 4)
|
|
IAdminSetting.chkItemedit.Checked = BitConverter.ToBoolean(contents, Pos + 5)
|
|
IAdminSetting.chkItemDelete.Checked = BitConverter.ToBoolean(contents, Pos + 6)
|
|
IAdminSetting.chkRestraintReg.Checked = BitConverter.ToBoolean(contents, Pos + 7)
|
|
IAdminSetting.chkRestraintRelease.Checked = BitConverter.ToBoolean(contents, Pos + 8)
|
|
|
|
IAdminSetting.chkCurrentLogin.Checked = BitConverter.ToBoolean(contents, Pos + 9)
|
|
IAdminSetting.chkLastLogin.Checked = BitConverter.ToBoolean(contents, Pos + 10)
|
|
IAdminSetting.chkDoingLogout.Checked = BitConverter.ToBoolean(contents, Pos + 11)
|
|
|
|
|
|
Else
|
|
|
|
MsgBox(ITextProcessPacket.msg_error_19 + ". ErrorCode : " + errorCode.ToString, MsgBoxStyle.OKOnly, ITextMSG.msg_faild)
|
|
|
|
End If
|
|
|
|
End Sub
|
|
|
|
|
|
Private Function ConvertArrayToItem(ByVal recvarray() As Byte, ByVal startpos As Int32) As ItemInfo
|
|
|
|
Dim encoding As Encoding = encoding.GetEncoding(Code)
|
|
|
|
If 84 + startpos <= recvarray.GetLength(0) Then
|
|
|
|
ConvertArrayToItem.m_szItemName = encoding.GetString(recvarray, startpos, 64)
|
|
ConvertArrayToItem.m_dwItemUID = BitConverter.ToUInt64(recvarray, startpos + 64)
|
|
ConvertArrayToItem.m_usItemProtoTypeID = BitConverter.ToUInt16(recvarray, startpos + 72)
|
|
ConvertArrayToItem.m_cItemType = recvarray(startpos + 74)
|
|
ConvertArrayToItem.m_cTakeType = recvarray(startpos + 75)
|
|
ConvertArrayToItem.m_cXPos = recvarray(startpos + 76)
|
|
ConvertArrayToItem.m_cYPos = recvarray(startpos + 77)
|
|
ConvertArrayToItem.m_cZPos = recvarray(startpos + 78)
|
|
ConvertArrayToItem.m_cNumOrDurability = recvarray(startpos + 79)
|
|
ConvertArrayToItem.m_cXSize = recvarray(startpos + 80)
|
|
ConvertArrayToItem.m_cYSize = recvarray(startpos + 81)
|
|
ConvertArrayToItem.m_bEquip = BitConverter.ToBoolean(recvarray, startpos + 82)
|
|
ConvertArrayToItem.m_cPadding = recvarray(startpos + 83)
|
|
|
|
ReDim ConvertArrayToItem.m_cSocket(7)
|
|
ReDim ConvertArrayToItem.m_usAttribute(34)
|
|
|
|
If 168 + startpos <= recvarray.GetLength(0) And True = ConvertArrayToItem.m_bEquip Then
|
|
|
|
ConvertArrayToItem.m_usRuneSocket = BitConverter.ToUInt16(recvarray, startpos + 84)
|
|
ConvertArrayToItem.m_cMaxDurability = recvarray(startpos + 86)
|
|
ConvertArrayToItem.m_cCurrentSocketNum = recvarray(startpos + 87)
|
|
ConvertArrayToItem.m_cMaxSocketNum = recvarray(startpos + 88)
|
|
ConvertArrayToItem.m_cMaterialType = recvarray(startpos + 89)
|
|
|
|
Array.Copy(recvarray, startpos + 90, ConvertArrayToItem.m_cSocket, 0, 8)
|
|
|
|
Dim nCount As Int32
|
|
For nCount = 0 To 34
|
|
ConvertArrayToItem.m_usAttribute(nCount) = BitConverter.ToUInt16(recvarray, startpos + 98 + nCount * 2)
|
|
Next
|
|
|
|
End If
|
|
|
|
End If
|
|
|
|
End Function
|
|
|
|
Public Sub UpdateItemView()
|
|
|
|
ds.Tables(CharItemListIndex).Clear()
|
|
|
|
Dim myEnumerator As System.Collections.IEnumerator = ICharInfo.CharItemData.GetEnumerator()
|
|
|
|
While myEnumerator.MoveNext()
|
|
|
|
Dim Item As ItemInfo = myEnumerator.Current
|
|
'Dim myDataRow As DataRow = ProcessPacket.ICharInfo.myDataTable.NewRow()
|
|
Dim myDataRow As DataRow = ds.Tables(CharItemListIndex).NewRow()
|
|
myDataRow("ItemName") = Item.m_szItemName
|
|
myDataRow("ItemIndex") = Item.m_dwItemUID
|
|
myDataRow("ItemTypeID") = Item.m_usItemProtoTypeID
|
|
myDataRow("ItemType") = Item.m_cItemType
|
|
|
|
myDataRow("ItemWhere") = GetTakePos(Item.m_cTakeType)
|
|
|
|
myDataRow("ItemX") = Item.m_cXPos
|
|
myDataRow("ItemY") = Item.m_cYPos
|
|
myDataRow("ItemZ") = Item.m_cZPos
|
|
myDataRow("Amount") = Item.m_cNumOrDurability
|
|
myDataRow("SizeX") = Item.m_cXSize
|
|
myDataRow("SizeY") = Item.m_cYSize
|
|
myDataRow("WhetherAmount") = Item.m_bEquip
|
|
myDataRow("RuneSocket") = Item.m_usRuneSocket
|
|
myDataRow("MaxDurability") = Item.m_cMaxDurability
|
|
myDataRow("CurSocketNum") = Item.m_cCurrentSocketNum
|
|
myDataRow("MaxSocketNum") = Item.m_cMaxSocketNum
|
|
myDataRow("MaterialType") = Item.m_cMaterialType
|
|
|
|
Dim nCount As Int32 = 0
|
|
|
|
For nCount = 0 To 7
|
|
myDataRow("Socket" + nCount.ToString) = Item.m_cSocket(nCount).ToString
|
|
Next
|
|
|
|
For nCount = 0 To 34
|
|
myDataRow("Attribute" + nCount.ToString) = Item.m_usAttribute(nCount).ToString
|
|
Next
|
|
|
|
'컬럼을 추가하기
|
|
'ICharInfo.myDataTable.Rows.Add(myDataRow)
|
|
ds.Tables(CharItemListIndex).Rows.Add(myDataRow)
|
|
|
|
End While
|
|
|
|
ICharItemInfo.grdResult.Refresh()
|
|
|
|
End Sub
|
|
|
|
|
|
|
|
|
|
Public Sub InitializeHandler()
|
|
|
|
'COMMAND : 1 - 로그인 Ack
|
|
IClientSocket.AddProcess(1, New ClientSocket.ProcessPacket(AddressOf ProcessLoginAck))
|
|
'어드민등록
|
|
IClientSocket.AddProcess(2, New ClientSocket.ProcessPacket(AddressOf ProcessRegAdmin))
|
|
'어드민 서치
|
|
IClientSocket.AddProcess(3, New ClientSocket.ProcessPacket(AddressOf ProcessSearchAdmin))
|
|
IClientSocket.AddProcess(4, New ClientSocket.ProcessPacket(AddressOf ProcessSearchAdmin))
|
|
'어드민 삭제
|
|
IClientSocket.AddProcess(5, New ClientSocket.ProcessPacket(AddressOf ProcessDeleteAdmin))
|
|
'어드민 정보변경
|
|
IClientSocket.AddProcess(6, New ClientSocket.ProcessPacket(AddressOf ProcessEditAdmin))
|
|
|
|
'현재접속인 사용자 검색
|
|
IClientSocket.AddProcess(7, New ClientSocket.ProcessPacket(AddressOf ProcessSelectCurrentUser))
|
|
'강제로그아웃
|
|
IClientSocket.AddProcess(8, New ClientSocket.ProcessPacket(AddressOf ProcessLogoutUser))
|
|
|
|
' 제재자 명단보기
|
|
IClientSocket.AddProcess(9, New ClientSocket.ProcessPacket(AddressOf ProcessViewRestraintUser))
|
|
' 제재자 추가
|
|
IClientSocket.AddProcess(10, New ClientSocket.ProcessPacket(AddressOf ProcessAddRestraintUser))
|
|
' 제재자인지 확인
|
|
IClientSocket.AddProcess(11, New ClientSocket.ProcessPacket(AddressOf ProcessCheckRestraintUser))
|
|
' 제재자 삭제
|
|
IClientSocket.AddProcess(12, New ClientSocket.ProcessPacket(AddressOf ProcessDeleteRestraintUser))
|
|
|
|
' UID로 캐릭터 이름 얻어오기
|
|
IClientSocket.AddProcess(13, New ClientSocket.ProcessPacket(AddressOf ProcessSelectCharidList))
|
|
' 캐릭터 이름으로 캐릭터 데이터 얻어 오기
|
|
IClientSocket.AddProcess(14, New ClientSocket.ProcessPacket(AddressOf ProcessSelectCharidInfo))
|
|
|
|
' 데이터 수정한 것 DB에 저장
|
|
IClientSocket.AddProcess(15, New ClientSocket.ProcessPacket(AddressOf ProcessCommitData))
|
|
|
|
' 캐릭터 데이터 업데이트
|
|
IClientSocket.AddProcess(16, New ClientSocket.ProcessPacket(AddressOf ProcessUpdateCharData))
|
|
' 캐릭터 마지막 위치 업데이트
|
|
IClientSocket.AddProcess(17, New ClientSocket.ProcessPacket(AddressOf ProcessUpdateLastPos))
|
|
|
|
' 아이템 생성
|
|
IClientSocket.AddProcess(18, New ClientSocket.ProcessPacket(AddressOf ProcessCreateItem))
|
|
' 아이템 업데이트
|
|
IClientSocket.AddProcess(19, New ClientSocket.ProcessPacket(AddressOf ProcessUpdateItem))
|
|
' 아이템 삭제
|
|
IClientSocket.AddProcess(20, New ClientSocket.ProcessPacket(AddressOf ProcessDeleteItem))
|
|
|
|
' 유저 로그인아웃 로그 보기
|
|
IClientSocket.AddProcess(21, New ClientSocket.ProcessPacket(AddressOf ProcessViewLoginoutLog))
|
|
|
|
' 유저 권한 얻어오기/세팅하기
|
|
IClientSocket.AddProcess(22, New ClientSocket.ProcessPacket(AddressOf ProcessAdminRightsAck))
|
|
IClientSocket.AddProcess(23, New ClientSocket.ProcessPacket(AddressOf ProcessAdminRightsAck))
|
|
|
|
End Sub
|
|
|
|
End Module
|
|
|
|
|
|
Module SendPacket
|
|
|
|
Public Sub SendViewLoginoutLog(ByVal szUserID As String)
|
|
|
|
Dim encoding As Encoding = encoding.GetEncoding(Code)
|
|
Dim sendb(15) As Byte
|
|
|
|
encoding.GetBytes(szUserID, 0, Min(16, szUserID.Length), sendb, 0)
|
|
|
|
IClientSocket.Send(21, sendb)
|
|
|
|
End Sub
|
|
|
|
Public Sub SendCheckBlocked(ByVal cConnectedServer As Byte, ByVal dwUID As Int32)
|
|
|
|
Dim sendb(4) As Byte
|
|
|
|
sendb(0) = cConnectedServer
|
|
Array.Copy(BitConverter.GetBytes(dwUID), 0, sendb, 1, 4)
|
|
|
|
IClientSocket.Send(11, sendb)
|
|
|
|
End Sub
|
|
|
|
Public Sub UpdateCharData(ByVal charInfo As CharInfo)
|
|
|
|
Dim encoding As Encoding = encoding.GetEncoding(Code)
|
|
Dim sendb(71) As Byte
|
|
|
|
Dim Pos As Int32 = 0
|
|
|
|
Array.Copy(BitConverter.GetBytes(Convert.ToInt32(charInfo.txtCID.Text)), 0, sendb, Pos, 4) ' CID
|
|
encoding.GetBytes(charInfo.txtName.Text, 0, Min(16, charInfo.txtName.Text.Length), sendb, Pos + 4) ' 이름
|
|
sendb(Pos + 20) = Convert.ToByte(charInfo.txtMW.Text) ' 1 : 남자, 2 : 여자
|
|
sendb(Pos + 21) = Convert.ToByte(charInfo.txtHead.Text) ' Head가 아니라 Hair임
|
|
sendb(Pos + 22) = Convert.ToByte(charInfo.txtFace.Text) ' 얼굴형
|
|
sendb(Pos + 23) = Convert.ToByte(charInfo.txtKind.Text) ' Kind - 캐릭터 종족. 0 : 인간, 1 : 아칸
|
|
Array.Copy(BitConverter.GetBytes(Convert.ToUInt16(charInfo.txtClass.Text)), 0, sendb, Pos + 24, 2) ' 캐릭터 클래스
|
|
|
|
Array.Copy(BitConverter.GetBytes(Convert.ToUInt32(charInfo.txtFame.Text)), 0, sendb, Pos + 26, 4) ' 명성
|
|
Array.Copy(BitConverter.GetBytes(Convert.ToUInt32(charInfo.txtMi.Text)), 0, sendb, Pos + 30, 4) ' 마일리지
|
|
Array.Copy(BitConverter.GetBytes(Convert.ToUInt32(charInfo.txtGuild.Text)), 0, sendb, Pos + 34, 4) ' 길드
|
|
Array.Copy(BitConverter.GetBytes(Convert.ToUInt32(charInfo.txtParty.Text)), 0, sendb, Pos + 38, 4) ' 파티
|
|
|
|
sendb(Pos + 42) = Convert.ToByte(charInfo.txtLevel.Text) ' 레벨
|
|
Array.Copy(BitConverter.GetBytes(Convert.ToUInt32(charInfo.txtMoney.Text)), 0, sendb, Pos + 43, 4) ' 돈
|
|
|
|
Array.Copy(BitConverter.GetBytes(Convert.ToUInt16(charInfo.txtIP.Text)), 0, sendb, Pos + 47, 2) ' IP (능력치 증가포인트)
|
|
Array.Copy(BitConverter.GetBytes(Convert.ToUInt16(charInfo.txtStr.Text)), 0, sendb, Pos + 49, 2) ' 힘
|
|
Array.Copy(BitConverter.GetBytes(Convert.ToUInt16(charInfo.txtDex.Text)), 0, sendb, Pos + 51, 2) ' 민첩성
|
|
Array.Copy(BitConverter.GetBytes(Convert.ToUInt16(charInfo.txtCon.Text)), 0, sendb, Pos + 53, 2) ' 건강
|
|
Array.Copy(BitConverter.GetBytes(Convert.ToUInt16(charInfo.txtIni.Text)), 0, sendb, Pos + 55, 2) ' 지력
|
|
Array.Copy(BitConverter.GetBytes(Convert.ToUInt16(charInfo.txtWis.Text)), 0, sendb, Pos + 57, 2) ' 지혜
|
|
|
|
Array.Copy(BitConverter.GetBytes(Convert.ToUInt16(charInfo.txtHp.Text)), 0, sendb, Pos + 59, 2) ' HP
|
|
Array.Copy(BitConverter.GetBytes(Convert.ToUInt16(charInfo.txtMp.Text)), 0, sendb, Pos + 61, 2) ' MP
|
|
|
|
Array.Copy(BitConverter.GetBytes(Convert.ToUInt64(charInfo.txtExp.Text)), 0, sendb, Pos + 63, 8) ' EXP
|
|
|
|
IClientSocket.Send(16, sendb)
|
|
|
|
End Sub
|
|
|
|
Public Sub UpdateLastPos(ByVal charInfo As CharInfo)
|
|
|
|
Dim sendb(11) As Byte
|
|
|
|
Array.Copy(BitConverter.GetBytes(Convert.ToSingle(charInfo.txtX.Text)), 0, sendb, 0, 4)
|
|
Array.Copy(BitConverter.GetBytes(Convert.ToSingle(charInfo.txtY.Text)), 0, sendb, 4, 4)
|
|
Array.Copy(BitConverter.GetBytes(Convert.ToSingle(charInfo.txtZ.Text)), 0, sendb, 8, 4)
|
|
|
|
IClientSocket.Send(17, sendb)
|
|
|
|
End Sub
|
|
|
|
Public Sub Commit()
|
|
|
|
Dim sendb(-1) As Byte
|
|
IClientSocket.Send(15, sendb)
|
|
|
|
End Sub
|
|
|
|
Public Sub SendCreateItem(ByVal szItemName As String, ByVal cTakePos As Byte, _
|
|
ByVal cXPos As Byte, ByVal cYPos As Byte, ByVal cZPos As Byte)
|
|
|
|
Dim encoding As Encoding = encoding.GetEncoding(Code)
|
|
Dim sendb(35) As Byte
|
|
|
|
encoding.GetBytes(szItemName, 0, Min(32, szItemName.Length), sendb, 0)
|
|
sendb(32) = cTakePos
|
|
sendb(33) = cXPos
|
|
sendb(34) = cYPos
|
|
sendb(35) = cZPos
|
|
|
|
IClientSocket.Send(18, sendb)
|
|
|
|
End Sub
|
|
|
|
|
|
Public Sub SendUpdateItem(ByVal Item As ItemInfo)
|
|
|
|
Dim encoding As Encoding = encoding.GetEncoding(Code)
|
|
Dim sendb(167) As Byte
|
|
|
|
Dim Pos As Int32 = 0
|
|
|
|
encoding.GetBytes(Item.m_szItemName, 0, Min(64, Item.m_szItemName.Length), sendb, Pos)
|
|
Array.Copy(BitConverter.GetBytes(Item.m_dwItemUID), 0, sendb, Pos + 64, 8)
|
|
Array.Copy(BitConverter.GetBytes(Item.m_usItemProtoTypeID), 0, sendb, Pos + 72, 2)
|
|
sendb(Pos + 74) = Item.m_cItemType
|
|
sendb(Pos + 75) = Item.m_cTakeType
|
|
sendb(Pos + 76) = Item.m_cXPos
|
|
sendb(Pos + 77) = Item.m_cYPos
|
|
sendb(Pos + 78) = Item.m_cZPos
|
|
sendb(Pos + 79) = Item.m_cNumOrDurability
|
|
sendb(Pos + 80) = Item.m_cXSize
|
|
sendb(Pos + 81) = Item.m_cYSize
|
|
sendb(Pos + 82) = BitConverter.GetBytes(Item.m_bEquip)(0)
|
|
sendb(Pos + 83) = Item.m_cPadding
|
|
|
|
If True = Item.m_bEquip Then
|
|
|
|
Array.Copy(BitConverter.GetBytes(Item.m_usRuneSocket), 0, sendb, Pos + 84, 2)
|
|
sendb(Pos + 86) = Item.m_cMaxDurability
|
|
sendb(Pos + 87) = Item.m_cCurrentSocketNum
|
|
sendb(Pos + 88) = Item.m_cMaxSocketNum
|
|
sendb(Pos + 89) = Item.m_cMaterialType
|
|
|
|
Array.Copy(Item.m_cSocket, 0, sendb, Pos + 90, 8)
|
|
|
|
Dim nCount As Int32
|
|
For nCount = 0 To 34
|
|
Array.Copy(BitConverter.GetBytes(Item.m_usAttribute(nCount)), 0, sendb, Pos + 98 + nCount * 2, 2)
|
|
Next
|
|
|
|
End If
|
|
|
|
IClientSocket.Send(19, sendb)
|
|
|
|
End Sub
|
|
|
|
|
|
Public Sub SendDeleteItem(ByVal dwItemUID As UInt64, ByVal usProtoTypeID As UInt16, _
|
|
ByVal cTakePos As Byte, ByVal cXPos As Byte, ByVal cYPos As Byte, ByVal cZPos As Byte)
|
|
|
|
Dim sendb(13) As Byte
|
|
|
|
Array.Copy(BitConverter.GetBytes(dwItemUID), 0, sendb, 0, 8)
|
|
Array.Copy(BitConverter.GetBytes(usProtoTypeID), 0, sendb, 8, 2)
|
|
sendb(10) = cTakePos
|
|
sendb(11) = cXPos
|
|
sendb(12) = cYPos
|
|
sendb(13) = cZPos
|
|
|
|
IClientSocket.Send(20, sendb)
|
|
|
|
End Sub
|
|
|
|
Public Sub SendAdminRightSearch(ByVal cAdminRightID As Char)
|
|
|
|
Dim sendb(0) As Byte
|
|
sendb(0) = Asc(cAdminRightID)
|
|
|
|
IClientSocket.Send(22, sendb)
|
|
|
|
End Sub
|
|
|
|
Public Sub SendAdminRightUpdate(ByVal cAdminRightID As Char, ByVal cRights As Boolean())
|
|
|
|
Dim sendb(20) As Byte
|
|
sendb(0) = Asc(cAdminRightID)
|
|
|
|
Dim Pos As Int32 = 1
|
|
|
|
For Pos = 1 To 20
|
|
|
|
If True = cRights(Pos - 1) Then
|
|
sendb(Pos) = 1
|
|
End If
|
|
|
|
Next
|
|
|
|
IClientSocket.Send(23, sendb)
|
|
|
|
End Sub
|
|
|
|
End Module
|
|
|
|
|