Page 2 of 2

Re: Forge version 1.5.37

PostPosted: 14 Mar 2015, 13:23
by Hellfish
Well, holy balls. This is amazing and terrifying at the same time :) Couple of quick things:
1.Being able to connect between two local Forge instances would ease testing but I get an exception:
PrivilegedActionException | Open
Code: Select all
Forge Version:    SVN
Operating System: Windows 8.1 6.3 x86
Java Version:     1.8.0_40 Oracle Corporation

java.security.PrivilegedActionException: java.security.PrivilegedActionException: java.net.SocketException: Cannot assign requested address: connect: localhost/127.0.0.1:0
   at java.security.AccessController.doPrivileged(Native Method)
   at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:75)
   at java.awt.EventQueue.dispatchEvent(EventQueue.java:721)
   at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
   at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
   at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
   at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
   at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
   at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
Caused by: java.security.PrivilegedActionException: java.net.SocketException: Cannot assign requested address: connect: localhost/127.0.0.1:0
   at java.security.AccessController.doPrivileged(Native Method)
   at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:75)
   at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:86)
   at java.awt.EventQueue$4.run(EventQueue.java:724)
   at java.awt.EventQueue$4.run(EventQueue.java:722)
   ... 9 more
Caused by: java.net.SocketException: Cannot assign requested address: connect: localhost/127.0.0.1:0
   at sun.nio.ch.Net.connect0(Native Method)
   at sun.nio.ch.Net.connect(Net.java:458)
   at sun.nio.ch.Net.connect(Net.java:450)
   at sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:648)
   at io.netty.channel.socket.nio.NioSocketChannel.doConnect(NioSocketChannel.java:193)
   at io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.connect(AbstractNioChannel.java:199)
   at io.netty.channel.DefaultChannelPipeline$HeadContext.connect(DefaultChannelPipeline.java:1088)
   at io.netty.channel.AbstractChannelHandlerContext.invokeConnect(AbstractChannelHandlerContext.java:471)
   at io.netty.channel.AbstractChannelHandlerContext.connect(AbstractChannelHandlerContext.java:456)
   at io.netty.channel.ChannelOutboundHandlerAdapter.connect(ChannelOutboundHandlerAdapter.java:47)
   at io.netty.channel.AbstractChannelHandlerContext.invokeConnect(AbstractChannelHandlerContext.java:471)
   at io.netty.channel.AbstractChannelHandlerContext.connect(AbstractChannelHandlerContext.java:456)
   at io.netty.channel.AbstractChannelHandlerContext.connect(AbstractChannelHandlerContext.java:438)
   at io.netty.channel.DefaultChannelPipeline.connect(DefaultChannelPipeline.java:908)
   at io.netty.channel.AbstractChannel.connect(AbstractChannel.java:202)
   at io.netty.bootstrap.Bootstrap$2.run(Bootstrap.java:165)
   at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:380)
   at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:357)
   at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:116)
   at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:137)
   at java.lang.Thread.run(Thread.java:745)
2.The port fields are set to not editable for some reason.
3.The chat remains even after I close out of the lobby. Can't test if it's still connected because of point 1 but still.

Fake edit: If I make the port fields editable and use a nonzero port I can connect between two local instances.
Stream of consciousness notes | Open
*As for point three, the chat does stay connected, the instance that closes out still gets chat messages.
*The host didn't get the join message once so far, the joiner did get it.
*If I add an AI player, the joiner can change it's team, but it doesn't show for the host. If the host changes it, it's updated for the joiner.
*If I add an AI player, then change it's slot back to Open, the joiner disappears and the AI player takes it's slot, while the last slot turns Open.Seems like the joiners avatar and name just gets overwritten by the AI's.
*Joiner seems unable to change avatar.
*Started the game after getting the joiner overwritten, the game only starts for the host. Joiner is still in lobby, only recieves chat messages. Turns out the player that actually got in the game was an AI.
*Started a match without adding an AI, joiner is getting double chat messages.
*Joiner doesn't get "Waiting for opponent" while host chooses wether to play or draw.
*Had to rearrange the layout for the joiner, as it started with it's fields on the top of the window and the hand as a tab instead of an open field. (if that makes sense)
*Closed match for host, joiner gets no message about that, now gets correct non-doubled chat messages.
*Tried to host again on same instance, got exception
Code: Select all
Forge Version:    SVN
Operating System: Windows 8.1 6.3 x86
Java Version:     1.8.0_40 Oracle Corporation

java.security.PrivilegedActionException: java.security.PrivilegedActionException: java.net.BindException: Address already in use: bind
   at java.security.AccessController.doPrivileged(Native Method)
   at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:75)
   at java.awt.EventQueue.dispatchEvent(EventQueue.java:721)
   at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
   at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
   at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
   at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
   at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
   at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
