示例#1
0
    public static void MsgtoCli_Maintenance(Msg_Maintenance msg)
    {
        DateTime dt = msg.maintenTime;

        H.klog($"Cli Got Server Time to maintain {dt}");
        // TODO: DISPLAY POPUP TO SHOW THEM TIME SERVER WILL BE MAINTAINED
    }
示例#2
0
文件: KnetMan.cs 项目: JK-IT/UnityGit
    /// <summary>
    /// Called on the server when a new client connects.
    /// <para>Unity calls this on the Server when a Client connects to the Server. Use an override to tell the NetworkManager what to do when a client connects to the server.</para>
    /// </summary>
    /// <param name="conn">Connection from client.</param>
    public override void OnServerConnect(NetworkConnection conn)
    {
        H.klog1($"Server Getting a Connection from client {conn}", this.name);

        AddCliOnConnect(conn);

        // sending not ready msg
        NetworkServer.SetClientNotReady(conn);
        Msg_Welcome msgtocli = new Msg_Welcome {
            wlcomemsg = $"Hey , my friends {conn.connectionId}", cliconnid = conn.connectionId
        };

        conn.Send(msgtocli);
        Msg_Maintenance msgMaintenance = new Msg_Maintenance {
            maintenTime = DateTime.Now
        };

        conn.Send(msgMaintenance);
    }