Compare commits
No commits in common. "115-app-store-connect-response" and "development" have entirely different histories.
115-app-st
...
developmen
@ -611,14 +611,14 @@
|
|||||||
CODE_SIGN_ENTITLEMENTS = GoldWars/GoldWars.entitlements;
|
CODE_SIGN_ENTITLEMENTS = GoldWars/GoldWars.entitlements;
|
||||||
CODE_SIGN_IDENTITY = "Apple Development";
|
CODE_SIGN_IDENTITY = "Apple Development";
|
||||||
CODE_SIGN_STYLE = Automatic;
|
CODE_SIGN_STYLE = Automatic;
|
||||||
CURRENT_PROJECT_VERSION = 1;
|
CURRENT_PROJECT_VERSION = 4;
|
||||||
DEVELOPMENT_TEAM = DDKFQG46BQ;
|
DEVELOPMENT_TEAM = DDKFQG46BQ;
|
||||||
INFOPLIST_FILE = GoldWars/Info.plist;
|
INFOPLIST_FILE = GoldWars/Info.plist;
|
||||||
LD_RUNPATH_SEARCH_PATHS = (
|
LD_RUNPATH_SEARCH_PATHS = (
|
||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
"@executable_path/Frameworks",
|
"@executable_path/Frameworks",
|
||||||
);
|
);
|
||||||
MARKETING_VERSION = 2.0;
|
MARKETING_VERSION = 1.0;
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = de.hft.stuttgart.ip2.goldwars;
|
PRODUCT_BUNDLE_IDENTIFIER = de.hft.stuttgart.ip2.goldwars;
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||||
@ -634,14 +634,14 @@
|
|||||||
CODE_SIGN_ENTITLEMENTS = GoldWars/GoldWars.entitlements;
|
CODE_SIGN_ENTITLEMENTS = GoldWars/GoldWars.entitlements;
|
||||||
CODE_SIGN_IDENTITY = "Apple Development";
|
CODE_SIGN_IDENTITY = "Apple Development";
|
||||||
CODE_SIGN_STYLE = Automatic;
|
CODE_SIGN_STYLE = Automatic;
|
||||||
CURRENT_PROJECT_VERSION = 1;
|
CURRENT_PROJECT_VERSION = 4;
|
||||||
DEVELOPMENT_TEAM = DDKFQG46BQ;
|
DEVELOPMENT_TEAM = DDKFQG46BQ;
|
||||||
INFOPLIST_FILE = GoldWars/Info.plist;
|
INFOPLIST_FILE = GoldWars/Info.plist;
|
||||||
LD_RUNPATH_SEARCH_PATHS = (
|
LD_RUNPATH_SEARCH_PATHS = (
|
||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
"@executable_path/Frameworks",
|
"@executable_path/Frameworks",
|
||||||
);
|
);
|
||||||
MARKETING_VERSION = 2.0;
|
MARKETING_VERSION = 1.0;
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = de.hft.stuttgart.ip2.goldwars;
|
PRODUCT_BUNDLE_IDENTIFIER = de.hft.stuttgart.ip2.goldwars;
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||||
|
@ -5,6 +5,12 @@
|
|||||||
// Created by Tim Herbst on 13.05.20.
|
// Created by Tim Herbst on 13.05.20.
|
||||||
// Copyright © 2020 SP2. All rights reserved.
|
// Copyright © 2020 SP2. All rights reserved.
|
||||||
//
|
//
|
||||||
|
import Foundation
|
||||||
|
|
||||||
|
struct Heartbeat: Codable {
|
||||||
|
var date: Date
|
||||||
|
}
|
||||||
|
|
||||||
struct NotificationModel: Codable {
|
struct NotificationModel: Codable {
|
||||||
let name: String
|
let name: String
|
||||||
|
|
||||||
|
@ -215,11 +215,25 @@ final class GameCenterManager: NSObject, GKMatchmakerViewControllerDelegate, GKG
|
|||||||
print("Recieved elo data: \(eloData.scoreToReport)")
|
print("Recieved elo data: \(eloData.scoreToReport)")
|
||||||
EloHelper.reportScore(score: eloData.scoreToReport)
|
EloHelper.reportScore(score: eloData.scoreToReport)
|
||||||
}
|
}
|
||||||
|
if let heartbeat = try? jsonDecoder.decode(Heartbeat.self, from: data) {
|
||||||
|
entityManager.getHUD()?.roundTimer.isHeartbeatLocked = false
|
||||||
|
let df = DateFormatter()
|
||||||
|
df.dateFormat = "yyyy-MM-dd HH:mm:ss"
|
||||||
|
let dateString = df.string(from: heartbeat.date)
|
||||||
|
print("Received last Heartbeat at \(dateString)")
|
||||||
|
}
|
||||||
|
|
||||||
MultiplayerNetwork.sharedInstance.isSending = false
|
MultiplayerNetwork.sharedInstance.isSending = false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func match(_ match: GKMatch, player: GKPlayer, didChange state: GKPlayerConnectionState) {
|
||||||
|
if myMatch != match { return }
|
||||||
|
if state == GKPlayerConnectionState.disconnected {
|
||||||
|
self.opponentQuit = true;
|
||||||
|
gameScene?.gameQuit()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func initAndSendMap() -> Void {
|
func initAndSendMap() -> Void {
|
||||||
self.gameScene = GameScene(size: self.menusc!.size)
|
self.gameScene = GameScene(size: self.menusc!.size)
|
||||||
let mapModel = MapFactory(scene: self.gameScene!, entityManager: entityManager).load()
|
let mapModel = MapFactory(scene: self.gameScene!, entityManager: entityManager).load()
|
||||||
|
@ -71,4 +71,10 @@ class MultiplayerNetwork{
|
|||||||
let encoded = (try? encoder.encode(NotificationModel(name: name)))!
|
let encoded = (try? encoder.encode(NotificationModel(name: name)))!
|
||||||
sendData(data: encoded)
|
sendData(data: encoded)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func sendHeartbeatToPlayer() {
|
||||||
|
let encoder = JSONEncoder()
|
||||||
|
let encoded = (try? encoder.encode(Heartbeat(date: Date())))!
|
||||||
|
sendData(data: encoded)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -12,6 +12,7 @@ class RoundTimer: Timer {
|
|||||||
|
|
||||||
var timer: Timer?
|
var timer: Timer?
|
||||||
var timeLeft: Int = 0
|
var timeLeft: Int = 0
|
||||||
|
var isHeartbeatLocked = false
|
||||||
var calculate = false
|
var calculate = false
|
||||||
var roundEnded = "Syncing"
|
var roundEnded = "Syncing"
|
||||||
|
|
||||||
@ -68,5 +69,10 @@ class RoundTimer: Timer {
|
|||||||
calculate = false
|
calculate = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!isHeartbeatLocked && (timeLeft % 7 == 0)){
|
||||||
|
MultiplayerNetwork.sharedInstance.sendHeartbeatToPlayer()
|
||||||
|
isHeartbeatLocked = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -84,7 +84,6 @@ class MenuScene: SKScene {
|
|||||||
if entityManager.entities.count != 0 {
|
if entityManager.entities.count != 0 {
|
||||||
entityManager.getBackground()!.update(deltaTime: currentTime)
|
entityManager.getBackground()!.update(deltaTime: currentTime)
|
||||||
entityManager.getButtonByName(buttonName: "startGameButton").component(ofType: ButtonComponent.self)?.buttonNode.isEnabled = GameCenterManager.isAuthenticated
|
entityManager.getButtonByName(buttonName: "startGameButton").component(ofType: ButtonComponent.self)?.buttonNode.isEnabled = GameCenterManager.isAuthenticated
|
||||||
entityManager.getButtonByName(buttonName: "gameCenterButton").component(ofType: ButtonComponent.self)?.buttonNode.isEnabled = GameCenterManager.isAuthenticated
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if GameCenterManager.sharedInstance.initIsFinish {
|
if GameCenterManager.sharedInstance.initIsFinish {
|
||||||
|
Loading…
Reference in New Issue
Block a user