Developing a game, alternatives for saving the current status
I'm building a videogame with java. I need to have a save/load option, so I can leave the game and and then continue any other day. The most obvious answer is to pass all the info to a text file. But someone told me that maybe I could just save the current status of the memory used by my game at that moment or something like that, so I wouldn't have to worry about formating a text file. Anyone knows if this is possible or at least is there any other alternative to the text file? The game has lots of different objects moving around the screen and I think it would be very difficult to make a text file that would save every object. So any suggestions?
Serilization is OK, but may cause some problem according to compatibility with later versions. For me the usage of XML-Serialization made sense. you may use something like:
FileOutputStream stateFileOutput = new FileOutputStream("myState.out");
new XMLEncoder(state).writeObject(stateObject);
FileInputStream stateFileInput = new FileInputStream("myState.out");
state = (MyStateObject)XMLDecoder(stateFileInput).readObject();
...
Similar Messages
-
Location/directory used by JRE, for saving the temporary Internet files
Hello sir,
I am working on a project( in JavaFX ) which takes the URL of a streaming FLV video( eg: http://sun.edgeboss.net/download/sun/media/1460825906/1460825906_11810873001_09c01923-00.flv ) as input and plays it in Media Player component.
I have successfully played the streaming video, by taking the aid of sample project, Media Box( http://javafx.com/samples/MediaBox/ ).
Now I am interested in knowing the location/directory, where these temporary Internet files will be downloaded to. Please let me know, the location/directory used by JRE( on both Windows and Linux ) for saving the temporary Internet files. Also let me know, if there is any possibility of changing that location/directory.
Thanks for any help, in advance.
Edited by: prabhakar9885 on Aug 22, 2010 2:29 AMYou should avoid posting the same message multiple times...
By definition, streaming is supposed to play the received movie data on the fly, without intermediary file. Now, it depends on implementation, if that's real streaming, etc., so in practice there might be a temp file, or not.
But this temp location will be, obviously, highly dependent on the current system (even between WinXP and Win7, for example). You can find the answer experimentally, eg. on Windows by using Sysinternals' Process Monitor application (did that to find out where Storage files go), but it is brittle.
I doubt there is (an official) way to know that from within the JavaFX application... -
I used to have a close tab for exiting the current site I was on instead of closing all of firefox. It was a red box with an x in it. How do I get it back?
Click in a blank space on a toolbar & open 'customize'. You'll find that there is a gray "x" (on my browser it's gray) that is for closing a tab. Drag it up to wherever you want on the toolbar & it should work fine.
-
File name used by plug-in for saving the image file.
I have a program that creates a web page that has an object tag with a call to a program and that program delivers a PDF file. When my users want to save that image the name of the image is a random name. Is there any way to make the plug-in, Adobe, use the meta tag Title or any other infromation that my program can provide, as image (file) name to be used for saving the image. (the initial suggested name)? I really appreciate your help.
One option is to rename the file after it's been exported using Windows File I/O API.
-
Query to get objects list for which the current user has 'SELECT' privilege
Hi,
I want to get tables and views list for which the current user has 'SELECT' privilege excluding sytem tables and views. The privilege information for the current user is scattered in more than one system views. I have following system views
USER_TAB_PRIVS_RECD - Object grants for which the current user is the grantee
ROLE_TAB_PRIVS - describes table privileges granted to roles. Information is provided only about roles to which the user has access.
If the object privilege is granted explicitly like "GRANT ALL ON TABLE_NAME TO "USERNAME" then this privilege entry goes to USER_TAB_PRIVIS_RECD
If the object privilege is granted by ROLE. Role is created with certain object privileges. this role is assigned to user "GRANT ROLE_NAME TO "USERNAME"", then this entry goes to ROLE_TAB_PRIVS
From these findings, I have composed below query
(SELECT DISTINCT TABLE_NAME FROM USER_TAB_PRIVS_RECD) UNION (SELECT DISTINCT TABLE_NAME FROM ROLE_TAB_PRIVS WHERE PRIVILEGE = 'SELECT')
Have I got user's all prvilege details? should I look some other system views?
How to exclude system table privileges details?
(SELECT DISTINCT TABLE_NAME FROM USER_TAB_PRIVS_RECD) UNION (SELECT DISTINCT TABLE_NAME FROM ROLE_TAB_PRIVS WHERE PRIVILEGE = 'SELECT' AND OWNER NOT IN ('SYS','SYSTEM') Is this right?
What about Public role in Oracle? Should I consider public role here?
Oracel Version :11g
I want make this query to work on Oracle 8i or above version
Thanks>
I want to get tables and views list for which the current user has 'SELECT' privilege excluding sytem tables and views.
>
You will need a hierarchical query to do that.
Try this script for Listing privileges recursively for Oracle users
http://www.adp-gmbh.ch/ora/misc/recursively_list_privilege.html -
Method for Saving the attendence data
Dear All,
We are implementing the HR,MM,FI,SD module and also implementing the Kronos Time Machine for Time details.
I got the text file in which employee attendence data is mentioned from the kronos system.Now which way i have to used for upload this information in sap tables or infotype .Because some buddy told we can not used the CATS ,I don't know why.
So now how i can save attendence data and also in which table in sap we have to save that data.Kindly Help me .I am using IT2001,2002 and 2006 infotype for time management
Kindly tell me the procedure for saving the Attendence data it' urg.
Thanks
sandeep
Edited by: SANDEEEP DABRAL on Jun 19, 2009 2:45 PMHi
Does your client is using punch in and punch out data. If then then we can store the P10 and P20 data in SAP directly with the help of the integration with 3rd party systems.
If not then just prepare a customized prghramme with the help of ABAP guys to uplad the data in IT 2002 against the absence types.
For this you need to do the Absences customization in SAP R/3
Thanks
Sheetal -
What is the current status for Kerberos Constrained delegation feature on the ASA platform?
What is the current status for Kerberos Constrained delegation feature on the ASA platform?
Hi Oscar,
This is not available yet in the current software. Now, we cannot give any official information on this forum about software that has not been released yet, but if you really want to know I would suggest that you contact your local Cisco sales office to confirm with your account team which new features will be in the upcoming ASA 8.4 software release.
hth
Herbert -
Standard report Programs to find the current status of workflows
Hi Experts,
Are there any Standard report Programs to find the current status of workflows or workflows which are pending.
Regards,
HariGo to SWI1 t-code
Give the appropriate Status - Ready or Inprocess or Waiting
Input the Task - either WF Template or Standard Task.
Choose the time period and execute the report.
Regards,
PR. -
Get the current status of IDOC
Hi,
I want the current status of IDOC.
Is there any function module through which i can get the current status of IDOC?Hi,
Use function module "FTR_IDOC_READ", Output structure "PE_IDOC_STATUS" holds the current status of IDOC number
Regards
Vinod -
Script for Checking the Server Status
Hi All,
I just need the script for monitoring the server status through the WLST.My scenario:I have 2 server in Running State.If any one of the server get failed or in not RUNNING state then i use the script for starting that server automatically.I tried some of the script but it is not working properly .If any one have the sample script please share with me.
Regards,
Ove.Hi Syed,
Replication state is very easy to see in 4.x and earlier. The last changenumber in the supplier changelog is visible (on the root DSE IIRC), and each consumer suffix has an operational attribute "copiedfrom" that tells you the name of the supplier, the database generation id, and the last change replayed from the supplier.
So a script that compares the results of
ldapsearch -h <supplier> -s base -b "" "objectclass=*" lastchangenumber
and
ldapsearch -h <consumer> -s base -b <base_suffix> "objectclass=*" copiedFrom
will show you if a replica has fallen out of sync. It won't tell you more than how many changes behind the replica is, though, because pre-5.x changenumbers are sequential integers, not timestamps.
However, the change that corresponds to the changenumber is clearly visible under the "cn=changelog" suffix. So if you look at the change itself you can see the timestamp on it.
For more info on the status of replication, you should be able to query the agreements on the supplier. Those live under the "Netscape Machine Data Suffix", which you can also find on the supplier's root DSE:
ldapsearch -h <supplier> -s base -b "" "objectclass=*" netscapemdsuffix
And of course the error logs will usually tell you if replication is failing outright.
I may be off on some of the attribute names, but if you do some investigating along these lines, you should be able to figure it out. -
hi,
After intrgrating with Webcenter site with EClipse using CSDT plugin. When i tries to create a template using eclipse IDE. And when i click on 'Create New Template' icon on eclipse , I am getting error "*** Developer Tools: Reading sites for user: fwadmin returned status: Forbidden"
Thanks,
KumarHello,
Check if your user has correct permission or not.
User must of part of RestAdmin group. Read here- http://docs.oracle.com/cd/E29542_01/doc.1111/e29634/dt_quickstart.htm#WBCSD942
Regards,
Guddu -
A script for adding the current date to file name?
I am working in Indesign CS3. I frequently save file as PDFs into a designated folder. I was hoping for help in writing a script that would apply the current date to the end of the file name, when saved into this folder. Some days, I save the same file several times, into this folder. I was also hoping there was a way to add a date and version, for example "filename_2.25.11(1).pdf" Is this possible? Can someone help me?
ok, I ended up with this test routine:
on adding folder items to this_folder after receiving added_items
tell application "Finder"
repeat with this in added_items
my checkifopened(this)
display dialog (name of this) as text
end repeat
end tell
end adding folder items to
on checkifopened(this)
set a to POSIX path of (this as alias)
repeat until 1 = 0
## don't like that one because it relies on an error msg ... so
(** try
set b to do shell script "lsof | grep " & quoted form of a
on error
exit repeat
end try**)
##so I use this one
set b to do shell script "lsof"
if b does not contain a then
exit repeat
else
say "still opened"
end if
end repeat
end checkifopened
this is a folder action that tests if the added file is still opened by an application... there is no delay between each test-loop since lsof takes some time to execute...
And after adding a timeout (just in case) to this function the final script looks like this:
on adding folder items to thefolder after receiving added_items
tell application "Finder"
set folderkind to kind of thefolder
set myfiles to every item of thefolder whose name does not contain "#" and kind is not folderkind
repeat with myfile in myfiles
set myfile_datestring to my get_datestring(creation date of myfile)
set myfilename to name of myfile
if (count of every character of myfilename) > 4 and (character -4 of myfilename) as text is "." then
set filestatus to my checkifopened(myfile, 60)
if filestatus = false then
display dialog "timeout on folder action"
else
set tmp to ((characters 1 through -5 of myfilename) & "#" & myfile_datestring & (characters -4 through -1 of myfilename)) as text
set myfilename to my checknamewith_pdfsuffix(tmp, thefolder, false)
set name of myfile to myfilename
end if
end if
end repeat
end tell
end adding folder items to
on get_datestring(mydate)
return year of mydate & "-" & (characters -2 through -1 of (("0" & (month of mydate as integer)) as text)) & "-" & (characters -2 through -1 of (("0" & (day of mydate as integer)) as text)) as text
end get_datestring
on checknamewith_pdfsuffix(n, D, looped)
--check if filename exists in D
-- so if "A File.pdf" exists it names it "A File 1.pdf","A File 2.pdf",...
#n = string of the filename
#D = file reference to the directory to check
#looped = boolean used for recursive loop...
tell application "Finder"
set thefiles to name of every item of (D as alias)
end tell
if thefiles contains n then
if looped = false then
set n to ((characters 1 through -5 of n) & "(1)" & (characters -4 through -1 of n)) as text
my checknamewith_pdfsuffix(n, D, true)
else
set tmp to (last word of ((characters 1 through -5 of n) as text) as integer)
set tmpcount to (count of characters of (tmp as text)) + 5
set tmp to tmp + 1
set n to ((characters 1 through (-1 * tmpcount) of n) & "(" & tmp & ")" & (characters -4 through -1 of n)) as text
my checknamewith_pdfsuffix(n, D, true)
end if
else
return n
end if
end checknamewith_pdfsuffix
on checkifopened(this, mytimeout)
## this file reference
## timeout in seconds
set a to POSIX path of (this as alias)
set startdate to current date
repeat until 1 = 0
## don't like that one because it relies on an error msg ... so
(** try
set b to do shell script "lsof | grep " & quoted form of a
on error
exit repeat
end try**)
##so I use this one
set b to do shell script "lsof"
if b does not contain a then
return true
else if ((current date) - startdate) > mytimeout then
return false
else
##say "still opened"
end if
end repeat
end checkifopened
to use this save this script in /Library/Scripts/Folder Action Scripts
and add this as a folder action to your folder...
The script processes all files inside that folder each time a new files is added... -
Find exact package for saving the workbech request for std SAP object
Hello friends I have edited a std SAP prog for printing the import PO(got access key from market place).After editing while creating transport request I am not able to find the package to which it should be saved.now the problem is that How to move that program to our quality server.
the program is
/1BCDWB/LSF00000063TOPHi achal,
are you sure you modified a standard SAP object. /1BCDWB/ prefix is common with all quick view reports - they are local and user-specific. You can convert a quickview to query to report. Using a modification key you may add it to the standard - choose a package as you prefer. But better copy the generated query report to customer name space - because it never was and never will be SAP standard. If it is in customer name space, release changes are no problem at all.
Regards,
Clemens -
Question for saving the parameters in order to reload them on the next run of the VI.
Hello,
I need your help if it is possible.
I have an application : Figure1.vi
For running this vi: first I choice the parameters which I'd like display,for example Courant Isa, Isb, etc..
and I click on the button Valider for display their respectives curves.
My question is I'd like to save the last parameters of displaying in order to reload them on the next run of the VI.
What is the method to save them?
I think that There are several ways of saving the parameters in order to reload them on the next run of the VI. For my particular case, someone say me that he would recommend usingan .ini file, which can be written using the configuration VI's on the file i/o palette.
I already See "Write Configuration Settings File.vi" and "Read Configuration Settings File.vi" in the Example Finder for an example of how to do this but I don't know what I must make in my application when I have a graph XY and a multi plot.
When I click on Enrgistrer:I'd like to save my parameters but when I clik on «Charger», I'd like to reload the last parameters whwen I save.
Can you help me, please ?
I send you my files,
Thannks a lot ,
Attachments:
Fig.zip 78 KBHello,
In your case it's perhaps better to use an XML file.
Connect everything you want to save into and array or a cluster, and then use the "Flatten to XML" and then, "Write to XML File".
Then in he beginning of you program, use "Read from XML file" and "Unflatten from XML", this should recover the data you previously stored in the file. Connect to the type input of the "Unflatten from XML" the type you created when saving (the array or the cluster of all your data).
Hope this helps,
Paulo -
ME21N - in which table saved the release status for specific release code ?
and for the specific po number.
Hi
You will find all Release codes in T16FS
Release procedures are used in condition tables to control whether the condition types for these condition tables have to be read during pricing condition determination or not.
If the condition table status is released then only the condition types will be read during pricing determination. If the status is not released, then they can be used for information purposes or for simulation of pricing.
The release status is controlled by processing status too, which can be seen in condition record creation screen.
So in crux, the processing status with Release status help in simulation of pricing, blockign the condition records from being read during pricing etc.
For more information an F1 help on the following path will give you some more information.
SPROSD-BF-PRICING-DEFINE PROCESSING STATUS----Here read the documentation meant for this link. You will get some more clarity on this.
<b>Reward points</b>
Regards
Maybe you are looking for
-
Officejet Pro 8600 Plus Duplexing Problem
When I print a document that is one sided the printer stops and lets the ink dry and pulls it back in as if it were a double sided document. Is this normal for this printer. This is my first HP printer and it didn't do this on other printers that I h
-
The send a msm with my cloud code to actívate other device to a telephome o dont have. What can i do
-
Hi I am a SAP certified Solution consultant (Order fulfillment), also I have got the S-user ID. Could you help me in getting the logo ? Whom should I send the S-user ID and Training Center details? Rgds CGRA
-
App Rejected: Freezes on launch image, "content not loading"
I've built and tested a newly finished iOS app on an iPad 1. It works fine. On submitting the app to Apple, I receive a rejection and the reason "No content was loaded". They attach a screenshot showing my launch screen and nothing else. The app seem
-
Can I increase db_files parameter without restarting database
I get following error message : ORA-00059: maximum number of DB_FILES exceeded Can I increase the db_files parameter dynamically without restarting the database. thanks!