C# 클래스 InRoomRoundTimer, Droid-Soccer

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
파일 보기 프로젝트 열기: repelex/Droid-Soccer 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
SecondsPerTurn int
StartTime double
TextPos Rect
secondsbeforeend double
starting_severtime double
timetostart double

공개 메소드들

메소드 설명
OnGUI ( ) : void
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).

Update ( ) : void

비공개 메소드들

메소드 설명
StartRoundNow ( ) : void

메소드 상세

OnGUI() 공개 메소드

public OnGUI ( ) : void
리턴 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

Update() 공개 메소드

public Update ( ) : void
리턴 void

프로퍼티 상세

SecondsPerTurn 공개적으로 프로퍼티

public int SecondsPerTurn
리턴 int

StartTime 공개적으로 프로퍼티

public double StartTime
리턴 double

TextPos 공개적으로 프로퍼티

public Rect TextPos
리턴 Rect

secondsbeforeend 공개적으로 프로퍼티

public double secondsbeforeend
리턴 double

starting_severtime 공개적으로 프로퍼티

public double starting_severtime
리턴 double

timetostart 공개적으로 프로퍼티

public double timetostart
리턴 double