public void enterServer() { user = net.userInstance; string name = user.createRoom(); net.eFieldId.Text = name; Debug.Log("Server E Filed ID: " + net.eFieldId.Text); }
private void close() { if (user != null) { user.Close(); user = null; Debug.Log("Connection close."); } }
void Awake() { long rand; bool rev = false; int isOnline = PlayerPrefs.GetInt("network", 0); Debug.Log("isOnline" + isOnline); if (isOnline != 0 && NetworkStart.user != null) { this.netuser = NetworkStart.user; if (this.netuser.IsServer) { rev = true; } rand = this.netuser.Rand; Debug.Log("Seed:" + rand); this.level = 0; } else { this.level = PlayerPrefs.GetInt("level", 1); if (this.level == 0) { this.level = 1; } this.ai = new LilyAcolasia_AI.AI(this.level); this.demoAi = null; //new LilyAcolasia_AI.AI (4); this.currentGameState = GameState.AIAction; rand = new System.Random().Next(); } Debug.Log("Level:" + level); this.observer = new GameObserverImpl(this, this.netuser); this.gameOperator = new LilyAcolasia.GameOperator(this.observer, "AI", "You", rand, rev); LilyAcolasia.CardDeck.Handler = this.CardMove; FindObjects(); CreateCards(); }
public void enterClient() { user = net.userInstance; if (net.eFieldIdClient.Text == "" || net.eFieldIdClient.Text == null) { net.eFieldIdClient.Text = net.input.text; } string id = net.eFieldIdClient.Text; long seed; if (!decode(id, out seed)) { net.statusText.text = "Invalid ID!"; } else { net.statusText.text = ""; user.Rand = seed; user.joinRoom(id); Debug.Log("E Filed ID: " + net.eFieldIdClient.Text); } }
public GameObserverImpl(GameMaster master, PhotonNetworkPlayer user) { this.master = master; this.user = user; }