Home | Webstore
Latest News: OOTP 15 Released! - Beyond the Sideline Football Announced! - OOTP 14: Update #7 Released! - FHM 2014: Version 1.5 Available! - Out Of The Park Baseball 14 Released! - iOOTP Baseball 2013 for iOS Available NOW! - Title Bout Championship Boxing 2.5 released!

OOTP 15 Released - Buy Now!

Beyond the Sideline Football Announced!
  

Go Back   OOTP Developments Forums > Out of the Park Baseball 15 > OOTP Mods

OOTP Mods Logos, roster packs, historical databases, OOTP tools, FaceGen files... it's all here!

Reply
 
LinkBack Thread Tools
Old 05-11-2009, 10:14 AM   #1 (permalink)
Bat Boy
 
rglass95's Avatar
 
Join Date: Jan 2005
Location: Frisco, TX
Posts: 14
Thanks: 0
Thanked 1x in 1 post
Carya Game Log Viewer

Download

http://www.glass4.com/hbl/carya_log/carya_log.zip

What is it?

A while back I wrote a utility for my league (Hickory Baseball League) for managing our live playoff simulations. I received a request for its use in another league so I'm packaging it up for anyone that wants to use it. As you can see from the screenshot below, this web app allows for up to 4 games to be "watched" at once - each section of the screen will update every 5 seconds with the next action of the game.



How does it work?

When a game is simulated, a game log is generated in your \Documents\Out of the Park Developments\OOTP Baseball 9\saved_games\HBL.lg\news\txt\leagues\ directory. This program parses that file and reads the events of a game into a database. Then, when you inform the system to start the display of the game, it will begin showing the game in the screen above.

Setting it up

First, you'll need a website with some a database and PHP support. I use mySQL. Here is the script you'll need to run to generate the required tables.

Code:
-- --------------------------------------------------------

-- 
-- Table structure for table `carya_log_event`
-- 

CREATE TABLE `carya_log_event` (
  `eventID` int(11) NOT NULL default '0',
  `gameID` int(11) NOT NULL default '0',
  `eventText` varchar(255) NOT NULL default '',
  `inning` int(11) NOT NULL default '0',
  `baseState` char(3) NOT NULL default '',
  `outs` int(11) NOT NULL default '0',
  `batter` varchar(30) NOT NULL default '',
  `pitcher` varchar(30) NOT NULL default '',
  `runs` int(11) NOT NULL default '0',
  `hits` int(11) NOT NULL default '0',
  `errors` int(11) NOT NULL default '0',
  PRIMARY KEY  (`eventID`,`gameID`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

-- 
-- Table structure for table `carya_log_game`
-- 

CREATE TABLE `carya_log_game` (
  `gameID` int(11) NOT NULL default '0',
  `awayTeam` varchar(50) NOT NULL default '',
  `homeTeam` varchar(50) NOT NULL default '',
  PRIMARY KEY  (`gameID`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

-- 
-- Table structure for table `carya_log_timer`
-- 

CREATE TABLE `carya_log_timer` (
  `id` int(11) NOT NULL default '0',
  `gameID` int(11) NOT NULL default '0',
  `startTime` int(11) NOT NULL default '0',
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

INSERT INTO carya_log_timer VALUES (1, -1, -1);
INSERT INTO carya_log_timer VALUES (2, -1, -1);
INSERT INTO carya_log_timer VALUES (3, -1, -1);
INSERT INTO carya_log_timer VALUES (4, -1, -1);
Download the code from the link at the top of the post and open global.php.

Code:
$filePath = "/$HTML_PATH$/carya_log/logs/";
$imagePath = "http://$URL$/";

function connect_database() {
  $user="$USER_NAME$";
  $password="$PASSWORD$";
  $database="$DATABASE$";
  mysql_connect("$DB_SERVER$", $user, $password, FALSE, MYSQL_CLIENT_COMPRESS);
  @mysql_select_db($database) or die("db error");
}
$HTML_PATH$: This is where your files are located on your web host. Mine in this case would be '/home/0/2/9/17116/17116/public_html/'.
$URL$: This is the URL to your website, for example 'www.glass4.com/hbl'. This path is used to show the team icons (16x16, png). The icons will be the same as the team name in the game log file (for instance, 'Baltimore Orioles.png').
$USER_NAME$: User name for your database connection.
$PASSWORD$: Password for your database connection.
$DATABASE$: Name of your database.
$DB_SERVER$: Name of the server your database is on.

So once you've made those modifications you should be ready to go. Starting a game for viewing is a 5 step process:

1) Upload up to 4 log_$ID$.txt files from your OOTP folder to http://yourwebsite.com/carya_log/logs/ directory.
2) Navigate to http://yourwebsite.com/carya_log/load.php. This will parse the .txt files and save the events into the database.
3) Delete the log_$ID$.txt files.
4) Navigate to http://yourwebsite.com/carya_log/start.php. For each field on the screen, type in the id of the game you want to view ($ID$ in the txt file name).
5) Tell your users to navigate to http://yourwebsite.com/carya_log/ to watch the games!

That should be it. If you have any comments or questions feel free to post them in the thread and I'll get back to them when I can. This code is fairly old and I had some plans to eventually rewrite the thing to make it a bit more elegant, but I haven't found the time yet. There probably needs to be some security measures on the load and start pages so you could rename them or put them in a password-protected directory if you want. So use at your own risk in the meantime. Anyway, enjoy.
__________________
Hickory Baseball League
http://www.hblbaseball.com/

Last edited by rglass95; 04-24-2011 at 11:34 AM.
rglass95 is offline   Reply With Quote
Thank you for this post:
diamondreplays (08-05-2011)
Old 05-11-2009, 11:18 AM   #2 (permalink)
Hall Of Famer
 
Corsairs's Avatar
 
Join Date: Aug 2007
Posts: 2,231
Thanks: 1,537
Thanked 638x in 323 posts
You just sold me on upgrading our league to a website that supports mySQL.
__________________
Founder of the Planetary Extreme Baseball Alliance (PEBA) and the League of the Rising Sun (LRS)
Premiere OOTP fictional leagues where creativity counts and imagination is your only limitation
Check for openings - contact us today!
Corsairs is offline   Reply With Quote
Old 05-11-2009, 12:26 PM   #3 (permalink)
Hall Of Famer
 
f.montoya's Avatar
 
Join Date: Nov 2004
Posts: 6,005
Thanks: 267
Thanked 257x in 123 posts
This is awesome!!!

John, I should get you squared away with your new account as soon as we can decide on a domain name for you.
__________________
Fidel Montoya

Asahi2 Baseball Commissioner(Historical League Since 2004)
www.allsimbaseball.com (OOTP web hosting - Customized sites for online leagues - Sign up, Connect OOTP and Play!)
Share Your Mods - Free, unlimited and easy to upload to share your Mods instantly(free site registration required)
AllYouSports - "Because Facebook don't do baseball stats"
f.montoya is offline   Reply With Quote
Old 05-11-2009, 12:38 PM   #4 (permalink)
All Star Reserve
 
Join Date: Dec 2001
Location: NY
Posts: 613
Thanks: 3
Thanked 16x in 8 posts
This utility rules. It makes simming the playoffs a hell of a lot of fun.
__________________
-------------------
Montreal Expos / Calgary Storm, HBL
HBL Baseball - Founded March 2001.
HBL Waiting List
Qrashman is offline   Reply With Quote
Old 05-11-2009, 01:18 PM   #5 (permalink)
Bat Boy
 
rglass95's Avatar
 
Join Date: Jan 2005
Location: Frisco, TX
Posts: 14
Thanks: 0
Thanked 1x in 1 post
Edit - took the demo down for a bit.
__________________
Hickory Baseball League
http://www.hblbaseball.com/

Last edited by rglass95; 05-12-2009 at 12:28 AM.
rglass95 is offline   Reply With Quote
Old 04-15-2011, 03:02 AM   #6 (permalink)
All Star Starter
 
soadeathdealer's Avatar
 
Join Date: Nov 2009
Location: AZ Via VA
Posts: 1,518
Thanks: 291
Thanked 230x in 198 posts
Post

having issues getting this to work
i get sql errors when i load the table into the sql data base abd
then i get this when i go to load.php


singles. Error ("Single .

Outs: 0
INSERT INTO carya_log_event (eventID, gameID, eventText, inning, baseState, outs, batter, pitcher, runs, hits, errors) VALUES (1, load.php, ' singles. Error ("Single .', 0, '010', 0, '', '', 0, 1, 0);

Fatal error: Maximum execution time of 30 seconds exceeded in /home/www/hrb.soa-skateboards.com/carya_log/load.php on line 238



then i get a bunch of error when i goto watch the game

Carya Game Log Viewer

i welcome any help
soadeathdealer is offline   Reply With Quote
Old 04-19-2011, 11:38 AM   #7 (permalink)
Hall Of Famer
 
Join Date: Dec 2001
Location: Union City, TN
Posts: 6,126
Thanks: 59
Thanked 568x in 336 posts
Its looking for files in the following line of code:

/home/www/hrb.soa-skateboards.com/carya_log/view.php

the part between the www and the carya_log should be your account username, not your url. I'm not even sure the www is needed. I don't use that in my paths.


Secondly, how did I miss this post for the past two years? My buddy who runs the BBS' sister league pointed it out to me today.

This a great tool. I'll be installing tonight.

Last edited by Cooleyvol; 04-19-2011 at 11:40 AM.
Cooleyvol is offline   Reply With Quote
Old 04-19-2011, 11:55 AM   #8 (permalink)
Hall Of Famer
 
Join Date: Dec 2001
Location: Union City, TN
Posts: 6,126
Thanks: 59
Thanked 568x in 336 posts
After looking at this, from what I can tell you can only load a max of four games. You cannot choose from many games as I first thought.

It'd be great if all the logs of the recent sim could be uploaded and the user could choose the games he wanted to watch.
Cooleyvol is offline   Reply With Quote
Thank you for this post:
sdodd (07-23-2011)
Old 07-23-2011, 12:26 PM   #9 (permalink)
Minors (Triple A)
 
sdodd's Avatar
 
Join Date: Jan 2011
Posts: 267
Thanks: 51
Thanked 67x in 31 posts
I'm with you.. This is the first time I have seen this and I also missed it!! I will be installing tonight as well
sdodd is offline   Reply With Quote
Old 07-23-2011, 05:39 PM   #10 (permalink)
Minors (Triple A)
 
sdodd's Avatar
 
Join Date: Jan 2011
Posts: 267
Thanks: 51
Thanked 67x in 31 posts
Ok.. I need just a little help. Here is the error I'm getting

Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/mlob/public_html/carya_log/view.php on line 273
sdodd is offline   Reply With Quote
Old 07-23-2011, 06:52 PM   #11 (permalink)
Minors (Triple A)
 
sdodd's Avatar
 
Join Date: Jan 2011
Posts: 267
Thanks: 51
Thanked 67x in 31 posts
got the error fixed... Now I just can't get the team logos to show
sdodd is offline   Reply With Quote
Old 07-23-2011, 07:38 PM   #12 (permalink)
Minors (Triple A)
 
sdodd's Avatar
 
Join Date: Jan 2011
Posts: 267
Thanks: 51
Thanked 67x in 31 posts
Got it all figured out!! Awesome
sdodd is offline   Reply With Quote
Old 09-13-2011, 06:14 PM   #13 (permalink)
All Star Starter
 
soadeathdealer's Avatar
 
Join Date: Nov 2009
Location: AZ Via VA
Posts: 1,518
Thanks: 291
Thanked 230x in 198 posts
This utility rules. and my League Home-Run Baseball League will use this for its playoffs for both leagues . i love this app a lot have been using it for a long time .




my league its fictional league with 2 leagues in one league file the HRBL and the Puro Yakyu (PY), just opened for gms like 2 dyas ago chk us out and join

http://www.ootpdevelopments.com/boar...apply-now.html
__________________
Jerseys and caps/logos and more
http://s39.photobucket.com/albums/e1...%20and%20caps/


Leagues
POTD: Vermont/Co-Commish: http://potd.pterodactyl.ca/
MTBL: Daytona Bombers: http://mtblcentral.com/Board/
RFTP : Braves/co-commish: http://rftp.tuckermade.net
Application for membership into RFTP
The Show: Miami Marlins: http://theshow.ootpleagues.com/index.php
soadeathdealer is offline   Reply With Quote
Old 10-21-2011, 01:52 PM   #14 (permalink)
Minors (Double A)
 
Join Date: Feb 2010
Posts: 141
Thanks: 2
Thanked 49x in 30 posts
Pbp

Quote:
Originally Posted by soadeathdealer View Post
This utility rules. and my League Home-Run Baseball League will use this for its playoffs for both leagues . i love this app a lot have been using it for a long time .




my league its fictional league with 2 leagues in one league file the HRBL and the Puro Yakyu (PY), just opened for gms like 2 dyas ago chk us out and join

http://www.ootpdevelopments.com/boar...apply-now.html
All I would want is the ability to copy the detailed PBP for a game or games to a file where I would then take it and put it in a Word document. At that point I would use text-to-speech software to create and MP3 for that game or games.

Will this work for that purpose?

Thanks
MLHFFYP is offline   Reply With Quote
Old 10-22-2011, 06:25 PM   #15 (permalink)
All Star Starter
 
soadeathdealer's Avatar
 
Join Date: Nov 2009
Location: AZ Via VA
Posts: 1,518
Thanks: 291
Thanked 230x in 198 posts
u can just go into the game logs and pull the data out and do what u need to with it .

the logs are in the news folder under text or html depending on which u want to use
__________________
Jerseys and caps/logos and more
http://s39.photobucket.com/albums/e1...%20and%20caps/


Leagues
POTD: Vermont/Co-Commish: http://potd.pterodactyl.ca/
MTBL: Daytona Bombers: http://mtblcentral.com/Board/
RFTP : Braves/co-commish: http://rftp.tuckermade.net
Application for membership into RFTP
The Show: Miami Marlins: http://theshow.ootpleagues.com/index.php
soadeathdealer is offline   Reply With Quote
Old 05-25-2012, 06:58 AM   #16 (permalink)
Hall Of Famer
 
Join Date: Dec 2001
Location: Union City, TN
Posts: 6,126
Thanks: 59
Thanked 568x in 336 posts
Some threads should just be pinned. This is one of those threads.

So many pinned threads are no longer useful while nuggets like this fall through the cracks.
Cooleyvol is offline   Reply With Quote
Old 05-25-2012, 07:08 AM   #17 (permalink)
All Star Starter
 
soadeathdealer's Avatar
 
Join Date: Nov 2009
Location: AZ Via VA
Posts: 1,518
Thanks: 291
Thanked 230x in 198 posts
Yea its still very usefull

Sent from my DROID X2 using Tapatalk 2
__________________
Jerseys and caps/logos and more
http://s39.photobucket.com/albums/e1...%20and%20caps/


Leagues
POTD: Vermont/Co-Commish: http://potd.pterodactyl.ca/
MTBL: Daytona Bombers: http://mtblcentral.com/Board/
RFTP : Braves/co-commish: http://rftp.tuckermade.net
Application for membership into RFTP
The Show: Miami Marlins: http://theshow.ootpleagues.com/index.php
soadeathdealer is offline   Reply With Quote
Reply

Bookmarks

Thread Tools

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
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 08:51 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.
Search Engine Friendly URLs by vBSEO 3.6.1
Copyright © 2013 Out of the Park Developments