| 42 |
//myScriptEngine.World.EventManager.OnRemoveEntity += OnRemoveEntity; |
//myScriptEngine.World.EventManager.OnRemoveEntity += OnRemoveEntity; |
| 43 |
//myScriptEngine.World.EventManager.OnPythonScriptCommand += OnPythonScriptCommand; |
//myScriptEngine.World.EventManager.OnPythonScriptCommand += OnPythonScriptCommand; |
| 44 |
//myScriptEngine.World.EventManager.OnPythonClassChange += OnPythonClassChange; |
//myScriptEngine.World.EventManager.OnPythonClassChange += OnPythonClassChange; |
|
//myScriptEngine.World.EventManager.OnRexClientScriptCommand += OnRexClientScriptCommand; |
|
| 45 |
//myScriptEngine.World.EventManager.OnPrimVolumeCollision += OnPrimVolumeCollision; |
//myScriptEngine.World.EventManager.OnPrimVolumeCollision += OnPrimVolumeCollision; |
| 46 |
//myScriptEngine.World.EventManager.OnRexScriptListen += OnRexScriptListen; |
//myScriptEngine.World.EventManager.OnRexScriptListen += OnRexScriptListen; |
|
//myScriptEngine.World.EventManager.OnRexClientStartUp += OnRexClientStartUp; |
|
|
|
|
| 47 |
} |
} |
| 48 |
|
|
| 49 |
|
|
| 79 |
{ |
{ |
| 80 |
try |
try |
| 81 |
{ |
{ |
| 82 |
|
//IRexBot related |
| 83 |
if (vPresence.ControllingClient is IRexBot) |
if (vPresence.ControllingClient is IRexBot) |
| 84 |
{ |
{ |
| 85 |
string EventParams = "\"add_bot\"," + vPresence.LocalId.ToString() + "," + "\"" + vPresence.UUID.ToString() + "\""; |
string EventParams = "\"add_bot\"," + vPresence.LocalId.ToString() + "," + "\"" + vPresence.UUID.ToString() + "\""; |
| 90 |
string EventParams = "\"add_presence\"," + vPresence.LocalId.ToString() + "," + "\"" + vPresence.UUID.ToString() + "\""; |
string EventParams = "\"add_presence\"," + vPresence.LocalId.ToString() + "," + "\"" + vPresence.UUID.ToString() + "\""; |
| 91 |
myScriptEngine.ExecutePythonCommand("CreateEventWithName(" + EventParams + ")"); |
myScriptEngine.ExecutePythonCommand("CreateEventWithName(" + EventParams + ")"); |
| 92 |
} |
} |
| 93 |
|
|
| 94 |
|
//Tie up some RexClientView events |
| 95 |
|
RexNetwork.RexClientView rex; |
| 96 |
|
if (vPresence.ClientView.TryGet(out rex)) |
| 97 |
|
{ |
| 98 |
|
rex.OnReceiveRexStartUp += OnRexClientStartUp; |
| 99 |
|
rex.OnReceiveRexClientScriptCmd += OnRexClientScriptCommand; |
| 100 |
|
} |
| 101 |
} |
} |
| 102 |
catch (Exception e) |
catch (Exception e) |
| 103 |
{ |
{ |
| 202 |
} |
} |
| 203 |
} |
} |
| 204 |
|
|
| 205 |
public void OnRexClientScriptCommand(ScenePresence avatar, List<string> vCommands) |
public void OnRexClientScriptCommand(RexNetwork.RexClientView remoteClient, UUID agentID, List<string> commands) |
| 206 |
{ |
{ |
| 207 |
try |
try |
| 208 |
{ |
{ |
| 209 |
string Paramlist = ""; |
string Paramlist = ""; |
| 210 |
foreach (string s in vCommands) |
foreach (string s in commands) |
| 211 |
Paramlist = Paramlist + "," + "\"" + s + "\""; |
Paramlist = Paramlist + "," + "\"" + s + "\""; |
| 212 |
|
|
| 213 |
string EventParams = "\"client_event\",\"" + avatar.UUID.ToString() + "\"" + Paramlist; |
string EventParams = "\"client_event\",\"" + agentID.ToString() + "\"" + Paramlist; |
| 214 |
myScriptEngine.ExecutePythonCommand("CreateEventWithName(" + EventParams + ")"); |
myScriptEngine.ExecutePythonCommand("CreateEventWithName(" + EventParams + ")"); |
| 215 |
} |
} |
| 216 |
catch (Exception e) |
catch (Exception e) |
| 263 |
} |
} |
| 264 |
} |
} |
| 265 |
|
|
| 266 |
public void OnRexClientStartUp(ScenePresence avatar, string vStatus) |
public void OnRexClientStartUp(RexNetwork.RexClientView client, UUID agentID, string status) |
| 267 |
{ |
{ |
| 268 |
try |
try |
| 269 |
{ |
{ |
| 270 |
string EventParams = "\"client_startup\",\"" + avatar.UUID.ToString() + "\",\"" + vStatus + "\""; |
string EventParams = "\"client_startup\",\"" + agentID.ToString() + "\",\"" + status + "\""; |
| 271 |
myScriptEngine.ExecutePythonCommand("CreateEventWithName(" + EventParams + ")"); |
myScriptEngine.ExecutePythonCommand("CreateEventWithName(" + EventParams + ")"); |
| 272 |
} |
} |
| 273 |
catch (Exception e) |
catch (Exception e) |