Skip to content

Commit 4101e5b

Browse files
committed
fix(sdk): remove shouldBePaused property from Player
1 parent 9dcae63 commit 4101e5b

File tree

4 files changed

+9
-24
lines changed

4 files changed

+9
-24
lines changed

gradle/custom-tasks/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
plugins {
2-
kotlin("jvm") version "1.3.71"
2+
kotlin("jvm") version "1.4.10"
33
`java-gradle-plugin`
44
}
55

@@ -20,4 +20,4 @@ gradlePlugin {
2020
id = "scripts-task"
2121
implementationClass = "sc.gradle.PlaceholderPlugin"
2222
}
23-
}
23+
}

sdk/src/framework/sc/helpers/XStream.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ import java.security.PrivilegedAction
1010
* Using the KXml2 parser because the default (Xpp3) and StAX can't parse some special characters in attribute values:
1111
* <protocol><authenticate passphrase="examplepassword"/>
1212
* <prepare gameType="swc_2018_hase_und_igel">
13-
* <slot displayName="Häschenschule" canTimeout="true" shouldBePaused="true"/>
14-
* <slot displayName="Testhase" canTimeout="true" shouldBePaused="true"/>
13+
* <slot displayName="Häschenschule" canTimeout="true"/>
14+
* <slot displayName="Testhase" canTimeout="true"/>
1515
* </prepare>
1616
*/
1717
val xStream = XStream(KXml2Driver()).apply {

sdk/src/server-api/sc/framework/plugins/Player.kt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,6 @@ open class Player @JvmOverloads constructor(
3434
@XStreamOmitField
3535
var canTimeout: Boolean = false
3636

37-
@XStreamOmitField
38-
var shouldBePaused: Boolean = false
39-
4037
@XStreamOmitField
4138
var left = false
4239

server/test/sc/protocol/requests/RequestTest.kt

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@ class RequestTest: RealServerTest() {
8787
fun prepareXmlTest() {
8888
val request = xStream.fromXML("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
8989
"<prepare gameType=\"swc_2018_hase_und_igel\">\n" +
90-
" <slot displayName=\"Häschenschule\" canTimeout=\"true\" shouldBePaused=\"true\"/>\n" +
91-
" <slot displayName=\"Testhase\" canTimeout=\"true\" shouldBePaused=\"true\"/>\n" +
90+
" <slot displayName=\"Häschenschule\" canTimeout=\"true\"/>\n" +
91+
" <slot displayName=\"Testhase\" canTimeout=\"true\"/>\n" +
9292
"</prepare>")
9393
assertEquals(PrepareGameRequest::class.java, request.javaClass)
9494
assertEquals("Häschenschule", (request as PrepareGameRequest).slotDescriptors[0].displayName)
@@ -163,31 +163,23 @@ class RequestTest: RealServerTest() {
163163
val sp1 = room.slots[0].role.player
164164
sp1.addPlayerListener(p1Listener)
165165
admin.send(PauseGameRequest(room.id, true))
166-
admin.observe(room.id)
166+
admin.observe(room.id, false)
167167

168168
// Wait for admin
169169
TestHelper.waitUntilTrue({ listener.observedReceived }, 2000)
170170

171-
172171
player2.joinRoomRequest(TestPlugin.TEST_PLUGIN_UUID)
173172
TestHelper.waitMillis(500)
174173
room.slots[1].role.player.addPlayerListener(p2Listener)
175174

176175
// Wait for the server to register that
177176
TestHelper.waitUntilTrue({ room.isPauseRequested }, 2000)
178177

179-
assertTrue(room.isPauseRequested)
180-
val pr1 = room.slots[0].role
181-
val pr2 = room.slots[1].role
182-
assertTrue(pr1.player.shouldBePaused)
183-
assertTrue(pr2.player.shouldBePaused)
184-
185-
186178
// Wait for it to register
187179
// no state will be send if game is paused TestHelper.waitUntilTrue(()->listener.newStateReceived, 2000);
188180
listener.newStateReceived = false
189181

190-
assertTrue(TestHelper.waitUntilTrue({ p1Listener.playerEventReceived }, 2000))
182+
TestHelper.waitUntilTrue({ p1Listener.playerEventReceived }, 2000)
191183
p1Listener.playerEventReceived = false
192184
assertEquals(p1Listener.requests.size.toLong(), 1)
193185
assertEquals(p1Listener.requests[0].javaClass, WelcomeMessage::class.java)
@@ -231,11 +223,7 @@ class RequestTest: RealServerTest() {
231223
// Wait for the server to register that
232224
TestHelper.waitUntilTrue({ room.isPauseRequested }, 2000)
233225

234-
val pr1 = room.slots[0].role
235-
val pr2 = room.slots[1].role
236-
assertTrue(pr1.player.shouldBePaused)
237-
assertTrue(pr2.player.shouldBePaused)
238-
226+
// TODO the section above duplicates the one of the previous test, clean that up
239227

240228
// Wait for it to register
241229
// no state will be send if game is paused TestHelper.waitUntilTrue(()->listener.newStateReceived, 2000);

0 commit comments

Comments
 (0)