Hi there!
Im working on a script that will allow an admin to remotely control a Half Life (game) server. At the moment im writing a part that will list the players currently on the server
I send the request to the server, and it returns a string in this format
(yea, the slashes are escaping the chars)
\1FirstPlayerName\0\0\0\0\0\2SecondPlayerName\0\35\0\0\0
etc..
anyway.. as you can see; each player starts with <player number>, then the player's name, then a set of 5 escaped chars. the 1st and last 3 are \0's, but the second one always keep changin, anythin from 0 to 255.
I know you can do this usin the preg_replace function, but im totally confused on the regular expression stuff 🙁
another confusion: the second number that keeps changing could be a \1 or a \2 etc... so it can interrupt splitting the string up to find individual player by the playernumber.
Would anyone be able to give me an example of replacing the \0#\0\0\0 format with somthin such as.. a 'Z' ?
Anyone up to the challenge? (lol)
thanks very much 😃
PS. if someone solves the problem i'll put them in the credits/about section of the script 😃
Daniel Ingegneri
http://omegasoft.ws