Click here to Skip to main content
15,893,594 members
Please Sign up or sign in to vote.
1.50/5 (2 votes)
See more:
How format this response from server to get a values of g_gametype or mapname ? i want to get a mapname and assign it to the textbox it is possible ?

????print
Server info settings:
g_compassShowEnemies0
g_gametype sd
gamename Call of Duty 4
mapname mp_backlot
protocol 6
shortversion 1.7
sv_allowAnonymous 0
sv_disableClientConsole0
sv_floodprotect 1
sv_hostname CoDWaWHost
sv_maxclients 10
sv_maxPing 0
sv_maxRate 25000
sv_minPing 0
sv_privateClients 0
sv_punkbuster 0
sv_pure 1
sv_voice 0
ui_maxclients 32
Posted

use the below code

Temp.Substring(Temp.IndexOf("g_gametype") + 10, Temp.IndexOf("gamename")-16 )


where Temp Holds your server response .

Sorry.., i am providing code in C#.., same can translate in VB .
 
Share this answer
 
v2
Comments
Rajesh Anuhya 20-Oct-10 8:46am    
why my answer is down voted.., plz let me know the reason???
can you give me a example of that ? and it is in a string
 
Share this answer
 
ok thank you very much, now i can move on with this :)
 
Share this answer
 
do you have that in a var?
its simple to do this if you do, use indexof and select between g_gametype and line.length
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900