Raised This Month: $359 Target: $400
 89%   Almost there!

SourceMod Profiler error


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
AnIHiL
Member
Join Date: Sep 2009
Old 08-22-2010 , 09:00   SourceMod Profiler error
Reply With Quote #1

When i'm trying to open XML file in SourceMod Profiler Report Viewer i get error: Error opening or parsing file.

I found out that it's a problem with parsing strings to doubles and culture info.

Ex.
if uptime="123.456" in XML file
Code:
m_duration = Double.Parse(xml.GetAttribute("uptime")); // error
if uptime="123,456" in XML file
Code:
m_duration = Double.Parse(xml.GetAttribute("uptime")); // it's ok
To solve this change in code:
Code:
m_duration = Double.Parse(xml.GetAttribute("uptime"));
to
Code:
m_duration = Double.Parse(xml.GetAttribute("uptime"), new System.Globalization.CultureInfo("en-US"));
Code:
item.max_time = Double.Parse(xml.GetAttribute("maxtime"));
to
Code:
item.max_time = Double.Parse(xml.GetAttribute("maxtime"), new System.Globalization.CultureInfo("en-US"));
Code:
item.min_time = Double.Parse(xml.GetAttribute("mintime"));
to
Code:
item.min_time = Double.Parse(xml.GetAttribute("mintime"), new System.Globalization.CultureInfo("en-US"));
Code:
item.total_time = Double.Parse(xml.GetAttribute("totaltime"));
to
Code:
item.total_time = Double.Parse(xml.GetAttribute("totaltime"), new System.Globalization.CultureInfo("en-US"));
I don't know if this will work for everyone. Instead of using System.Globalization.CultureInfo you can try to use:
Code:
m_duration = Double.Parse(xml.GetAttribute("uptime").Replace('.', ','));
etc.

Any dev could change source code for SourceMod Profiler? It would be good if others don't get this error.

ps. If it's a bad section pls move the topic.
AnIHiL is offline
Send a message via MSN to AnIHiL
Fyren
FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren
Join Date: Feb 2106
Old 08-22-2010 , 17:20   Re: SourceMod Profiler error
Reply With Quote #2

Post on the bug tracker.
Fyren is offline
AnIHiL
Member
Join Date: Sep 2009
Old 08-22-2010 , 17:51   Re: SourceMod Profiler error
Reply With Quote #3

Quote:
Originally Posted by Fyren View Post
Post on the bug tracker.
In which section ? I couldn't find anything that is connected to SM Profiler.
AnIHiL is offline
Send a message via MSN to AnIHiL
rhelgeby
Veteran Member
Join Date: Oct 2008
Location: 0x4E6F72776179
Old 08-23-2010 , 11:52   Re: SourceMod Profiler error
Reply With Quote #4

I suppose "core" is the only one related to the profiler.
__________________
Richard Helgeby

Zombie:Reloaded | PawnUnit | Object Library
(Please don't send private messages for support, they will be ignored. Use the forum.)
rhelgeby is offline
Send a message via MSN to rhelgeby
DarkEnergy
SourceMod Donor
Join Date: Apr 2008
Location: Georgia Tech, MSECE
Old 08-23-2010 , 18:14   Re: SourceMod Profiler error
Reply With Quote #5

my profiler reads fine

you can also just open the xml in wordpad
__________________
War3:Source Developer
"Your CPU is just a bunch of Muxes"
DarkEnergy is offline
Zack771
Senior Member
Join Date: Apr 2012
Location: 192.168.1.16
Old 07-02-2014 , 05:00   Re: SourceMod Profiler error
Reply With Quote #6

Sorry to dig up this post, but i was getting the same error as @AnIHiL.

Then in my XML file i change all "." with "," then the profiler works.
__________________
"Embrace your dreams, and whatever happend protect your honor"
Zack Fair
Zack771 is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 00:54.


Powered by vBulletin®
Copyright ©2000 - 2022, vBulletin Solutions, Inc.
Theme made by Freecode