|
|
#11 | ||||||||||
![]()
|
اولا: شكرا علي الموضوع بس برضو مش عارف اظبط packet 3013 ^^ اجيب كل حاجه اجي عند ال Items و اضيع ![]() ثانيا: بالنسبه للناس اللي عايزه ال code في VB.NET كود:
Public Sub SendPacket(ByVal OpCode As String, ByVal sData As String, ByVal direction As Byte, ByVal Enc As Boolean)
Using buffer As New IO.MemoryStream
Using w As New IO.BinaryWriter(buffer)
w.Write(CUShort(0)) ' Size is 0 because it 'cannot' be known yet.
w.Write(CUShort("&H" + OpCode)) ' Converts the string Opcode to a UInt16, reading the Opcode as a hexadecimal representation
If Enc = True Then
If direction = 1 Then 'send to server
w.Write(CUShort(3)) ' Encryption flag phConnector
ElseIf direction = 2 Then 'send to client
w.Write(CUShort(4))
End If
Else
If direction = 1 Then 'send to server
w.Write(CUShort(1)) ' Encryption flag phConnector
ElseIf direction = 2 Then 'send to client
w.Write(CUShort(2))
End If
End If
For n As Integer = 0 To sData.Length / 2 - 1 ' Each byte is two characters and starting from 0 so decreasing by 1
w.Write(CByte("&H" & sData.Substring(n * 2, 2))) ' Writes every byte
Next
w.BaseStream.Position = 0 ' Resets the position to write the size
w.Write(CUShort(w.BaseStream.Length - 6)) ' Writes the size to the '0' placeholder
w.Flush() ' Makes sure the data is written to the buffer
Client.Send(buffer.ToArray) ' Sends the buffer to the Socket
End Using
End Using
End Sub
كود:
Public Sub SendPacket(ByVal OpCode As String, ByVal sData As String)
Using buffer As New IO.MemoryStream
Using w As New IO.BinaryWriter(buffer)
w.Write(CUShort(0))
w.Write(CUShort("&H" + OpCode))
w.Write(CUShort(1))
For n As Integer = 0 To sData.Length / 2 - 1
w.Write(CByte("&H" & sData.Substring(n * 2, 2)))
Next
w.BaseStream.Position = 0
w.Write(CUShort(w.BaseStream.Length - 6))
w.Flush()
Client.Send(buffer.ToArray)
End Using
End Using
End Sub
يا tarek لو مش عايز ال form تعلق اعمل thread جديده كود:
Dim Recv As Thread = New Thread(AddressOf Receiving) وبين كود:
Private Sub Receiving() End sub شكرا مره ثانيه ![]() حولو انت ل #C بقي y" class="inlineimg" /> |
||||||||||
|
التعديل الأخير تم بواسطة ahmdod2 ; 04-01-2013 الساعة 10:18 PM
|
| يتصفح الموضوع حالياً : 1 (0 عضو و 1 زائر) | |
|
|
المواضيع المتشابهه
|
||||
| الموضوع | كاتب الموضوع | المنتدى | الردود | آخر مشاركة |
| اسفسارات داخل الجيم : اسم الجيم + اسماء المدن + ازاى اعرف اجيب كود | Emely | قسم الاسئلة و الاستفسارات لعمل السيرفرات الخاصة | 4 | 03-02-2014 01:27 PM |
| استفسار داخل الجيم | dematreio | قسم الاسئلة و الاستفسارات لعمل السيرفرات الخاصة | 6 | 01-11-2013 01:41 AM |
| طلب من داخل الجيم | يوسف النجم | قسم الاسئلة و الاستفسارات لعمل السيرفرات الخاصة | 4 | 19-11-2012 05:21 PM |