So yeah change of plan,
Crowley is still a v13 server however it is wrote in Java and uses Hibernate with BoneCP.
Code:
Crowley "Styx" (v0.1.2)
Supported client: RELEASE-13
INFO [main] (Crowley.java53) - Default configuration file found (styx.props)
INFO [main] (Configuration.java25) - Loading configuration file: styx.props
INFO [main] (Crowley.java63) - Configuration built with 2 properties
INFO [main] (Crowley.java64) - Creating channel factory
INFO [main] (Crowley.java67) - Attempting to configure hibernate
INFO [main] (Version.java37) - Hibernate Commons Annotations 3.2.0.Final
INFO [main] (Environment.java603) - Hibernate 3.6.8.Final
INFO [main] (Environment.java636) - hibernate.properties not found
INFO [main] (Environment.java814) - Bytecode provider name : javassist
INFO [main] (Environment.java695) - using JDK 1.4 java.sql.Timestamp handling
INFO [main] (Configuration.java2156) - configuring from resource: /hibernate.cfg.xml
INFO [main] (Configuration.java2175) - Configuration resource: /hibernate.cfg.xml
INFO [main] (Configuration.java2297) - Configured SessionFactory: null
INFO [main] (Configuration.java1676) - Hibernate Validator not found: ignoring
INFO [main] (HibernateSearchEventListenerRegister.java75) - Unable to find org.hibernate.search.event.FullTextIndexEventListener on the classpath. Hibernate Search is not enabled.
INFO [main] (ConnectionProviderFactory.java173) - Initializing connection provider: com.jolbox.bonecp.provider.BoneCPConnectionProvider
INFO [main] (Dialect.java135) - Using dialect: org.hibernate.dialect.H2Dialect
INFO [main] (SettingsFactory.java126) - Database ->
name : MySQL
version : 5.5.15
major : 5
minor : 5
INFO [main] (SettingsFactory.java132) - Driver ->
name : MySQL-AB JDBC Driver
version : mysql-connector-java-5.1.18 ( Revision: tonci.grgin@oracle.com-20110930151701-jfj14ddfq48ifkfq )
major : 5
minor : 1
INFO [main] (TransactionFactoryFactory.java62) - Using default transaction strategy (direct JDBC transactions)
INFO [main] (TransactionManagerLookupFactory.java83) - No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended)
INFO [main] (SettingsFactory.java179) - Automatic flush during beforeCompletion(): disabled
INFO [main] (SettingsFactory.java183) - Automatic session close at end of transaction: disabled
INFO [main] (SettingsFactory.java190) - JDBC batch size: 15
INFO [main] (SettingsFactory.java193) - JDBC batch updates for versioned data: disabled
INFO [main] (SettingsFactory.java198) - Scrollable result sets: enabled
INFO [main] (SettingsFactory.java206) - JDBC3 getGeneratedKeys(): enabled
INFO [main] (SettingsFactory.java214) - Connection release mode: auto
INFO [main] (SettingsFactory.java241) - Default batch fetch size: 1
INFO [main] (SettingsFactory.java245) - Generate SQL with comments: disabled
INFO [main] (SettingsFactory.java249) - Order SQL updates by primary key: disabled
INFO [main] (SettingsFactory.java253) - Order SQL inserts for batching: disabled
INFO [main] (SettingsFactory.java431) - Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
INFO [main] (ASTQueryTranslatorFactory.java47) - Using ASTQueryTranslatorFactory
INFO [main] (SettingsFactory.java261) - Query language substitutions: {}
INFO [main] (SettingsFactory.java266) - JPA-QL strict compliance: disabled
INFO [main] (SettingsFactory.java271) - Second-level cache: enabled
INFO [main] (SettingsFactory.java275) - Query cache: disabled
INFO [main] (SettingsFactory.java406) - Cache region factory : org.hibernate.cache.impl.NoCachingRegionFactory
INFO [main] (SettingsFactory.java285) - Optimize cache for minimal puts: disabled
INFO [main] (SettingsFactory.java294) - Structured second-level cache entries: disabled
INFO [main] (SettingsFactory.java314) - Echoing all SQL to stdout
INFO [main] (SettingsFactory.java323) - Statistics: disabled
INFO [main] (SettingsFactory.java327) - Deleted entity synthetic identifier rollback: disabled
INFO [main] (SettingsFactory.java343) - Default entity-mode: pojo
INFO [main] (SettingsFactory.java347) - Named query checking : enabled
INFO [main] (SettingsFactory.java351) - Check Nullability in Core (should be disabled when Bean Validation is on): enabled
INFO [main] (SessionFactoryImpl.java202) - building session factory
INFO [main] (BasicTypeRegistry.java150) - Type registration [wrapper_characters_clob] overrides previous : org.hibernate.type.CharacterArrayClobType@7e543cb1
INFO [main] (BasicTypeRegistry.java150) - Type registration [wrapper_materialized_blob] overrides previous : org.hibernate.type.WrappedMaterializedBlobType@4c5cc942
INFO [main] (BasicTypeRegistry.java150) - Type registration [clob] overrides previous : org.hibernate.type.ClobType@5fa13338
INFO [main] (BasicTypeRegistry.java150) - Type registration [java.sql.Clob] overrides previous : org.hibernate.type.ClobType@5fa13338
INFO [main] (BasicTypeRegistry.java150) - Type registration [materialized_clob] overrides previous : org.hibernate.type.MaterializedClobType@5029d294
INFO [main] (BasicTypeRegistry.java150) - Type registration [blob] overrides previous : org.hibernate.type.BlobType@69c01ba9
INFO [main] (BasicTypeRegistry.java150) - Type registration [java.sql.Blob] overrides previous : org.hibernate.type.BlobType@69c01ba9
INFO [main] (BasicTypeRegistry.java150) - Type registration [characters_clob] overrides previous : org.hibernate.type.PrimitiveCharacterArrayClobType@43582a7c
INFO [main] (BasicTypeRegistry.java150) - Type registration [materialized_blob] overrides previous : org.hibernate.type.MaterializedBlobType@514d556e
INFO [main] (SessionFactoryObjectFactory.java105) - Not binding factory to JNDI, no JNDI name configured
INFO [main] (Crowley.java75) - Attempting to bootstrap server
INFO [main] (Crowley.java82) - Server bound to: 127.0.0.1:38101
INFO [New I/O server boss #1 ([id: 0x1624e801, /127.0.0.1:38101])] (ChannelHandler.java22) - Client connected with id: 839033548
If an error occurs when we try and bind the server we now handle the exception and close the session factory:
Code:
INFO [main] (Crowley.java76) - Attempting to bootstrap server
FATAL [main] (Crowley.java86) - Failed to bind to: /127.0.0.1:38101
INFO [main] (SessionFactoryImpl.java927) - closing
INFO [main] (BoneCP.java156) - Shutting down connection pool...
INFO [main] (BoneCP.java177) - Connection pool has been shutdown.
Finished implementing the Decoder and writing the ClientMessage class now i just need to write the session manager, encoder and server message classes and were running with fire.
Code:
INFO [main] (Crowley.java84) - Attempting to bootstrap server
INFO [main] (Crowley.java99) - Server bound on 127.0.0.1:9001
INFO [New I/O server boss #1 ([id: 0x0a211b37, /127.0.0.1:9001])] (ChannelHandler.java22) - Client connected with id: 429620322
INFO [New I/O server boss #1 ([id: 0x0a211b37, /127.0.0.1:9001])] (ChannelHandler.java24) - Sent ghetto hello message to client: 429620322
INFO [New I/O server worker #1-1] (Decoder.java43) - Message received (id: 206 length: 0) from client #429620322
DEBUG [New I/O server worker #1-1] (Decoder.java44) - Message data: CN
Finished up the encoder and server message classes. I'd like to thank Dom (Myrax) for giving me a hand getting to grips with Netty :)
Code:
INFO [main] (Crowley.java78) - Creating channel factory
INFO [main] (Crowley.java84) - Attempting to bootstrap server
INFO [main] (Crowley.java99) - Server bound on 127.0.0.1:9001
INFO [New I/O server boss #1 ([id: 0x79429cb2, /127.0.0.1:9001])] (ChannelHandler.java23) - Client connected with id: 1317923722
INFO [New I/O server boss #1 ([id: 0x79429cb2, /127.0.0.1:9001])] (ChannelHandler.java24) - Sent ghetto hello message to client: 1317923722
INFO [New I/O server boss #1 ([id: 0x79429cb2, /127.0.0.1:9001])] (Encoder.java28) - Message sent (id: 0 length: 1024) to client #1317923722
DEBUG [New I/O server boss #1 ([id: 0x79429cb2, /127.0.0.1:9001])] (Encoder.java29) - Message data: @@
INFO [New I/O server worker #1-1] (Decoder.java43) - Message received (id: 206 length: 0) from client #1317923722
DEBUG [New I/O server worker #1-1] (Decoder.java44) - Message data: CN
Session Manager is now done, when a user connects a session is created for them by the session manager which then triggers the hello message to be sent to the client.
Code:
INFO [main] (Crowley.java83) - Creating channel factory
INFO [main] (Crowley.java89) - Attempting to bootstrap server
INFO [main] (Crowley.java104) - Server bound on 127.0.0.1:9001
INFO [New I/O server boss #1 ([id: 0x0d3f136e, /127.0.0.1:9001])] (Encoder.java28) - Message sent (id: 0 length: 1024) to client #1741587908
DEBUG [New I/O server boss #1 ([id: 0x0d3f136e, /127.0.0.1:9001])] (Encoder.java29) - Message data: @@
INFO [New I/O server boss #1 ([id: 0x0d3f136e, /127.0.0.1:9001])] (SessionManager.java27) - Accepted session (id: 1 ip: 127.0.0.1)
INFO [New I/O server worker #1-1] (Decoder.java43) - Message received (id: 206 length: 0) from client #1741587908
DEBUG [New I/O server worker #1-1] (Decoder.java44) - Message data: CN