Post: [Release]Get Server Details C#
02-25-2014, 06:04 PM #1
Mango_Knife
In my man cave
(adsbygoogle = window.adsbygoogle || []).push({}); Hey guys

Welcome and today im release a function that originaly made by Seb5594, but i just converted it to mw2 Awesome face
So if you are using this dont forget to give credits to Seb5594

Alright so this is how you are using that:

1) Add this code somewhere on your project:
    
//Please Credit Seb5594, Shark And Mango_Knife
#region Boolean's
public static Boolean InGame()
{
return Lib.ReadBool(0x01D17A8C);
}
private static String ReturnInfos(Int32 Index)
{
return Encoding.ASCII.GetString(Lib.GetBytes(0x17A54E0, 0x234)).Replace(@"\", "|").Split('|'Winky Winky[Index];
}
private static String OnlineInfos(Int32 Index)
{
return Encoding.ASCII.GetString(Lib.GetBytes(0x009aa2d9, 0x234)).Replace(@"\", "|").Split('|'Winky Winky[Index];
}
private static Boolean Online()
{
if (ReturnInfos(1) == "cg_predictItems")
{
return true;
}
else
{
return false;
}
}
#endregion
#region Host Name?
public static String getHostName()
{
if (InGame())
{
if (Online())
{
return ReturnInfos(Cool Man (aka Tustin);
}
else
{
return ReturnInfos(16);
}
}
else { return "Not in game"; }
}
#endregion
#region Max Players?
public static String getMaxPlayers()
{
if (InGame())
{
if (Online())
{
return OnlineInfos(1Cool Man (aka Tustin);
}
else
{
return ReturnInfos(1Cool Man (aka Tustin);
}
}
else { return "Not in game"; }
}
#endregion
#region Gamemode
public static String getGameMode()
{
if (InGame())
{
if (Online())
{
//Online
switch (OnlineInfos(2))
{
default: return "Unknown Gametype";
case "1": return "Loading Game";
case "war": return "Team Deathmatch";
case "dm": return "Free for All";
case "sd": return "Search and Destroy";
case "dom": return "Domination";
case "dem": return "Demolition";
case "gtnw": return "Global Thermonuclear War";
case "ctf": return "Capture The Flag";
case "arena": return "Arena";
}
}
else
{
//Private Match
switch (ReturnInfos(2))
{
default: return "Unknown Gametype";
case "1": return "Loading Game";
case "war": return "Team Deathmatch";
case "dm": return "Free for All";
case "sd": return "Search and Destroy";
case "dom": return "Domination";
case "dem": return "Demolition";
case "gtnw": return "Global Thermonuclear War";
case "ctf": return "Capture The Flag";
case "arena": return "Arena";
}
}
}
else { return "Not in game"; }
}
#endregion
#region Hardcore?
public static String getHardcore()
{
if (InGame())
{
if (Online())
{
switch (OnlineInfos(4))
{
default: return "Unknown Gametype";
case "20000": return "Loading Game";
case "0": return "Off";
case "1": return "On";
}
}
else
{
switch (ReturnInfos(4))
{
default: return "Unknown Gametype";
case "20000": return "Loading Game";
case "0": return "Off";
case "1": return "On";
}
}
}
else { return "Not in game"; }
}
#endregion
#region Map
public static String get_MapName()
{
String str = Lib.ReadString(0xD495F4), MapStr = "Not in game";
if (InGame())
{
if (str.Contains("afghan"))
MapStr = "Afghan";
if (str.Contains("highrise"))
MapStr = "Highrise";
if (str.Contains("rundown"))
MapStr = "Rundown";
if (str.Contains("quarry"))
MapStr = "Quarry";
if (str.Contains("nightshift"))
MapStr = "Skidrow";
if (str.Contains("terminal"))
MapStr = "Terminal";
if (str.Contains("brecourt"))
MapStr = "Wasteland";
if (str.Contains("derail"))
MapStr = "Derail";
if (str.Contains("estate"))
MapStr = "Estate";
if (str.Contains("favela"))
MapStr = "Favela";
if (str.Contains("invasion"))
MapStr = "Invasion";
if (str.Contains("rust"))
MapStr = "Rust";
if (str.Contains("scrapyard") || str.Contains(("boneyard")))
MapStr = "Scrapyard";
if (str.Contains("sub"))
MapStr = "Subbase";
if (str.Contains("underpass"))
MapStr = "Underpass";
if (str.Contains("checkpoint"))
MapStr = "Karachi";
if (str.Contains("bailout"))
MapStr = "Bailout";
if (str.Contains("compact"))
MapStr = "Salvage";
if (str.Contains("storm") || str.Contains(("storm2")))
MapStr = "Storm";
if (str.Contains("crash"))
MapStr = "Crash";
if (str.Contains("overgrown"))
MapStr = "Overgrown";
if (str.Contains("strike"))
MapStr = "Strike";
if (str.Contains("vacant"))
MapStr = "Vacant";
if (str.Contains("trailerpark"))
MapStr = "Trailer Park";
if (str.Contains("fuel"))
MapStr = "Fuel";
if (str.Contains("abandon"))
MapStr = "Carnival";
if (str.Contains("dlc2_ui_mp"))
MapStr = "Not in game";
}
return MapStr;
}
#endregion


2) Put 10 labels somewhere you want the Server Details Function, it will be like that:
You must login or register to view this content.

3) Now insert this function on your Button:
label1.Text = getHostName();
label2.Text = getMapName();
label3.Text = getGameMode();
label4.Text = getHardcore();
label5.Text = getMaxPlayers();
It need to be match to those labels: You must login or register to view this content.

And thats all your done Smile
In the end you will get something like that:
You must login or register to view this content.
If you want to make this auto refresh just use timer:


Credits:
Mango_Knife - Updated this to Mw2.
Seb5594 - Original Function.
    
private void timer1_Tick(object sender, EventArgs e)
{
label1.Text = getHostName();
label2.Text = getMapName();
label3.Text = getGameMode();
label4.Text = getHardcore();
label5.Text = getMaxPlayers();
}
(adsbygoogle = window.adsbygoogle || []).push({});

The following 6 users say thank you to Mango_Knife for this useful post:

.MrRedDoT, FusionIsDaName, Hori_By_Nature, MoTmrD-, MrRambo, SnaY
07-14-2014, 10:13 AM #11
Mango_Knife
In my man cave
Fixed!
07-14-2014, 10:15 AM #12
That is awesome. Smile
07-14-2014, 10:22 AM #13
Mango_Knife
In my man cave
Originally posted by ImEraz
It doesnt work for me


Originally posted by jwm614 View Post
your offset is not working for me on mw2 ethier but AlmightySo is working for me


Not its work Happy
07-14-2014, 12:11 PM #14
Shark
Retired.
Originally posted by Knife View Post
Hey guys

Welcome and today im release a function that originaly made by Seb5594, but i just converted it to mw2 Awesome face
So if you are using this dont forget to give credits to Seb5594

Alright so this is how you are using that:

1) Add this code somewhere on your project:
    
//Please Credit Seb5594, Shark And Mango_Knife
#region Boolean's
public static Boolean InGame()
{
return Lib.ReadBool(0x01D17A8C);
}
private static String ReturnInfos(Int32 Index)
{
return Encoding.ASCII.GetString(Lib.GetBytes(0x17A54E0, 0x234)).Replace(@"\", "|").Split('|'Winky Winky[Index];
}
private static String OnlineInfos(Int32 Index)
{
return Encoding.ASCII.GetString(Lib.GetBytes(0x009aa2d9, 0x234)).Replace(@"\", "|").Split('|'Winky Winky[Index];
}
private static Boolean Online()
{
if (ReturnInfos(1) == "cg_predictItems")
{
return true;
}
else
{
return false;
}
}
#endregion
#region Host Name?
public static String getHostName()
{
if (InGame())
{
if (Online())
{
return ReturnInfos(Cool Man (aka Tustin);
}
else
{
return ReturnInfos(16);
}
}
else { return "Not in game"; }
}
#endregion
#region Max Players?
public static String getMaxPlayers()
{
if (InGame())
{
if (Online())
{
return OnlineInfos(1Cool Man (aka Tustin);
}
else
{
return ReturnInfos(1Cool Man (aka Tustin);
}
}
else { return "Not in game"; }
}
#endregion
#region Gamemode
public static String getGameMode()
{
if (InGame())
{
if (Online())
{
//Online
switch (OnlineInfos(2))
{
default: return "Unknown Gametype";
case "1": return "Loading Game";
case "war": return "Team Deathmatch";
case "dm": return "Free for All";
case "sd": return "Search and Destroy";
case "dom": return "Domination";
case "dem": return "Demolition";
case "gtnw": return "Global Thermonuclear War";
case "ctf": return "Capture The Flag";
case "arena": return "Arena";
}
}
else
{
//Private Match
switch (ReturnInfos(2))
{
default: return "Unknown Gametype";
case "1": return "Loading Game";
case "war": return "Team Deathmatch";
case "dm": return "Free for All";
case "sd": return "Search and Destroy";
case "dom": return "Domination";
case "dem": return "Demolition";
case "gtnw": return "Global Thermonuclear War";
case "ctf": return "Capture The Flag";
case "arena": return "Arena";
}
}
}
else { return "Not in game"; }
}
#endregion
#region Hardcore?
public static String getHardcore()
{
if (InGame())
{
if (Online())
{
switch (OnlineInfos(4))
{
default: return "Unknown Gametype";
case "20000": return "Loading Game";
case "0": return "Off";
case "1": return "On";
}
}
else
{
switch (ReturnInfos(4))
{
default: return "Unknown Gametype";
case "20000": return "Loading Game";
case "0": return "Off";
case "1": return "On";
}
}
}
else { return "Not in game"; }
}
#endregion
#region Map
public static String get_MapName()
{
String str = Lib.ReadString(0xD495F4), MapStr = "Not in game";
if (InGame())
{
if (str.Contains("afghan"))
MapStr = "Afghan";
if (str.Contains("highrise"))
MapStr = "Highrise";
if (str.Contains("rundown"))
MapStr = "Rundown";
if (str.Contains("quarry"))
MapStr = "Quarry";
if (str.Contains("nightshift"))
MapStr = "Skidrow";
if (str.Contains("terminal"))
MapStr = "Terminal";
if (str.Contains("brecourt"))
MapStr = "Wasteland";
if (str.Contains("derail"))
MapStr = "Derail";
if (str.Contains("estate"))
MapStr = "Estate";
if (str.Contains("favela"))
MapStr = "Favela";
if (str.Contains("invasion"))
MapStr = "Invasion";
if (str.Contains("rust"))
MapStr = "Rust";
if (str.Contains("scrapyard") || str.Contains(("boneyard")))
MapStr = "Scrapyard";
if (str.Contains("sub"))
MapStr = "Subbase";
if (str.Contains("underpass"))
MapStr = "Underpass";
if (str.Contains("checkpoint"))
MapStr = "Karachi";
if (str.Contains("bailout"))
MapStr = "Bailout";
if (str.Contains("compact"))
MapStr = "Salvage";
if (str.Contains("storm") || str.Contains(("storm2")))
MapStr = "Storm";
if (str.Contains("crash"))
MapStr = "Crash";
if (str.Contains("overgrown"))
MapStr = "Overgrown";
if (str.Contains("strike"))
MapStr = "Strike";
if (str.Contains("vacant"))
MapStr = "Vacant";
if (str.Contains("trailerpark"))
MapStr = "Trailer Park";
if (str.Contains("fuel"))
MapStr = "Fuel";
if (str.Contains("abandon"))
MapStr = "Carnival";
if (str.Contains("dlc2_ui_mp"))
MapStr = "Not in game";
}
return MapStr;
}
#endregion


2) Put 10 labels somewhere you want the Server Details Function, it will be like that:
You must login or register to view this content.

3) Now insert this function on your Button:
label1.Text = getHostName();
label2.Text = getMapName();
label3.Text = getGameMode();
label4.Text = getHardcore();
label5.Text = getMaxPlayers();
It need to be match to those labels: You must login or register to view this content.

And thats all your done Smile
In the end you will get something like that:
You must login or register to view this content.
If you want to make this auto refresh just use timer:


Credits:
Mango_Knife - Updated this to Mw2.
Seb5594 - Original Function.
    
private void timer1_Tick(object sender, EventArgs e)
{
label1.Text = getHostName();
label2.Text = getMapName();
label3.Text = getGameMode();
label4.Text = getHardcore();
label5.Text = getMaxPlayers();
}


here is way better code I made, it sort of works like dvar_getstring just you dont need rpc... :p

    
public static String getString(String type)
{
String Main = ReadString(0x9AA2D9);
string[] MainArray = Main.Split('\\'Winky Winky;
Int32 StrLen = Main.Length;
Int32 strIndex = 0;

for (int i = 0; i < MainArray.Length; i++)
{
if (MainArray[i] == type)
{
i++;
strIndex = i;
continue;
}
}
return MainArray[strIndex];
}


Detail Types
    
g_gametype
g_hardcore
mapname
protocal
scr_game_allowkillcam
scr_team_fftype
shortversion
sv_hostname
sv_maxclients
sv_privateClients
sv_privateClientsForClients


Example
    
String hostName = getString("sv_hostname");


Enjoy :p

The following user thanked Shark for this useful post:

Swaqq
07-14-2014, 12:12 PM #15
Mango_Knife
In my man cave
Originally posted by Shark View Post
here is way better code I made, it sort of works like dvar_getstring just you dont need rpc... :p

    
public static String getString(String type)
{
String Main = ReadString(0x9AA2D9);
string[] MainArray = Main.Split('\\'Winky Winky;
Int32 StrLen = Main.Length;
Int32 strIndex = 0;

for (int i = 0; i < MainArray.Length; i++)
{
if (MainArray[i] == type)
{
i++;
strIndex = i;
continue;
}
}
return MainArray[strIndex];
}


Detail Types
    
g_gametype
g_hardcore
mapname
protocal
scr_game_allowkillcam
scr_team_fftype
shortversion
sv_hostname
sv_maxclients
sv_privateClients
sv_privateClientsForClients


Example
    
String hostName = getString("sv_hostname");


Enjoy :p


lol k.
07-15-2014, 07:39 AM #16
iNDMx
Do a barrel roll!
Nice ! Mango ! :p
07-19-2014, 10:34 AM #17
I have a problem with the Lib.ReadBool function and i use the PS3Lib.dll and i Coding for Cex/Dex. Can any one help me ? Thx
07-20-2014, 07:52 AM #18
Mango_Knife
In my man cave
Originally posted by MoDzZ View Post
I have a problem with the Lib.ReadBool function and i use the PS3Lib.dll and i Coding for Cex/Dex. Can any one help me ? Thx


change it to PS3.Extension.ReadBool
07-20-2014, 10:07 AM #19
Thx Mango_Knife Smile

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo