Home | Webstore
Latest News: OOTP 25 Available - FHM 10 Available - OOTP Go! Available

Out of the Park Baseball 25 Buy Now!

  

Go Back   OOTP Developments Forums > Out of the Park Baseball 25 > OOTP Mods
Register Blogs FAQ Calendar Today's Posts Search

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

Reply
 
Thread Tools
Old 05-11-2009, 10:14 AM   #1
rglass95
Bat Boy
 
rglass95's Avatar
 
Join Date: Jan 2005
Location: Frisco, TX
Posts: 14
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
Old 05-11-2009, 11:18 AM   #2
Corsairs
Hall Of Famer
 
Corsairs's Avatar
 
Join Date: Aug 2007
Posts: 2,360
You just sold me on upgrading our league to a website that supports mySQL.
__________________
Founder of the Planetary Extreme Baseball Alliance (PEBA)
Premiere OOTP fictional league 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
f.montoya
Hall Of Famer
 
f.montoya's Avatar
 
Join Date: Nov 2004
Posts: 6,069
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 ex-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)
f.montoya is offline   Reply With Quote
Old 05-11-2009, 12:38 PM   #4
Qrashman
All Star Reserve
 
Join Date: Dec 2001
Location: NY
Posts: 651
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
rglass95
Bat Boy
 
rglass95's Avatar
 
Join Date: Jan 2005
Location: Frisco, TX
Posts: 14
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
soadeathdealer
Hall Of Famer
 
soadeathdealer's Avatar
 
Join Date: Nov 2009
Location: VA
Posts: 2,140
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
Cooleyvol
Hall Of Famer
 
Cooleyvol's Avatar
 
Join Date: Dec 2001
Location: Union City, TN
Posts: 6,383
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
Cooleyvol
Hall Of Famer
 
Cooleyvol's Avatar
 
Join Date: Dec 2001
Location: Union City, TN
Posts: 6,383
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
Old 07-23-2011, 12:26 PM   #9
sdodd
Major Leagues
 
Join Date: Jan 2011
Posts: 332
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
sdodd
Major Leagues
 
Join Date: Jan 2011
Posts: 332
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
sdodd
Major Leagues
 
Join Date: Jan 2011
Posts: 332
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
sdodd
Major Leagues
 
Join Date: Jan 2011
Posts: 332
Got it all figured out!! Awesome
sdodd is offline   Reply With Quote
Old 09-13-2011, 06:14 PM   #13
soadeathdealer
Hall Of Famer
 
soadeathdealer's Avatar
 
Join Date: Nov 2009
Location: VA
Posts: 2,140
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

OOTP

POTD: Vermont/Co-Commish
MTBL: League Closed
The Show: Jacksonville Bombers
RFTP : Braves/co-commish: League Closed
HRBL: Commish: League Closed

DDSPF

WWPF- Miami

CSFL- Tampa

USFL: New Orleans

DDSCF

SNCFL: Florida/ JMU
soadeathdealer is offline   Reply With Quote
Old 10-21-2011, 01:52 PM   #14
MLHFFYP
Minors (Double A)
 
Join Date: Feb 2010
Posts: 148
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
soadeathdealer
Hall Of Famer
 
soadeathdealer's Avatar
 
Join Date: Nov 2009
Location: VA
Posts: 2,140
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

OOTP

POTD: Vermont/Co-Commish
MTBL: League Closed
The Show: Jacksonville Bombers
RFTP : Braves/co-commish: League Closed
HRBL: Commish: League Closed

DDSPF

WWPF- Miami

CSFL- Tampa

USFL: New Orleans

DDSCF

SNCFL: Florida/ JMU
soadeathdealer is offline   Reply With Quote
Old 05-25-2012, 06:58 AM   #16
Cooleyvol
Hall Of Famer
 
Cooleyvol's Avatar
 
Join Date: Dec 2001
Location: Union City, TN
Posts: 6,383
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
soadeathdealer
Hall Of Famer
 
soadeathdealer's Avatar
 
Join Date: Nov 2009
Location: VA
Posts: 2,140
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

OOTP

POTD: Vermont/Co-Commish
MTBL: League Closed
The Show: Jacksonville Bombers
RFTP : Braves/co-commish: League Closed
HRBL: Commish: League Closed

DDSPF

WWPF- Miami

CSFL- Tampa

USFL: New Orleans

DDSCF

SNCFL: Florida/ JMU
soadeathdealer is offline   Reply With Quote
Reply

Bookmarks


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 07:55 PM.

 

Major League and Minor League Baseball trademarks and copyrights are used with permission of Major League Baseball. Visit MLB.com and MiLB.com.

Officially Licensed Product – MLB Players, Inc.

Out of the Park Baseball is a registered trademark of Out of the Park Developments GmbH & Co. KG

Google Play is a trademark of Google Inc.

Apple, iPhone, iPod touch and iPad are trademarks of Apple Inc., registered in the U.S. and other countries.

COPYRIGHT © 2023 OUT OF THE PARK DEVELOPMENTS. ALL RIGHTS RESERVED.

 

Powered by vBulletin® Version 3.8.10
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright © 2020 Out of the Park Developments