Need Help For Developing Java Network RPG
Greetings,
Did anyone develop any similar game?I'm developing one for my final year project and i need some guidelines on that.
Thanks for your help in advanced.
Cheers,
yc
Since you are making a 2D game I suppose that speed is not really important. Don't make it too hard on yourself and use objectstreams.
first thing you need is a class which holds all the variables you want to send (like position, health, whatever) and let it implement the "Serializable" interface.
next stop: the client side connection
socket = new Socket(ipaddress, port);
obi = new ObjectInputStream(socket.getInputStream());
obu = new ObjectOutputStream(socket.getOutputStream());and the server side connection:
ServerSocket s = new ServerSocket(port);
while(true) { // keep accepting new connections
socket = s.accept();
obu = new ObjectOutputStream(socket.getOutputStream());
obi = new ObjectInputStream(socket.getInputStream());
}make sure you turn around output and input. The server won't continue unless his output has input on the clientside.
with the objectoutputsstream you can send the objects:
obu.writeObject(netData);
obu.flush();
// make sure you flushreceiving the object:
netData = (YourNetData) oi.readObject();so what you need is a client side function that sends objects, a client side thread that handles received objects.
The easiest way to make a server is making an array of client threads and put the socket and the objectstreams in the thread. The thread can read an incoming object and send it to all clients in the array. This way you never have to change your server, you only have to change the object you send.
Similar Messages
-
Need help for downloading java at mac book retina
i want to download java at my mac book pro retina but everytime we downloaded its not working..i need this because im going to use it to open my bank account...everytime i gonna check my bank account i need to use another computer not this my mac.why?? can you help me please.
Banks do NOT use Java-in-a-Browser for anything, at all. If you have received a suggestion to conduct banking with JAVA enabled in your Browser, someone is attempting to commit a crime, with you as the intended victim. You are being scammed and should report it to the Police.
-
Need help for a java assignment
i am having trouble with my java assignment, so i thought i will give it a try here and hope that i will get some help. ^^
the method is to load a file and try to create an object out of it. but even though the sequence of loading is correct, the method still doesn't work. there is no error in compilation and the coding seems correct to me. help?
the codes are below and if any other code is needed. ask me for it. =)
public void saveToFile(String fileName)
try
File f = new File(fileName);
PrintWriter p = new PrintWriter(f);
p.println(fileName);
p.println("***");
for(int i =0; i<categories.length; i++)
if(categories[i] != null)
p.print(categories.getCatNum());
Car[] x = categories[i].getListOfCars();
for(int q=0; q<x.length;q++)
if(x[q] != null)
if(x[q] instanceof EconomyCar)
p.print("Economy Car");
x[q].getCarNum();
x[q].getBrand();
x[q].getPrice();
else if(x[q] instanceof LuxuryCar)
p.print("Luxury Car");
x[q].getCarNum();
x[q].getBrand();
x[q].getPrice();
else if(x[q] instanceof SportCar)
p.print("Sport Car");
x[q].getCarNum();
x[q].getBrand();
x[q].getPrice();
p.println(x[q].getCarNum());
p.println(x[q].getBrand());
p.println(x[q].getPrice());
p.close();
catch(IOException e)
System.out.println("IO Error");
public void loadFromFile(String fileName)
try
File file = new File(fileName);
Scanner sc = new Scanner(file);
String shopName = sc.nextLine();
CarMart Cm = new CarMart(shopName);
while(sc.hasNextLine());
String line = sc.nextLine();
while(line.equals("***"));
int CateNum = sc.nextInt(); sc.nextLine();
Category Cate = new Category(CateNum);
String typeOfCar = sc.nextLine();
if(typeOfCar.equals("Economy Car"))
String CarNum = sc.nextLine();
String brand = sc.nextLine();
double price = sc.nextDouble(); sc.nextLine();
EconomyCar e = new EconomyCar(CarNum, brand, price);
else if(typeOfCar.equals("Luxury Car"))
String CarNum = sc.nextLine();
String brand = sc.nextLine();
double price = sc.nextDouble(); sc.nextLine();
LuxuryCar l = new LuxuryCar(CarNum, brand, price);
else if(typeOfCar.equals("Sport Car"))
String CarNum = sc.nextLine();
String brand = sc.nextLine();
double price = sc.nextDouble(); sc.nextLine();
SportCar s = new SportCar(CarNum, brand, price);
sc.close();
catch(FileNotFoundException a)
System.out.println("Filename not found");morgalr wrote:
erm. its supposed to save a file containing all the data of a car. then the loadFromFile method is supposed to load that file and create a car out of it.I want one, could you please make mine a Dodge Viper.A fascinating insight into your secret worries about your masculinity :) -
Need help for develop websevice on weblogic
Hi to all,
I created a webservice.ear, using servicegen and I've deployed it on Weblogic with success. But when I try to use the test-link I receive some server errors.
I use this task in my build.xml file :
<target
name="ear-webservice"
depends="ejb-jar" >
<servicegen
destEar="${build_ear}/${ear-file}"
warName="${war-file}"
contextURI="${ws-context-uri}">
<service
ejbJar="${dist}/${ejb_jar_file}"
targetNamespace="my-webservice"
serviceName="MYWebService"
serviceURI="/MYWebservice"
generateTypes="True"
expandMethods="true">
</service>
<classpath refid="webservice.classpath"/>
</servicegen>
<wsdlgen ear="${build_ear}/${ear-file}"
warName="${war-file}"
serviceName="MYWebService"
wsdlFile="${build_wsdl}/${wsdl-file}"/>
</target>
and the first exception in weblogic's logs is
javax.naming.NamingException: Could not lookup EJB home, tried .....
Can you help me ?
I have only avaible the ejb.jar
Thanks very much in advace.
best regards
francyHi,
You should use afterrange with the combination of EVSUM function. EVSUM function will show the totals, before sending the data to the database. Please refer to the below links from help.sap:
http://help.sap.com/saphelp_bpc75_nw/helpdata/en/66/a04d49392d401382d0dc1b099acad0/content.htm
http://help.sap.com/saphelp_bpc75_nw/helpdata/en/b2/f117dd464b4252a279ab7f67b4436d/content.htm
Hope this helps. -
Need help in developing BADI for IT0001
Hi All,
I need help in developing BADI for IT0001.
On IT0001 create or change, there is need to update IT0017 with following data from IT0001
-Company Code
-Cost center
-Business Area
-Begin and End Date.
Other fields from IT0017 need to be derived from Position and update in IT0017.
Please guide me how I can address this. I do not want to go for dynamic action, as it is not getting evoked during background jobs.
I am new to BADI development and will appreciate step by step instructions.
ThanksHi,
follow the below steps to achive
Steps:
1. Execute Business Add-In(BADI) transaction SE18
2. Enter BADI name i.e. HRPAD00INFTY and press the display
button
3. Select menu option Implementation->Create
4. Give implementation a name such as Z_HRPAD00INFTY
5. You can now make any changes you require to the BADI within this
implementation, for example choose the Interface tab there are 3 methods avialble
6. Double click on the method you want to change, you can now enter
any code you require.
7. Please note to find out what import and export parameters a
method has got return the original BADI definition
(i.e. HRPAD00INFTY) and double click on the method name
for example within HRPAD00INFTY contract is a method
8. When changes have been made activate the implementation
<b>Reward points</b>
Regards -
Need help to develop Pythagoras theorem-
Hi i need help to develop proofs 2,3,4
of pythagoras theorems in java as demonstrations
These are applets can anyone help me with it or give me an idea of how to go about developing it -
the site is the following
http://www.uni-koeln.de/ew-fak/Mathe/Projekte/VisuPro/pythagoras/pythagoras.html
then double click on the screen to make it startPardon my ASCII art, but I've always liked the following, simple, geometric proof:
a b
---------------------------------------+
| | |
a| I | II |
| | |
---------------------------------------+
| | |
| | |
| | |
| | |
| | |
b| IV | III |
| | |
| | |
| | |
| | |
| | |
| | |
---------------------------------------+It almost goes without saying that I+II+III+IV == (a+b)^2, and II == IV == a*b,
I == a*a and III == b*b, showing that (a+b)^2 == a^2+a*b+a*b+b^2.
I hope the following sketch makes sense, stand back, ASCII art alert again: a b
---------------------------------------+
| . VI |
| . . |a
| V . |
| +
| |
| . |
b| . |
| |
| IX |
| . |
| . |b
| |
+ |
| . |
a| . . VII |
| VIII . |
---------------------------------------+
a bThe total area equals (a+b)^2 again and equals the sum of the smaller areas:
(a+b)^2 == V+VI+VII+VIII+IX. Let area IX be c^2 for whatever c may be.
V+VII == VI+VIII == a*b, so a^2+b^2+2*ab= c^2+2*a*b; IOW a^2+b^2 == c^2
Given this fundamental result, the others can easily be derived from this one,
or did I answer a question you didn't ask?
kind regards,
Jos -
Need help for writing extract program
hi
i need help for writing extract program to retriew data from legacy system.
i already developed bdc programs for me31k and me21.
my requirement is to write extract program s for those t.codes.
to retriew data from legacy system and stored in flat file.i need help with a java program. it is a program that allows the user to enter a student's GPA, number of extracurricular activities, and number of service activities. The user can not enter a gpa above 4.0 or below 0. The user can not enter a negative number for the number of both activities. If the student meets the following criteria: 1) GPA of 3.8 or above and at least one extracurricular activity and one service activity, 2) GPA below 3.8 but at least 3.4 and a total of at least three extracurricular and service activities, 3) GPA below 3.4 but at least 3.0 and at least two extracurricular activities and three service activities, the message "Scholarship candidate" should display. If the student does not meet the criteria above, then the message"not a candidate" should display. Can you help me, please?
You haven't posted ANY 'java program' for us to help with.
The forum is NOT a coding service. It is to help you with YOUR code.
Post the code you have written and SHOW us (don't just tell us) how you compile it and execute it and the results you get. Then we can help you with any problems you are are having.
If you need help understanding just what the program should be doing you need to ask your instructor to clarify the assignment. -
Need help for importing oracle 10G dump into 9i database
hi, Someone help me to import oracle 10G dump into 9i database. I'm studying oracle . Im using oracle 10G developer suite(downloaded from oracle) and oracle 9i database. I saw some threads tat we can't import the higher version dumps into lower version database. But i'm badly need help for importing the dump...
or
someone please tell me the site to download oracle 9i Developer suite as i can't find it in oracle site...I didnt testet it to import a dump out of a 10g instance into a 9i instance if this export has been done using a 10g environment.
But it is possible to perform an export with a 9i environment against a 10g instance.
I am just testing this with a 9.2.0.8 environment against a 10.2.0.4.0 instance and is working so far.
The system raises an EXP-00008 / ORA-37002 error after exporting the data segments (exporting post-schema procedural objects and actions).
I am not sure if it is possible to perform an import to a 9i instance with this dump but maybe worth to give it a try.
It should potentially be possible to export at least 9i compatible objects/segments with this approach.
However, I have my doubts if this stunt is supported by oracle ...
Message was edited by:
user434854 -
Need help for access list problem
Cisco 2901 ISR
I need help for my configuration.... although it is working fine but it is not secured cause everybody can access the internet
I want to deny this IP range and permit only TMG server to have internet connection. My DHCP server is the 4500 switch.
Anybody can help?
DENY 10.25.0.1 – 10.25.0.255
10.25.1.1 – 10.25.1.255
Permit only 1 host for Internet
10.25.7.136 255.255.255.192 ------ TMG Server
Using access-list.
( Current configuration )
object-group network IP
description Block_IP
range 10.25.0.2 10.25.0.255
range 10.25.1.2 10.25.1.255
interface GigabitEthernet0/0
ip address 192.168.2.3 255.255.255.0
ip nat inside
ip virtual-reassembly in max-fragments 64 max-reassemblies 256
duplex auto
speed auto
interface GigabitEthernet0/1
description ### ADSL WAN Interface ###
no ip address
pppoe enable group global
pppoe-client dial-pool-number 1
interface ATM0/0/0
no ip address
no atm ilmi-keepalive
interface Dialer1
description ### ADSL WAN Dialer ###
ip address negotiated
ip mtu 1492
ip nat outside
no ip virtual-reassembly in
encapsulation ppp
dialer pool 1
dialer-group 1
ppp authentication pap callin
ppp pap sent-username xxxxxxx password 7 xxxxxxxxx
ip nat inside source list 101 interface Dialer1 overload
ip route 0.0.0.0 0.0.0.0 Dialer1
ip route 10.25.0.0 255.255.0.0 192.168.2.1
access-list 101 permit ip 10.25.0.0 0.0.255.255 any
access-list 105 deny ip object-group IP any
From the 4500 Catalyst switch
( Current Configuration )
interface GigabitEthernet0/48
no switchport
ip address 192.168.2.1 255.255.255.0 interface GigabitEthernet2/42
ip route 0.0.0.0 0.0.0.0 192.168.2.3Hello,
Host will can't get internet connection
I remove this configuration...... access-list 101 permit ip 10.25.0.0 0.0.255.255 any
and change the configuration .... ip access-list extended 101
5 permit ip host 10.25.7.136 any
In this case I will allow only host 10.25.7.136 but it isn't work.
No internet connection from the TMG Server. -
I need help for Blackberry8700g, It is the error message Java.lang.outofmemory Error. I can not make even phone calls. After reset it is same message pop up and does not off the power jum error523
You are in line to wipe and reload the OS on the BlackBerry.
Follow the directions here and you will be fine.
http://www.blackberryfaq.com/index.php/How_do_I_wipe_the_BlackBerry_using_Jl_Cmder%3F
1. If any post helps you please click the below the post(s) that helped you.
2. Please resolve your thread by marking the post "Solution?" which solved it for you!
3. Install free BlackBerry Protect today for backups of contacts and data.
4. Guide to Unlocking your BlackBerry & Unlock Codes
Join our BBM Channels (Beta)
BlackBerry Support Forums Channel
PIN: C0001B7B4 Display/Scan Bar Code
Knowledge Base Updates
PIN: C0005A9AA Display/Scan Bar Code -
Need help connecting a windows network printer to my Mac (Xerox Phaser 3600) over a windows home network.
My Mac runs lion and the windows desktop runs Windows XP
I have tried for a few hours or so to connect my mac to this printer over a home network.
For your information it does work when connected directly to my mac using a USB Cable.
If there is no soultion could I have help getting the drivers for a Dell All-in-One Photo 926In most cases you can connect to the Windows shared printer from the Mac. But there is a dependence on the Mac driver being compatible. For many consumer inkjets, the vendor created driver cannot be used for this type of connection so you need to look at alternative drivers, such as Gutenprint or PrintFab. If you can tell us which brand and model of printer you have shared from Windows then we can answer your question with the preferred procedure on the Mac.
-
Looking help for developing labview code [Urgent]
Hi,
I need help in developing labview code. I am new to labview and will appreciate if someone can help me in this matter. I need to control the intensity of AC load (halogen lamp with 2kW,230V,50Hz) using Labview and Arduino. But my project using interrupt in Arduino, so it is not possible to use Labview Interface For Arduino(LIFA). I searched and it might be possible to use VISA serial in this matter. Attached is the circuit and the code of Arduino. Someone who is expert in this matter can help me?
The concept of my project is almost same with https://www.youtube.com/watch?v=oeVJ5bs6E8M&feature=youtu.be
Solved!
Go to Solution.
Attachments:
Zero Cross Circuit.docx 203 KB
Triggering Circuit.docx 48 KB
Coding for Arduino.txt 7 KBHi,
You will find all information you need and LabVIEW VI examples on the LabVIEW Interface for Arduino
LabVIEW Interface for Arduino
Regards,
Valentin
Certified TestStand Architect
Certified LabVIEW Developer
National Instruments France
#adMrkt{text-align: center;font-size:11px; font-weight: bold;} #adMrkt a {text-decoration: none;} #adMrkt a:hover{font-size: 9px;} #adMrkt a span{display: none;} #adMrkt a:hover span{display: block;}
Travaux Pratiques d'initiation à LabVIEW et à la mesure
Du 2 au 23 octobre, partout en France -
I need help for Blackberry8700g
New User! I need help for Blackberry8700g; It is the error message Java.lang.outofmemory Error. I can not make even phone calls. After reset it is same message pop up and does not off the power jum error523 100408 .I tried How_do_I_wipe_the_BlackBerry_using_Jl_Cmder%3F but it does not allow me to log in.Thanks,Rehan
check this instruction:
http://crackberry.com/blackberry-101-lecture-12-how-reload-operating-system-nuked-blackberry -
Resources for developing java UDFs used in XI
I am with some Java background working in XI
for developing Java UDFs used in XI are there any online resources or books other than from the SAP help and SAP certification material.Hi Kalyan
You can get a lot of UDF already discussed in Forum and Blogs, Wiki
As you said you are familiar with Java then you wont find any difficulty
https://www.sdn.sap.com/irj/sdn/advancedsearch?cat=sdn_weblog&query=xi+udf&adv=false&sortby=cm_rnd_rankvalue
Thanks
Gaurav -
by i need help for my photoshop connective..if you ceck problem please.
Does your Cloud subscription properly show on your account page?
If you have more than one email, are you sure you are using the correct Adobe ID?
https://www.adobe.com/account.html for subscriptions on your Adobe page
If yes
Some general information for a Cloud subscription
Cloud programs do not use serial numbers... you log in to your paid Cloud account to download & install & activate... you MAY need to log out of the Cloud and restart your computer and log back in to the Cloud for things to work
Log out of your Cloud account... Restart your computer... Log in to your paid Cloud account
-Sign in help http://helpx.adobe.com/x-productkb/policy-pricing/account-password-sign-faq.html
-http://helpx.adobe.com/creative-cloud/kb/sign-in-out-creative-cloud-desktop-app.html
-http://helpx.adobe.com/x-productkb/policy-pricing/activation-network-issues.html
-http://helpx.adobe.com/creative-suite/kb/trial--1-launch.html
-ID help https://helpx.adobe.com/contact.html?step=ZNA_id-signing_stillNeedHelp
If no
This is an open forum, not Adobe support... you need Adobe staff to help
Adobe contact information - http://helpx.adobe.com/contact.html
-Select your product and what you need help with
-Click on the blue box "Still need help? Contact us"
Maybe you are looking for
-
Is anyone else having problems with saving PDFs to disk?
Recently, I have not been able to download and save PDF files on my iMac. Every time I download a file it is blank. The problem started several weeks ago and I thought at the time that the file was somehow protected. However, I successfully did a dow
-
I am planning to purchase a new camcorder soon. Unlike my previous recorders, I want this one to be compatible with my iMac for editing purposes (deleting video scenes and adding music) followed by the burning of DVDs. I have a lengthy list of camcor
-
Inventory Management output message
Hi Experts Currently the output types WE03 & WLB1 is used for plant A with respective logo (smartform). When rolling out to plant B, (required different logo), inorder to differentiate the output type by plant, should i custom the Table 072 ? As curr
-
Am installing Premier Elements 11. Have Photoshop Elements 11 installed.
I have Photoshop Elements 11 installed now installing Premier Elements 11. Install is asking to choose 32bit or 64bit install. The computer is 64 bit. If I choose that during the install of Premier will that cause any problems with Photoshop and espe
-
I am currently mixing 10 songs. Because logic lacks an easy way to apply global changes in a mix to a group of related songs, I have all of the tracks for all 10 songs loaded into a single logic "song" file. The songs appear in the arrange window con