Esempio n. 1
0
        public bool Connected(int RpcID)
        {
            RpcClientInfo Info = GetClient(RpcID);

            if (Info == null)
            {
                return(false);
            }

            Log.Success("ServerMgr", Info.Description() + " | Connected");

            foreach (Type type in Server.RegisteredTypes[0])
            {
                Server.GetLocalObject(type).OnClientConnected(Info);
            }

            foreach (RpcClientInfo ConnectedClient in GetClients())
            {
                if (Info.RpcID == ConnectedClient.RpcID)
                {
                    continue;
                }

                try
                {
                    foreach (Type type in Server.RegisteredTypes[1])
                    {
                        Log.Debug("ServerMgr", Info.Name + " Send to : " + ConnectedClient.Name + ",T=" + type);
                        RpcServer.GetObject(type, ConnectedClient.Ip, ConnectedClient.Port).OnClientConnected(Info);
                        RpcServer.GetObject(type, Info.Ip, Info.Port).OnClientConnected(ConnectedClient);
                    }
                }
                catch (Exception e)
                {
                    Log.Error("ServerMgr", e.ToString());
                    Log.Notice("ServerMgr", "Invalid : " + ConnectedClient.Description());
                }
            }


            Info.Connected = true;

            return(true);
        }
Esempio n. 2
0
 public override void OnClientDisconnected(RpcClientInfo Info)
 {
     Log.Notice("ClientMgr", Info.Description() + " | Disconnected");
 }
Esempio n. 3
0
 public override void OnClientDisconnected(RpcClientInfo Info)
 {
     Log.Notice("ClientMgr", Info.Description() + " | Disconnected");
 }