Caused by: java.security.PrivilegedActionException: java.net.BindException: Address already in use: bind
   at java.security.AccessController.doPrivileged(Native Method)
   at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:75)
   at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:86)
   at java.awt.EventQueue$4.run(EventQueue.java:724)
   at java.awt.EventQueue$4.run(EventQueue.java:722)
   ... 9 more
Caused by: java.net.BindException: Address already in use: bind
   at sun.nio.ch.Net.bind0(Native Method)
   at sun.nio.ch.Net.bind(Net.java:437)
   at sun.nio.ch.Net.bind(Net.java:429)
   at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:223)
   at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74)
   at io.netty.channel.socket.nio.NioServerSocketChannel.doBind(NioServerSocketChannel.java:125)
   at io.netty.channel.AbstractChannel$AbstractUnsafe.bind(AbstractChannel.java:484)
   at io.netty.channel.DefaultChannelPipeline$HeadContext.bind(DefaultChannelPipeline.java:1080)
   at io.netty.channel.AbstractChannelHandlerContext.invokeBind(AbstractChannelHandlerContext.java:430)
   at io.netty.channel.AbstractChannelHandlerContext.bind(AbstractChannelHandlerContext.java:415)
   at io.netty.channel.ChannelDuplexHandler.bind(ChannelDuplexHandler.java:38)
   at io.netty.handler.logging.LoggingHandler.bind(LoggingHandler.java:240)
   at io.netty.channel.AbstractChannelHandlerContext.invokeBind(AbstractChannelHandlerContext.java:430)
   at io.netty.channel.AbstractChannelHandlerContext.bind(AbstractChannelHandlerContext.java:415)
   at io.netty.channel.DefaultChannelPipeline.bind(DefaultChannelPipeline.java:903)
   at io.netty.channel.AbstractChannel.bind(AbstractChannel.java:197)
   at io.netty.bootstrap.AbstractBootstrap$2.run(AbstractBootstrap.java:350)
   at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:380)
   at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:357)
   at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:116)
   at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:137)
   at java.lang.Thread.run(Thread.java:745)
*Hosting again works if I change the port number to a different one from last game.
*If the host hosts another lobby, and the joiner chats in the old chat, the host gets the message anyway.
*Started the game with a third,AI, player.Got into the match layout but neither host nor joiner gets a prompt and can't do anythingNvm, got a mulligan prompt for the host at last, AI was going first.Joiner gets double chat messages again.Layout is weird again.
*Just noticed, shortcut keys like E for end turn is triggered while typing in chat.Joiner is seeing double of his own chat messages too.
*If another player closes out while you have priority, game (naturally) gets stuck waiting for opponent once you pass priority.
*Not sure what happened here of if it's even related to online play, but I got an exception with Forge in the background while typing up the previous point:
Code: Select all
Forge Version:    SVN
Operating System: Windows 8.1 6.3 x86
Java Version:     1.8.0_40 Oracle Corporation

java.lang.NullPointerException
   at forge.net.NetGuiGame.isUiSetToSkipPhase(NetGuiGame.java:305)
   at forge.player.PlayerControllerHuman.chooseSpellAbilityToPlay(PlayerControllerHuman.java:866)
   at forge.game.phase.PhaseHandler.startFirstTurn(PhaseHandler.java:917)
   at forge.game.GameAction.startGame(GameAction.java:1390)
   at forge.game.Match.startGame(Match.java:96)
   at forge.match.HostedMatch$2.run(HostedMatch.java:227)
   at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
   at java.lang.Thread.run(Thread.java:745)
It's a bit annoying to test like this but that's not your fault :) Hopefully some of that is helpful and I'd love to help test more. :)

Re: Forge version 1.5.37

PostPosted: 14 Mar 2015, 13:49
by elcnesh
Ah yes, I actually set the port numbers to be equal to the value in the Forge properties file. Copy the forge.properties.example to forge.properties (in forge-gui) and edit the port number. Wanted to se that automatically but forgot... Maybe we can just hardcode the port number so that everyone always uses the same (ForgeProfileProperties.java:75).

Hosting twice (or even connecting twice) with the same app instance of Forge is definitely bugged, that the sort of cleanup it still needs.

Re: Forge version 1.5.37

PostPosted: 14 Mar 2015, 15:38
by elcnesh
So I just found at (thanks Agetian) that the class CompletableFuture I used is a Java 8 class. I'll check if there's a Java 7 replacement; sorry to those who're unable to compile in the meantime!

Re: Forge version 1.5.37

PostPosted: 14 Mar 2015, 16:14
by drdev
So how hard would it be to get network support working on the mobile app? I can do the GUI development, but is there anything I should know before I start?

