public void Serialize(NetDataWriter writer)
 {
     time = System.DateTimeOffset.Now.ToUnixTimeSeconds();
     hash = ClusterServer.GetAppServerRegisterHash(peerInfo.peerType, time);
     peerInfo.Serialize(writer);
     writer.PutPackedLong(time);
     writer.Put(hash);
 }
 public bool ValidateHash()
 {
     if (string.IsNullOrEmpty(hash))
     {
         return(false);
     }
     return(hash.Equals(ClusterServer.GetAppServerRegisterHash(peerInfo.peerType, time)));
 }
Exemple #3
0
 protected override void FixedUpdate()
 {
     base.FixedUpdate();
     if (IsServer)
     {
         ClusterServer.Update();
     }
 }
Exemple #4
0
        public bool MapContainsUser(string userId)
        {
#if UNITY_STANDALONE && !CLIENT_BUILD
            return(ClusterServer.MapContainsUser(userId));
#else
            return(false);
#endif
        }
Exemple #5
0
 public override void OnStartServer()
 {
     this.InvokeInstanceDevExtMethods("OnStartServer");
     base.OnStartServer();
     ClusterServer.StartServer();
 }
Exemple #6
0
 protected override void Start()
 {
     base.Start();
     ClusterServer = new ClusterServer(this);
 }
Exemple #7
0
 public override void OnStopServer()
 {
     Clean();
     base.OnStopServer();
     ClusterServer.StopServer();
 }