From 68260622443ef41ee7de2173acced382cf9e7c2b Mon Sep 17 00:00:00 2001 From: aceld Date: Thu, 25 Apr 2019 18:15:51 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0zinx=20logo=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- znet/server.go | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/znet/server.go b/znet/server.go index 62f3b70..90b5f77 100644 --- a/znet/server.go +++ b/znet/server.go @@ -7,6 +7,19 @@ import ( "zinx/ziface" ) +var zinx_logo = ` + ██ + ▀▀ + ████████ ████ ██▄████▄ ▀██ ██▀ + ▄█▀ ██ ██▀ ██ ████ + ▄█▀ ██ ██ ██ ▄██▄ + ▄██▄▄▄▄▄ ▄▄▄██▄▄▄ ██ ██ ▄█▀▀█▄ + ▀▀▀▀▀▀▀▀ ▀▀▀▀▀▀▀▀ ▀▀ ▀▀ ▀▀▀ ▀▀▀ + ` +var top_line = `┌───────────────────────────────────────────────────┐` +var border_line = `│` +var bottom_line = `└───────────────────────────────────────────────────┘` + //iServer 接口实现,定义一个Server服务类 type Server struct { //服务器的名称 @@ -47,10 +60,6 @@ func NewServer () ziface.IServer { //开启网络服务 func (s *Server) Start() { fmt.Printf("[START] Server name: %s,listenner at IP: %s, Port %d is starting\n", s.Name, s.IP, s.Port) - fmt.Printf("[Zinx] Version: %s, MaxConn: %d, MaxPacketSize: %d\n", - utils.GlobalObject.Version, - utils.GlobalObject.MaxConn, - utils.GlobalObject.MaxPacketSize) //开启一个go去做服务端Linster业务 go func() { @@ -158,5 +167,17 @@ func (s *Server) CallOnConnStop(conn ziface.IConnection) { } } +func init() { + fmt.Println(zinx_logo) + fmt.Println(top_line) + fmt.Println(fmt.Sprintf("%s [Github] https://github.com/aceld %s", border_line, border_line)) + fmt.Println(fmt.Sprintf("%s [tutorial] https://www.jianshu.com/p/23d07c0a28e5 %s", border_line, border_line)) + fmt.Println(bottom_line) + fmt.Printf("[Zinx] Version: %s, MaxConn: %d, MaxPacketSize: %d\n", + utils.GlobalObject.Version, + utils.GlobalObject.MaxConn, + utils.GlobalObject.MaxPacketSize) +} +