Also, that Java 8 reference is blocking me from doing anything right now, so how soon do you think that will be fixed?

Re: Forge version 1.5.37

PostPosted: 14 Mar 2015, 21:41
by elcnesh
Fixed it! :)

On mobile, it's mostly the lobby GUI that's missing. You can take a look at CSubmenuOnlineLobby to see how the lobby views (VLobby) are connected to the data containers, either in the form of a server or a client lobby. Once this connection is established, the lobby takes care of letting the game point its controllers and gui-pointers to the right objects (either AI, or to a local or remote client).

Re: Forge version 1.5.37

PostPosted: 14 Mar 2015, 22:56
by drdev
Perhaps I'm missing something, but the Online Multiplayer tab does nothing when clicked. How do i access the online GUI stuff for the desktop version?

Re: Forge version 1.5.37

PostPosted: 14 Mar 2015, 23:00
by friarsol
drdev wrote:Perhaps I'm missing something, but the Online Multiplayer tab does nothing when clicked. How do i access the online GUI stuff for the desktop version?
Did you follow this? "I've added this feature but not yet enabled it visibly; uncomment line 140 of VHomeUI to use it."

Re: Forge version 1.5.37

PostPosted: 15 Mar 2015, 02:53
by drdev
So to kind of help with things on the desktop end of things, I just committed a change the makes the chat window have a titlebar and be movable, resizable, and hidable. I have not come up with a means for reshowing it once hidden however.

ChatWindow.PNG
ChatWindow.PNG (11.57 KiB) Viewed 4654 times

Re: Forge version 1.5.37

PostPosted: 20 Mar 2015, 15:10
by elcnesh
(There's no 1.5.38 post yet, so I'll just post this here for now. Feel free to copy it over to the new thread once it's there!)

In the Feature Requests post I saw the request to add a tooltip to the avatars. I've done that, but now it seems to me that the "Players" tab is kind of useless... I'm not sure if it was used a lot at all, except maybe to track commander damage, but all the functionality is now in the tooltips. Is there any reason to keep it? (I'll assume not unless someone gives a reason)

Removing it does cause some issues with the match layout though... I've fixed this now by leaving the entry in EDocID and pointing it to an empty doc, which means it'll be removed from the layout file as soon as the layout changes even once.

Edit: PS: awaiting replies, I haven't actually committed anything yet.

Re: Forge version 1.5.37

PostPosted: 28 Mar 2015, 05:34
by Alvy01
friarsol wrote:
drdev wrote:Perhaps I'm missing something, but the Online Multiplayer tab does nothing when clicked. How do i access the online GUI stuff for the desktop version?
Did you follow this? "I've added this feature but not yet enabled it visibly; uncomment line 140 of VHomeUI to use it."
Hello, I would really like to try this but I'm unsure how to uncomment the line of code. Could you give a quick rundown of how to do so if it's not too much trouble?

Re: Forge version 1.5.37

PostPosted: 02 Apr 2015, 09:23
by squee1968
Alvy01 wrote:
friarsol wrote:
drdev wrote:Perhaps I'm missing something, but the Online Multiplayer tab does nothing when clicked. How do i access the online GUI stuff for the desktop version?
Did you follow this? "I've added this feature but not yet enabled it visibly; uncomment line 140 of VHomeUI to use it."
Hello, I would really like to try this but I'm unsure how to uncomment the line of code. Could you give a quick rundown of how to do so if it's not too much trouble?
I would also love to know the answer to this. I have followed the steps in the wiki to no avail.

Re: Forge version 1.5.37

PostPosted: 02 Apr 2015, 09:28
by elcnesh
The feature is far from finished, so unless you're actually interested in developing, I wouldn't recommend trying it. It'd most likely crash on turn 1 (or even before that). The message is really for the dev's, it requires a checked-out version of the software.

That being said, squee, what part of the Wiki are you talking about? AFAIK I haven't added anything about multiplayer to the wiki yet...

Re: Forge version 1.5.37

PostPosted: 02 Apr 2015, 09:44
by squee1968
elcnesh wrote:The feature is far from finished, so unless you're actually interested in developing, I wouldn't recommend trying it. It'd most likely crash on turn 1 (or even before that). The message is really for the dev's, it requires a checked-out version of the software.

That being said, squee, what part of the Wiki are you talking about? AFAIK I haven't added anything about multiplayer to the wiki yet...
I wouldn't have a clue as far as developing, but I am interested in the feature, so I followed all the steps in the "How to get started developing forge" wiki, because I figured if I checked out the project with eclipse, I could uncomment the line on my own PC, run it, and see what it looks like, how functional it is, etc.