Photon Communication Process Analysis "one" (user login) [Unity3d-->ugui-->playmaker-->pun-->photon3unity3d.dll-->photon Master serve __pun
Last Update:2018-08-21
Source: Internet
Author: User
Photon Communication Process Analysis "one" (user login) Route node: [Unity3d-->ugui-->playmaker-->pun-->photon3unity3d.dll-->photon Master Server-->mysql] Step: 1, "Client" user enter user name, password. Set Photonnetwork. Authvalues.
-->accountlogin.cs Photonnetwork. Authvalues = new Authenticationvalues (); Photonnetwork. Authvalues.authtype = Customauthenticationtype. Custom; Photonnetwork. Authvalues.addauthparameter (account), account. Value); Photonnetwork. Authvalues.addauthparameter ("Password", password. Value); 2, "Client" Connection Photon server
-->
PhotonNetworkConnectUsingSettings.cs Photonnetwork. Connectusingsettings (Gameversion.value);
-->
PhotonNetwork.cs Networkingpeer.connect (Networkingpeer.masterserveraddress, serverconnection. Masterserver);
"Entrance" Static constructor, Photonhandler "Photonpeer.service ()" is created to listen for server-side messages
-->
NetworkingPeer.cs BOOL connecting = base. Connect (ServerAddress, "", this. Tokenforinit); if (connecting) {switch (type) {case serverconnection. Nameserver:state = clientstate. Connectingtonameserver; break; Case Serverconnection. Masterserver:state = clientstate. Connectingtomasterserver; break; Case Serverconnection. Gameserver:state = clientstate. Connectingtogameserver; break; } }
--> LoadBalancingPeer.cs
; Photonpeer.cs[in Photon3Unity3d.dll] Photon client plugin, responsible for Communicates with the photon server. include: Communication Protocol (UDP,TCP); Connection method (connect (string serveraddress, String applicationname, object custom); Disconnect (Disconnect ()); Registertype (type Customtype, by Te code, Serializestreammethod Serializemethod, Deserializestreammethod constructor); Opcustom (byte customop Code, Dictionary < Byte, object > CustomopparametERS, bool sendreliable); EXECUTE request/Response (Service (); Queuedincomingcommands queuedoutgoingcommands) &N Bsp Callback Monitoring (Iphotonpeerlistener "Onoperationresponse, OnEvent, onstatuschanged, Debugreturn"); &NB Sp