Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (754)
Games in Android Showcase (229)
games submitted by our members
Games in WIP (842)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
   Home   Help   Search   Login   Register   
  Show Posts
Pages: [1]
1  Game Development / Networking & Multiplayer / Re: Sending Object through TCP/IP... on: 2003-04-26 23:18:53, I've managed to get the Deck successfully deserialized...that's the good news...

the bad that I had to be using the same version of the JVM on both sides (precisely as all of you had implied)...and that's not taking advantage of the platform independency that java is used for...SO...I will be taking the advice of mr. blahblahblahh and using the M/V/C technique...

I guess i had to learn the lesson of swing serialization the hard way...

thanx for helping me out, fellas...I appreciate it...

2  Game Development / Networking & Multiplayer / Re: Sending Object through TCP/IP... on: 2003-04-25 02:36:30
I am using the same classes...

I think i might be able to narrow it down, however...

it says the exception is coming from javax.swing.Jcomponent...a Deck object is basically a subclass of a Vector (perfectly serializable, btw)...the Deck contains any number of Card objects...Cards are basically just subclasses of a, a JButton is a JComponent, so I'm pretty sure that the problem lies within that class...however, I'm not sure how serialization works with hierarchy...

in order to make the classes compatible, i have set the serialVersionUID in both the Deck class and the Card class...

static final long serialVersionUID = -8436333800348538015L;

static final long serialVersionUID = -8293881053128968132L;

as you can see, those SVUIDs aren't either of the ones described in the exception...

does anyone have a clue as to what I should do to fix this problem???...has anyone run into this before?...

Thanx for any input...


3  Game Development / Networking & Multiplayer / Sending Object through TCP/IP... on: 2003-04-23 20:40:08
I am trying to send a Deck object that I have created by subclassing the Vector class through a TCP/IP Connection...I'm not sure if i'm doing this correctly, however...the problem isn't getting the deck SENT, i don't think, but receiving it correctly is the problem...

The Client side code is as follows...

InetAddress server = InetAddress.getByName("hippo");
                 int port = 22222;
                 Socket socket = new Socket(server, port);
                 System.out.println("Connected to server...attempting to send deck");
                 ObjectOutputStream oos = new ObjectOutputStream(socket.getOutputStream());

(I'm catching everything necessary...)

Please don't poke too much fun at the code, i'm just beginning this TCP/IP stuff ;-)

anyways, i'm sure that the message is getting to the server...because the connection is made fine...

server code is as follows...

int servPort = 22222;
             ServerSocket serverSocket = new ServerSocket(servPort);
                   Socket inSocket = serverSocket.accept();
                   ObjectInputStream ois = new ObjectInputStream(inSocket.getInputStream());
                   Object possibleDeck = ois.readObject();
                       System.out.println("Checking for Instance");
                       if(possibleDeck instanceof Deck){
                             System.out.println("It's a Deck");
                             deck = (Deck)possibleDeck;                        
                             System.out.println("Deck Loaded..."      );
                             System.out.println("It's not a deck");

it gives the error message (which i will display in a sec) when it reaches the line:  "Object possibleDeck = ois.readObject();"

The error message is as follows... javax.swing.JComponent; local class incompatible:
stream classdesc serialVersionUID = 4775608949283930591, local class serialVers
ionUID = -7908749299918704233

I can't seem to fix might help to know if where the problem is it the WAY that i'm sending the object (basically, CAN I DO IT THAT WAY????)...or does it have to do with something else?...

any help is appreciated...even suggestions on how to fix it (sample code is *always* welcome...) ...

if i'm not sending the object in the correct manner, what is the best (easiest, even) to send one object from one machine to another?...

Thanx for any help....

4  Game Development / Networking & Multiplayer / 2 Player M:TG Online Card Game... on: 2003-04-15 01:52:45
I'm developing an online card game for Magic:  The Gathering that will, at first, be only a 2 Player game.  I am proficient in Java, but the Socket Programming is where I'm the most ignorant...

Firstly, I want this to be as live action as possible (basically, if I move a card on the table, then the other player sees me moving the card)...I don't think this type of animation is too demanding, so I'm planning on using TCP/IP.  

My questions is, once the connection between the two players is made (when connecting, one serving as the server, and the other the client), am I going to be able to have each of the players be able to send and receive messages simultaneously?  And if so, how do I do that?

I guess my ignorance of SocketProgramming is showing through now, but I have this notion that in order to receive something, you have to be listening for that particular someting.  Is it possible to have the GUI running on ONE thread, and when a message is needed to be sent, I can send that on ANOTHER thread?  While simultaneously listening on yet ANOTHER thread for information coming from the other client (in case he plays/moves a card)?

Once again, I'm new to this socket programming thing...and any input will be helpful.  Also, if I'm completely missing something, or if you think i'm looking too much into this, please, your other suggestions are welcome.  


Pages: [1]
DesertCoockie (20 views)
2018-05-13 18:23:11

nelsongames (68 views)
2018-04-24 18:15:36

nelsongames (65 views)
2018-04-24 18:14:32

ivj94 (748 views)
2018-03-24 14:47:39

ivj94 (79 views)
2018-03-24 14:46:31

ivj94 (579 views)
2018-03-24 14:43:53

Solater (95 views)
2018-03-17 05:04:08

nelsongames (168 views)
2018-03-05 17:56:34

Gornova (362 views)
2018-03-02 22:15:33

buddyBro (1022 views)
2018-02-28 16:59:18
Java Gaming Resources
by philfrei
2017-12-05 19:38:37

Java Gaming Resources
by philfrei
2017-12-05 19:37:39

Java Gaming Resources
by philfrei
2017-12-05 19:36:10

Java Gaming Resources
by philfrei
2017-12-05 19:33:10

List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05 is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!