Author Topic: How can i get server info...  (Read 7927 times)

0 Members and 1 Guest are viewing this topic.

Offline xmRipper

  • Soldat Beta Team
  • Flagrunner
  • ******
  • Posts: 742
    • Personal
Re: How can i get server info...
« Reply #20 on: March 21, 2007, 10:33:05 am »
Code: [Select]
Private Sub Winsock1_DataArrival(ByVal bytesTotal As Long)
  Dim Buffer() As Byte
  Winsock1.GetData Buffer
  parseASEPacket Buffer
  Text2.Text = MapName
End Sub

what's wrong ::)
Co-Founder / CTO @ Macellan
Founder Turkish Soldat Community

Offline chrisgbk

  • Inactive Staff
  • Veteran
  • *****
  • Posts: 1739
Re: How can i get server info...
« Reply #21 on: March 21, 2007, 04:52:51 pm »
Code: [Select]
Private Sub Winsock1_DataArrival(ByVal bytesTotal As Long)
  Dim Buffer() As Byte
  Winsock1.GetData Buffer
  parseASEPacket Buffer
  Text2.Text = MapName
End Sub

what's wrong ::)

The code I provided has all the variables private to the function; to make them accessible outside the function you would need to make them global instead. Also, I highly recommend that any code you write in VB uses the Option Explicit directive, otherwise if you use a variable that doesn't exist VB creates it for you automatically; this has the effect of making your code run without errors, but not functioning the way you intend.

Offline FliesLikeABrick

  • Administrator
  • Flamebow Warrior
  • *****
  • Posts: 6144
    • Ultimate 13 Soldat
Re: How can i get server info...
« Reply #22 on: March 25, 2007, 02:53:10 pm »
Can anyone post an ASE parser in PHP (if they already have one) ?

edit: I'm writing one now, I'll have it done in a few hours (I'm at work and its quite busy, so I'm not sure how long it'll actually take)
« Last Edit: March 25, 2007, 04:33:52 pm by FliesLikeABrick »

Offline chrisgbk

  • Inactive Staff
  • Veteran
  • *****
  • Posts: 1739
Re: How can i get server info...
« Reply #23 on: March 25, 2007, 05:53:11 pm »
Can anyone post an ASE parser in PHP (if they already have one) ?

edit: I'm writing one now, I'll have it done in a few hours (I'm at work and its quite busy, so I'm not sure how long it'll actually take)

You can use the one Frenchie used as the base of his ASE lobby which is available here: http://www.tuts.net/~titulaer/rcon-0.38.0.tar.gz
then modify it as I detail here: http://forums.soldat.pl/index.php?topic=2928.msg34131#msg34131
or here: http://forums.soldat.pl/index.php?topic=2928.msg34172#msg34172
(or go one step further and modify it to be generic and parse the flag byte and use the value of it to determine what to parse.

However, it's rather trivial to write your own, as it's a simple protocol; particularily when you have visual basic code to follow since VB is reasonably close to psuedo-code.

Also, a followup to xmRipper:

Code: [Select]
Private Sub Winsock1_DataArrival(ByVal bytesTotal As Long)
  Dim Buffer() As Byte
  ReDim Buffer(bytesTotal - 1)
  Winsock1.GetData Buffer
  parseASEPacket Buffer
End Sub

should work; I didn't notice the lack of ReDim when I last looked at it.
« Last Edit: March 25, 2007, 06:05:29 pm by chrisgbk »

Offline FliesLikeABrick

  • Administrator
  • Flamebow Warrior
  • *****
  • Posts: 6144
    • Ultimate 13 Soldat
Re: How can i get server info...
« Reply #24 on: March 25, 2007, 09:54:08 pm »
I made another PHP one, I think it is more efficient a bit more featureful than Frenchie's.  It provides some "fixed" versions of things like time remaining, time limit, and other values (strips text so they're int-only and ready for use)
http://forums.soldat.pl/index.php?topic=12200
« Last Edit: March 25, 2007, 09:58:15 pm by FliesLikeABrick »