AttributeError: 'SCA_PythonController' object has no attribute 'getOwner' I'm using v2.69 and I get this error in my terminal:


  AttributeError: 'SCA_PythonController' object has no attribute 'getOwner'


I'm using Linux. 

The error in the line 21. Is the problem in my code or the version?

from GameLogic import * 
import GameLogic as GameLogic
#START THIS SETUP ONE TIME AS A SERVER AND ONE TIME AS A CLIENT

#BEVORE YOU START THIS SETUP AS A CLIENT REPLACE THE * IN THE 
#LINE BELOW WITH THE SERVER IP 
#(FOR EXAMPLE: GameLogic.IP = "192.123.100.1")



GameLogic.IP = "192.168.1.1"





#THE CODE BELOW SETS UP IF YOU PLAY THE CLIENT OR THE SERVER
#TO START THE SERVER PRESS F1 TO START THE CLIENT F2

cont = GameLogic.getCurrentController()
obj = cont.getOwner()
scene = getCurrentScene()
Server = cont.getSensor("F1")
Client = cont.getSensor("F2")

if Server.isPositive():
    Server = scene.getObjectList()["OBServer"]
    Server.Activ = 1
if Client.isPositive():
    Client = scene.getObjectList()["OBClient"]
    Client.Activ = 1
This is Python code written for BGE 2.49 and earlier.

You need to convert it to BGE 2.5+. This includes API changes and upgrade to Python 3.0.

To make it short:

.getOwner()      -&gt; .owner
.getSensor("F1") -&gt; .sensors["F1"]
.getObjectList() -&gt; .objects
["OBServer"]     -&gt; ["Server"] 
Server.Activ     -&gt; Server["Activ"]


It looks like this is just a fragment of more logic.