public void bindConnection(PlayerConn conn) { myConn = conn; conn.player = this; isConnected = true; changeAccount(10000, 0); }
/// <summary> /// make a player registered in this game /// Indeed, only after this function is called /// can the player attend this game online /// </summary> /// <returns></returns> public int registerInGameManager(PlayerConn me) { if (!isServer) { return(0); } for (int i = 0; i < players.Length; i++) { if (!players[i].isConnected) { players[i].bindConnection(me); players[i].myConn.RpctoWaitForReady(); me.RpcsetCamera(i + 1); return(i + 1); } } return(0); }