Damage resolution error

Issues with the game engine (not campaign)

Moderators: BeeRockxs, Moderators

Post Reply
TigerShark
Mekwars Server Operator
Posts: 710
Joined: Wed Feb 24, 2010 8:28 am

Damage resolution error

Post by TigerShark » Mon Sep 26, 2016 12:38 am

Code: Select all

[16:33] Error while parsing the following String: 558217*1st Dieron Regulars*0*0*0* *false*18*3*13*13*9*9*0*0*Dervish DV-6M.MTF
[16:33] [java.util.NoSuchElementException]
[16:33] java.util.StringTokenizer.nextToken(StringTokenizer.java:349)
[16:33] server.campaign.operations.OperationEntity. (OperationEntity.java:107)
[16:33] server.campaign.operations.ShortResolver.possibleSalvageFromReport(ShortResolver.java:3499)
[16:33] server.campaign.operations.ShortResolver.resolveShortAttack(ShortResolver.java:317)
[16:33] server.campaign.operations.OperationManager.resolveShortAttack(OperationManager.java:350)
[16:33] server.campaign.CampaignMain.doProcessAutomaticReport(CampaignMain.java:975)
[16:33] server.MWServ.clientRecieve(MWServ.java:685)
[16:33] server.ServerWrapper.processCommand(ServerWrapper.java:63)
[16:33] server.MWChatServer.commands.Command.process(Command.java:37)
[16:33] server.MWChatServer.CommandProcessorRemote.process(CommandProcessorRemote.java:159)
[16:33] server.MWChatServer.MWChatClient.incomingMessage(MWChatClient.java:192)
[16:33] server.MWChatServer.ReaderThread.normalRun(ReaderThread.java:71)
[16:33] server.MWChatServer.ReaderThread.run(ReaderThread.java:97)
[16:33] java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
[16:33] java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
[16:33] java.lang.Thread.run(Thread.java:745)

TigerShark
Mekwars Server Operator
Posts: 710
Joined: Wed Feb 24, 2010 8:28 am

Re: Damage resolution error

Post by TigerShark » Mon Sep 26, 2016 12:39 am

There are several of these, since it affected all 9 units deployed. Part 2:

Code: Select all

[16:33] Unable to apply damage to unit PXH-2
[16:33] [java.util.NoSuchElementException]
[16:33] java.util.StringTokenizer.nextToken(StringTokenizer.java:349)
[16:33] common.util.unitdamage.MekDamageHandler.applyDamageString(MekDamageHandler.java:254)
[16:33] common.util.UnitUtils.applyBattleDamage(UnitUtils.java:2722)
[16:33] server.campaign.operations.ShortResolver.assembleSalvageStrings(ShortResolver.java:1518)
[16:33] server.campaign.operations.ShortResolver.resolveShortAttack(ShortResolver.java:325)
[16:33] server.campaign.operations.OperationManager.resolveShortAttack(OperationManager.java:350)
[16:33] server.campaign.CampaignMain.doProcessAutomaticReport(CampaignMain.java:975)
[16:33] server.MWServ.clientRecieve(MWServ.java:685)
[16:33] server.ServerWrapper.processCommand(ServerWrapper.java:63)
[16:33] server.MWChatServer.commands.Command.process(Command.java:37)
[16:33] server.MWChatServer.CommandProcessorRemote.process(CommandProcessorRemote.java:159)
[16:33] server.MWChatServer.MWChatClient.incomingMessage(MWChatClient.java:192)
[16:33] server.MWChatServer.ReaderThread.normalRun(ReaderThread.java:71)
[16:33] server.MWChatServer.ReaderThread.run(ReaderThread.java:97)
[16:33] java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
[16:33] java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
[16:33] java.lang.Thread.run(Thread.java:745)

TigerShark
Mekwars Server Operator
Posts: 710
Joined: Wed Feb 24, 2010 8:28 am

Re: Damage resolution error

Post by TigerShark » Mon Sep 26, 2016 12:47 am

gamelog.0 information

Code: Select all

20160925 16:33:14.303 Starting report process by [Dedicated] Dedicated 1

20160925 16:33:14.304 [Dedicated] Dedicated 1 reported: CR|2nd Canopian Light Horse#558217*1st Dieron Regulars*0*0*0* *false*18*3*13*13*9*9*0*0*Dervish DV-6M.MTF#536043*1st Dieron Regulars*0*0*0* *false*18*3*13*13*9*9*0*0*Shadow Hawk SHD-2H.MTF#550683*1st Dieron Regulars*1*0*0* *false*14*3*11*11*-3*-3*0*0*Phoenix Hawk PXH-2.MTF#533293*1st Dieron Regulars*0*0*0* *false*13*3*11*11*7*7*0*0*Phoenix Hawk PXH-2.MTF#536510*2nd Canopian Light Horse*1*0*0* *false*14*3*11*11*7*7*0*0*Phoenix Hawk PXH-2.MTF#561200*2nd Canopian Light Horse*0*0*0* *false*11*3*8*8*6*6*0*0*Night Hawk NTK-2Q.MTF#561201*2nd Canopian Light Horse*0*0*0* *false*11*3*8*8*6*6*0*0*Night Hawk NTK-2Q.MTF#537521*2nd Canopian Light Horse*0*0*1* *true*false*false*Nightshade ECM VTOL.BLK#536859*2nd Canopian Light Horse*0*0*0* *false*11*3*8*8*6*6*0*0*Talon TLN-5V.MTF#

