![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#21 |
|
Professional Programmer
|
Re: back to online battleship
yes since that is technically theroot of the problem. Thats where you set input and output sockets twice thus overwritting one socket.
Chris
__________________
Steven Skiena - Algorithms ,[->+>+<<]>>[-<<+>>]>++++++++[-<++++++++>]<+[-<->]>+<<[[-]+++++++++++++++.[-]>]>>[+++++++++.[-]],brainf**k -- It's such a pretty language |
|
|
|
|
|
#22 |
|
Professional Programmer
Join Date: Feb 2005
Posts: 343
Rep Power: 4
![]() |
Re: back to online battleship
ok i did it and it works but it does the move to that players board not the other do i just need to go into takeTurn and make it so the turn is executed on the other person's board? So in takeTurn1 it would take the turn on b2 and in takeTurn2 it would take the turn on b1?
|
|
|
|
|
|
#23 |
|
Professional Programmer
|
Re: back to online battleship
yes, thats correct.
Chris
__________________
Steven Skiena - Algorithms ,[->+>+<<]>>[-<<+>>]>++++++++[-<++++++++>]<+[-<->]>+<<[[-]+++++++++++++++.[-]>]>>[+++++++++.[-]],brainf**k -- It's such a pretty language |
|
|
|
|
|
#24 |
|
Professional Programmer
Join Date: Feb 2005
Posts: 343
Rep Power: 4
![]() |
Re: back to online battleship
i dont know i cant get it to do it. I have takeTurn1 receive b2 and then takeTurn on b2 and then send b2 back but it still does moves on itself i think unless im confusing them or something
|
|
|
|
|
|
#25 |
|
Professional Programmer
|
Re: back to online battleship
paste that bit of code in and let me have a look
__________________
Steven Skiena - Algorithms ,[->+>+<<]>>[-<<+>>]>++++++++[-<++++++++>]<+[-<->]>+<<[[-]+++++++++++++++.[-]>]>>[+++++++++.[-]],brainf**k -- It's such a pretty language |
|
|
|
|
|
#26 |
|
Professional Programmer
Join Date: Feb 2005
Posts: 343
Rep Power: 4
![]() |
Re: back to online battleship
i think its in the client that its doing it because when i enter a move on one client it is doing that move on the board that is printed for the client i dont know if in sending and receiving its switching them or something but here is the server takeTurn methods
java Syntax (Toggle Plain Text)
java Syntax (Toggle Plain Text)
|
|
|
|
|
|
#27 |
|
Professional Programmer
|
Re: back to online battleship
hmmm, try sending the other board see what that outputs, is it possible for me to see a sample set of outputs?
Chris
__________________
Steven Skiena - Algorithms ,[->+>+<<]>>[-<<+>>]>++++++++[-<++++++++>]<+[-<->]>+<<[[-]+++++++++++++++.[-]>]>>[+++++++++.[-]],brainf**k -- It's such a pretty language |
|
|
|
|
|
#28 | |
|
Professional Programmer
Join Date: Feb 2005
Posts: 343
Rep Power: 4
![]() |
Re: back to online battleship
Quote:
|
|
|
|
|
|
|
#29 |
|
Professional Programmer
Join Date: Feb 2005
Posts: 343
Rep Power: 4
![]() |
Re: back to online battleship
do i maybe have to flip the receives like in takeTurn1 i call receive() but store it in b2 and then in takeTurn2 i call receive2() and store it in b1 but when setting up the players i call receive() and send() in receivePlayer1() and receive2() and send2() in receivePlayer2() so its like im mixing them or something
|
|
|
|
|
|
#30 |
|
Professional Programmer
|
Re: back to online battleship
thats because when the client sends the board to the server it sends b1 from client1, and you have the server saying it is b2 from player1
Chris
__________________
Steven Skiena - Algorithms ,[->+>+<<]>>[-<<+>>]>++++++++[-<++++++++>]<+[-<->]>+<<[[-]+++++++++++++++.[-]>]>>[+++++++++.[-]],brainf**k -- It's such a pretty language |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to get an email to fill out an online form? | r2d246 | C++ | 2 | Jan 16th, 2006 12:42 PM |
| I am back | kurifu | Coder's Corner Lounge | 9 | Oct 21st, 2005 4:31 AM |
| Eternity Online | Lucid | Project Ideas | 4 | May 12th, 2005 9:54 AM |