0 Members and 5 Guests are viewing this topic.
I know refresh packet but I don't know connecting and retrieving info By using ASE data
Quote from: xmRipper on March 17, 2007, 01:19:05 pmI know refresh packet but I don't know connecting and retrieving info By using ASE data   yeah, I was just using that as an example of how it'd be nice to have a list of code snippets
I know refresh packet but I don't know connecting and retrieving info By using ASE data  Â
If you're working inside the server, it could probably help to type /info to get information on the server, I think.
I might make some samples later.
Private Type ASEPlayer  Name As String  Team As String  Skin As String  Score As String  Ping As String  TimePlayed As StringEnd TypePrivate Type ASERule  Name As String  Value As StringEnd TypePrivate Function parseASEHeader(packet() As Byte, ByRef offset As Integer) As String  parseASEHeader = Chr(packet(offset)) + Chr(packet(offset + 1)) + Chr(packet(offset + 2)) + Chr(packet(offset + 3))  offset = offset + 4End FunctionPrivate Function parseASEString(packet() As Byte, ByRef offset As Integer) As String  Dim length As Integer  Dim i As Integer  length = packet(offset) - 1  offset = offset + 1  For i = offset To offset + length - 1    parseASEString = parseASEString + Chr(packet(i))  Next i  offset = offset + lengthEnd FunctionPrivate Function parseASERule(packet() As Byte, ByRef offset As Integer) As ASERule  parseASERule.Name = parseASEString(packet, offset)  parseASERule.Value = parseASEString(packet, offset)End FunctionPrivate Function parseASEPlayer(packet() As Byte, ByRef offset As Integer) As ASEPlayer  Dim flags As Byte  Dim i As Integer  i = offset  flags = packet(i)  i = i + 1  If (flags And 1) > 0 Then parseASEPlayer.Name = parseASEString(packet, i)  If (flags And 2) > 0 Then parseASEPlayer.Team = parseASEString(packet, i)  If (flags And 4) > 0 Then parseASEPlayer.Skin = parseASEString(packet, i)  If (flags And 8) > 0 Then parseASEPlayer.Score = parseASEString(packet, i)  If (flags And 16) > 0 Then parseASEPlayer.Ping = parseASEString(packet, i)  If (flags And 32) > 0 Then parseASEPlayer.TimePlayed = parseASEString(packet, i)End FunctionPrivate Sub parseASEPacket(packet() As Byte, Optional offset As Integer = 0)  Dim header As String  Dim GameName As String  Dim PortNumber As String  Dim ServerName As String  Dim GameType As String  Dim MapName As String  Dim Version As String  Dim Passworded As String  Dim NumPlayers As String  Dim MaxPlayers As String  Dim Rule As ASERule  Dim Player As ASEPlayer  Dim i As Integer    i = offset  header = parseASEHeader(packet, i)  If header <> "EYE1" Then Exit Sub  GameName = parseASEString(packet, i)  PortNumber = parseASEString(packet, i)  ServerName = parseASEString(packet, i)  GameType = parseASEString(packet, i)  MapName = parseASEString(packet, i)  Version = parseASEString(packet, i)  Passworded = parseASEString(packet, i)  NumPlayers = parseASEString(packet, i)  MaxPlayers = parseASEString(packet, i)  Do    Rule = parseASERule(packet, i)  Loop Until Rule.Name <> ""  Dim PlayerCount As Integer  Do    Player = parseASEPlayer(packet, i)    PlayerCount = PlayerCount + 1  Loop Until PlayerCount = CInt(MaxPlayers)End Sub
i cant connect to the ASE port of any server :/
Quote from: xmRipper on March 18, 2007, 03:31:32 pmi cant connect to the ASE port of any server :/Ofcourse you can't. No one can.Because ASE uses the UDP Protocol. Which is connectionless. Not TCP.
EYE1soldat23073xmRipper ServerCapture the Flagctf_Death21.3.1005Respawn Time5 SecsBonus Frequency Very Few SurvivalNoRealisticNoSystemWindowsTime Left4:49 MinutesTime Limit5 Minutes Next Mapctf_KampfProtectedNo
Okay, thanks for everything. I've connected. chrisgbk, how can I use the codes you gave? Can you help me? The data I receive is this;Code: [Select]EYE1soldat23073xmRipper ServerCapture the Flagctf_Death21.3.1005Respawn Time5 SecsBonus Frequency Very Few SurvivalNoRealisticNoSystemWindowsTime Left4:49 MinutesTime Limit5 Minutes Next Mapctf_KampfProtectedNo