BarukKhazad
MegamekNET Moderator
Posts: 329
Joined: Mon Nov 21, 2011 10:56 pm

Re: Damage resolution error

Post by BarukKhazad » Mon Sep 26, 2016 4:56 am

After working with Tigershark and checking code, it is definite that the ded is sending back status reports as if the UseAdvanceRepair setting was false but this is only happening for some of the games.

Three things were found out. The ded is set to self-restart every ten games, the server gives the UseAdvanceRepair=true to the ded when the ded sign's in, and this ded had a config file with the UseAdvanceRepair=false. I suspect that a ded will load from the config file in some situation and this is why the problem is happening just sometimes. The value in the file has been changed and we'll see what happens.

Spork
Mekwars Developer
Posts: 3893
Joined: Wed Feb 13, 2008 10:23 pm

Re: Damage resolution error

Post by Spork » Mon Sep 26, 2016 3:18 pm

We should change code so it sends back the same string regardless, and let the *server* decide how to use it.
Never had much, grew up with nothing
But the music, well it was something
Been down and out, I've been on top of the world,
World that keeps on spinning on a turntable.

BarukKhazad
MegamekNET Moderator
Posts: 329
Joined: Mon Nov 21, 2011 10:56 pm

Re: Damage resolution error

Post by BarukKhazad » Mon Sep 26, 2016 8:05 pm

Yes.

TigerShark
Mekwars Server Operator
Posts: 710
Joined: Wed Feb 24, 2010 8:28 am

Re: Damage resolution error

Post by TigerShark » Tue Sep 27, 2016 9:44 am

After it was hard coded...

Code: Select all

[01:30] [java.util.ConcurrentModificationException]
[01:30] java.util.Vector$Itr.checkForComodification(Vector.java:1184)
[01:30] java.util.Vector$Itr.next(Vector.java:1137)
[01:30] server.campaign.SPlayer.availableTechsToString(SPlayer.java:1820)
[01:30] server.campaign.SPlayer.toString(SPlayer.java:2789)
[01:30] server.campaign.CampaignMain.savePlayerFile(CampaignMain.java:2849)
[01:30] server.campaign.CampaignMain.forceSavePlayer(CampaignMain.java:2823)
[01:30] server.campaign.SPlayer.setSave(SPlayer.java:168)
[01:30] server.campaign.SPlayer.addMoney(SPlayer.java:1454)
[01:30] server.campaign.commands.RepairUnitCommand.process(RepairUnitCommand.java:229)
[01:30] server.campaign.CampaignMain.fromUser(CampaignMain.java:759)
[01:30] server.MWServ.clientRecieve(MWServ.java:657)
[01:30] server.ServerWrapper.processCommand(ServerWrapper.java:63)
[01:30] server.MWChatServer.commands.Command.process(Command.java:37)
[01:30] server.MWChatServer.CommandProcessorRemote.process(CommandProcessorRemote.java:159)
[01:30] server.MWChatServer.MWChatClient.incomingMessage(MWChatClient.java:192)
[01:30] server.MWChatServer.ReaderThread.normalRun(ReaderThread.java:71)
[01:30] server.MWChatServer.ReaderThread.run(ReaderThread.java:97)
[01:30] java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
[01:30] java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
[01:30] java.lang.Thread.run(Thread.java:745)
[01:30] Unable to save 1st sun zhang academy cadre
Troubling thing is the last line, where it appears the player's data wasn't saved.

BarukKhazad
MegamekNET Moderator
Posts: 329
Joined: Mon Nov 21, 2011 10:56 pm

Re: Damage resolution error

Post by BarukKhazad » Wed Sep 28, 2016 5:38 am

You are seeing that error for the first time because it only happens when players can repair their units. When the slice happens, all player files are saved. If a player has a repair job happening at that moment, the error will occur because the player save requires exclusive access. So the player save is delayed until the next slice (4 or 5 minutes?)

On the MegaMekNET server, this error happens happened 74 times in the last 18 months. A couple of times this month.

The hard-coded "return true;" in IsUsingAdvanceRepair() is not causing this. Hopefully the logged info will indicate when the setting is flagged as false. No games today had the issue.

TigerShark
Mekwars Server Operator
Posts: 710
Joined: Wed Feb 24, 2010 8:28 am

Re: Damage resolution error

Post by TigerShark » Wed Sep 28, 2016 5:43 am

Yes, I haven't seen it since. Works fine now :)

Post Reply