EdgeMultiplay.NetworkedPlayer Class Reference

The player script should inherit from Networked Player NetworkedPlayer contains all the player data retrieved from the server More...

Inheritance diagram for EdgeMultiplay.NetworkedPlayer:
EdgeMultiplay.EdgeMultiplayCallbacks

Public Member Functions

void ListenToMessages ()
 Call ListenToMessages() to start listening to messages from the server More...
 
void StopListening ()
 Add StopListening when you want to stop listening to messages from the server More...
 
override void OnWebSocketEventReceived (GamePlayEvent gameplayEvent)
 During GamePlay once a event received from another player (Websocket) More...
 
override void OnUDPEventReceived (GamePlayEvent udpEvent)
 During GamePlay once a event received from another player (UDP) More...
 
virtual void OnMessageReceived (GamePlayEvent gamePlayEvent)
 This the Main Callback to call from your PlayerManager to access messages sent from other players. More...
 
virtual void OnOwnershipRequestReceived (NetworkedPlayer requestee, Observable observable)
 OnOwnershipRequestReceived is Received from the server once another player requests the ownership of an observable More...
 
void SetUpPlayer (Player playerFromServer, string roomId, bool isLocalPlayer=false)
 
void SendGamePlayEvent (GamePlayEvent gamePlayEvent)
 Sends an event to all players in the room More...
 
void SendGamePlayEventUDP (GamePlayEvent gamePlayEvent)
 Sends an event to all players in the room (UDP) More...
 
void BroadcastMessage (GamePlayEvent gamePlayEvent)
 Sends an event to all players in the room except the sender More...
 
void BroadcastMessage (string eventName, Vector3 position)
 Sends an event to all players in the room except the sender More...
 
void BroadcastMessage (string eventName, Quaternion rotation)
 Sends an event to all players in the room except the sender More...
 
void BroadcastMessage (string eventName, Vector3 position, Quaternion rotation)
 Sends an event to all players in the room except the sender More...
 
void BroadcastMessage (string eventName, List< int > integerArray)
 Sends an event to all players in the room except the sender More...
 
void BroadcastMessage (string eventName, List< float > floatArray)
 Sends an event to all players in the room except the sender More...
 
void BroadcastMessage (string eventName, string[] stringData=null, int[] commandInts=null, float[] floatData=null, bool[] booleanData=null)
 Sends an event to all players in the room except the sender More...
 
Observable CreateObservableObject (string prefabName, Vector3 startPosition, Quaternion startRotation, SyncOptions syncOption, bool interpolatePosition=false, bool interpolateRotation=false, float interpolationFactor=0)
 Creates synced GameObject in runtime in the local player's world and sends an event to all players in the room to create the observable in their worlds More...
 
- Public Member Functions inherited from EdgeMultiplay.EdgeMultiplayCallbacks
void ConnectToEdge (bool useAnyCarrierNetwork=true, bool useFallBackLocation=false, string path="")
 Starts the connection to your Edge server, server discovery is based on GPS location and the telecommunication carrier More...
 
virtual void OnConnectionToEdge ()
 Called once the ConnectToEdge Request succeed More...
 
virtual void OnFaliureToConnect (string reason)
 Called once the ConnectToEdge Request fails More...
 
virtual void OnRegisterEvent ()
 Called once the server assigned a playerId to the user right after the connection is established More...
 
virtual void OnNotificationEvent (Notification notification)
 Called once a notification is received from the server More...
 
virtual void OnRoomsListReceived (List< Room > rooms)
 The response for EdgeManager.GetRooms() returns list of rooms on the server More...
 
virtual void OnNewRoomCreatedInLobby ()
 Called automatically once a new room is created on the server You can use this callback to call EdgeManager.GetRooms() to get the updated list of the rooms in the lobby More...
 
virtual void OnRoomRemovedFromLobby ()
 Called automatically once a room is removed from the lobby You can use this callback to call EdgeManager.GetRooms() to get the updated list of the rooms in the lobby More...
 
virtual void OnRoomCreated (Room room)
 Called once the local player creates a room, The response of EdgeManagre.CreateRoom() and might be the response of EdgeManager.JoinOrCreateRoom() in case of room creation More...
 
virtual void OnRoomJoin (Room room)
 Called once the local player joins a room, The response of EdgeManagre.JoinRoom() and might be the response of EdgeManager.JoinOrCreateRoom() in case of room join More...
 
virtual void PlayerJoinedRoom (Room room)
 Called automatically once a player joins the local player room More...
 
virtual void OnJoinRoomFailed ()
 Called once a JoinRoom Request fails on the server More...
 
virtual void OnGameStart ()
 Called once the game starts, the game starts on the server once the number of players == the maximum players per room More...
 
virtual void OnPlayerLeft (RoomMemberLeft playerLeft)
 Called once a player in the same room as the local player leaves the room More...
 
virtual void OnLeftRoom ()
 Called once ExitRoom request in(EdgeManager.ExitRoom()) succeed More...
 
virtual void OnNewObservableCreated (Observable observable)
 Server Callback when a new Observable is created by one of the players More...
 

Public Attributes

string roomId
 the id of the room that the player is a member of More...
 
int playerIndex
 the player order in the room, ex. the first player to join a room has playerIndex of 0 More...
 
string playerId
 The player Id that the server assigns to the player More...
 
string playerName
 Player Name sat in the CreateRoom or JoinRoom Request. More...
 
Action< NetworkedPlayer, ObservableownershipRequested
 
Action< GamePlayEventplayerEvent
 
bool isLocalPlayer
 
bool ActivePlayer = true
 Can be used to set the player to be active or inactive although the player is still an active connection in the room More...
 

Properties

EdgeMultiplayObserver observer [get, set]
 The observer responsible for tracking the observable transforms More...
 

Additional Inherited Members

- Static Public Attributes inherited from EdgeMultiplay.EdgeMultiplayCallbacks
static Action connectedToEdge
 
static Action< string > failureToConnect
 
static Action registerEvent
 
static Action< NotificationnotificationEvent
 
static Action< GamePlayEventeventReceived
 
static Action< GamePlayEventudpEventReceived
 
static Action< RoomMemberLeftplayerLeft
 
static Action< List< Room > > roomsList
 
static Action< RoomroomCreated
 
static Action< RoomroomJoin
 
static Action< RoomplayerRoomJoined
 
static Action joinRoomFaliure
 
static Action newRoomCreatedInLobby
 
static Action roomRemovedFromLobby
 
static Action leftRoom
 
static Action gameStart
 
static Action gameEnd
 
static Action< ObservablenewObservableCreated