Jump to content

Create graphs that your clients can access from their own web page


LFA

Recommended Posts

Requires TCAdmin version 1.0.2051.22937 or greater

 

 

 

See the attached files

 

 

 

You have 2 options.

 

1- Generate the images with the script and tell your clients the links to their game server's charts. Tip: Run it as a scheduled task.

 

 

 

2- Allow them to generate the chart for their game server by linking to a web page from their site. for example:

 

http://tcadmin.yourdomain.com/playeractivity.aspx?ip=127.0.0.1&port=27960&days=0&showtitle=1

 

 

 

This will return the generated image.

 

 

 

 

 

How to use the script file (GenerateCharts.tcascript):

 

 

 

Open it with notepad.

 

 

 

Under CONFIGURATION

 

Change the settings you want to change. Most importantly the path where the charts are generated (SaveDirectory)

 

 

 

This path should point to a folder that is available from the web, for example C:\Program Files\TCAdmin Control Panel\Web\Charts\

 

 

 

make sure the specified folder exists.

 

 

 

 

 

How to use the webpage (playeractivity.aspx):

 

 

 

Save the file to your TCAdmin Web folder. (C:\Program Files\TCAdmin Control Panel\Web)

 

 

 

Open with notepad and make any configuration changes (under CONFIGURATION)

 

 

 

To access the image, you client will have to link to the web page in an image tag like this:

 

 

<img src="http://tcadmin.yourdomain.com/playeractivity.aspx?ip=127.0.0.1&port=27960" />

 

 

 

The web page has 6 possible parameters:

 

ip: the ip that the game server is using (required)

 

port: the port that the game server is using (required)

 

width: The width of the generated chart (optional)

 

height: The height of the generated chart (optional)

 

days: The number of days the chart will show. (optional) Default value is 0. 0 means today only, 1 Day means today and yesterday, 7 days means today + last 7 days, etc

 

showtitle: Specify if the chart should have a title. (optional, 1 or 0, default value is 1)

 

 

 

 

 

 

 

 

 

Advanced Configuration

 

To make advanced changes, like colors, fonts, etc, you will have to check the SDK documentation for TCAdminSDK.Util.ChartGenerator.ChartProperties.

 

 

 

Here is an example than modifies the chart color and font. This would be placed right after the CONFIGURATION section in the scripts:

 

 

 

ChartProperties.BackColor = System.Drawing.Color.SeaShell
ChartProperties.MainPenColor = System.Drawing.Color.HotPink
ChartProperties.WaterMarkColor = System.Drawing.Color.SpringGreen
ChartProperties.TitleFont = New System.Drawing.Font("Arial Black", 10, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point)
ChartProperties.LabelFont = New System.Drawing.Font("Arial", 10, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point)

GenerateCharts.tcascript

playeractivity.aspx

Link to comment
Share on other sites

  • 2 months later...
  • 3 months later...
  • 3 weeks later...
  • 2 months later...

Where can we find the possible values for the chart properties fields?

 

 

 

For example, is it possible to use Hex for color instead of color names?

 

 

 

And what field controls the background of the graph itself?

 

 

 

I can find what controls the background of the entire image, but I cannot seem to change the white background on the chart itself.

 

 

 

I was also wondering if it was possible to turn off the white background for the chart and turn off the background for the entire image, thus in a sense, making it a transparent image of just the text and the graph. Is this possible?

 

 

 

G3mInI

Link to comment
Share on other sites

  • 7 months later...
  • 3 weeks later...

Since it looks like the forum transfer messed up all the links...can we repost this so it readable?

 

Also is it possible to create a graph for the playerslots? Its in the reports area but i wanna see if maybe i can pull a copy of it out.

Link to comment
Share on other sites

I am sure there is. but it would involve you coding a script to do it.

 

 

 

You can try the LGS script located here, and modify it.

 

http://www.tcadmin.com/forum/index.php?t=msg&goto=3641&a mp;a mp;rid=3&srch=lgsl#msg_3641

 

 

Is that how they make they "slots used" and slots available on some gsp websites?... I honestly don't know a thing about "lgs script".

 

 

That link is also borken.

Link to comment
Share on other sites

Spitfire...I am writing a custom script for the LGSL but its proving to be a bit of a pain....i was just wondering if maybe we can pull the graph from tcadmin directly.

 

If not i guess ill keep workin on this script here.

Link to comment
Share on other sites

  • 4 weeks later...
  • 5 months later...

Archived

This topic is now archived and is closed to further replies.

  • Who's Online   0 Members, 0 Anonymous, 130 Guests (See full list)

    • There are no registered users currently online
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Terms of Use