C# 클래스 RaceTimer, KestrelFPV

Simple script that uses a property to sync a start time for a multiplayer game.
When entering a room, the first player will store the synchronized timestamp. You can't set the room's synchronized time in CreateRoom, because the clock on the Master Server and those on the Game Servers are not in sync. We use many servers and each has it's own timer. Everyone else will join the room and check the property to calculate how much time passed since start. You can start a new round whenever you like. Based on this, you should be able to implement a synchronized timer for turns between players.
상속: MonoBehaviour
파일 보기 프로젝트 열기: eleurent/KestrelFPV 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
BreakDuration int
TurnDuration int

공개 메소드들

메소드 설명
OnJoinedRoom ( ) : void

Called by PUN when this client entered a room (no matter if joined or created).

OnMasterClientSwitched ( PhotonPlayer, newMasterClient ) : void In theory, the client which created the room might crash/close before it sets the start time. Just to make extremely sure this never happens, a new masterClient will check if it has to start a new round.
OnPhotonCustomRoomPropertiesChanged ( Hashtable, propertiesThatChanged ) : void

Called by PUN when new properties for the room were set (by any client in the room).

Start ( ) : void
Update ( ) : void

비공개 메소드들

메소드 설명
StartRoundNow ( ) : void

메소드 상세

OnJoinedRoom() 공개 메소드

Called by PUN when this client entered a room (no matter if joined or created).
public OnJoinedRoom ( ) : void
리턴 void

OnMasterClientSwitched() 공개 메소드

In theory, the client which created the room might crash/close before it sets the start time. Just to make extremely sure this never happens, a new masterClient will check if it has to start a new round.
public OnMasterClientSwitched ( PhotonPlayer, newMasterClient ) : void
newMasterClient PhotonPlayer,
리턴 void

OnPhotonCustomRoomPropertiesChanged() 공개 메소드

Called by PUN when new properties for the room were set (by any client in the room).
public OnPhotonCustomRoomPropertiesChanged ( Hashtable, propertiesThatChanged ) : void
propertiesThatChanged Hashtable,
리턴 void

Start() 공개 메소드

public Start ( ) : void
리턴 void

Update() 공개 메소드

public Update ( ) : void
리턴 void

프로퍼티 상세

BreakDuration 공개적으로 프로퍼티

public int BreakDuration
리턴 int

TurnDuration 공개적으로 프로퍼티

public int TurnDuration
리턴 int