public static void ReadMessage(Session session, byte[] bytes) { try { ByteArray array = new ByteArray(bytes); int type = array.ReadInt(); int command = array.ReadInt(); int namelength = array.ReadInt(); string name = null; if (namelength > 0) { name = array.ReadUTFBytes((uint)namelength); } int commentLength = array.ReadInt(); string comment = null; if (commentLength > 0) { comment = array.ReadUTFBytes((uint)commentLength); } SocketModel model = new SocketModel { type = type, command = command, name = name, message = comment }; LogicHandler.getInstance().process(session, model); } catch { } }
public static LogicHandler getInstance() { if (Instance == null) { Instance = new LogicHandler(); } return(Instance); }