![]() |
BomberUnits
...a Unity learning project
|
Collaboration diagram for NetAdapter:Static Public Member Functions | |
| static void | ActivateOfflineMode () |
| static void | ConnectToMasterServer () |
| Called by the NET management when a connection is requested by the user. More... | |
| static void | DisconnectFromMasterServer () |
| Called by the NET management when disconnection from join or host is requested by the user. More... | |
| static void | HostNewRoom (string name) |
| Called immediately by the state logic after connecting to the master server to open up a new hosted room. More... | |
| static void | LeaveRoom () |
| Called after having connected the master server to switch from Hosting to Joining. | |
| static void | JoinRoom () |
| static GameObject | Instantiate (GameObject prefab, Vector3 spawnLoc, Quaternion rotation, object[] initData=null, bool isSceneObj=false) |
| Spawns a clone of the given prefab and initializes it with the given data. More... | |
| static bool | IsConnected () |
| Returns true if this client is connected to the Master or in OfflineMode. Should always be true! | |
| static bool | IsMaster () |
| True if this client is the MasterClient or OfflineMode active. | |
| static bool | IsClientConnected (string clientID) |
| static bool | IsInRoom () |
| static string | GetClientID () |
| Photon assigns IDs to players, which we call "Client" here. More... | |
| static Client | GetLocalClient () |
| static int | GetActorNr () |
| Returns the local client's actor number. -1 if not in a room. | |
| static void | Destroy (GameObject go) |
| Offers destruction for networked and non-networked objects. More... | |
| static bool | HasClient (string clientId) |
| Checks whether the requested client ID is known. More... | |
| static System.Collections.Generic.IEnumerable< Client > | GetAllClients () |
| static Client | GetClient (string clientId) |
| Gets the Client object given a user id. More... | |
| static byte | GetNewEventCode () |
| static Client | GetMasterClient () |
| static void | DestroyFromMaster (GameObject go) |
| Allows network-destruction of objects with PhotonView, if these have a Net::PhotonDestructor component. More... | |
| static void | LoadSceneForWholeRoom (string sceneName) |
| Provides Scene loading for all clients in the room. More... | |
| static object | GetClientData (string key, string clientId="OfflineClient") |
| static Hashtable | GetClientHashtable (string clientId="OfflineClient") |
| static void | SendClientData (string key, object data) |
| Version to support giving the key and data to be packed automatically. | |
| static void | SendClientData (Hashtable data) |
| Uses Photon custom properties to save data per client. More... | |
| static void | RemoveClientData (string key) |
| static object | GetRoomData (string key) |
| static Hashtable | GetRoomHashtable () |
| static void | SetRoomData (string key, object data) |
| static int | GetCommonTimeStamp () |
| Returns the common timebase of the Photon server as an overflowing int. More... | |
Static Private Attributes | |
| static byte | eventCodeCounter = 1 |
| Counter to give out new event codes on request. | |
Definition at line 12 of file NetAdapter.cs.
|
inlinestatic |
Called by the NET management when a connection is requested by the user.
Connects using standards settings and bases the party's name on the main player name.
Definition at line 32 of file NetAdapter.cs.
|
inlinestatic |
Offers destruction for networked and non-networked objects.
This client has to own the networked object!
Definition at line 149 of file NetAdapter.cs.
|
inlinestatic |
Allows network-destruction of objects with PhotonView, if these have a Net::PhotonDestructor component.
Destroys normally if not connected.
Definition at line 230 of file NetAdapter.cs.
|
inlinestatic |
Called by the NET management when disconnection from join or host is requested by the user.
Wrapper to call disconnect on Photon, leaving any room and the master server.
Definition at line 47 of file NetAdapter.cs.
|
inlinestatic |
Gets the Client object given a user id.
The User has to be in the same room. Will return null and log errors if the client is unknown. Photon calls clients "Players", but we change the terminology, as we want to enable multiple players per client.
Definition at line 197 of file NetAdapter.cs.
|
inlinestatic |
Photon assigns IDs to players, which we call "Client" here.
This can be used to identify each Player in the game via client and player UID. The client ID is only available after connecting.
Definition at line 125 of file NetAdapter.cs.
|
inlinestatic |
Returns the common timebase of the Photon server as an overflowing int.
Comparisons work fine as long as differences of timestamps are used because the overflows are negated if the time difference is within one full value range.
Definition at line 350 of file NetAdapter.cs.
|
inlinestatic |
Checks whether the requested client ID is known.
Will return true during offline mode or disconnected, as the local client should then have the virtual ID "OfflineClient".
Definition at line 169 of file NetAdapter.cs.
|
inlinestatic |
Called immediately by the state logic after connecting to the master server to open up a new hosted room.
The room is automatically joined.
Definition at line 54 of file NetAdapter.cs.
|
inlinestatic |
Spawns a clone of the given prefab and initializes it with the given data.
The prefab has to be within a 'Resources' folder.
Definition at line 84 of file NetAdapter.cs.
|
inlinestatic |
Definition at line 77 of file NetAdapter.cs.
|
inlinestatic |
Provides Scene loading for all clients in the room.
This works because AutomaticallySyncScene is set to true! Also works in Offline Mode (IsMaster is then always true).
Definition at line 249 of file NetAdapter.cs.
|
inlinestatic |
Uses Photon custom properties to save data per client.
This data is maintained during (dis-)connecting and in offline mode. The used data types however need to be registered with Photon so they can be (de-)serialized.
Definition at line 293 of file NetAdapter.cs.