private void Start() { skt = new PENet.PESocket <ClientSession, NetMsg>(); skt.StartAsClient(IPCfg.srvIP, IPCfg.srvPort); skt.SetLog(true, (string msg, int lv) => { switch (lv) { case 0: msg = "Log:" + msg; Debug.Log(msg); break; case 1: msg = "Warn:" + msg; Debug.LogWarning(msg); break; case 2: msg = "Error:" + msg; Debug.LogError(msg); break; case 3: msg = "Info:" + msg; Debug.Log(msg); break; } }); }
///服务初始化 public void InitSvc() { instance = this; client = new PENet.PESocket <ClientSession, GameMsg>(); //日志输出设置 client.SetLog(true, (string msg, int lv) => { switch (lv) { case 0: msg = "Log:" + msg; Debug.Log(msg); break; case 1: msg = "Warn:" + msg; Debug.LogWarning(msg); break; case 2: msg = "Error:" + msg; Debug.LogError(msg); break; case 3: msg = "Info:" + msg; Debug.Log(msg); break; } }); client.StartAsClient(SrvCfg.srvIP, SrvCfg.srvPort); }
private void Start() { //启动客户端 client = new PENet.PESocket <ClientSeesion, NetMsg>(); client.StartAsClient(IPCfg.srvIP, IPCfg.srvPort); client.SetLog(true, (string msg, int lv) => { switch (lv) { case 0: msg = "log" + msg; Debug.Log(msg); break; case 1: msg = "war" + msg; Debug.LogWarning(msg); break; case 2: msg = "err" + msg; Debug.LogError(msg); break; case 3: msg = "info" + msg; Debug.Log(msg); break; } }); }
private void Start() { client.StartAsClient(IPCf.srvIP, IPCf.srvPort); client.SetLog(true, (string msg, int level) => { switch (level) { case 0: msg = "Log:" + msg; Debug.Log(msg); break; case 1: msg = "warn:" + msg; Debug.Log(msg); break; case 2: msg = "error:" + msg; Debug.Log(msg); break; case 3: msg = "info:" + msg; Debug.Log(msg); break; } }); }
public void InitSvc() { Instance = this; client = new PENet.PESocket <ClientSession, GameMsg>(); client.SetLog(true, (string msg, int lv) => { switch (lv) { case 0: msg = "Log:" + msg; Debug.Log(msg); break; case 1: msg = "Warn:" + msg; Debug.LogWarning(msg); break; case 2: msg = "Error:" + msg; Debug.LogError(msg); break; case 3: msg = "Info:" + msg; Debug.Log(msg); break; default: break; } }); client.StartAsClient(SrvCfg.srvIP, SrvCfg.srvPort); Common.Log(GetType() + "/InitSvc()/Init NetSvc..."); }