It is currently 18 Nov 2019, 03:39
   
Text Size

Forge version 1.5.37

Post MTG Forge Related Programming Questions Here

Moderators: timmermac, friarsol, Blacksmith, KrazyTheFox, Agetian, CCGHQ Admins

Re: Forge version 1.5.37

Postby Hellfish » 14 Mar 2015, 13:23

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. :)
So now you're
Screaming for the blood of the cookie monster
Evil puppet demon of obesity
Time to change the tune of his fearful ballad
C is for "Lettuce," that's good enough for me
User avatar
Hellfish
Programmer
 
Posts: 1297
Joined: 07 Jun 2009, 10:41
Location: South of the Pumphouse
Has thanked: 110 times
Been thanked: 169 times

Re: Forge version 1.5.37

Postby elcnesh » 14 Mar 2015, 13:49

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.
elcnesh
 
Posts: 290
Joined: 16 May 2014, 15:11
Location: Netherlands
Has thanked: 34 times
Been thanked: 92 times

Re: Forge version 1.5.37

Postby elcnesh » 14 Mar 2015, 15:38

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!
elcnesh
 
Posts: 290
Joined: 16 May 2014, 15:11
Location: Netherlands
Has thanked: 34 times
Been thanked: 92 times

Re: Forge version 1.5.37

Postby drdev » 14 Mar 2015, 16:14

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?
drdev
Programmer
 
Posts: 1958
Joined: 27 Jul 2013, 02:07
Has thanked: 189 times
Been thanked: 565 times

Re: Forge version 1.5.37

Postby elcnesh » 14 Mar 2015, 21:41

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).
elcnesh
 
Posts: 290
Joined: 16 May 2014, 15:11
Location: Netherlands
Has thanked: 34 times
Been thanked: 92 times

Re: Forge version 1.5.37

Postby drdev » 14 Mar 2015, 22:56

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?
drdev
Programmer
 
Posts: 1958
Joined: 27 Jul 2013, 02:07
Has thanked: 189 times
Been thanked: 565 times

Re: Forge version 1.5.37

Postby friarsol » 14 Mar 2015, 23:00

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."
friarsol
Global Moderator
 
Posts: 7478
Joined: 15 May 2010, 04:20
Has thanked: 241 times
Been thanked: 936 times

Re: Forge version 1.5.37

Postby drdev » 15 Mar 2015, 02:53

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 2439 times
drdev
Programmer
 
Posts: 1958
Joined: 27 Jul 2013, 02:07
Has thanked: 189 times
Been thanked: 565 times

Re: Forge version 1.5.37

Postby elcnesh » 20 Mar 2015, 15:10

(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.
elcnesh
 
Posts: 290
Joined: 16 May 2014, 15:11
Location: Netherlands
Has thanked: 34 times
Been thanked: 92 times

Re: Forge version 1.5.37

Postby Alvy01 » 28 Mar 2015, 05:34

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?
Alvy01
 
Posts: 9
Joined: 16 Mar 2015, 13:39
Has thanked: 3 times
Been thanked: 0 time

Re: Forge version 1.5.37

Postby squee1968 » 02 Apr 2015, 09:23

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.
squee1968
 
Posts: 189
Joined: 18 Nov 2011, 03:28
Has thanked: 107 times
Been thanked: 24 times

Re: Forge version 1.5.37

Postby elcnesh » 02 Apr 2015, 09:28

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...
elcnesh
 
Posts: 290
Joined: 16 May 2014, 15:11
Location: Netherlands
Has thanked: 34 times
Been thanked: 92 times

Re: Forge version 1.5.37

Postby squee1968 » 02 Apr 2015, 09:44

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.
squee1968
 
Posts: 189
Joined: 18 Nov 2011, 03:28
Has thanked: 107 times
Been thanked: 24 times

Previous

Return to Developer's Corner

Who is online

Users browsing this forum: MSN [Bot] and 4 guests

cron

Who is online

In total there are 5 users online :: 1 registered, 0 hidden and 4 guests (based on users active over the past 10 minutes)
Most users ever online was 546 on 15 Nov 2019, 10:18

Users browsing this forum: MSN [Bot] and 4 guests

Login Form