Skip to content

Commit 9a0059a

Browse files
authored
Merge pull request #1803 from madsboddum/static-item-log-improve
Log unknown item warnings in the context of the player, so tracing is…
2 parents 188e4a1 + d428252 commit 9a0059a

1 file changed

Lines changed: 8 additions & 10 deletions

File tree

src/main/java/com/projectswg/holocore/services/support/objects/items/StaticItemService.kt

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
/***********************************************************************************
2-
* Copyright (c) 2024 /// Project SWG /// www.projectswg.com *
2+
* Copyright (c) 2025 /// Project SWG /// www.projectswg.com *
33
* *
4-
* ProjectSWG is the first NGE emulator for Star Wars Galaxies founded on *
4+
* ProjectSWG is an emulation project for Star Wars Galaxies founded on *
55
* July 7th, 2011 after SOE announced the official shutdown of Star Wars Galaxies. *
6-
* Our goal is to create an emulator which will provide a server for players to *
7-
* continue playing a game similar to the one they used to play. We are basing *
8-
* it on the final publish of the game prior to end-game events. *
6+
* Our goal is to create one or more emulators which will provide servers for *
7+
* players to continue playing a game similar to the one they used to play. *
98
* *
109
* This file is part of Holocore. *
1110
* *
@@ -29,12 +28,12 @@ package com.projectswg.holocore.services.support.objects.items
2928
import com.projectswg.holocore.intents.support.global.chat.SystemMessageIntent
3029
import com.projectswg.holocore.intents.support.objects.CreateStaticItemIntent
3130
import com.projectswg.holocore.intents.support.objects.ObjectCreatedIntent
31+
import com.projectswg.holocore.resources.support.data.server_info.StandardLog
3232
import com.projectswg.holocore.resources.support.objects.StaticItemCreator
3333
import com.projectswg.holocore.resources.support.objects.swg.SWGObject
3434
import com.projectswg.holocore.resources.support.objects.swg.creature.CreatureObject
3535
import me.joshlarson.jlcommon.control.IntentHandler
3636
import me.joshlarson.jlcommon.control.Service
37-
import me.joshlarson.jlcommon.log.Log
3837
import java.util.*
3938

4039
class StaticItemService : Service() {
@@ -50,6 +49,7 @@ class StaticItemService : Service() {
5049
objectCreationHandler.containerFull()
5150
return
5251
}
52+
val requesterOwner = csii.requester.owner ?: return
5353

5454
val objects = ArrayList<SWGObject>()
5555
for (itemName in itemNames) {
@@ -59,10 +59,8 @@ class StaticItemService : Service() {
5959
obj.moveToContainer(container)
6060
ObjectCreatedIntent(obj).broadcast()
6161
} else {
62-
Log.d("%s could not be spawned because the item name is unknown", itemName)
63-
val requesterOwner = csii.requester.owner
64-
if (requesterOwner != null)
65-
SystemMessageIntent.broadcastPersonal(requesterOwner, String.format("%s could not be spawned because the item name is unknown", itemName))
62+
StandardLog.onPlayerError(this, requesterOwner, "unknown static item %s", itemName)
63+
SystemMessageIntent.broadcastPersonal(requesterOwner, String.format("%s could not be spawned because the item name is unknown", itemName))
6664
}
6765
}
6866

0 commit comments

Comments
 (0)